0% found this document useful (0 votes)
9 views27 pages

Public Key Cryptography & RSA Algorithm: Presented by

Uploaded by

srishtigaikwad19
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)
9 views27 pages

Public Key Cryptography & RSA Algorithm: Presented by

Uploaded by

srishtigaikwad19
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/ 27

Public Key Cryptography

& RSA Algorithm


Presented by-
Pallabi Patowary(Roll no-CSI15018)
Indrajit Kalita(Roll no-CSI15004)
CRYPTOGRAPHY
– study of techniques for secure communication in the presence of third
parties
– The science of using mathematics to encrypt and decrypt data.
– Cryptography enables us to store sensitive information or transmit it across
insecure networks so that it cannot be read by anyone except the intended
recipient

 Plaintext: The original intelligible message


 Cipher text: The transformed message
– Key: A key is a complex value that is determined using an algorithm .
 Encryption: The process of converting plaintext to cipher text
 Decryption: The process of converting cipher text back into plaintext.

Types of Cryptography-
1. Private Key Cryptography
2. Public Key Cryptography
PUBLIC-KEY CRYPTOGRAPHY
• Also known as Asymmetric-key cryptography

• Encryption and decryption are


carried out using two different
keys

• Symmetric key cryptography


uses same secret key for
encryption and decryption

• In 1976 Diffie and Hellman


Introduced public-key cryptography

• Based on mathematical
calculation
Public-Key Characteristics

– computationally infeasible to find private key


knowing only algorithm & public key

– computationally easy to en/decrypt messages


when the relevant (private/public) key is known

– either of the two related keys can be used for


encryption and other is used for decryption
Pictorial scenario of PKC
CONFIDENTIALITY

• protecting the information from disclosure to


unauthorized parties.

• ensures that only the right people (people


who knows the key) can read the information.
How PKC works when Confidentiality
is needed
1. Each system generates a pair of keys.

2. Each system publishes its public key keeping its


companion key private.

3. If A wishes to send a message to B then it


encrypts the message using B’s public key.

4. When B receives the message, it decrypts the


message using its private key. No one else can
decrypt the message because only B knows its
private key.
A’s public and private keys – PUA and PRA.
B’s public and private keys -- PUB and PRB.
C = E(PUB ; M)
M= D(PRB ; C )
AUTHENTICATION

• The sender and receiver can confirm each


other’s identity and origin/destination of the
information
A’s public and private keys – PUA and PRA.
B’s public and private keys -- PUB and PRB.
C = E(PRA ; M)
M= D(PUA ; C )
A’s public and private keys – PUA and PRA.
B’s public and private keys - PUB and PRB.
C = E[PUB ; E(PRA ; M)]
M = D[PUA ; D(PRB ; C)]
DIFFERENCE BETWEEN SYMMETRIC AND ASYMMETRIC KEY
CRYPTOGRAPHY
Asymmetric key
Characteristic Symmetric key cryptography
cryptography

One key is used for encryption


Key used for
Same key is used and another ;different key is
encryption/decryption
used for decryption

Speed of encryption/decryption Very fast Slower

Usually same as or less than the More than the original plain text
Size of resulting encrypted text
original plain text size. size

Only, either one of the keys is


Both parties should know the key
Known keys known by the two parties in
in symmetric key encryption
public key encryption.

Confidentiality, digital signature


Usage Confidentiality
etc.
Public-Key Applications

– encryption/decryption(provide Confidentiality)
– digital signatures (provide authentication or proof
of origin)
RSA Algorithm - Introduction

 by Rivest, Shamir & Adleman of MIT in 1977


 best known & widely used public-key scheme
• RSA is the first practical public-key cryptosystems and is
widely used for secure data transmission

• Every number has a prime factorization and it is hard to


find if the number is very large. The time complexity is
also very high. But on the other hand the multiplication
is easy and time complexity is also not very high.
– For example the multiplication of 15 and 30 is 450 but the prime
factorization of 450 is not easy and also it takes more time as
compare to multiplication

• The RSA algorithm involves three steps: key generation,


encryption and decryption.
Mathematics behind RSA
• Theorem 1 : Let a, p be two integers that are co-prime to each
other. Then, there is only a unique integer x ∈ Zp satisfying
ax mod p = b
Regardless of the value of b.
• Corollary(1) : If a and p are co-prime to each other, then 0, a, 2a, ...,
(p - 1)a are all distinct after modulo p.

• Theorem 2(Fermat’s Little Theorem) : If p is a prime number, for


any non-zero a ∈ Zp, it holds that
a ( p −1) mod p = 1

• Theorem 3(Chinese Remainder Theorem) : Let p and q be two co-


prime integers. Then
If x mod p = 1 and x mod q = a then
x mod pq = a
Mathematics behind RSA
• Eulers Totient Function(ø) : When doing arithmetic
modulo n then

 The complete set of residues is: 0...(n-1)

 The reduced set of residues is those numbers (residues)


which are relatively prime to n

 Number of elements in reduced set of residues is called


the Euler Totient Function ø(n)

 If the the number ‘n’ is a prime number then the value of


ø(n)=n-1
RSA ALGORITHM
• Choose two large prime numbers p and q randomly

• Let n = pq.

• Let ɸ (n) = (p - 1)(q - 1).

• Choose a large number e ϵ [2,ɸ-1] that is co-prime to ɸ(n) .

• Compute d [2,ɸ-1] such that


ed mod ɸ (n) = 1 or ed = k× ɸ (n)+1
There is a unique such d. Furthermore, d must be co-prime to ɸ (n)

• Announce to the whole word the pair (e; n), which is his public key.

• Keep the pair (d; n) secret to himself, which is his private key

• Sender will now use the public key to encrypt the message M as follows
C = Me mod n. Here, C is the encrypted message.

• Receiver will use its own private key to decrypt the message by using the equation
M=Cd mod n
PROOF OF RSA
• The private key d is unique and d must be co-prime to ɸ (n)
Proof : From the above corollary (1) , we found that e and ɸ(n) are co-prime.
Therefore, there exists only one unique integer d, such that
ed mod ɸ (n) = 1.
Hence d is unique
Again, Let d is not co-prime so t is the greatest common divisor of d and ɸ(n)
Suppose
d = c1t and ɸ (n) = c2t.
From ed mod ɸ (n) = 1. We know ed = c3 ɸ (n) + 1 for some integer c3.
Hence:
ec1t = c3c2t + 1
t(ec1- c3c2)=1
Therefore t=1.
Hence it is proved that the private key d is unique and co-prime with ɸ(n).
PROOF OF RSA
• How to Prove M ed mod n = M mod n

Proof : Since n=pq, Therefore we need to prove the following two condition
M ed mod p = M mod p and
M ed mod q = M mod q
Now,
M ed mod p = M k1×φ ( n ) +1 mod p (Since ed = k1×φ ( n) +1, k1 = some constant)
= M k 1×φ ( n ) M mod p
= M k1× ( p −1)( q −1) M mod p (Since φ ( n) = ( p − 1)( q − 1))
= M k 2×( p −1) M mod p (Let k 2 = k1× ( q −1))
= ( M ( p −1) mod p) k 2 M mod p

Now let us assume that M and p are co-prime then according to Fermat’s theorem
M ( p −1) mod p = 1
Then M ed mod p = 1k 2 M mod p = M mod p
PROOF OF RSA
Again if M is a multiple of prime p then
M mod p = 0

Therefore,
M ed mod p = ( M ( p −1) mod p) k 2 × 0 = M mod p

Hence it is proved that,


M ed mod p = M mod p

Similarly we can prove that M ed mod q = M mod q

Now we can conclude that M ed mod n = M mod n


PROOF OF RSA

Proved that M = C d mod n


Proof:
We know that M < n therefore,
M = M mod n

= M ed mod n (Since M mod n = M ed mod n)


= ( M e mod n) d mod n
= C d mod n (Since C = M e modn)

Hence proved
RSA Example
• Select primes: p=17 & q=11
• Compute n = pq =17×11=187
• Compute ø(n)=(p–1)(q-1)=16×10=160
• Select e : gcd(e,160)=1; choose e=7
• Determine d: de=1 mod 160 and d < 160 Value is d=23 since
23×7=161= 10×160+1
• Publish public key KU={7,187}
• Keep secret private key KR={23,187}
• sample RSA encryption/decryption is:
• given message M = 88 (note that 88<187)
• encryption:
C = 887 mod 187 = 11
• decryption:
M = 1123 mod 187 = 88
PRACTICAL APPLICATIONS OF THE RSA ALGORITHM
• To this day the RSA together with the AES algorithm is
the mostly used algorithm in commercial systems.
It is used:
-to protect web traffic, in the SSL protocol
(Security Socket Layer),
-to guarantee email privacy and authenticity in
PGP (Pretty Good Privacy)
-to guarantee remote connection in SSH (Secure
Shell).
-Furthermore it plays an important role in the
modern payment systems through SET protocol (Secure
Electronic Transaction).
• RSA has been used in most digital data, information and
telephone security applications.
ADVANTAGES OF RSA

• Very fast, very simple encryption and verification.


• Easier to implement than Elliptical curve
cryptography(ECC).
• Easier to understand.
• Widely deployed, better industry support.

DISADVANTAGES OF RSA

• Very slow key generation.


• Slow decryption, which is slightly tricky to implement
securely.
• Two-part key is vulnerable to GCD attack if poorly
implemented.
CONCLUSION
• RSA is the most popular public-key cryptosystem available today. It can be
used for both encryption and authentication. The security of RSA is
related to the assumption that factoring is difficult. An easy factoring
method or some other feasible attack would break RSA.

• RSA is built into current operating systems by Microsoft, Apple, Sun, and
Novell. In hardware, RSA can be found in secure telephones, on Ethernet
network cards, and on smart cards. The estimated installed base of RSA
encryption engines is around 20 million, making it by far the most widely
used public-key cryptosystem in the world.

• Finally, DES is much faster than RSA. In software, DES is generally at least
100 times as fast as RSA. In hardware, DES is between 1,000 and 10,000
times as fast, depending on the implementation. Implementations of RSA
will probably narrow the gap a bit in coming years, as there are growing
commercial markets, but DES will get faster as well.

You might also like