From e2e4c5715ed89ef945f6b1adfb5b8b79ae158ef5 Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Fri, 22 Apr 2022 15:02:40 +1000 Subject: Added README, added more UDP decryption stuff --- webrtc/src/opcodes/SelectProtocol.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'webrtc/src/opcodes/SelectProtocol.ts') diff --git a/webrtc/src/opcodes/SelectProtocol.ts b/webrtc/src/opcodes/SelectProtocol.ts index 29b9c1f9..75ab4495 100644 --- a/webrtc/src/opcodes/SelectProtocol.ts +++ b/webrtc/src/opcodes/SelectProtocol.ts @@ -161,11 +161,14 @@ export async function onSelectProtocol(this: Server, socket: WebSocket, data: Pa }; */ + this.decryptKey = [...sodium.randombytes_buf(sodium.crypto_secretbox_KEYBYTES)]; + console.log(this.decryptKey.map(x => String.fromCharCode(x)).join("")); + socket.send(JSON.stringify({ op:VoiceOPCodes.SESSION_DESCRIPTION, d: { video_codec: "H264", - secret_key: [...sodium.from_hex("724b092810ec86d7e35c9d067702b31ef90bc43a7b598626749914d6a3e033ed")], + secret_key: this.decryptKey, mode: "aead_aes256_gcm_rtpsize", media_session_id: "blah blah blah", audio_codec: "opus", -- cgit 1.5.1