Created
August 11, 2014 11:33
-
-
Save lukehedger/9480d82c6212a5ec163d to your computer and use it in GitHub Desktop.
AES encryption with CryptoJS and Browserify
This file contains hidden or 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
# Include Crypto JS modules as required | |
CryptoJS = require 'crypto-js' | |
AES = require 'crypto-js/aes' | |
# then use like so: | |
str = "Message to encrpyt" | |
passcode = "wu gang chops the tree" | |
hash = AES.encrypt(str, passcode).ciphertext.toString(CryptoJS.enc.Base64) # => hI524rbTeezmKq9BSl1b0ZOtgGAu+4y8X4FAk/VAMh8= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Resources: