标签:rsa加密 mod code ring 加密 crypto rsa turn ext
1.
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
}
2.
function
b(a, b) {
var
c = CryptoJS.enc.Utf8.parse(b),
d = CryptoJS.enc.Utf8.parse(
"0102030405060708"
),
e = CryptoJS.enc.Utf8.parse(a),
f = CryptoJS.AES.encrypt(e, c, {
iv: d,
mode: CryptoJS.mode.CBC
});
return
f.toString()
}
function
c(a, b, c) {
var
d,
e;
return
setMaxDigits(131), d =
new
RSAKeyPair(b,
""
, c), e = encryptedString(d, a)
}
标签:rsa加密 mod code ring 加密 crypto rsa turn ext
原文地址:http://www.cnblogs.com/zhangyubao/p/7016859.html