Elliptic-curve Diffie-Hellman (ECDH) lets two parties create the same shared secret across an insecure network without transmitting that secret. Each party keeps a private key, exchanges a public key, and combines the other party’s public key with its own private key. The shared result can become an AES key in a hybrid-encryption design. section 7.1.2
Figure 7.3 The DH algorithm computes the same result from the (payment private key, warehouse public key) and (warehouse private key, payment public key) key combinations.
The key-combination diagram shows why both parties independently compute the same shared result. section 7.1.2
Practical security guidance:
- Use approved curves such as Curve25519 rather than choosing arbitrary elliptic curves; some curves have weaknesses. section 7.4
- Prefer configuring ECDH through protocols such as TLS or SSH instead of reimplementing its mathematics. section 7.4
- Compared with original DH, ECDH uses elliptic curves, shorter keys, and faster performance for comparable security. section 7.4


