Diffie-Hellman(DH Group) Key Agreement Method[w1]
ZZ = g ^ (xb * xa) mod p
Note that the individual parties actuallyperform the computations:
ZZ = (yb ^ xa) mod p = (ya ^ xb) mod p
ya is party a's public key; ya = g ^ xa modp
yb is party b's public key; yb = g ^ xb modp
xa is party a's private key
xb is party b's private key
p is a large prime
q is a large prime
g = h^{(p-1)/q} mod p, where
h is any integer with 1 < h < p-1such that h{(p-1)/q} mod p > 1
(ghas order q mod p; i.e. g^q mod p = 1 if g!=1)
j a large integer such that p=qj + 1
(See Section 2.2 for criteria for keys andparameters)