node
const crypto = require('crypto');
function aesEncrypt(data, key) {
var cipher = crypto.createCipheriv('rc4', key, "");
console.log("-->>" + data);
data = data.toString('utf8');
var crypted = cipher.update(data, 'utf8', 'base64');
crypted += cipher.final('base64');
return crypted;
}
CryptoJS
str = CryptoJS.enc.Utf8.parse(str);
var utfStr = CryptoJS.RC4.encrypt(str, secret);
1
Qool 2019-05-14 14:48:10 +08:00
解密出来是对的就行了
|
2
napsterwu 2019-05-14 15:24:44 +08:00 via iPhone
因为有 padding
|