首页 > 技术文章 > React中使用jsencrypt进行RSA加密

codeit 2021-03-01 22:34 原文

安装jsencrypt库

npm install --save jsencrypt

 页面中引入jsencrypt

import JSEncrypt from 'jsencrypt'

调用方法

var encrypt = new JSEncrypt();
encrypt.setPublicKey('公钥字符串');
let password= encrypt.encrypt('helloworld'); 
console.info(password);

推荐阅读