Skip to main content

Encryption Layer 3: Server-to-Recipient

Draft

This section is under construction.

Purpose

Layer 3 encrypts the message between the SMP server and the recipient. This ensures the server cannot read the E2E-encrypted content, but also prevents other recipients on the same server from reading each other's messages.

Key Agreement

  1. Recipient generates an X25519 DH keypair (rcvDhPrivate, rcvDhPublic)
  2. rcvDhPublic is sent to the server during queue creation (NEW)
  3. Server generates its own X25519 keypair and returns srvDhPublic in the IDS response
  4. Both sides compute the shared secret via X25519 DH
  5. The shared secret is processed through HSalsa20 (crypto_box_beforenm)

smpEncMessage Format

┌──────────┬───────────────┬──────────────┬────────────────┐
│ Header │ Nonce (24B) │ AuthTag(16B) │ Ciphertext │
└──────────┴───────────────┴──────────────┴────────────────┘

Decryption

  • Algorithm: NaCl crypto_box_open (XSalsa20-Poly1305)
  • Key: Precomputed shared secret (32 bytes)
  • Nonce: 24 bytes extracted from the message
  • Output: ClientMsgEnvelope