Crypto handshakce and encryption/decryption

This commit is contained in:
2026-08-28 14:13:45 +02:00
parent a19de564fe
commit 07506aa2eb
5 changed files with 149 additions and 13 deletions
+2
View File
@@ -4,6 +4,7 @@ import EnclaveWebSocket from "./ws";
import { sha512 } from "@noble/hashes/sha2.js";
import { getWSUrl } from "@/lib/serverList";
import { ClientMeta, ServerMeta, StoredMessage } from "@/lib/types";
import { ed25519 } from "@noble/curves/ed25519.js";
ed.hashes.sha512 = sha512;
@@ -60,6 +61,7 @@ export default class EnclaveServer {
) {
this.websocket = new EnclaveWebSocket(
getWSUrl(this.hostname, this.isSecure),
ed25519.utils.toMontgomerySecret(clientSecretKey),
);
const publicKeyString = base58.encode(clientPublicKey);