Skip to content

feat(remote): add authenticated end-to-end encryption over NATS - #597

Merged
huichen merged 8 commits into
mainfrom
claude/remote-e2ee
Sep 13, 2026
Merged

huichen merged 8 commits into
mainfrom
claude/remote-e2ee

Conversation

@huichen

@huichen huichen commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add authenticated end-to-end encryption above NATS: Noise XXpsk0 for QR/copy-paste pairing, pinned-key IK for reconnects, fresh directional traffic keys and ChaCha20-Poly1305 records.
  • Encrypt commands, replies, approvals, events, catalogs, presence/disconnect notifications and file chunks; authenticate routing/request context and enforce a bounded replay window. No production plaintext fallback.
  • Keep scanning and pasting the same full invitation. The one-time secret is generated locally and never uploaded to the pairing API. Integrate GUI and headless invitation display, durable peer binding and authenticated readiness handoff.
  • Add shared Rust/JS vectors, malicious-relay tests, recovery/persistence tests, benchmarks and CI coverage for the new crypto crate.

Compatibility / deployment

  • Both endpoints must upgrade and existing pairs must pair again. Short numeric pairing codes are not introduced.
  • Production Desktop now requires verified NATS TLS; Mobile requires WSS. Existing non-TLS deployments must enable TLS rather than downgrade.
  • Broker availability and traffic/subject metadata remain outside the confidentiality guarantee. Desktop keys use the existing owner-restricted atomic credential file; Mobile uses SecureStore.
  • The legacy development web client is not a v2 client.

Validation

  • Full manual CI passed before PR creation: https://github.com/futuregene/future-os/actions/runs/34752393892 (all Linux Rust groups, JS checks, proto freshness, Windows/macOS/Linux compile checks).
  • Subsequent origin/main integrations were rechecked locally. Full Windows Desktop: 1167 library + 1 binary + 3 integration tests passed; 1 existing illustrative doc test ignored.
  • Desktop TS: typecheck/lint, 110 suites / 967 tests passed. Mobile: typecheck/lint, 71 suites / 900 tests passed.
  • Crypto crate: fmt, all-targets clippy (-D warnings), 6 tests passed. Desktop GUI/headless all-targets clippy passed; headless remote tests and CLI integration tests passed.
  • Android Metro/Hermes export passed. Physical Android/iOS runtime, handset battery measurements, production TLS configuration and independent cryptographic audit were not performed.

Protocol: desktop/DEV_MD/REMOTE_E2EE.md
Detailed evidence and desktop-JS microbenchmarks: docs/verification/remote-e2ee-20260913.md

@huichen
huichen enabled auto-merge (squash) September 13, 2026 11:19
@huichen
huichen merged commit 476b90e into main Sep 13, 2026
12 checks passed
@huichen
huichen deleted the claude/remote-e2ee branch September 13, 2026 11:26
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