Selection of parameters in Diffie-Hellman

Posted by allenzzzxd on Stack Overflow See other posts from Stack Overflow or by allenzzzxd
Published on 2010-03-08T18:55:18Z Indexed on 2010/03/08 19:06 UTC
Read the original article Hit count: 356

Filed under:
|
|

Hello, maybe it's not so proper to ask this question here... anyway, I'm trying to use the gmp library for the implementation of DH, but the problem here I got is:

Once, when I was doing the tests to observe the output, although big values of prime and the private keys were selected:

  • p was about more than 300 digits long in decimal
  • a, b were about 100 digits long

finally I got a shared secret key which was extremely small, perhaps smaller than 10^8 in decimal...

This problem didn't show up many times, in fact, during all the observation, it appeared just once...but still, this was not so good at all.

So I wonder if there are some methods which can avoid this... Thanx a lot

© Stack Overflow or respective owner

Related posts about diffiehellman

Related posts about c