function aesEncrypt(text, secKey) {
var key = CryptoJS.enc.Utf8.parse(secKey);
var iv = CryptoJS.enc.Utf8.parse("0102030405060708");
var srcs = CryptoJS.enc.Utf8.parse(text);
var encrypted = CryptoJS.AES.encrypt(srcs, key, {
iv: iv,
mode: CryptoJS.mode.CBC
});
return encrypted.toString()
}
function rsaEncrypt(text, pubKey, modulus) {
setMaxDigits(131);
var keys = new RSAKeyPair(pubKey,"",modulus);
var encText = encryptedString(keys, text);
return encText
}
不太懂加密什么的,顺便帮解答一下 CryptoJS.enc.Utf8.parse() 是干啥用的,谢啦
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
小伙看你根骨奇佳,潜力无限,来学PHP伐。