Open dank074 opened 2 months ago
From what I've seen, the encryption seems to be between the frame/NALU splitter and packetizer, so theoretically nothing needs to be changed in the packetizer (thank god). That introduces another layer of coupling between the WebSocket side and media handling side though, which could become ugly...
If a start code sequence is encountered the nonce is incremented and encryption is re-attempted. This process can repeat up to 10 times until a start code sequence is not encountered in the ciphertext and supplemental protocol data. It must be impossible for a start code to consistently appear in the protocol supplemental data section. In the unlikely event that the maximum number of attempts is reached the frame is dropped and a failure is returned.
This looks very scuffed...let's see how it goes.
Unfortunately we don't have much option here...
OpenMLS is working on adding WASM bindings https://github.com/openmls/openmls/pull/1525
It will be interesting to see what Discord.js does, since they'll also need a TS solution for their voice package
From the changelog, we'll have a 6 month deprecation period to implement the protocol. Let's hope either OpenMLS or mls-rs will have an npm package by then
@dank074 Discord.JS implemented DAVE a while ago. Useful references:
That's not DAVE, just regular transport security that we're already doing
Oh....
That's not DAVE, just regular transport security that we're already doing
Anyways, there IS a library for DAVE, and it's provided by Discord. Not sure what's stopping you from using it :|
Well, it's not published but...
The plan now (for me at least) is to wait for OpenMLS or mls-rs to have an official npm package that we can use. They're both Rust libraries that can be compiled to WASM relatively easily.
It uses native code (C++), and we don't want to have to maintain a native package ourselves (Node native modules are hard)
- The code is designed to work together with the voice module in the Discord app, and wouldn't be compatible with this library (or at least would require extensive modifications)
The plan now (for me at least) is to wait for OpenMLS or mls-rs to have an official npm package that we can use. They're both Rust libraries that can be compiled to WASM relatively easily.
@longnguyen2004
No?
I linked to the js
version of the library, not the C/C++ version of the library.
It doesn't link to any native libraries. I went through every file in the JS version, doesn't look like it's linking to anything, just base64-js
& @noble/hashes
.
Those are utilities functions only, it doesn't contain any actual encryption functions, all of that is done in native code (trust me, I've read through them all)
Discord announcement:
This can be in the backburner for now since it looks like they won't force it until sometime in 2025. Interesting that Stage Channel voice connections aren't mentioned in the encryption-eligible audio/video session types. I guess those are the only ones that won't support E2EE encryption