Skip to content

Add E2E encryption for inbox/outbox messaging#162

Open
koenvanderveen wants to merge 10 commits intomainfrom
koen/encryption
Open

Add E2E encryption for inbox/outbox messaging#162
koenvanderveen wants to merge 10 commits intomainfrom
koen/encryption

Conversation

@koenvanderveen
Copy link
Collaborator

Summary

  • Add optional end-to-end encryption using syft-crypto-python (Rust-based crypto)
  • Encryption/decryption happens in ConnectionRouter — GDrive transport stays unaware of encryption
  • Key exchange via dedicated GDrive folders during peer approval flow
  • Backward compatible: try_decrypt gracefully handles unencrypted messages
  • New KeyManager class manages key generation, persistence, and peer bundle storage
  • 14 new unit tests covering key gen, encrypt/decrypt roundtrip, full DS→DO flow, bundle exchange, and backward compat

Test plan

  • All 14 new encryption tests pass
  • All 201 existing unit tests pass (no regressions)
  • Integration test with real GDrive accounts

🤖 Generated with Claude Code

Implements optional end-to-end encryption using syft-crypto-python.
Encryption happens in ConnectionRouter (transport stays unaware).
Key exchange occurs during peer approval via dedicated GDrive folders.
Backward compatible — unencrypted messages still work via try_decrypt fallback.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

- Extract 4 raw-bytes transport methods into connection interface,
  removing GDrive-specific logic from ConnectionRouter
- Make KeyManager a Pydantic BaseModel with proper typing
- Add GdriveEncryptionBundlesFolder class for folder naming consistency
- Add encryption bundle patterns to orphaned file cleanup
- Cache encryption bundles folder ID and clear in reset_caches
- Rename VersionManager -> PeerManager across entire codebase
…thods

Renamed: send_raw_bytes_to_inbox → send_raw_bytes_to_inbox_ds,
download_next_raw_from_inbox → download_next_raw_proposed_message_from_datasite_owner_inbox,
write_raw_bytes_to_outbox → write_raw_bytes_to_outbox_do.

Removed unused: transport_name(), download_events_message_by_id_from_outbox(),
is_message_file(), GDRIVE_TRANSPORT_NAME constant.
…ection

Rename role-specific methods to use consistent owner_/watcher_ prefixes
instead of mixed _do/_ds/_as_do/_as_ds suffixes. Also properly wire
PeerStore through ConnectionRouter.from_configs and fix encryption tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant