It may not be right to ask this question here ... anyway, I'm trying to use the gmp library to implement DH, but the problem here I got:
Once, when I was doing tests to observe the output, although large values โโof the simple and private keys were selected:
- p there were more than 300 decimal digits
- a, b about 100 characters long
Finally, I got a shared secret key that was extremely small, possibly less than 10 ^ 8 in decimal ...
This problem did not occur many times, in fact, during all the observations, it appeared only once ... but still it was not so good.
So, I am wondering if there are any methods that can avoid this ... Thanx a lot
source
share