前端jsencrypt.js进行RSA加密var key = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCg 5gpQHzbcsvW46Fuuw2117xpDZVpyTdhdw2VFeRgrAcOLQblaksSl4qKHj0WIjy4Vl1VjbQOjkqMbHAuPEfQheinadbAUHHuCf/s4vdkTM29LT8v5Y4d7H R5mAhp3fWvj7qwBYpp3MM6wxd8eq5yow9xO8gqoFkWtDLrPdCawIDAQAB";
var str = "123456";
var encrypt = new JSEncrypt();
encrypt.setPublicKey(key);
var encryptStr = encrypt.encrypt(str);
console.log(str);
console.log(encryptStr);
评论