React中使用jsencrypt进行RSA加密

安装jsencrypt库

npm install --save jsencrypt

 页面中引入jsencrypt

import JSEncrypt from 'jsencrypt'

调用方法

var encrypt = new JSEncrypt();
encrypt.setPublicKey('公钥字符串');
let password= encrypt.encrypt('helloworld'); 
console.info(password);
原文地址:https://www.cnblogs.com/codeit/p/14466407.html