I'm trying to figure out an RSA Encryption (using Java) by finding out P and Q. Here is what I have to do:
I have to generate two random numbers (P and Q) and following the guidelines:
- P & Q has to be at the most 7 bits long
- P & Q cannot be 0 or 1 (Using the Math.random() function is what I'm doing for this step)
- P & Q must be primes
- P & Q cannot be the same number (Already have this figured out)
- (PQ) must be at least 256 (Already have this figured out)
So, basically I'm starting out with this:
double p = Math.random();
double q = Math.random();
... and then trying to follow the 5 guidelines above. Can anyone give me a hint on how to figure out #1 and #3?
Thanks!
Aucun commentaire:
Enregistrer un commentaire