Diffie–Hellman key exchange
Diffie–Hellman key exchange is a public-key key-agreement protocol that enables parties to derive a shared secret over an insecure channel without transmitting it.
Real-World Cryptography
Diffie-Hellman key exchange is a public-key protocol that lets parties establish a shared secret over an insecure channel.
- How it is used
- Establishes a shared secret over an insecure channel for later symmetric encryption.
- How deep it goes
- Explains the exchange, modular key formulas, discrete-logarithm basis, standards, and authentication limits.
- Examples
- Uses Alice-and-Bob shape combinations and modular arithmetic with generator 3 and prime 5.
- What you can do after
- Operate/configure DH using suitable parameters, validate received public keys, and distinguish passive from active MITM risks.
Read how Real-World Cryptography explains Diffie–Hellman key exchange →
Hacking Cryptography
Diffie–Hellman key exchange is a key-agreement protocol in which participants derive a shared secret from exchanged public values and retained private exponents.
- How it is used
- Establishes shared secrets for public-key cryptography and key exchanges in TLS.
- How deep it goes
- Derives public values and shared-secret equations through modular arithmetic, without implementation code or parameter-selection guidance.
- Examples
- Works through Alice and Bob using p = 13, g = 7, private exponents 3 and 9, and shared secret 5.
- What you can do after
- Evaluate how public values produce a shared secret without exposing either private exponent.
Read how Hacking Cryptography explains Diffie–Hellman key exchange →
Elliptic Curve Cryptography for Developers
A public-key key-agreement protocol that lets parties establish a shared secret over an insecure network using private values and exchanged public values.
- How it is used
- Uses elliptic-curve public keys to establish a secret for a symmetric encryption algorithm.
- How deep it goes
- Explains the exchange flow and test implementation, but defers detailed curve and prime selection.
- Examples
- Demonstrates reciprocal multiprecision calculations with pass-phrase and random private-key inputs, producing matching hexadecimal shares.
- What you can do after
- Build a testable elliptic-curve exchange and verify that both parties compute identical shared key material.
Read how Elliptic Curve Cryptography for Developers explains Diffie–Hellman key exchange →
Software Security for Developers
Diffie-Hellman is a public-key key-agreement algorithm based on the computational difficulty of the discrete logarithm problem.
- How it is used
- Uses public-key agreement to establish a symmetric encryption key across an insecure communication channel.
- How deep it goes
- Explains exchanged keys, private-key protection, equivalent computations, and the untransmitted shared secret, while deferring mathematical detail.
- Examples
- Uses a public-chat analogy, an ACME payment-and-warehouse scenario, and a shared-secret computation equation.
- What you can do after
- Evaluate how DH establishes an AES key and distinguish its role from the encryption of application data.
Read how Software Security for Developers explains Diffie–Hellman key exchange →
Related concepts
- X3DHused by · X3DH is a non-interactive key-exchange protocol that combines multiple Diffie-Hellman exchanges to establish shared keying material for asynchronous messaging.
- API keyproduces · An API key is a credential used to identify or authorize a client accessing an application programming interface.
- key exchangekind of · Key exchange is a cryptographic protocol by which communicating parties establish a shared secret over a communication channel without directly transmitting that secret.
- elliptic-curve diffie-hellmanincludes · Elliptic-curve Diffie-Hellman is a public-key key-agreement method in which parties derive a shared secret through elliptic-curve point operations.
- CPaceused by · CPace is a symmetric password-authenticated key-exchange algorithm in which parties derive a group generator from a shared password and use it for ephemeral Diffie-Hellman key exchange.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



