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()
是干啥用的,谢啦
不用转,一切尽在crypto库:
http://pythonhosted.org/pycrypto/
其中的RSA和AES算法就是
cryptojs应该是个三方库,提供加密算法