Skip to content

Instantly share code, notes, and snippets.

@joecliff
Last active August 29, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joecliff/10830447 to your computer and use it in GitHub Desktop.
Save joecliff/10830447 to your computer and use it in GitHub Desktop.
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