Public key algorithm

22
Public Key Algorithm By Pankaj Jatav (110101168) Rahul Kumar (120101813) Rahul Aggarwal (110101189)

description

Public key algorithm

Transcript of Public key algorithm

Page 1: Public key algorithm

Public Key Algorithm

ByPankaj Jatav (110101168)

Rahul Kumar (120101813)Rahul Aggarwal

(110101189)Prateek Pandey

(110101180)

Page 2: Public key algorithm

Cryptography

The art of the Secret (crypto-) writing (-graphy). It enables you to store information or transmit it across insecure networks, so that it cannot be read by anyone except the intended recipient.

Page 3: Public key algorithm
Page 4: Public key algorithm

TERMINOLOGY

Plain Text:- The message or data that is to be transmitted over the network.

Cipher :- A mapping algorithm which is used to encrypt or decrypt the message.

Key : A key is a number (or a set of numbers) that the cipher implements to encrypt or decrypt a message.

To encrypt a message we need to convert the plaintext to ciphertext using an encryption algorithm and encryption key whereas to decrypt the message we require a decryption algorithm and a decryption key to reveal the plaintext

Page 5: Public key algorithm

5Symmetric Key Cryptography

Symmetric-key cryptography refers to encryption methods in which both the sender and receiver share the same key (or, less commonly, in which their keys are different, but related in an easily computable way). This was the only kind of encryption publicly known until June 1976.

Page 6: Public key algorithm

Symmetric Key Cryptography System

Page 7: Public key algorithm

7Asymmetric Key Cryptography

Asymmetric cryptography or public-key cryptography is cryptography in which a pair of keys is used to encrypt and decrypt a message so that it arrives securely. Initially, a network user receives a public and private key pair from a certificate authority. Any other user who wants to send an encrypted message can get the intended recipient's public key from a public directory. They use this key to encrypt the message, and they send it to the recipient. When the recipient gets the message, they decrypt it with their private key, which no one else should have access to.

Page 8: Public key algorithm

ASYMMETRIC KEY Cryptography System

Page 9: Public key algorithm

Why use Public Key Algorithms??

Page 10: Public key algorithm

ASYMMETRIC KEY Cryptography System

Page 11: Public key algorithm

Proposed by Diffie and Hellman in 1976.

The encryption algorithm must meet 3 requirements:

1. D(E(P))=P

2. It is Exceedingly difficult to deduce D from E.

3. E cannot be broken by a chosen plaintext attack.

Public Key Algorithms

Page 12: Public key algorithm
Page 13: Public key algorithm

13Public key blueprint

The keys used to encrypt and decrypt are different. Anyone who wants to be a receiver needs to “publish”

an encryption key, which is known as the public key. Anyone who wants to be a receiver needs a unique

decryption key, which is known as the private key. It should not be possible to deduce the plaintext from

knowledge of the ciphertext and the public key. Some guarantee needs to be offered of the

authenticity of a public key.

Page 14: Public key algorithm

Public Key Algorithms

Algorithms Satisfying all three requirements are:

RSA ElGamal

Page 15: Public key algorithm

RSAGiven by Rivest, Shamir & Adleman of MIT in 1977

Best known & widely used public-key scheme

Based on exponentiation in a finite field over integers modulo a prime

Uses large integers (eg. 1024 bits)

Security due to cost of factoring large numbers

Page 16: Public key algorithm

RSA

Choose two large prime numbers p, q. (e.g., 1024 bits each)

Compute n = p*q and z = (p-1)(q-1).

Choose d (with d<n) that has no common factors with z. (e, z are “relatively prime”).

Choose e such that ed-1 is exactly divisible by z. (in other words: ed mod z = 1 ).

Page 17: Public key algorithm

RSA: Encryption, decryption

Given (n,e) and (n,d) as computed above

Dividing Plain Text into Blocks: 0<=P<n

To encrypt message P (<n), compute

To decrypt received bit pattern, C, compute

Public key is (n,e).

Private key is (n,d).

C = M (mod n)

e

M = C (mod n)

d

Page 18: Public key algorithm

RSA example:Let us choose p=3 and q=11. Then n=33 and z=20.d=7 (so d, z relatively prime).e=3 (so ed-1 exactly divisible by z).

M Me C = M mod ne

19 6859 28

C M = C mod nd

28 13492928512 19C

d

Encrypt:

Decrypt:

Encrypting messages:

Page 19: Public key algorithm

RSA Issues

RSA is computationally intense. Commonly used key lengths are 1024

bits The plain text should be smaller than

the key length The encrypted text is of the same size

as the key length Generally used to encrypt secret keys. Basis: Factoring a big number is hard

Page 20: Public key algorithm

Summary Public key systems replace the problem of distributing

symmetric keys with one of authenticating public keys Public key encryption algorithms need to be trapdoor one-

way functions RSA is a public key encryption algorithm whose security is

believed to be based on the problem of factoring large numbers

ElGamal is a public key encryption algorithm whose security is believed to be based on the discrete logarithm problem

RSA is generally favoured over ElGamal for practical rather than security reasons

RSA and ElGamal are less efficient and fast to operate than most symmetric encryption algorithms because they involve modular exponentiation

DH key exchange is an important protocol on which many real key exchange protocols are based

Page 21: Public key algorithm

Thank You

Page 22: Public key algorithm

Attacks on RSA

Smooth Number Attack: If you sign m1 and m2

S1 = md1 mod n

S2 = m2d mod n

Attacker can sign m1m2, m1/m2, m12, m1jm2k

Easy to do if mi’s are small (smooth) numbers.

Cube Root Problem of RSA If public exponent e=3:

hde mod n = h

hd mod n = h1/3

Simply compute h1/3 mod n