//公钥加密
function encrypt(data)
{
var obj = new JSEncrypt();
obj.setPublicKey(RSA_PUBLIC_KEY); //公钥
var data = obj.encrypt(data);
return data;
}
//私钥解密
function decrypt(data)
{
var obj = new JSEncrypt();
obj.setPrivateKey(RSA_PRIVATE_KEY); //私钥
var data = obj.decrypt(data);
return data;
}
1