Skip to content

Instantly share code, notes, and snippets.

@anitaa1990
Created April 6, 2018 09:06
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 anitaa1990/7a2c493b50a5bdfab8a8356387e240d9 to your computer and use it in GitHub Desktop.
Save anitaa1990/7a2c493b50a5bdfab8a8356387e240d9 to your computer and use it in GitHub Desktop.
AES Encryption - Javascript
//Sample Implementation can be found here: https://jsfiddle.net/4zb9hrxb/1890/
let key = "Q8pTgdOC7h25qKVncJlzDA=="
let message = "TestAnitaa009"
let base64Key = CryptoJS.enc.Base64.parse(key);
var iv = base64Key
let encryptedValue = CryptoJS.AES.encrypt(message, base64Key, {
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7,
iv: base64Key
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment