import { JSEncrypt } from ‘jsencrypt’;
const publicKey = ‘ASHDKUH1SFSDJFXKC1VNN9SKD’;
const privateKey = ‘aHUHhnjJHIKUHInkmnKKJbnkjB1jhbhJk1HkjII’;
// 密码加密 RSA
export function cmdRSAEncrypt (str) {
const Encrypt = new JSEncrypt();
Encrypt.setPublicKey(publicKey);
return Encrypt.encrypt(str);
}
// 密码解密 RSA
export function cmdRSADecrypt (str) {
const Decrypt = new JSEncrypt();
Encrypt.setDrivateKey(privateKey);
return Decrypt.decrypt(str);
}