HomeDiffie-Hellman Key Exchange

Diffie-Hellman Key Exchange

Online Diffie-Hellman key exchange tool with ECDH and X25519 negotiation, two-party public key exchange, and shared-secret verification for TLS demos, secure channel debugging, and cryptography learning.

How Diffie-Hellman Works

Alice and Bob generate key pairs, exchange public keys, and derive the same shared secret independently. Even if public keys are intercepted, the shared secret cannot be directly recovered.

Algorithm Settings

Derived length controls the final shared-secret output size.

Alice

(shown after key generation)
(shown after key generation)

Bob

(shown after key generation)
(shown after key generation)

Quick Demo (Auto Mode)

Click the button below to run the full key exchange flow automatically.



Documentation

This tool demonstrates Diffie-Hellman (including ECDH) key exchange, showing how Alice and Bob derive the same shared secret over a public channel.

Key Features

  • Multiple DH/ECDH algorithm options
  • Per-party key generation and public key exchange
  • Shared-secret computation and consistency check
  • Built-in auto demo flow

Steps

  1. Select algorithm and derived key length.
  2. Generate key pairs for Alice and Bob.
  3. Exchange public keys and fill peer key fields.
  4. Compute both shared secrets and verify they match.

Use Cases

  • Key agreement education
  • ECDH interoperability testing
  • Security protocol onboarding demos

Notes

  • DH provides key agreement, not identity authentication.
  • Production systems should combine certificates or signatures to prevent MITM attacks.
  • Both parties must use the same algorithm parameters.