Updated
This commit is contained in:
parent
d61b8b7bd8
commit
46783c4f38
57 changed files with 4178 additions and 5992 deletions
13
frontend/@dasig/scripts/functions/encryptRsa.ts
Normal file
13
frontend/@dasig/scripts/functions/encryptRsa.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { JSEncrypt } from "jsencrypt";
|
||||
import { $rsaPublicKey } from "../../../configs/config.security.ts";
|
||||
|
||||
const enc = new JSEncrypt();
|
||||
const PUBLIC_KEY = $rsaPublicKey.get();
|
||||
|
||||
export default (message: string) => {
|
||||
enc.setPublicKey(PUBLIC_KEY);
|
||||
const encrypted = enc.encrypt(message).toString();
|
||||
const fixedEncrypted = encrypted.replace(/\//g, "~");
|
||||
|
||||
return fixedEncrypted;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue