-
Notifications
You must be signed in to change notification settings - Fork 315
Open
Description
@kaylendog will be working on encrypted state - we will track our plans and progress here.
Goal
Investigate the feasibility of MSC3414 and prototype it in rust-sdk.
Context
Currently, all state events in a room are unencrypted: only non-state events can be encrypted.
To enhance privacy, we should encrypt state events where possible.
Problems
- The server holds the current state of a room, and it uses
type
+state_key
as the key of the map. This causes 2 problems:- Encrypted events have a fixed
type
ofm.room.encrypted
so events of different types will clash - We potentially want the true
state_key
to be inaccessible to people without decryption keys
- Encrypted events have a fixed
We will start by not considering this problem, then progressively enhance our solution.
Plan
- Set-up, logins, passwords etc.
- Build matrix-rust-sdk including multiverse
- Run a local synapse and connect to it from multiverse
- Encrypt a test event. Write the minimum possible code to get a state event to send and receive whose contents are encrypted. Look at OlmMachine::encrypt_room_event. You will probably need to write a similar method called
encrypt_state_event
and figure out how to call it from multiverse. You will probably need to add code to decrypt state events if they arrive encrypted. - Consider stuffing the event type into
state_key
so the server can hold two events of differenttype
with the samestate_key
even if they are encrypted. E.g. change the state_key to be "{type}:${state_key}" (note: careful choice of separator will eventually be needed, but no need to worry too much now). Confirm that the server correctly returns the right state in this circumstance. Figure out how to get the client to "unstuff" it and understand the right type and state_key. - Investigate how well this works. E.g. can I do live location sharing using encrypted state events?
- Implement runtime feature flag for encrypted state
- Merge into upstream SDK
- Investigate implementing encrypted state into existing clients - feature/labs flag.
bnjbvr
Metadata
Metadata
Assignees
Labels
No labels