Fixed registration, added per room message encryption

This commit is contained in:
pascalyazid committed 2026-05-15 18:39:21 +02:00
1 parent 3135131ae4
commit 30edfab0a3
2 files changed
+22 -18

No files matched your search

+3 -3
View File
@@ -4,7 +4,7 @@ import {
privateDecrypt,
constants,
subtle,
} from "crypto";
} from "node:crypto";
import { decryptPrivateKey } from "./decrypt_private_key";
import { createClient } from "@/utils/supabase/server";
@@ -88,8 +88,8 @@ export async function encryptMessageValue(
// Web Crypto AES-GCM output = ciphertext || authTag (last 16 bytes)
const buf = Buffer.from(encrypted);
const ciphertext = buf.slice(0, buf.length - 16).toString("base64");
const authTag = buf.slice(buf.length - 16).toString("base64");
const ciphertext = buf.slice(0, - 16).toString("base64");
const authTag = buf.slice(- 16).toString("base64");
return {
ciphertext,