AES encryption in WeChat applet using CryptoJS
Resource: Resource address
method
function encrypt() { var str = 'Message'; // key 16 bits var key = '1234567891234567'; // initial vector initial vector 16 bits var iv = '1234567891234567'; var pwd = CryptoJS.encrypt(str, key, iv); console.log('AES encryption:' + pwd); var original = CryptoJS.decrypt(pwd, key, iv); console.log('AES decrypt:' + original); }
use
var aes = require('../../utils/aes_util.js') aes.encrypt('123')
encrypted result
Can also be used to encrypt ECB etc...
Validation: Validation result URL