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

The text is encrypted with AES using a key derived from the password and the salt, and the result is returned as a Base64 string. Decrypt it with $Crypto.Decrypt and the same password and salt. Do not write the password in the script; scripts are visible to everyone who can edit the process definition.

Examples

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

See Also