The first stage of RSA key generation is to choose two large prime numbers, p and q. A php utility to find prime numbers up to 2 Billion (i.e. 2 000 000 000 ) is provided below. This is adequate for 56 bit RSA encryption simulations. This script has a 30 second processing time limitation which will interrupt the program if a very large range is given. Best to play with this a little...
Pick some two of the prime numbers offered and cut and paste them into the form for further use.
For full RSA simulations a bc based prime number finder is provided as source code and on-line here .
Test your values of P and Q here
When you have chosen your two prime numbers.....we need to find phi == (p-1)(q-1)
We now need to find a small number 'e' which is co-prime to phi. This number may therefore be any number you choose, (except 1, which would be unsafe cryptographically) as long as it is co-prime to phi . This number forms the second part of your public key. Hints to choosing e .
Note that this calls the gcd (greatest common denominator) function which returns 1 when co-prime values are entered.
We now need to find a number 'd' so that d.e % phi == 1 This number will be your private key.
Enter a seed value for D or calculate it yourself. If the number typed obeys d.e % phi == 1 it will be used, otherwise it will be used as a start seed value. Leave blank to iterate to find lowest d value. Note on the algorithm used are here
|
|