KenTan85
asked on
RSA Alogthrim
I am currently trying to generate sercet key and public key using RSA. I have a doubt upon doing. After I choose the 2 prime numbers (p,q), I would need to select a "e" which is
m = (p-1)(q-1)
gcd(e, m) = 1
There is more than 1 value for e, it could be quite a lot of number, which 1 to use? Also the e choosen some will produce the same "d" which is as follow
ed = 1 mod m
My question here is that is it ok for value d and e to be the same? If not, how to I choose an e which is of different value of d???
m = (p-1)(q-1)
gcd(e, m) = 1
There is more than 1 value for e, it could be quite a lot of number, which 1 to use? Also the e choosen some will produce the same "d" which is as follow
ed = 1 mod m
My question here is that is it ok for value d and e to be the same? If not, how to I choose an e which is of different value of d???
ASKER
Hi you are right, I am using small prime to test it out, I try using prime number like, 7, 11, 13,17 and I always end up with the same e and d when I choose e.
So that mean I should not use small prime?
So that mean I should not use small prime?
if you use the small primes 7,11
then m=6*10=60
so if e=17, d would be 53
if e=13, d would be 37
(60 has many small factors so 7*11 is not the best choice for p*q,even for small primes)
then m=6*10=60
so if e=17, d would be 53
if e=13, d would be 37
(60 has many small factors so 7*11 is not the best choice for p*q,even for small primes)
ASKER
The thing I do not understand is that there are so many e, which 1 should I choose? And is there any cnodition to choose e? I only know if this condition below
gcd(e, m) = 1
gcd(e, m) = 1
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I realised some of the e does give me the same d and e , that would make my secret ket and public key same isn't it? Is it true that some e will make me into such suitation?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
My guess.... and tell me if I'm wrong, is that you are testing your algorithm on small primes and coming up with the same e and d.
The aforementioned range of the randomly selected primes (and here is the brilliance of RSA) does change over time, and more importantly, processing power. Using small primes may cloud the situation as large primes (64 bit +) are commonly used in practice.
here is an example of short primes working out
p = 61 and q = 53
n=61*53=3233
(p-1)(q-1) = (61 - 1)(53 - 1) = 3120
e = 17
d = 2753