Top Banner
Presented by- Pallabi Patowary(Roll no-CSI15018) Indrajit Kalita(Roll no-CSI15004) Public Key Cryptography & RSA Algorithm
27

Public Key Cryptography and RSA algorithm

Feb 09, 2017

Download

Engineering

Indra97065
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Public Key Cryptography and RSA algorithm

Presented by- Pallabi Patowary(Roll no-CSI15018)

Indrajit Kalita(Roll no-CSI15004)

Public Key Cryptography & RSA Algorithm

Page 2: Public Key Cryptography and RSA algorithm

CRYPTOGRAPHYCRYPTOGRAPHY– 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 Cryptography2. Public Key Cryptography

Page 3: Public Key Cryptography and RSA algorithm

PUBLIC-KEY CRYPTOGRAPHYPUBLIC-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 HellmanIntroduced public-key cryptography

• Based on mathematical calculation

Page 4: Public Key Cryptography and RSA algorithm

Public-Key CharacteristicsPublic-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

Page 5: Public Key Cryptography and RSA algorithm

Pictorial scenario of PKCPictorial scenario of PKC

Page 6: Public Key Cryptography and RSA algorithm

CONFIDENTIALITY

• protecting the information from disclosure to unauthorized parties.

• ensures that only the right people (people who knows the key) can read the information.

Page 7: Public Key Cryptography and RSA algorithm

How PKC works when Confidentiality How PKC works when Confidentiality is neededis 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.

Page 8: Public Key Cryptography and RSA algorithm

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 )

Page 9: Public Key Cryptography and RSA algorithm

AUTHENTICATION

• The sender and receiver can confirm each other’s identity and origin/destination of the information

Page 10: Public Key Cryptography and RSA algorithm

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 )

Page 11: Public Key Cryptography and RSA algorithm

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)]

Page 12: Public Key Cryptography and RSA algorithm

DIFFERENCE BETWEEN SYMMETRIC AND ASYMMETRIC KEY DIFFERENCE BETWEEN SYMMETRIC AND ASYMMETRIC KEY CRYPTOGRAPHYCRYPTOGRAPHY

Characteristic Symmetric key cryptographyAsymmetric key

cryptography

Key used for encryption/decryption

Same key is usedOne key is used for encryption and another ;different key is used for decryption

Speed of encryption/decryption Very fast Slower

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

More than the original plain text size

Known keysBoth parties should know the key in symmetric key encryption

Only, either one of the keys is known by the two parties in public key encryption.

Usage ConfidentialityConfidentiality, digital signature etc.

Page 13: Public Key Cryptography and RSA algorithm

Public-Key ApplicationsPublic-Key Applications

– encryption/decryption(provide Confidentiality)– digital signatures (provide authentication or proof

of origin)

Page 14: Public Key Cryptography and RSA algorithm

RSA Algorithm - Introduction

by Rivest, Shamir & Adleman of MIT in 1977 best known & widely used public-key scheme

Page 15: Public Key Cryptography and RSA algorithm

• 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.

Page 16: Public Key Cryptography and RSA algorithm

Mathematics behind RSA 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∈

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 ∈

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

modax p b

( 1) mod 1pa p

If mod 1 and mod then modx p x q a

x pq a

Page 17: Public Key Cryptography and RSA algorithm

Mathematics behind RSA 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

Page 18: Public Key Cryptography and RSA algorithm

RSA ALGORITHMRSA 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 thated 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 followsC = 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

Page 19: Public Key Cryptography and RSA algorithm

PROOF OF RSAPROOF 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.

Hence:ec1t = c3c2t + 1

t(ec1- c3c2)=1

From ed mod ɸ(n) = 1. We know ed = c3 ɸ(n) + 1 for some integer c3.

Therefore t=1.Hence it is proved that the private key d is unique and co-prime with ɸ(n).

Page 20: Public Key Cryptography and RSA algorithm

PROOF OF RSAPROOF OF RSA

• How to Prove

Proof : Since n=pq, Therefore we need to prove the following two condition

mod modedM n M n

mod mod and

mod mod

ed

ed

M p M p

M q M q

1 ( ) 1

Now,

mod mod (Since 1 ( ) 1, 1 some constant)ed k nM p M p ed k n k 1 ( ) modk nM M p

1 ( 1)( 1) mod (Since ( ) ( 1)( 1))k p qM M p n p q 2 ( 1) mod (Let 2 1 ( 1))k pM M p k k q

( 1) 2( mod ) modp kM p M p

Now let us assume that M and p are co-prime then according to Fermat’s theorem ( 1) mod 1pM p

Then 2mod 1 mod moded kM p M p M p

Page 21: Public Key Cryptography and RSA algorithm

PROOFPROOF OF RSA OF RSA

Again if M is a multiple of prime p thenmod 0M p

( 1) 2

Therefore,

mod ( mod ) 0 moded p kM p M p M p

Hence it is proved that,

mod modedM p M p

Similarly we can prove that mod modedM q M q

Now we can conclude that mod modedM n M n

Page 22: Public Key Cryptography and RSA algorithm

PROOFPROOF OF RSA OF RSA

Proof:Proved that moddM C n

We know that therefore,M n

modM M n

mod (Since mod mod )ed edM n M n M n

( mod ) mode dM n n

mod (Since modn)d eC n C M

Hence proved

Page 23: Public Key Cryptography and RSA algorithm

RSA ExampleRSA 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

Page 24: Public Key Cryptography and RSA algorithm

PRACTICAL APPLICATIONS OF THE RSA ALGORITHMPRACTICAL 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.

Page 25: Public Key Cryptography and RSA algorithm

ADVANTAGES OF RSAADVANTAGES 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 RSADISADVANTAGES 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.

Page 26: Public Key Cryptography and RSA algorithm

CONCLUSION 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.

Page 27: Public Key Cryptography and RSA algorithm