A key exchange lets two parties establish the same secret without sending that secret directly. They can then use it as a key for authenticated encryption. section 1.4.1 section 5.0
A Diffie-Hellman-style exchange follows a short sequence:
- Agree on common public parameters. section 1.4.1
- Generate a private key and a corresponding public key on each side. section 5.1
- Exchange only the public keys; observers may see them. section 5.1
- Combine the peer’s public key with the local private key to derive the same shared secret. section 1.4.1 section 5.1
Alice and Bob against a snooper
Alice and Bob have never spoken but want private communication. Sending a symmetric key directly would expose it to a passive snooper. A key exchange gives both parties a shared key that the snooper cannot reproduce from the public exchange alone, allowing subsequent authenticated encryption. section 5.1
Confidentiality against passive observation is not authentication. An active man-in-the-middle can replace public keys, impersonate both parties, and create two separate exchanges. Authentication, mutual authentication, known public keys, or signatures are needed to address that threat. section 5.1 section 5.5
Diffie-Hellman remains widely used. ECDH offers smaller keys than traditional DH, while asymmetric encryption can also encapsulate a generated symmetric key. RSA-based exchange is less preferred than ECDH, and Kyber provides a lattice-based alternative still described at the level of ideas and intuition. section 5.5 section 6.2.1 section 14.3.3

