Skip to content

Instantly share code, notes, and snippets.

@joecliff
Last active Aug 29, 2015
Embed
What would you like to do?
crypto-js aes encrypt descrypt
var CryptoJS = require("crypto-js");//replace this with script tag in browser env
var encrypted = CryptoJS.AES.encrypt("Message", "Secret Passphrase").toString();
console.log(encrypted);
var decrypted = CryptoJS.AES.decrypt(encrypted, "Secret Passphrase").toString(CryptoJS.enc.Utf8);
console.log(decrypted);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment