微信小程序-AES,ECB,Pkcs7加密解密

时间:2025-03-31 07:32:34

var Aes = require(''); //引用AES源码js

var key = .(" 十六位十六进制数作为秘钥"); 

var iv = .('十六位十六进制数作为秘钥偏移量'); 

//加密方法

function Aese(secretPwd){

var secretPwd = secretPwd+'&ct=3&vcode=1.2.3'; 

var encrypted = (secretPwd, key, {

mode: ,

padding: .Pkcs7

});

//  加密

return '?q='+();

}

//解密方法

function Aesd(ciphertext) {

var bytes = ((), key, {

mode: ,

padding: .Pkcs7

});

var plaintext = (.Utf8);

return plaintext;

}