Public-key cryptography
Agree on shared keys
Use an established authenticated key-agreement protocol to derive session keys without sending the final shared key across the network.
8 minute lesson
Key agreement lets two parties derive shared secret material. It does not automatically prove who the other party is.
Protocols combine ephemeral key agreement with signatures, certificates, or pre-established identity. Feed the result through the protocol’s key derivation and use separate keys by purpose. Do not assemble a handshake from raw primitives.
A client and server perform raw Diffie-Hellman over an untrusted network. An active attacker establishes one shared key with the client and another with the server, reading and changing traffic between them.
Key agreement needs authenticated identities and a defined key schedule. Use a protocol such as current TLS instead of composing raw agreement, signatures, and derivation yourself.
Trace a TLS connection and save where the ephemeral agreement, certificate identity, transcript authentication, and derived traffic keys appear conceptually. Verify the connection with the expected hostname. Then connect through a test endpoint with the wrong identity and capture the authentication failure.
Lesson completed