This commit is contained in:
Patrick Alvin Alcala 2025-11-26 10:56:07 +08:00
parent d61b8b7bd8
commit 46783c4f38
57 changed files with 4178 additions and 5992 deletions

View 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;
};