Rsa

27
7/21/2019 Rsa http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 1/27 CRYPTOGRAPHY PUBLIC KEYCRYPTOGRAPHY: RSA

description

Rsa

Transcript of Rsa

Page 1: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 1/27

CRYPTOGRAPHYPUBLIC KEY CRYPTOGRAPHY: RSA

Page 2: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 2/27

PRIVATE-KEY CRYPTOGRAPHY

traditionalprivate/secret/single key cryptography usesone key

shared by both sender and receiver if this key is disclosed communications arecompromised

also issymmetric, parties are equal hence does not protect sender from receiverforging a message & claiming is sent by sender

Page 3: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 3/27

PUBLIC-KEY CRYPTOGRAPHY

probably most significant advance in the 3000

year history of cryptography

usestwo keys – a public & a private key

asymmetric since parties arenot equaluses clever application of number theoretic

concepts to function

complementsrather than replaces private key

crypto

Page 4: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 4/27

WHY PUBLIC-KEY CRYPTOGRAPHY?

developed to address two key issues:key distribution – how to have securecommunications in general without having totrust a KDC with your key

digital signatures – how to verify a messagecomes intact from the claimed sender

public invention due to Whitfield Diffie &Martin Hellman at Stanford Uni in 1976

known earlier in classified community

Page 5: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 5/27

Page 6: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 6/27

PUBLIC-KEY CRYPTOGRAPHY

Page 7: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 7/27

PUBLIC-KEY CRYPTOSYSTEM:

SECRECY

Page 8: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 8/27

PUBLIC-KEY CRYPTOSYSTEM:

 AUTHENTICATION

•   Known as Digital Signature• It is impossible to alter the message without

access to A’s private key, so the message is

authenticated both in terms of source and in

terms of data integrity.

Page 9: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 9/27

PUBLIC-KEY CRYPTOSYSTEM: AUTHENTICATION AND SECRECY

Page 10: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 10/27

RSA

by Rivest, Shamir & Adleman of MIT in 1977

best known & widely used public-key scheme

based on exponentiation in a finite (Galois) field

over integers modulo a primenb. exponentiation takes O((log n)3) operations (easy)

uses large integers (eg. 1024 bits)

security due to cost of factoring large numbersnb. factorization takes O(elog n log log n) operations

(hard)

Page 11: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 11/27

10.2.2 Procedure

Figure 10.6  Encryption, decryption, and key generation in RSA

Page 12: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 12/27

Two Algebraic Structures

10.2.2 Continued 

 Encryption!ecryption Ring"  R # $% n , &, ' (

 )ey*+eneration +roup"  + # $% φ n-  , ' (∗

Page 13: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 13/27

4-1 ALGEBRAIC STRUCTURES

Cryptography requires sets of integers and specificoperations that are defined for those sets. The

combination of the set and the operations that are

applied to the elements of the set is called an

algebraic structure. In this chapter, we will define

three common algebraic structures: groups, rings,

and fields.

Topics discussed in this section:

  4.1.1  Groups

4.1.2  Rings

4.1.3  Fields

Page 14: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 14/27

4.1  Continued 

Figure 4.1 Common algebraic structure

Page 15: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 15/27

4.1.1 Groups

 A group (G) is a set of elements with a binar

operation (•)  that satisfies four properties (or a!ioms).

 A "ommutati#e group satisfies an e!tra propert$

"ommutati#it%

❏ &losure%❏  Asso"iati#it%

❏ &ommutati#it%

❏ '!isten"e of identit%❏ '!isten"e of in#erse%

Page 16: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 16/27

4.1.1  Continued 

Figure 4.2 Group

Page 17: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 17/27

4.1. !ing 

 A ring$ R *+,$ •$ -$ is an algebrai" stru"ture with

two operations.

Figure 4.4 !ing 

Page 18: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 18/27

4.1.   Continued '!ample 4.11

he set / with two operations$ addition and multipli"ation$ is a "ommutati#e ring. 0e

show it b R /$ $ -. Addition satisfies all of the fi#e properties multipli"ation

satisfies onl three properties.

Page 19: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 19/27

RSA ALGORITHM

Page 20: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 20/27

WHY RSA WORKS

because of Euler's Theorem:aø(n)mod n = 1 wheregcd(a,n)=1

in RSA have:n=p.qø(n)=(p-1)(q-1) carefully chosee &d to be inversesmod ø(n) hencee.d=1+k.ø(n) for somek

hence :

Cd = Me.d = M1+k.ø(n) = M1.(Mø(n))k = M1.(1)k = M1 = M mod n 

Page 21: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 21/27

RSA EXAMPLE - KEY SETUP

1. Select primes: p=17 & q =11

2. Calculate n = pq =17 x 11=187

3. Calculate ø(n)=( p–1)(q-1)=16x10=160

4. Selecte: 

gcd(e,160)=1; choosee=75. Determined: de= 1 mod 160 andd < 160  Value isd=! since!x7=161= 10x160+1

6. Publish public key"#=$7,187%

7. Keep secret private key"=$!,187%

Page 22: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 22/27

RSA EXAMPLE - EN/DECRYPTION

Public key PU = {7, 187} and private key PR = {23, 187}.

given messageM = 88 (nb.88<187)

encryption:

C = 887 mod 187 = 11 

decryption:M = 11! mod 187 = 88 

Exploiting the properties of modular arithmetic

Page 23: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 23/27

EXAMPLE

Page 24: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 24/27

RSA ANOTHER EXAMPLE

Page 25: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 25/27

RSA ANOTHER EXAMPLE

Page 26: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 26/27

RSA ANOTHER EXAMPLE

Page 27: Rsa

7/21/2019 Rsa

http://slidepdf.com/reader/full/rsa56d6bf571a28ab301695d70e 27/27

RSA ANOTHER EXAMPLE