Asymmetric Key Cryptography, RSA

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

MBS College of Engineering & Technology 1

 Also Called as Public Key Cryptography


 Two different keys are used
Private Key
Public Key

Matrix of Private and Public Key

Key Details A should know B should know


A’s Private Key Yes No
A’s Public Key Yes Yes
B’s Private Key No Yes
B’s Public Key Yes Yes
MBS College of Engineering & Technology 2
MBS College of Engineering & Technology 3
Symmetric Key Cryptography Asymmetric Key Cryptography
Use pair of keys: Public Key & Private
Use same cryptographic keys for both Key.
encryption of plain text and decryption of The Public Key is disseminated Key
cipher text. The Private Key is known only to the
owner

Simple since only one key is used in both Complex as it uses separate key for both
operations operations

Faster execution speed Comparatively slower

DES, AES, RC5 are some common RSA and Diffie-Hellman are some
algorithms common algorithms

MBS College of Engineering & Technology 4


 Most popular asymmetric key cryptography algorithm
 It solves the problem of key agreement and
distribution
 The name RSA comes from the first letters of the
surnames of three researchers who developed it-
Ron Rivest, Adi Shamir and Len Adleman

MBS College of Engineering & Technology 5


1) Choose two large prime numbers P and Q.
2) Calculate N=P*Q
3) Select the public key (i.e. the encryption key) E such that it is
not a factor of (P-1) * (Q-1)
4) Select the private key (i.e. the decryption key) D such that the
following equation is true:
(D*E) mod (P-1) * (Q-1) = 1
5) For encryption calculate the cipher text CT from the plain text
PT as follows:
CT=PTE mod N
6) Send CT as Cipher text to the receiver
7) For decryption calculate the plain text PT from cipher text CT
as follows:
PT=CTD mod N
MBS College of Engineering & Technology 6
1) Choose two large prime numbers P and Q.
Let P=7 Q=17
2) Calculate N=P*Q
N = 7 * 17 = 119
3) Select the public key (i.e. the encryption key) E
such that it is not a factor of (P-1) * (Q-1)
Applying the formula: (7-1) * (17-1) = 6 * 16 = 96
The factors of 96 are 2*2*2*2*2*3
Thus we have to choose E such that none of the factors of
E is 2 and 3
Let us choose E=5

MBS College of Engineering & Technology 7


4) Select the private key (i.e. the decryption key) D
such that the following equation is true:
(D*E) mod (P-1) * (Q-1) = 1
(D*5) mod (7-1) * (17-1) = 1
(D*5) mod (6) * (16) = 1
(D*5) mod (96) = 1
After some calculations let us take D=77
Then the following is true:
(77*5) mod (96) = 1

MBS College of Engineering & Technology 8


5) For encryption calculate the cipher text CT from
the plain text PT as follows:
CT=PTE mod N
 Let the plain text that we want to encrypt is 10
CT=105 mod 119
= 100000 mod 119
= 40
6) Send CT as Cipher text to the receiver
Send 40 as Cipher text to the receiver

MBS College of Engineering & Technology 9


7) For decryption calculate the plain text PT from
cipher text CT as follows:
PT=CTD mod N
PT = 4077 mod 119
= 10, which is equal to original plain text 10

MBS College of Engineering & Technology 10


MBS College of Engineering & Technology 11
MBS College of Engineering & Technology 12
MBS College of Engineering & Technology 13
MBS College of Engineering & Technology 14
MBS College of Engineering & Technology 15
MBS College of Engineering & Technology 16
MBS College of Engineering & Technology 17
MBS College of Engineering & Technology 18

You might also like