$Crypto.Encrypt

Overview

Encrypts given text with password

string $Crypto.Encrypt(password: string, salt: string, text: string)

Arguments

string password

Password to be used in encryption

string salt

Salt to be used in encryption

string text

Text to be encrypted

Returns

Encrypted data in base64 encoding

Example

Encrypt and decrypt text

var password = 'password123'; var textToEncrypt = 'hello'; var salt = 'salt'; var encryptedText = $Crypto.Encrypt(password, salt, textToEncrypt); var decryptedText = $Crypto.Decrypt(password, salt, encryptedText);

Copyright © 2010 - 2023 Emakin. All rights reserved.