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

Alice's Public Key

8

Bob's Public Key

19

Shared Secret

2

Security Level

4.5 bits

How to Use This Calculator
  1. Start by filling in the input fields below. Results update instantly as you type, so you can experiment with different values to see how they affect the outcome.
  2. Prime Modulus (p) — Large prime number Accepts values from 2 to 1,000 (default: 23).
  3. Generator (g) — Primitive root modulo p Accepts values from 2 to 100 (default: 5).
  4. Alice's Private Key (a) — Alice's secret private key Accepts values from 1 to 1,000 (default: 6).
  5. Bob's Private Key (b) — Bob's secret private key Accepts values from 1 to 1,000 (default: 15).
  6. Once all inputs are set, review your results in the Results panel. Here's what each output means:
  7. Alice's Public Key — shown as a numeric value. This is the primary result of this calculator.
  8. Bob's Public Key — shown as a numeric value. This is the primary result of this calculator.
  9. Shared Secret — shown as a numeric value. This is the primary result of this calculator.
  10. Security Level — shown as a numeric value. This is the primary result of this calculator.
  11. Discrete Log Complexity — shown as a numeric value.
  12. Explore the related calculators below if you need deeper analysis or want to approach this topic from a different angle.
Ad Placeholder

Formula

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

Related Calculators

Ad Placeholder