E2EE Operation Mode
Last updated
Last updated
Prior to sending frames through WebRTC, they are encrypted with a specific key. On the receiving end, frames received through WebRTC are decrypted with the same key before being played. This process occurs during the Insertable Stream step, as depicted in the image below.
Insertable Stream is a Duplex Stream that has both a readable and writable stream and can process data through TransformStream. By default, WebRTC uses VP8 as the video codec and Opus as the audio codec. The transform function receives encodedFrame data, where the type of encodedFrame is either key or delta for video frames, and undefined for audio frames. Depending on the codec, a keyframe header has 10 bytes, and an interframe (delta frame) header has 3 bytes in VP8. In Opus, an audio frame has a 1-byte TOC header, and only the payload is encrypted or decrypted. In VDN, when a host creates a new audio/video session, they generate a key for E2EE and share it with the Audience clients participating in the session. Using this key, all clients perform encryption and decryption in the End-To-End segment.