Add E2EE chat plumbing to supabase-e2ee (key directory, verification, EncryptedRoom)#91
Merged
Merged
Conversation
… EncryptedRoom - KeyDirectory (Supabase + in-memory): publish/fetch public keys - safetyNumber() for out-of-band MITM verification + pluggable TrustStore ledger - EncryptedRoom: verify-first encrypt-on-send / decrypt-on-receive over realtime, with history() and a live messages() flow; strict requireVerified by default - Migration for device_keys + e2ee_messages (RLS + realtime publication) - VerificationTest, regenerated BCV api dump, module README Static ECDH->AES-GCM: no forward secrecy (documented); for 'server can't read' commercial threat model, not Signal-grade.
This file contains hidden or 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
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.
Extends the opt-in
supabase-e2eemodule from a raw crypto box into a full plug-and-play encrypted-chat layer.What's added
SupabaseKeyDirectory(publish/fetch public keys via adevice_keystable) +InMemoryKeyDirectory.safetyNumber(localPub, peerPub)(order-independent, identical on both sides) + a pluggableTrustStoreledger (TrustLevel/TrustEntry,InMemoryTrustStore).openEncryptedRoom(...)factory → verify-first encrypt-on-send / decrypt-on-receive room oversupabase-realtime, withhistory()and a livemessages()flow. StrictrequireVerifiedby default; rejects a changed key asIDENTITY_CHANGED.supabase/migrations/20260628_add_e2ee_tables.sql(device_keys+e2ee_messages, RLS + realtime publication).VerificationTest), regenerated BCV api dump, module README.Notes
supabase-database+supabase-realtimeas deps of this opt-in module (a Supabase chat app uses both anyway); the raw crypto API stays usable standalone.Honest caveat
Static ECDH→AES-GCM = no forward secrecy (documented in the README). Sufficient for the "server can't read messages" commercial threat model; not Signal-grade.
Verification
:supabase-e2ee:detekt,apiCheck, and:supabase-e2ee:jvmTestall green (VerificationTest 5 + E2eeTest 4 pass).