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

U3 Rsa Algorithm

The document discusses the RSA algorithm, which is a widely used public-key encryption algorithm. It was developed in 1977 and works by using both a public key and a private key. The public key is used to encrypt messages, while only the corresponding private key can decrypt them. The security of RSA comes from the difficulty of factoring large prime numbers.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

U3 Rsa Algorithm

The document discusses the RSA algorithm, which is a widely used public-key encryption algorithm. It was developed in 1977 and works by using both a public key and a private key. The public key is used to encrypt messages, while only the corresponding private key can decrypt them. The security of RSA comes from the difficulty of factoring large prime numbers.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Rsa Algorithm

RSA is the best known, and by far the most widely used general
public key encryption algorithm, and was first published by Rivest, Shamir
& Adleman of MIT in 1978 [RIVE78]. Since that time RSA has reigned
supreme as the most widely accepted and implemented general-purpose
approach to public-key encryption. The RSA scheme is a block cipher in
which the plaintext and the ciphertext are integers between 0 and n-1 for
some fixed n and typical size for n is 1024 bits (or 309 decimal digits). It is
based on exponentiation in a finite (Galois) field over integers modulo a
prime, using large integers (eg. 1024 bits). Its security is due to the cost of
factoring large numbers. RSA involves a public-key and a private-key where
the public key is known to ll and is used to encrypt data or message. The
data or message which has been encrypted using a public key can only be
decryted by using its corresponding private-k y. Each user generates a key
pair i.e. public and private key using the following steps:
 each user selects two large primes at random - p, q
 compute their system modulus n=p.q
 calculate ø(n), where ø(n)=(p-1)(q- 1)
 selecting at random the encry tion key e, where 1<e<ø(n),and gcd(e,ø(n))=1
 solve following equation to find decryption key d: e.d=1 mod ø(n) and 0≤d≤n
 publish their public encr ption key: KU={e,n}
 keep secret private decryption key: KR={d,n}

Both the sender and receiver must know the values of n and e, and only the
receiver knows the value of d. Encryption and Decryption are done using
the following equations. To encrypt a message M the sender:
– obtains public key of recipient KU={e,n}
– computes: C=Me mod n, where 0≤M<n
To decrypt the ciphertext C the owner:
– uses their private key KR={d,n}
– computes: M=Cd mod n = (Me) d mod n = Med mod n
For this algorithm to be satisfactory, the following requirements are to be met.
a) Its possible to find values of e, d, n such that Med = M mod n for all M<n
b) It is relatively easy to calculate Me and C for all values of M < n.
c) It is impossible to determine d given e and n

The way RSA works is based on Number theory: Fermat’s little


theorem: if p is prime and a is positive integer not divisible by p, then ap-1
≡ 1 mod p. Corollary: For any positive integer a and prime p, ap ≡ a mod
p.
Fermat’s theorem, as useful as will turn out to be does not provide us
with integers d,e we are looking for –Euler’s theorem (a refinement of
Fermat’s) does. Euler’s function associates to any positive integer n, a number
φ(n): the number of positive integers smaller than n and relatively prime to n.
For example, φ(37) = 36 i.e. φ(p) = p-1 for any prime p. For any two primes
p,q, φ(pq)=(p-1)(q-1). Euler’s theorem: for any relatively prime integers a,n
we have aφ(n)≡1 mod n. Corollary: For ny integers a,n we have aφ(n)+1≡a
mod n Corollary: Let p,q be two odd primes and n=pq. Then: φ(n)=(p-1)(q-
1) For any integer m with 0<m<n, m(p-1)(q-1)+1 ≡ m mod n For any
integers k,m with 0<m<n, mk(p-1)(q-1)+1 ≡ m mod n Euler’s theorem
provides us the numbers d, e such that Med=M mod n. We have to choose
d,e such that ed=kφ(n)+1, or equivalently, d≡e-1mod φ(n)

AN EXAMPLE OF
RSA
can be given as, Determine d: de=1 mod 160 and d < 160 Value is d=23
Select primes: p=17 & since 23×7=161= 10×160+1
q=11 Publish public key KU={7,187}
Compute n = pq Keep secret private key KR={23,187}
=17×11=187 Now, given message M = 88 (nb. 88<187)
Compute ø(n)=(p–1)(q- encryption: C = 887 mod 187 = 11
1)=16×10=160 decryption: M = 1123 mod 187 = 88
Select e : gcd(e,160)=1;
choose e=7
Difference between Private key and Public key
 Difficulty Level : Basic
 Last Updated : 29 Jan, 2020
Cryptography is the science of secret writing with the intention of keeping the data secret.
Cryptography is classified into symmetric cryptography, asymmetric cryptography and
hashing.
Private Key:
In Private key, the same key (secret key) is used for encryption and decryption. In this
key is symmetric because the only key is copy or share by another party to decrypt the
cipher text. It is faster than the public key cryptography.
Public Key:
In Public key, two keys are used one key is used for encryption and another key is used
for decryption. One key (public key) is used for encrypt the plain text to convert it into
cipher text and another key (private key) is used by receiver to decrypt the cipher text to
read the message.
Now, we see the difference between them:
S.N Private Key Public Key
O
1. Private key is faster than public It is slower than private key.
key.
2. In this, the same key (secret key) In public key cryptography, two keys
and algorithm is used to encrypt are used, one key is used for
and decrypt the message. encryption and while the other is used
for decryption.
3. In private key cryptography, the In public key cryptography, one of the
key is kept as a secret. two keys is kept as a secret.
4. Private key Public key is Asymmetrical because
is Symmetrical because there is there are two types of key: private and
only one key that is called secret public key.
key.
5. In this cryptography, sender and In this cryptography, sender and
receiver need to share the same receiver does not need to share the
key. same key.
6. In this cryptography, the key is In this cryptography, public key can be
private. public and private key is private.

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