v2.6
Encryption (deprecated) ​
Encryption.encrypt() and Encryption.decrypt() are deprecated.
Use the Crypto library instead.
Collection of encryption functions.
Methods ​
encrypt (deprecated) ​
javascript
encrypt(text: string, key: string)Encrypts a string using the AES algorithm. Returns a base64 encoded string. The result is not deterministic.
Parameters ​
text string
The text to encrypt.
key string
The encryption key.
Return type ​
string
Examples ​
javascript
// Encrypts a string using the AES algorithm:
Encryption.encrypt('my secret text', 'my secret key')decrypt (deprecated) ​
javascript
decrypt(text: string, key: string)Decrypts a string using the AES algorithm.
Parameters ​
text string
The text to decrypt.
key string
The encryption key.
Return type ​
string
Examples ​
javascript
// Decrypts a string using the AES algorithm:
Encryption.decrypt('my encrypted text', 'my secret key')