[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Diffie-Helman example in g++



Earlier, Douglas Barnes wrote:

> a is a constant, known to all (especially to both A and B).

Yes, that is true, but it still must be a primitive root w.r.t p. 
Unfortunately I am not well versed enough to explain the mathematical
reasoning behind this, but in the texts I have read, they all stated
this fact.

In an implementation of D-H I did for a project once, I ensured that
these conditions were met. Some probablistic analysis showed that approx
37-38% of numbers < p are primitive roots (done by sampling primes and
testing all n < p to see if n was primitive root), so finding a primitive
root was trivial.

Matthew.
-- 
Matthew Gream, [email protected]. "... encryption is the ultimate means of
Consent Technologies, 02-821-2043.  protection against an Orwellian state."