//公钥加密 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; }
2019-12-21 19:35:23 73KB js RSA加密解密
1