encrypt.js
374 Bytes
function passwordEncrypt(rawPwd) {
let PK = window.global.PK;
let E = window.global.E;
let rsa = new RSAKey();
// console.log("rsa === ", rsa);
rsa.setPublic(PK, E);
let res = rsa.encrypt(rawPwd);
// console.log("res === ", res);
if (res == null) return rawPwd;
return res;
}
module.exports = {
passwordEncrypt: passwordEncrypt
}