key exchange

The step in which two parties establish a shared secret key over a network, so they can then encrypt their conversation.

In more detail

It is done either by key agreement, where both sides contribute and compute the same secret, as in Diffie-Hellman and X25519, or by key transport, where one side creates the key and sends it encrypted to the other. The resulting secret is fed into a key derivation function to make the session keys used by a fast symmetric cipher. The exchange must be authenticated, or an attacker in the middle can run a separate exchange with each side.

Examples

openssl pkeyutl -derive -inkey bob.key -peerkey alice.pub -out bob.bin
Alice and Bob derived the same secret

Related terms

Taught in

References