Skip to content

Conversation

@cloudwebrtc
Copy link
Contributor

@cloudwebrtc cloudwebrtc commented Aug 30, 2023

  • python wrappers for e2ee
  • examples

examples:
publish hue video with e2ee
e2ee_hue.py

publish wave with e2ee
e2ee_wave.py

publish and subscribe
e2ee_wave_recv.py
e2ee_hue_recv.py

@cloudwebrtc cloudwebrtc changed the title (WIP) e2ee support. e2ee support. Sep 1, 2023
@cloudwebrtc cloudwebrtc marked this pull request as ready for review September 1, 2023 04:26
Copy link
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great work! 🔥

A few comments. Will let @theomonnom give the final 👍

break


def do_e2ee_test(room: livekit.Room):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like this should be a separate file? it's not part of the example

room = livekit.Room()
video_stream = None
# listen to e2ee_state_changed event
@room.listens_to("e2ee_state_changed")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we've used @room.on in the past, would be great to keep it consistent.

await room.connect(URL, TOKEN, options= livekit.RoomOptions(
auto_subscribe= True,
dynacast= True,
e2ee_options= livekit.e2ee.E2EEOptions(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should remove if both are default

# sys.path.append(import_dir)

import livekit

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need some docs on what this example does and how to use it with the _recv examples

alternatively, we can tell users to go to meet.livekit.io to use as the subscriber

livekit/e2ee.py Outdated
DEFAULT_MAGIC_BYTES = b"LK-ROCKS"
DEFAULT_RATCHET_WINDOW_SIZE = 16

class EncryptionType(enum.Enum):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's great to have these python classes! do these map to FFI types?

@cloudwebrtc
Copy link
Contributor Author

cloudwebrtc commented Sep 4, 2023

e2ee_wave_recv.py/e2ee_hue_recv.py in the PR is used to check that the decrypted audio/video raw data can be correctly received in e2ee mode. These two examples are not necessary. you can remove it if you want.
Receiving audio/video in e2ee mode works correctly in the rust example, so it should work in Python too

@theomonnom theomonnom merged commit 42d1625 into main Sep 5, 2023
@theomonnom theomonnom deleted the duan/e2ee branch September 5, 2023 01:25
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.

3 participants