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
- 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.
- Prime Modulus (p) — Large prime number Accepts values from 2 to 1,000 (default: 23).
- Generator (g) — Primitive root modulo p Accepts values from 2 to 100 (default: 5).
- Alice's Private Key (a) — Alice's secret private key Accepts values from 1 to 1,000 (default: 6).
- Bob's Private Key (b) — Bob's secret private key Accepts values from 1 to 1,000 (default: 15).
- Once all inputs are set, review your results in the Results panel. Here's what each output means:
- Alice's Public Key — shown as a numeric value. This is the primary result of this calculator.
- Bob's Public Key — shown as a numeric value. This is the primary result of this calculator.
- Shared Secret — shown as a numeric value. This is the primary result of this calculator.
- Security Level — shown as a numeric value. This is the primary result of this calculator.
- Discrete Log Complexity — shown as a numeric value.
- 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 pRelated Calculators
Ad Placeholder