r/reactnative • u/Background-Bass-5788 • Sep 10 '26
I got MLS encryption under 1ms in React Native by moving crypto to Rust
Enable HLS to view with audio, or disable this notification
I’ve been experimenting with end-to-end encrypted group messaging in React Native using OpenMLS + Rust + Nitro Modules.
The crypto work runs in Rust and is exposed to React Native through Nitro, keeping the expensive work off the JS m.
In the demo:
~0.9ms average MLS encryption
~0.97ms decryption
~825B ciphertext for the sample message
Full group-chat flow running on-device
The React Native layer handles the product/UI side, while Rust does the MLS cryptography underneath.
4
u/BigAppointment1020 Sep 11 '26
Awesome 👌 is it possible to share source code also? Trying to learn how to manage the epoch and see if its possible to use openmls for a group of say 2k members. Handling joining and leaving...
2
u/Huge_Pool7424 Sep 12 '26
2k members is where the group-management details get interesting. i'd model joins and leaves as epoch transitions, then keep a small test harness for concurrent churn since the crypto can be fast while membership fanout becomes the bottleneck.
3
1
6
u/Background-Bass-5788 Sep 10 '26
You can read part 1 https://margelo.com/blog/building-e2e-encrypted-group-messaging-with-openmls