Encryption & Privacy Architecture

Goal: No Single Entity Can Read Messages

This is not just about E2E encryption — it's about ensuring that even metadata (who talks to whom, when, how often) is not observable by any single party.

Signal Protocol / Double Ratchet

The Signal Protocol is the gold standard for 1-to-1 encrypted messaging.

How the Double Ratchet works:

  1. Two parties perform an initial key agreement (X3DH — Extended Triple Diffie-Hellman)
  2. They derive a shared root key
  3. For each message, a new message key is derived from the chain (KDF chain)
  4. Periodically, a new Diffie-Hellman ratchet step mixes in fresh keying material
  5. Result: every message is encrypted with a unique key

Security properties:

Adaptation for offline/proximity use:

MLS (Messaging Layer Security) — RFC 9420

MLS is an IETF standard for efficient group encryption. It solves Signal's scalability problem for groups.

How MLS works:

Relevance to our use case:

Metadata Protection

Encryption protects content but not metadata. For structural privacy, we need to protect:

1. Social graph (who knows whom):

2. Communication patterns (who talks when):

3. Device identity / tracking:

The Never-Online Privacy Advantage

When a device never connects to the internet, the attack surface collapses dramatically:

Threat                    | Online Mode          | Offline-Only
--------------------------|----------------------|------------------
Mass surveillance         | Possible (ISP, CDN)  | Impossible
Traffic analysis          | Possible (netflow)   | Impossible
Server compromise         | Risk (if relay used) | No server exists
IP-based tracking         | Possible             | No IP addresses
Legal compulsion (server) | Risk                 | Nothing to compel
Social graph extraction   | Risk (metadata)      | Only via physical observation
Message interception      | Risk (if E2E broken) | Requires physical proximity

This table shows why "never online" should be the default mode, with online as an opt-in that users choose knowing these tradeoffs.

Post-Quantum Considerations

Quantum computers threaten current public-key cryptography. For a forward-looking design:

These keys are part of the identity bundle defined in the Feed Format Spec.

Storage Encryption: Data at Rest

Protecting data on the device (and on relay servers) is as important as protecting data in transit. The following tools are relevant for our deployment scenarios.

Disk & Volume Encryption

VeraCrypt — Cross-platform disk encryption. Creates encrypted containers (file-based) or full volume encryption. Supports hidden volumes for plausible deniability (a second encrypted volume exists inside the outer one; the password you give reveals only the decoy). Relevant for relay server storage volumes and desktop research machines.

Shufflecake — Linux kernel-level plausible deniability tool, a modern replacement for the discontinued TrueCrypt hidden-volume concept. Creates up to 15 hidden filesystems on the same block device, each protected by a different passphrase. Unlike VeraCrypt, Shufflecake operates at the block device level, making forensic detection significantly harder.

Cryptomator — File-by-file encryption for cloud storage. Transparent AES-SIV encryption of each file before upload. Open source and well-audited (Cure53, 2021). Relevant for research document storage and relay server config backup to untrusted cloud hosts.

Picocrypt — Minimal single-file encryption tool using XChaCha20-Poly1305 and Argon2id for key derivation. No installation required. Useful for encrypting individual files (model weights, key material exports, backup archives) for air-gapped transfer via USB.

Relevance to Our System

Use case                        Recommended tool
──────────────────────────────  ────────────────────────────────
Relay server storage volume     VeraCrypt (Linux, automated mount)
                                or LUKS (Linux dm-crypt, standard)
Relay server cloud backup       Cryptomator (transparent cloud E2E)
Air-gapped key export / USB     Picocrypt (single-file, no install)
Forensic-sensitive research     Shufflecake (plausible deniability)
Phone app local database        SQLCipher (AES-256-CBC on SQLite)

LUKS (Linux Unified Key Setup) via dm-crypt is the standard choice for full-disk encryption on Raspberry Pi relay servers — it is integrated into the Linux kernel and adds negligible overhead. The relay server setup should include LUKS-encrypted partitions for the message store, key registry, and any AI model caches that might contain indirectly identifying data.


SimpleX Queue Model: Structural Metadata Protection

The SimpleX Chat protocol (covered in Existing Protocols) uses a queue-based identity model that offers insights for our metadata protection layer worth documenting here in detail.

The Problem with Keypair Identity

Every other E2E encrypted system — Signal, Session, Matrix, Briar — uses a persistent keypair as the user's global identity. The public key (or a derivative like a phone number hash) serves as a stable identifier. This creates:

  1. A linkable identity across all contacts and conversations
  2. A target for traffic analysis: if the server sees many senders writing to the same keypair, the social graph is partially exposed
  3. A permanent identifier that can be correlated across surveillance datasets

SimpleX's Solution: Per-Contact Anonymous Queues

Instead of a global identity, SimpleX creates a separate queue for each contact relationship:

Alice wants to message Bob:
  1. Bob creates a receive queue (Q_B) on a relay server
  2. Bob shares Q_B's address with Alice (via QR code, link, etc.)
  3. Alice sends messages to Q_B — the server sees only Q_B, not Alice's identity
  4. Alice also creates a receive queue (Q_A) and shares it with Bob
  5. Bob sends replies to Q_A — the server sees only Q_A
  6. Each queue is rotated periodically (new queue, same relationship)

What the relay server sees:
  - Messages arriving at queue addresses (opaque identifiers)
  - No link between Q_A and Q_B (they are on different or same servers, independently)
  - No user account, no global ID, no social graph

Application to Our Design

Our system can adapt this model for the offline case:

The NFC payload (currently planned at ~150 bytes) can accommodate a SimpleX-style queue descriptor alongside the existing key material with minimal additional space.


┌──────────────────────────────────────────┐
│           Message Encryption              │
│  1-to-1: Double Ratchet (Signal)         │
│  Groups: MLS (RFC 9420)                  │
├──────────────────────────────────────────┤
│           Key Exchange                    │
│  In-person: NFC/QR → X3DH (+ PQXDH)    │
│  Ratcheting: DH + post-quantum ratchet  │
├──────────────────────────────────────────┤
│           Identity                        │
│  Ed25519 signing keypair                 │
│  X25519 DH keypair                       │
│  ML-KEM-768 post-quantum keypair         │
├──────────────────────────────────────────┤
│           Metadata Protection             │
│  Offline: inherent (no network)          │
│  Online: Tor hidden services + padding   │
└──────────────────────────────────────────┘

Updates (2025–2026)

NIST Post-Quantum Standards Finalized (August 2024)

NIST officially published three FIPS post-quantum standards on 13 August 2024:

Our recommended identity bundle (Ed25519 + X25519 + ML-KEM-768) now maps directly to ratified federal standards. ML-KEM-768 is the FIPS 203 mid-security parameter set and is the variant Signal chose for SPQR (see below). Falcon (FN-DSA) and HQC are still in standardisation and not yet ready for production integration.

Signal SPQR and the Triple Ratchet (October 2025)

Signal published the Sparse Post-Quantum Ratchet (SPQR) on 2 October 2025. This is the production release of work presented at Eurocrypt 2025 and USENIX Security 2025.

Key facts for our stack:

Clarification on existing content: The existing page describes SPQR as "announced October 2025." This is accurate — the blog post date is 2 October 2025 — but rollout was still in progress as of that date, not yet complete. The page's recommended stack (Double Ratchet + SPQR ratchet, ML-KEM-768 identity key) remains valid and is confirmed by Signal's production choice.

OpenMLS — Active Development Through 2026

OpenMLS (Rust, maintained by Phoenix R&D and Cryspen) reached v0.8.1 on 13 February 2026, confirming the library is actively maintained and RFC 9420-conformant. AWS Labs' mls-rs provides an independent Rust implementation with 100% RFC 9420 conformance and full support for all default credential, proposal, and extension types. Neither library has shipped post-quantum ciphersuites as of early 2026; the MLS working group has not yet standardised PQ extensions. Groups in our design can safely adopt OpenMLS or mls-rs for the MLS layer while the PQ-MLS extension matures separately.

MLS Gaining Production Momentum

Google committed to using MLS for Android Messages, and active integration work is underway for Android and Firefox (Open Technology Fund). This broad industry adoption validates RFC 9420 as the right group-key-establishment target for our design and increases library maturity over time.

Mixnet and Metadata-Resistance Research

Katzenpost describes itself as the world's first post-quantum mixnet, integrating PQ cryptography for anonymous transport. Nym continues active development with a 2025 roadmap item to replace the Sphinx packet format with a lighter "Outfox" format for efficiency. Both projects confirm that mixnet-layer metadata protection is technically maturing, but independent reviews note that mixnets introduce latency that constrains real-time use. Our current recommendation (Tor + cover traffic for online mode; no network for offline mode) remains appropriate for a proximity-first app where online relay is already opt-in.