RAB 8ETRX DCE RSA Algorithm Examples
RAB 8ETRX DCE RSA Algorithm Examples
Perform encryption and decryption using the RSA algorithm for the following:
1. p=3; q=11; e=7; M=5
Answer:
n = p * q = 3 * 11 = 33
f(n) = (p-1) * (q-1) = 2 * 10 = 20
Now, we need to compute d = e-1 mod f(n) by using backward substitution of GCD
algorithm:
According to GCD:
20 = 7 * 2 + 6
7=6*1+1
6=1*6+0
Therefore, we have:
1=7–6
= 7 – (20 – 7 * 2)
= 7 – 20 + 7 * 2
= -20 + 7 * 3
-1 -1
Hence, we get d = e mod f(n) = e mod 20 = 3 mod 30 = 3
So, the public key is {7, 33} and the private key is {3, 33}, RSA encryption and
decryption is following:
Encryption Decryption
Plaintext ciphertext Plaintext
5 14 5
So, the public key is {3, 55} and the private key is {27, 55}, RSA encryption and
decryption is following:
Encryption Decryption
Plaintext ciphertext Plaintext
9 14 9
Hence, we get d = e-1 mod f(n) = e-1 mod 60 = -7 mod 60 = (53-60) mod 60 = 53
So, the public key is {17, 77} and the private key is {53, 77}, RSA encryption and
decryption is following:
Encryption Decryption
Plaintext ciphertext Plaintext
8 57 8
Encryption Decryption
Plaintext ciphertext Plaintext
7 106 7
Encryption Decryption
Plaintext ciphertext Plaintext
2 128 2