Link to home
Start Free TrialLog in
Avatar of KenTan85
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???
Avatar of occaustin
occaustin

RSA encryption depends (as you well know) on the random selection of prime numbers. The range from which these prime numbers are selected is most relevant as it determines the number of processes that would be required to break the algorithm.

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

Avatar of KenTan85

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?
Avatar of ozo
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)
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
SOLUTION
Avatar of Member_2_4694817
Member_2_4694817

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial