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

Re: Diffie-Helman example in g++




Earlier, Douglas Barnes wrote:

> // Demo of mathematics for Diffie-Hellman type key exchange
[..]
> // Does anyone have a clue what good values of 'a' are in this
> // algorithm?
> 
> a = 127;

The only restriction placed on /a/ is that it be a primitive root of
/p/. To do this, you choose /a/ at random until you find the condition
(/a/, /p/-1) == 1 is satisfied. Since there are lots of primitive roots,
this shouldn't take long. I wonder though, are there any strengths in
choosing higher values of /a/?

Feel free to correct me if I'm wrong, my engineering background means
my number theory isn't as strong as it could be (but I'm working on it
:-).

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