cryptographic-js
Advanced tools
Changelog
[1.0.2] - 2021-09-18
Changelog
[1.0.1] - 2020-12-02
Added format parameters for encrypted data to the encryption and decryption functions.
// Encrypt.
const cipher = new AES256CTR();
const plainText = 'Hello, World!';
const key = cipher.createKey('hex');
const iv = cipher.createIV('hex');
// Get encrypted data in base64 format.
const encoding = 'base64';
const encrypted = cipher.encrypt(plainText, key, iv, encoding);
// Decrypt.
const decrypted = cipher.decrypt(encrypted, key, iv, encoding);