Inferensys

Glossary

Elliptic Curve Diffie-Hellman (ECDH)

Elliptic Curve Diffie-Hellman (ECDH) is a key agreement protocol that allows two parties to establish a shared secret over an insecure channel using elliptic curve cryptography, providing equivalent security to traditional Diffie-Hellman with substantially smaller key sizes.
Operations room with a large monitor wall for system visibility and control.
CRYPTOGRAPHIC PROTOCOL

What is Elliptic Curve Diffie-Hellman (ECDH)?

A key agreement protocol that allows two parties to establish a shared secret over an insecure channel using the algebraic structure of elliptic curves, providing equivalent security to traditional Diffie-Hellman with significantly smaller key sizes.

Elliptic Curve Diffie-Hellman (ECDH) is a key-agreement protocol enabling two parties, each with an elliptic-curve public-private key pair, to compute a shared secret over an insecure channel. Each party combines their private key with the other's public key, resulting in the same elliptic curve point due to the commutative properties of scalar multiplication on the curve's cyclic group.

ECDH provides equivalent security to traditional finite-field Diffie-Hellman at a fraction of the key size—a 256-bit ECDH key offers comparable strength to a 3072-bit RSA key. This efficiency makes ECDH the foundational building block for high-performance Private Set Intersection (PSI) protocols, where it enables the oblivious comparison of encrypted set elements with minimal computational and bandwidth overhead.

CRYPTOGRAPHIC PRIMITIVE

Key Features of ECDH

Elliptic Curve Diffie-Hellman (ECDH) is a key-agreement protocol that allows two parties to establish a shared secret over an insecure channel. It provides equivalent security to traditional Diffie-Hellman with significantly smaller key sizes, making it ideal for efficient Private Set Intersection implementations.

01

Smaller Keys, Equivalent Security

ECDH achieves the same security level as traditional finite-field Diffie-Hellman with dramatically smaller key sizes. A 256-bit ECDH key provides security comparable to a 3072-bit RSA key.

  • 128-bit security: 256-bit ECDH vs. 3072-bit DH
  • 256-bit security: 512-bit ECDH vs. 15360-bit DH
  • Reduces bandwidth and storage overhead in PSI protocols
  • Critical for mobile and IoT applications with constrained resources
02

Mathematical Foundation on Elliptic Curves

ECDH operates over the elliptic curve discrete logarithm problem (ECDLP) rather than modular exponentiation. The protocol uses scalar multiplication of a public base point on a standardized curve like Curve25519 or secp256k1.

  • Alice generates private key a and public key aG
  • Bob generates private key b and public key bG
  • Shared secret: a(bG) = b(aG) = abG
  • ECDLP makes recovering a from aG computationally infeasible
03

Core Building Block for DH-Based PSI

ECDH serves as the foundational primitive for many classical Private Set Intersection protocols. In DH-PSI, each party hashes their set elements and exponentiates them with their private key, enabling intersection discovery without revealing non-matching elements.

  • Enables semi-honest secure PSI constructions
  • Used in contact discovery applications (e.g., Signal, WhatsApp)
  • Pairs with Cuckoo Hashing for efficient set representation
  • Forms the basis for asymmetric PSI where only one party learns the result
04

Forward Secrecy and Ephemeral Keys

ECDH supports perfect forward secrecy (PFS) when ephemeral key pairs are generated for each session. Even if a long-term private key is compromised, past session keys remain secure because the ephemeral private keys are discarded after use.

  • Ephemeral ECDH (ECDHE) generates fresh keys per session
  • Prevents retrospective decryption of captured traffic
  • Essential for secure messaging and TLS 1.3 handshakes
  • Adds minimal computational overhead due to fast ECC operations
05

Standardized Curves and Interoperability

ECDH implementations rely on standardized, well-vetted elliptic curves to ensure security and cross-platform compatibility. Widely adopted curves include:

  • Curve25519 (X25519): Designed for high-speed, constant-time ECDH
  • NIST P-256 (secp256r1): FIPS 186-4 compliant, widely used in government
  • secp256k1: Used in Bitcoin and blockchain applications
  • Curve448 (X448): Higher security margin for long-term protection

Standardization ensures consistent behavior across libraries like OpenSSL, libsodium, and Bouncy Castle.

06

Vulnerability to Quantum Attacks

ECDH is not post-quantum secure. Shor's algorithm running on a sufficiently powerful quantum computer can efficiently solve the ECDLP, breaking the protocol entirely.

  • Both ECDH and finite-field DH are vulnerable to quantum attacks
  • Migration to post-quantum key exchange (e.g., Kyber) is underway
  • NIST is standardizing quantum-resistant alternatives
  • Hybrid ECDH + post-quantum schemes provide transitional security
  • Current PSI protocols using ECDH will require redesign for long-term confidentiality
ECDH AND PRIVATE SET INTERSECTION

Frequently Asked Questions

Clear, technical answers to the most common questions about how Elliptic Curve Diffie-Hellman underpins efficient and secure private set intersection protocols.

Elliptic Curve Diffie-Hellman (ECDH) is a key agreement protocol that allows two parties, each with an elliptic curve public-private key pair, to establish a shared secret over an insecure channel. It works by leveraging the mathematical properties of elliptic curves, where scalar multiplication is easy to compute but its inverse, the elliptic curve discrete logarithm problem, is computationally infeasible. In practice, Alice generates a private key a and a public key aG (where G is a generator point). Bob generates b and bG. They exchange public keys. Alice computes a(bG) and Bob computes b(aG), both arriving at the identical shared secret abG. This shared secret can then be used to derive symmetric encryption keys. ECDH provides equivalent security to traditional Diffie-Hellman but with significantly smaller key sizes, making it ideal for resource-constrained environments and high-performance protocols like those used in private set intersection.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.