Sunteți pe pagina 1din 2

Q4a: In RSA system the public key e=7 and n= 187

Solution:
i)
What is private key of this user
N = pq
= 187
= 11 x 17
Calculate (n)=(p-1)(q-1)
=(17-1)(11-1)
=16*10
=160
So, e=7
Determine d such that ed=1 mod (n)
7d=1 mod 160
7*23=1 mod 160
161=1 mod 160
Here, Public key PU(e, n)=7, 187
Private key PR(d, n)=23, 187
ii)
Given data
Ciphertext c = 11
e = 7 and n = 187
plaintext =?
Plaintext P = Cd mod n
= 11 23 mod 187
= 79720245 mod 187
Plaintext = 88
iii)
Refer section xxxx
-------------------------------------------------------------------------------------------------------------------------Q4a) If generator g=2 and n or P =11, using Diffie-Hellman algorithm solve the following
1) Show that 2 is a primitive root of 11.
2) If A has a public key =9 , what is As private key?
3) If B has a public key =3 what is Bs private key?
4) Calculate the shared secret key.
Solution:
1) Show that 2 is a primitive root of 11.
2 1 mod 11 = 2
2 2 mod 11 = 4
2 3 mod 11 = 8
2 4 mod 11 = 5
2 5 mod 11 = 10
2 6 mod 11 = 9
2 7 mod 11 = 7
2 8 mod 11 = 3
2 9 mod 11 = 6
Using 2 as integer, we can get all the integer value in between 1 to 11. So 2 is a primitive
root of 11.
2) If A has a public key =9 , what is As private key?
2 6 mod 11 = 9
Therefore XA = 6
2) If B has a public key =3 what is Bs private key?
YB = (11) 6 mod 9
=1
4) Calculate the shared secret key
K = (YB) XA mod q
= (3) 6 mod 11
=3
---------------------------------------------------------------------------------------------------------------------------Q6b) Using RSA algorithm
Solution:

i)

P =3 q=11
e= 7 and M=12
n=p*q
= 3 * 11
= 33
(n) = (p-1) * (q-1)
= 2 * 10
= 20
ed=1 mod (n)
7d=1 mod 20
d= 3
Ciphertext (C) = Me mod n
= (12) 7 mod 33
C = 12
Decryption:
M = Cd mod n
= (12)3 mod 33
= 12
ii)
P =7 q=11
e=17 and M= 25
n=p*q
= 7 * 11
= 77
(n) = (p-1) * (q-1)
= 6 * 10
= 60
ed=1 mod (n)
17d=1 mod 77
d= 3
Ciphertext (C) = Me mod n
= (25) 17 mod 77
C=9
Decryption:
M = Cd mod n
= (9)57 mod 77
= 25
-------------------------------------------------------------------------------------Qb) for a given values p = 19, q=23 and e =3.Find n,(n) and d using RSA.
Solution: n = p * q
= 19 * 23
n = 437
(n) = (p-1) * (q-1)
= 18 * 22
(n)
= 396
ed=1 mod (n)
3d=1 mod 396

S-ar putea să vă placă și