-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Poc e2ee #296
Draft
lebaudantoine
wants to merge
9
commits into
main
Choose a base branch
from
poc-e2ee
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Poc e2ee #296
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit will be dropped.
inspired by LiveKit repo, follow their example
slug is another term in our app this is the room id
lebaudantoine
commented
Jan 7, 2025
Comment on lines
+20
to
+23
webhook: | ||
api_key: devkey | ||
urls: | ||
- https://meet.127.0.0.1.nip.io/api/v1.0/rooms/livekit-webhook/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I manually added the misssing authority certificate inside livekit alpine pod. I need to find a better solution !
/!\ default expiration of the cache, corner case, when a participant join right before, and right after. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
This PR implements end-to-end encryption (E2EE) capabilities for LiveKit rooms using WebRTC's Frame Encryption API. The implementation ensures that media streams are encrypted on the sender's side and can only be decrypted by authorized participants, maintaining confidentiality even from the LiveKit server.
It's a proof of concept, not intended to be merged.
According to LiveKit documentation :
E2EE adds an extra layer of security features, when you cannot trust the LiveKit server.
Proposal
During room access token generation, the first participant triggers the creation of a room passphrase, which is encrypted using Fernet symmetric encryption and stored in Redis. Subsequent participants retrieve this encrypted passphrase from the cache. When the room ends, LiveKit's webhook notifies the backend to invalidate the cached passphrase.
Using Fernet symmetric encryption is fine for short-term storage.
It's a naive approach, but yet simple.
All participants share an encryption key that remains constant throughout the meeting session, without rotation.
Technical Limitations
Current E2EE feature isn't perfect yet, for a few reasons:
Codec Compatibility
Limited to VP8 video and Opus audio
VP9/AV1 incompatible due to lack of encrypted backup codec support
Required for backwards compatibility with non-VP9 clients
→ doesn't support most recent and optimized Media codec.
Audio Processing
RED (Redundant Encoding) unsupported
Server cannot strip RED packets when E2EE enabled
→ Cannot enable this optimization.
Browser Support
Requires Firefox 117+ for compatibility
Chrome/Edge: 86+
Safari: 15.4+
→ Not available for our FF 115 users
Performance Considerations
Increased CPU usage on resource-constrained devices
Web Worker implementation mitigates main thread impact
AI or recording
E2EE disables Egress functionality, preventing AI features that require room audio recording and processing.
→ Disable a differentiating feature
Documentation
I haven't found any documentation on LiveKit website.
Algorithm
Yet supports only AES-GCM 128, no 256.
Source code
FrameCryptor is responsible for en-/decrypting media frames.
KeyProvider is responsible for key lifecycle.
Future Enhancements
Dynamic Encryption
Passphrase Requirements
Room Configuration
My 2cts
E2EE should be disabled by default for several reasons:
End-to-end encryption becomes critical in scenarios where: