Last active
August 29, 2015 13:59
-
-
Save joecliff/10830447 to your computer and use it in GitHub Desktop.
crypto-js aes encrypt descrypt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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