--- Wei Dai <[EMAIL PROTECTED]> wrote: > > Sort of on the subject, asking Crypto++ to > generate RSA keys has a possibility > > of creating invalid ones. Going back to my 16-bit > keys (I know this is an > > extreme example, but it makes the probabilities > higher) it can choose p = 233 > > and q = 211 (using e = 3 as before). With these > values it is impossible to > > calculate d as there is no d such that ed = 1 mod > phi. > > The algorithm for generating small primes is not > checking for e being > relatively prime to p-1. This isn't a problem for > real keysizes because > the algorithm for generating large primes (> 2^16) > does check, but I'll > get it fixed.
For RSA key generation, we need to ensure that we pick an e, that is 1 < e < phi and gcd( e, phi ) == 1, where phi = (p-1)(q-1) in RSA case. So we need to check e being relatively prime to (p-1)(q-1). Correct me if I am wrong. Thanks! __________________________________________________ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com
