Pcornel
Browse topics
Options
Recent
Favorites
Security · Technical reference

ECDH

Direct answer

ECDH (elliptic-curve Diffie-Hellman) lets two parties derive a shared secret over an open channel using their EC key pairs. Ephemeral ECDHE in TLS 1.3 gives perfect forward secrecy.

When to use this

Use this when deriving shared secrets with elliptic-curve Diffie-Hellman.

First 30 seconds

1. ECDH derives a shared secret from key pairs.

2. Ephemeral (ECDHE) for forward secrecy.

3. Feed the output through a KDF (HKDF).

4. Authenticate the exchange.

5. X25519 is common.

Operational verification

private + peer public → shared secret → KDF → keys

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • Static ECDH (reused keys) where forward secrecy is required.
  • Not validating that a received point lies on the curve (invalid-curve attacks) — use well-tested libraries.
  • Using the raw shared secret as a key; always run it through a KDF (HKDF).
  • Mixing up ECDH (key agreement) with ECDSA (signatures).
Platform / version applicability
Cryptography, PKI and secrets
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformCryptography, PKI and secrets
Scope / prerequisiteUse this when deriving shared secrets with elliptic-curve Diffie-Hellman.
What next?2 suggested next steps
Evidence1
On this pageJump to a specific section
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Ephemeral ECDHE gives forward secrecy.
  • Both sides must use the same curve.
  • Authenticate the exchange to stop MITM.
Key checks
  • openssl genpkey -algorithm X25519 -out a.pem; openssl pkeyutl -derive -inkey a.pem -peerkey b-pub.pem -out shared.bin — ECDH derive
  • openssl s_client -connect <host>:443 </dev/null | grep 'Server Temp Key' — TLS ECDHE
  • KDF applied to shared secret — HKDF
ReferenceWhy it matters1 section · depth on demand

ECDH vs ECDHE

  • ECDH with static keys gives the same shared secret each time; no forward secrecy.
  • ECDHE (ephemeral) generates a new key pair per session, so a stolen long-term key cannot decrypt old sessions.

TLS 1.3 only allows ephemeral key exchange. The shared secret is fed into a KDF (HKDF) to derive the actual encryption keys.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

ECDH (Elliptic Curve Diffie-Hellman) lets two parties derive a shared secret over an insecure channel using elliptic-curve key pairs. In its ephemeral form (ECDHE) a new key pair is generated for each session, providing forward secrecy.

Where it is used:

ProtocolUse
TLS 1.2/1.3ECDHE key exchange (X25519, P-256)
SSHcurve25519-sha256 key exchange
IPsec IKEv2DH groups 19, 20, 21, 31
Signal, WireGuardX25519

Modern TLS increasingly uses hybrid post-quantum key exchange (X25519 combined with ML-KEM) to protect recorded traffic against future quantum decryption.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docCryptography, PKI and secrets current

Authoritative/upstream documentation reviewed for bounded claims in Asymmetric Cryptography → ECDH. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://csrc.nist.gov/pubs/fips/186-5/final · confidence 94%
Confirmation

Confirm action

Continue?