Skip to content

Encrypt

Encrypts the given text with a password.

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

Parameters

string password
    The password to be used in encryption.

string salt
    The salt to be used in encryption.

string text
    The text to be encrypted.

Returns

The encrypted data in Base64 encoding.

Remarks

Encrypt and decrypt text:

1
2
3
4
5
6
7
var password = 'password123';
var textToEncrypt = 'hello';
var salt = 'salt';

var encryptedText = $Crypto.Encrypt(password, salt, textToEncrypt);

var decryptedText = $Crypto.Decrypt(password, salt, encryptedText);