Skip to main content
Calcimator

Diffie-Hellman Key Exchange Calculator

Calculate Diffie-Hellman key exchange parameters, shared secret, and security analysis.

Inputs

Results

Alice's Public Key

8

Bob's Public Key

19

Shared Secret

2

Security Level

4.5 bits

Discrete Log Complexity4.8
How to Use This Calculator
  1. Enter the prime modulus (p) and generator (g) values.
  2. Set each party private key value.
  3. Review the public keys and shared secret computed by the DH protocol.
  4. Verify the shared secret matches on both sides to confirm the protocol works correctly.
  5. Use group sizes of at least 2048 bits in production -- 768 and 1024-bit groups are deprecated.
Ad Placeholder

Formula

Shared Secret = (g^a)^b mod p = (g^b)^a mod p

Related Calculators

Ad Placeholder