Rijndael-JS
This is an implementation of Rijndael algorithm.
Supports 128/192/256 bit key/block, and ECB, CBC modes.
Unlike node-rijndael
, or node-mcrypt
, this is an pure-JS implementation.
Unlike js-rijndael
, this is licensed under MIT License.
Usage
const Rijndael = require('rijndael-js');
const key = 'Lorem ipsum dolor sit amet, cons';
const original = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do';
const iv = 'Ut enim ad minim veniam, quis no';
const cipher = new Rijndael(key, 'cbc');
const ciphertext = Buffer.from(cipher.encrypt(original, 256, iv));
ciphertext.toString("base64");
const plaintext = Buffer.from(cipher.decrypt(ciphertext, 256, iv));
original === plaintext.toString();
Changelog
v2.0.0
- Type of return data has changed to
Array
, from Buffer
- Internal code convention change
- Improve compatibility with non-node environment
v1.0.0
Initial release