What should I do to generate big prime numbers for RSA?
As you know, we need to big prime numbers to make private and public keys for RSA encryption algorithm.
If I want to do it by any sieve algorithms,it take lot of time.
What is the best way?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’re better off using a library for crypto routines. There are several, and they are fraught with subtle problems hopefully most of which are fixed in the existing implementations, and yet to be fixed in a new implementation.
However, I’ve played around with generating primes using Python and GMP:
http://stromberg.dnsalias.org/svn/huge-prime/trunk/
In short, trial division is best for small numbers, Miller-Rabin is good as a quick filter/test for a little larger numbers but you sometimes still end up using trial division to get guaranteed primes.