Top Banner
1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography
44

1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

Jan 03, 2016

Download

Documents

Hector Kennedy
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: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

1

Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA

Chih-Hung Wang

Sept. 2012

Part I: Introduction to Number TheoryPart II: Advanced Cryptography

Page 2: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

2

RSA Cryptosystem (1) Page 258

Page 3: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

3

RSA Cryptosystem (2)

Page 4: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

4

RSA Cryptosystem 1977 by Ron Rivest, Adi Shamir, and Len

Adleman (MIT) The first “secure” & “practical” public key

cryptosystem A block cipher in which the plaintext and

ciphertext are integers between 0 and n-1 for some n

Page 5: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

5

The RSA Algorithm (1/2)

Page 6: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

6

The RSA Algorithm (2/2)

Page 7: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

7

RSA Example

Receiver Sender

Public Key PKA(e,N)

Acquire(e,n)

C ¡× M e mod nSecret key

M=Cd mod n

Secret key d, p,q

Page 8: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

8

RSA Example

N=119 = p*q =7*17e=5; e*d =1 mod 6*16d=77

Page 9: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

9

Active attacks on cryptosystems (1) Chosen-plaintext attack (CPA)

Chosen-ciphertext attack (CCA)

Page 10: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

10

Active attacks on cryptosystems (2) Adaptive chosen-ciphertext attack (CCA2)

Page 11: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

11

Attack Scenarios

Page 12: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

12

The RSA Problem and Assumption

Page 13: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

13

Insecurity of the Textbook RSA Encryption Theorem 8.1

The RSA cryptosystem is “all-or-nothing” secure against CPA if and only if the RSA assumption holds.

Page 14: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

14

Meet-in-the-middle attack (1)

The multiplicative property of the RSA function

Space cost: 2length/2logN bits Time cost: OB(2length/2 +1(length/2+log3N))

Page 15: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

15

Meet-in-the-middle attack (2)

Page 16: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

16

Inadequacy of the CPA security of the RSA (1)

Blind attack

Page 17: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

17

Inadequacy of the CPA security of the RSA (2)

Page 18: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

18

Common modulus protocol failure (1) outsider attack Description

Page 19: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

19

Common modulus protocol failure (2) outsider attack

Page 20: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

20

Common modulus protocol failure (3) insider attack A square root of 1 mod M

Page 21: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

21

Common modulus protocol failure (4) insider attack Finding a nontrivial square root of 1 mod M

Page 22: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

22

Common modulus protocol failure (5) insider attack Given a public key e1, the holder of of an

encryption/decryption pair e2, d2 can generate the private key of another user.

Page 23: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

23

The low exponent protocol failure (1)

Use a small exponent for RSA public key in order to make the calculations for encryption fast and inexpensive to perform.

Problem description

Page 24: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

24

The low exponent protocol failure (2) salvaging Never send exactly the same message

Page 25: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

25

Other attacks (1) GCD attack

Franklin and Reiter Coopersmith, Franklin and Patarin (Eurocrypt’96)

Page 26: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

26

Other attacks (2) The Wiener’s attack

Wiener pointed out that if the secret key d was chosen too small, then it might be recovered

Page 27: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

27

Constraints of RSA Key Requirement

Key size in the range of 1024 to 2018 bits p and q should differ in length by only a few

digits. Thus, both p and q should be on the order of 1075 to 10100.

Both (p-1) and (q-1) should contain a large prime factor

gcd(p-1,q-1) should be small

Page 28: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

28

Factorization Techniques Fermat Factorization Monte Carlo Factorization The Pollard p-1 method of Factorization [239]

Page 29: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

29

Fermat Factorization (1)

Page 30: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

30

Fermat Factorization (2)

Page 31: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

31

Fermat Factorization (3) Example

Page 32: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

32

Monte Carlo Factorization (1)

Page 33: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

33

Monte Carlo Factorization (2)

Page 34: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

34

Monte Carlo Factorization (3) Example [1]

Page 35: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

35

Monte Carlo Factorization (4) Example [2]

Page 36: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

36

The Pollard p-1 method of Factorization (1)

Page 37: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

37

The Pollard p-1 method of Factorization (2) Example

Page 38: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

38

Optimal Asymmetric Encryption Padding (OAEP) Page 508

RSA-OAEP & Rabin-OAEP The plaintext message encrypted inside the RSA-

OAEP scheme can have a length up to 84% of the length of the modulus.

PKCS#1, IEEE P1363 & SET

Page 39: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

39

Optimal Asymmetric Encryption Padding (OAEP) RSA-OAEP (page 503)

Page 40: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

40

OAEP—Mixing of different algebraic structures

Page 41: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

41

RSA-OAEP Algorithm (1)Page 324

Page 42: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

42

RSA-OAEP Algorithm (2)

Page 43: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

43

RSA-OAEP Algorithm (3)

Page 44: 1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept. 2012 Part I: Introduction to Number Theory Part II: Advanced Cryptography.

44

OAEP Property Plaintext Randomization

A padding scheme like OAEP has a random input value which adds the randomness to the distribution of the padding result.

Data Integrity Protection Provides the decryption end with a mechanism to

check data integrity.