> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Yuliya Shulman > Sent: Wednesday, July 16, 2008 9:29 AM > To: openssl-users@openssl.org > Subject: RE: Prime number generation on FreeBSD-sparc64 > > > Thank you so much for providing the article and the flags! V8 worked, at > least with the limited functionality we're using! > > I know there are lists of prime numbers as well as known algorithms. We > don't generate primes for our own use; OpenSSL does. We're using > RSA_generate_key() - a function in rsa_depr.c > > In turn, it uses: > RSA_generate_key_ex() in rsa_gen.c > rsa_builtin_keygen() in rsa_gen.c > BN_generate_prime_ex() in prime.c > BN_is_prime_fasttest_ex() in bn_prime.c > > As for downloading a list of primes - I briefly toyed with the idea in > moments of desperation (this code is not easy to debug, to put it > mildly), but unfortunately, having a list of codes in one's program > makes it very easy to break them. >
Ah, but isn't every prime your program generates somewhere on one of those lists of primes? Thus an attacker does already have a list of codes... ;-) Be aware of 2 things in dealing with prime generation from OpenSSL: The prime generation routine cannot generate small primes. To see what I mean you can try generating a prime with 1 bit of length, 2 bits of length, 3 bits of length, etc. You should therefore range check any input you send to these routines to insure that the primes you want are not under 64 bits in length The routine doesen't guarentee the numbers it generates is prime. It only guarentees that it will NOT pass a number to you that is NOT prime. Basically, you have a 99.5% (or better depending on who you talk to) chance that any given number you get is prime. If you are using the primes as part of crypto key generation they are sufficient for this. If you are using them for some kind of scientific proof or some such, you really need to scrap all of this and replace it with a prime generation routine. Ted ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]