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

Computer Security: RSA (Rivest-Shamir-Adleman)

RSA is an asymmetric cryptographic algorithm that uses a public key and a private key. The public key is used to encrypt messages, while the private key is used to decrypt messages. It works by using two large prime numbers to generate the keys. To encrypt a message, the sender uses the receiver's public key to encrypt it. To decrypt it, the receiver uses their private key. The security of RSA comes from the difficulty of factoring large numbers.

Uploaded by

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

Computer Security: RSA (Rivest-Shamir-Adleman)

RSA is an asymmetric cryptographic algorithm that uses a public key and a private key. The public key is used to encrypt messages, while the private key is used to decrypt messages. It works by using two large prime numbers to generate the keys. To encrypt a message, the sender uses the receiver's public key to encrypt it. To decrypt it, the receiver uses their private key. The security of RSA comes from the difficulty of factoring large numbers.

Uploaded by

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

Computer Security

RSA (Rivest–Shamir–Adleman)
What is RSA Algorithm
RSA is an algorithm used by modern computers to encrypt and
decrypt messages. It is an asymmetric cryptographic algorithm. Asymmetric
means that there are two different keys. This is also called public key
cryptography, because one of the keys can be given to anyone. The other key
must be kept private. The algorithm is based on the fact that finding the factors
of a large composite number is difficult: when the integers are prime numbers,
the problem is called prime factorization. It is also a key pair (public and private
key) generator.
Pictography of RSA

Plain Text Cipher Text Plain Text


Sender Receiver
Encryption Decryption
Using Receiver’s Using Receiver’s
Public Key Private Key
Public Key & Private Key

RSA algorithm is an asymmetric


cryptography algorithm which means,
there should be two keys involve while
communicating, i.e., public key and private
key. There are simple steps to solve
problems on the RSA Algorithm.
Generating Key Public Key
Step 1: Choose two prime number p & q:

Choose large random prime number p & q

Step 2: Calculate the value of λ & n:


n=pxq λ = LCM((p - 1)(q - 1)

Step 3: Find the value of e (Public Key):


Choose the value of e, such that e should be co-prime. Co-prime
means is should not multiply by factors of λ and not divided by λ.
And this e is the public key of the RSA Algorithm
Compute the Private Key(d)

Multiplicative inverse of e in Zλ and calculate this using extended Euclidean


algorithm:
d = e in Zλ
Example
Encryption
Let plain text M and turns into number m by using an agreed-upon
reversible protocol known as a padding scheme.
• m = 123
• let p = 29 & q = 41
• Therefore, n = p x q = 29 x 41 = 1189
• λ = LCM((p - 1)(q - 1)) = LCM(28, 40) = 280
• e = 1 < e < λ , co-prime of λ.
• let e = 3 [Public key generated]
Cipher Text
Encryption
Cipher text, C = me mod n
Here, m = 123
e=3
n = 1189
Therefore, C = 1233 mod 1189
C = 1860867 mod 1189
C = 82 [Cipher text of 123]
Example
Decryption
Decryption factor d can be obtained by extended Euclidean algorithm
d = Multiplicative Inverse of e in Zλ, that means 3 in Z280
quotient r1 r2 r t1 t2 t
93 280 3 1 0 1 -93
3 3 1 0 1 -93 280
X 1 0 X -93 280 X

d = -93 mod 280 = 187 : Extended Euclidean Method


Now, plain text m can be found with this d.
m = Cd mod n = 82187 mod 1189 = 123 [plain text, padded form]
Thank You

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy