Choose the lengths (L,N) of the primes (p,q)
for a desired security strength:
You may use the domain parameters p, q and g in the text areas below, or generate new ones. Generation of new domain parameters may take a few minutes. It is silently performed in the background by a web worker.
To generate new domain parameters, enter a different initial domain parameter seed in the first text area below or click the button to generate one at random.
Initial domain parameter seed (256 bits, encoded as 64 hex digits):
Validate the generated domain parameters using Algorithm A.1.1.3 of NIST FIPS 186-4.
DH uses FFC key pairs. You may use the private and public keys in the text areas below for party A, or time the generation of random FFC key pairs by clicking the button.
The time it takes to generate a key pair is estimated by an experiment run in the background, where a web worker uses performance.now() to measure the time it takes to generate 100 random key pairs. Since performance.now() measures elapsed time rather than computation time, the measured time may be inflated by any extraneous activity taking place in the machine at the same time. To partially compensate for that, the experiment is repeated ten times and the minimum elapsed time is reported. The last random key pair generated in the last repetition of the experiment is written to the private and public key text areas for party A.
Private key x_A:
Public key y_A:
You may use the private and public keys in the text areas below for party B, or generate a random FFC key pair by clicking the button.
Private key x_B:
Public key y_B:
Click the button below to time the DH computation performed by party A.
As when timing key pair generation, the time it takes to perform a DH computation is estimated by an experiment run in the background, where a web worker uses performance.now() to measure the time it takes to perform 100 computations. Since performance.now() measures elapsed time rather than computation time, the measured time may be inflated by any extraneous activity taking place in the machine at the same time. To partially compensate for that, the experiment is repeated ten times and the minimum elapsed time is reported. The resulting shared secret is hex-encoded and written to the text area below.
You may check the public key validation checkbox to include validation of the public key of party B in the timing, performed as specified by Algorithm 5.6.2.3.1 of NIST SP 800-56Ar2. (An uncertified public key submitted by an untrusted party must be validated before performing a DH key exchange with that party.)
Include the validation of the public key of party B in the timing
Shared secret computed by party A (hex encoded):
Click the button below to perform the DH computation of party B.
Shared secret computed by party B (hex encoded):