aes-helper
v0.0.1
Published
AES encryption & decryption drop-in helper
Downloads
32
Readme
node-aes-helper
AES encryption & decryption drop-in helper
Installation:
npm install aes-helper
Usage:
var aes = require('aes-helper');
var password = 'pEm@@5M6~8rJ.c%3z*4=-{9};t7PP`j<0/KAC89t9V3Y57 >;(IrIb$K,w6`JV*|';
var plaintext = "Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras mattis consectetur purus sit amet fermentum. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vestibulum id ligula porta felis euismod semper. Sed posuere consectetur est at lobortis.";
var ciphertext = aes.encrypt(plaintext, password);
var decoded = aes.decrypt(ciphertext, password);
console.log("Encrypted:\n" + ciphertext + "\n");
console.log("Decrypted:\n" + decoded + "\n");
console.log("Test:");
console.log((decoded === plaintext ? 'Text matches, all okay.' : 'Problems...'));