Skip to content

feat: add end-to-end encryption in the SFrame format - #576

Merged
devopvoid merged 3 commits into
mainfrom
feat/e2ee
Nov 8, 2026
Merged

devopvoid merged 3 commits into
mainfrom
feat/e2ee

Conversation

@devopvoid

Copy link
Copy Markdown
Owner

Adds dev.onvoid.webrtc.e2ee: a KeyProvider whose transforms encrypt and decrypt encoded frames as SFrame (RFC 9605), with key IDs, rotation, per-stream key contexts, replay protection and defined handling of unknown keys and failed frames. VP8, VP9, AV1 and audio are covered; H.264/H.265 are refused.

  • PeerOptions, Whip and Whep take it as e2ee(keys).
  • Transforms can keep their frames from encoded-frame observers (enforced natively); MediaRecorder refuses encrypted tracks unless the key provider allows plaintext recording.
  • The new guide specifies the frame format; a WebCrypto implementation for browsers is published with the docs and tested against the Java side.

A KeyProvider in dev.onvoid.webrtc.e2ee encrypts and decrypts encoded
frames as RFC 9605 SFrame: participant keys with generations and
rotation, a key ID per sent stream, replay protection, defined handling
of unknown keys and failed frames, and codec layouts for VP8, VP9, AV1
and audio. PeerOptions, Whip and Whep take it as e2ee(keys).

Transforms can keep their frames from encoded-frame observers; the
native router enforces it, and MediaRecorder refuses such tracks unless
the key provider allows plaintext recording.

The guide specifies the frame format, and a WebCrypto implementation
for browsers is published with the docs and tested against Java.
@gitguardian

gitguardian Bot commented Nov 8, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 8 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
39831195 Triggered Generic High Entropy Secret 86642ea webrtc/src/test/resources/dev/onvoid/webrtc/e2ee/rfc9605-test-vectors.txt View secret
39831193 Triggered Generic High Entropy Secret 86642ea webrtc/src/test/resources/dev/onvoid/webrtc/e2ee/rfc9605-test-vectors.txt View secret
39831194 Triggered Generic High Entropy Secret 86642ea webrtc/src/test/resources/dev/onvoid/webrtc/e2ee/rfc9605-test-vectors.txt View secret
39831195 Triggered Generic High Entropy Secret 86642ea webrtc/src/test/resources/dev/onvoid/webrtc/e2ee/rfc9605-test-vectors.txt View secret
39831194 Triggered Generic High Entropy Secret 86642ea webrtc/src/test/resources/dev/onvoid/webrtc/e2ee/rfc9605-test-vectors.txt View secret
39831194 Triggered Generic High Entropy Secret 86642ea webrtc/src/test/resources/dev/onvoid/webrtc/e2ee/rfc9605-test-vectors.txt View secret
39831195 Triggered Generic High Entropy Secret 86642ea webrtc/src/test/resources/dev/onvoid/webrtc/e2ee/rfc9605-test-vectors.txt View secret
39831195 Triggered Generic High Entropy Secret 86642ea webrtc/src/test/resources/dev/onvoid/webrtc/e2ee/rfc9605-test-vectors.txt View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

# Conflicts:
#	webrtc/src/main/java/module-info.java
A peer with e2ee(keys) applied no codec preference, so macOS negotiated
H.264, whose frames end-to-end encryption drops. Such a peer now offers
and answers only VP8, VP9 and AV1 video, and videoCodecs() that names
none of them fails. KeyProvider.supportsCodec() tells which codecs can
be encrypted.

The call tests accept replayed frames, which retransmissions produce on
loaded machines, and print the stats when other frames are dropped.
@devopvoid
devopvoid merged commit 7ff8789 into main Nov 8, 2026
26 checks passed
@devopvoid
devopvoid deleted the feat/e2ee branch November 8, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant