0% found this document useful (0 votes)
5 views

4.3 RSA Algorithm

The RSA algorithm, introduced in 1977 by Rivest, Shamir, and Adleman, is an asymmetric encryption method that uses a pair of keys for encryption and decryption. Key generation involves selecting two prime numbers, calculating their product, and determining public and private keys based on Euler's Totient function. RSA ensures confidentiality, integrity, authenticity, and nonrepudiation in electronic communications, and is compared to symmetric algorithms like AES and DES in terms of security and speed.

Uploaded by

adityapandji1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

4.3 RSA Algorithm

The RSA algorithm, introduced in 1977 by Rivest, Shamir, and Adleman, is an asymmetric encryption method that uses a pair of keys for encryption and decryption. Key generation involves selecting two prime numbers, calculating their product, and determining public and private keys based on Euler's Totient function. RSA ensures confidentiality, integrity, authenticity, and nonrepudiation in electronic communications, and is compared to symmetric algorithms like AES and DES in terms of security and speed.

Uploaded by

adityapandji1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

4.

3 RSA Algorithm
-Mohd Janisar
• RSA stands for Rivest, Shamir, Aldeman
• It was introduced in 1977.
• It is an asymmetric encryption algorithm.
• Asymmetric because it uses one key for encryption and one for
decryption.
• Both the public and the private keys can encrypt/decrypt a message.
• The opposite key from the one used to encrypt a message is used to
decrypt it.
• This is one reason why RSA has become the most used
asymmetric algorithm.
• It provides a method to assure the confidentiality, integrity, authenticity
and nonrepudiation of electronic communications and data storage.
Steps for the key generation in
RSA :
• Consider 2 prime numbers. Lets say p and q
• Calculate n which is product of p and q. i.e. n=p*q
• Find Euler’s Totient function Φ(n) = (p-1)*(q-1)
• Select public key e such that
1. It must be prime
2. It must be less than Φ(n)
3. Must not be factor of Φ(n) i.e. GCD(e,Φ(n))=1.
• Find private key d such that the equation (d*e)mod T=1 holds
true.
• Lets see each step in detail….
• Consider two prime numbers as p=3, q=5;
• Lets calculate n as p*q. n=3*5=15
• Calculate Totient function Φ(n) = (p-1)*(q-1)
so Φ(n) = (3-1)*(5-1)
=8
• Find public key ‘e’ such that it’s a prime number which is less than Φ(n) and
GCD(e, Φ(n) ) =1
• The meaning of GCD(e, Φ(n) ) =1 is we have to find such a prime number less
than Φ(n) , when taken with Φ(n) , the greatest common divisor for both
should be none other than 1.
• Eg: In our case, prime numbers less 8 (i.e. the value of Φ(n)) are 3,5,7.
(Though 2 is prime number less than 8, it can not be considered because,
GCD(2,8) is not 1)
• So GCD(3,8)=1
GCD(5,8)=1 So lets select 3 as public key among 3,5,7
GCD(7,8)=1
• The last and final step is to find private key with the equation
(e*d)mod Φ(n)=1
• So in our example when we substitute values the equation
becomes : (3*d) mod 8=1
• This should be product of 3*d which should be multiple of 8
plus 1
Eg: consider d=3 then 3*3=9 which is (8*1)+1
similarly, d=11 then 11*3=33 which is (8*4)+1
This way it satisfies equation (3*3) mod 8=1 and (3*11)mod 8=1
for values 3 and 11
• So we have to find such numbers and select any one as private
key.
In our case lets take d=11 as a private key
Lets try encryption and decryption
Consider plain text as 8
Given p=3, q=5,
We calculated n=15, e=3, d=11
So the plain text 8 is ciphered as 2
Then, cipher text c =(p^e)mod n
∴ c= (8^3) mod 15
= 512 mod 15
=2
Lets have decryption of plain text from cipher text
Plain text p=(c^d) mod 15
So the cipher text 2 is decrypted as 8
∴ c= (2^11) mod 15
= 2048 mod 15
=8
Problem :
if p = 13, q = 5 and e = 7, find the value of d and plain text of cipher value 6.

Given p=13, q=5 Given that cipher value =6


n=13*5=65 So calculating (c^d)mod n
Φ(n)=(13-1)*(5-1) plaintext = (67) mod 65
= 12*4 plaintext = 46
=48 So d=7
So the plaintext=46
Given e=7
Lets confirm it by deciphering
(e*d)mod Φ(n) =1
Calculating (p^e)mod n
(7*d)mod 48=1
ciphertext=(467) mod 65
∴ d=7 which satisfies the equation as
ciphertext= 6
(7*7) mod 48=1
∴49mod 48 =1…….satisfied
So it matches with the given ciphertext=6
Difference between AES,DES and
RSA
Parameter AES DES RSA
Key Length 128/192/256 bits 64 bits > 1024 bits
Size of message 128 bits 64 bits Min 512 bits
block
Type of algorithm Symmetric Symmetric Asymmetric
Security Most secured Not enough secure Least secure
Key for decryption Same Same Different
Speed of Faster Moderate Slower
encryption
Thank you

You might also like