project-robius / robrix

A Matrix chat client written in pure Rust using the Makepad UI toolkit and the Robius app dev framework
MIT License
67 stars 11 forks source link

Support E2EE and device verification to enable decrypting message content #116

Open kevinaboos opened 3 weeks ago

kevinaboos commented 3 weeks ago

Currently Robrix sets up the Matrix SDK to auto-decrypt messages received in E2EE rooms

There are three main parts to this:

  1. Device verification, which is done via emoji sequences.
    • This requires the user to initiate the device verification procedure using another already-logged-in client (e.g., Element).
    • We need to prompt the logged-in user of Robrix to start emoji verification (perhaps via an in-app notification) and then display instructions on how to start the procedure using another client.
  2. Saving inner session state of the Matrix SDK to disk and restoring it upon app start.
    • E2EE session data must be saved and restored by the Matrix SDK in order to maintain the ability to decrypt messages after the app is booted the next time.
  3. Supporting querying encrypted images.
    • Currently Robrix assumes that all media requests are for MXC URIs that are unencrypted. See the MediaRequest type and the usage of the Plain(OwnedMxcUri) variant.

The first step would be to test item (1) above, it should suffice to just run the emoji verification sequence and then open an E2EE room, at which point the Matrix SDK should automatically decrypt all encrypted content. If it does not, then item (1) should be considered unsuccessful.

Examples/Resources

There is an example on basic emoji verification here: https://github.com/matrix-org/matrix-rust-sdk/blob/main/examples/emoji_verification/src/main.rs

Distinguishing separate issues

This issue does not cover: