initial commit with imported utils from old github project

This commit is contained in:
pascalyazid committed 2026-05-10 16:30:28 +02:00
commit 66bb463e23
39 files changed
+1944

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
"use server";
import { privateEncrypt } from "crypto";
import { decryptPrivateKey } from "@/utils/security/decrypt_private_key";
export async function encryptMessage(message: string) {
const privateKey = await decryptPrivateKey();
if (privateKey == null) {
return null;
}
try {
const message_buffer = Buffer.from(message, "utf-8");
const message_encrypted = privateEncrypt(privateKey, message_buffer);
return message_encrypted;
} catch (err) {
throw err;
}
}
+17
View File
@@ -0,0 +1,17 @@
"use server";
import { privateEncrypt } from "crypto";
import { decryptPrivateKey } from "@/utils/security/decrypt_private_key";
export async function encryptMessage(message: string) {
const privateKey = await decryptPrivateKey();
if (privateKey == null) {
return null;
}
try {
const message_buffer = Buffer.from(message, "utf-8");
const message_encrypted = privateEncrypt(privateKey, message_buffer);
return message_encrypted;
} catch (err) {
throw err;
}
}