Repository navigation
Conversation
Member
Author
|
Landed in develop through the batch #2210 (squash f39e460), tested together on Mancave run 5204. Generated by Claude Code |
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.
Before: Encrypted conversations could seal text, but there was no way to encrypt a file, so a file could not be attached without the host seeing it.
After: A file can be encrypted on the device with its own random key. The key never leaves the sealed message, and a ciphertext cannot be moved into another conversation. Nothing in the app uses it yet; the next PR adds attachments to the chat.
How:
seal_fileandopen_fileinlib/src/conversation.rsuse XChaCha20-Poly1305 with a random 32-byte key and a random 24-byte nonce per file, laid out as version, nonce, ciphertext and tag. The associated data holds a fixed label plus the conversation subject. The wasm crate exportsconversationSealFileandconversationOpenFile, withsealFileandopenFilewrappers inconversationCrypto.ts. Seven new Rust tests cover a round trip, a wrong conversation, a wrong key, a flipped byte in each part, two seals of the same bytes differing, an empty file and a 25 MiB file (19 conversation tests pass, clippy and fmt are clean for lib and the wasm32 target). Step 1 of the DM hosting plan.Requested by Joep