Skip to content

Encrypt

Encrypts given text with password

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

Parameters

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

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);