Diffie-Hellman Key Establishment
Follow these steps to run the Diffie-Hellman Key Establishment simulation.
Step 1: Public Information Setup
- Set public parameters in either way:
- Use Generate Prime to load a preset prime and default generator .
- Or type your own values for and directly in the input boxes.
- Optional: Click Another Generator to cycle valid preset generators for the currently selected preset prime.
- Public parameters must satisfy and .
Step 2: Private Key Selection
- For Alice:
- Enter a private key manually, or click Generate A.
- For Bob:
- Enter a private key manually, or click Generate B.
- Each private key must satisfy and .
Step 3: Public Key Calculation
- For Alice, click Calculate g^a to compute:
- For Bob, click Calculate g^b to compute:
Step 4: Exchange Public Keys
- Click Send Public Key to Bob to copy Alice's public key into Bob's received field.
- Click Send Public Key to Alice to copy Bob's public key into Alice's received field.
Step 5: Shared Secret Computation
- Alice clicks Calculate Shared Secret to compute:
- Bob clicks Calculate Shared Secret to compute:
Step 6: Verification
- Check the verification status shown in Step 3.
- Success condition:
- If the values do not match, verify that:
- Both users used the same and .
- Public keys were recalculated after any input change.
- Public keys were exchanged before shared-secret calculation.
Notes on Simulation Behavior
- The simulation clears stale computed outputs whenever core inputs change.
- Validation messages are shown when inputs are out of range or missing.
- This simulation demonstrates correctness of key establishment, not authentication against active attackers.