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
- Recipient generates an X25519 DH keypair (
rcvDhPrivate,rcvDhPublic) rcvDhPublicis sent to the server during queue creation (NEW)- Server generates its own X25519 keypair and returns
srvDhPublicin theIDSresponse - Both sides compute the shared secret via X25519 DH
- 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