Skip to content

Instantly share code, notes, and snippets.

@betray32
Created January 30, 2020 19:57
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 betray32/3e89b139ff31c61bd4664905f6c01a3a to your computer and use it in GitHub Desktop.
Save betray32/3e89b139ff31c61bd4664905f6c01a3a to your computer and use it in GitHub Desktop.
Permite encriptar con el AES256 en javascript con la libreria CryptoJS
function encriptarAes() {
const key = "z|8v2,.B'%CyH9%{_~='2.|+;`z>^4{N";
const keyutf = CryptoJS.enc.Utf8.parse(key);
var plaintext = ("16625261K");
var output = CryptoJS.AES.encrypt(plaintext, keyutf, {
mode : CryptoJS.mode.ECB
});
console.log("Encriptado: " + output.toString());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment