+ All Categories
Home > Documents > 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011...

1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011...

Date post: 02-Jan-2016
Category:
Upload: dana-sparks
View: 216 times
Download: 0 times
Share this document with a friend
56
1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced Cryptography
Transcript
Page 1: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

1

Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms

Chih-Hung Wang

Feb. 2011

Part I: Introduction to Number TheoryPart II: Advanced Cryptography

Page 2: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

2

The distribution of primes The natural way of measuring the density of

primes is to count the number of primes up to a bound x, where x is a real number. For a real number x ¸ 0, the function (x) is defined to be the number of primes up to x. Thus, (1) = 0, (2) = 1, (7.5) = 4, and so on.

Page 3: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

3

Some values of (x)

Page 4: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

4

The Sieve of Eratosthenes This is an algorithm for generating all the primes up

to a given bound k.

Page 5: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

5

The prime number theorem

Page 6: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

6

The error term in the prime number theory (1)

Page 7: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

7

The error term in the prime number theory (2)

Page 8: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

8

Sophie Germain primes

Page 9: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

9

Probabilistic primality testing Trial Division

Page 10: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

10

Trial division

Page 11: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

11

The Miller-Rabin test

Page 12: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

12

Error parameter (1)

Page 13: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

13

Error parameter (2)

Page 14: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

14

Carmichael numbers

Page 15: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

15

Good Primality testing (1)

Page 16: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

16

Good Primality testing (2)

Page 17: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

17

Error parameter

Page 18: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

18

Generating random primes using the Miller-Rabin Test

Page 19: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

19

Sieving up to a small bound

Page 20: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

20

Generating a random k-bit prime

Page 21: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

21

Perfect power testing (1)

Page 22: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

22

Perfect power testing (2)

Page 23: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

23

Perfect power testing (3)

Page 24: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

24

Deterministic Primality Testing The basic idea

Page 25: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

25

AKS algorithm

Page 26: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

26

Running time

Page 27: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

27

Notes

Page 28: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

28

Primality testing in Java Public BigInteger ( int bitLength, int certainty, Random rnd )

Public boolean isProbablePrime (int certainty)

Page 29: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

29

Cyclic groups Order of group element

Page 30: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

30

Order of group element

Page 31: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

31

(Example)Powers of Integers, Modulo 19

Page 32: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

32

Cyclic group & Group generator

Page 33: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

33

Example of Cyclic Group

Page 34: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

34

Theorem of Cyclic Group

Page 35: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

35

Prime Order group

Page 36: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

36

The Multiplicative Group Zn*

Page 37: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

37

The Multiplicative Group Zn*

Page 38: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

38

Example of The Multiplicative Group

Page 39: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

39

Finding Primitive Root

Page 166

Page 40: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

40

Application 1: Diffie-Hellman Key Exchange

Diffie and Hellman 1976 A number of commercial products employ this

key exchange technique This algorithm enables two users to exchange

key securely

Page 41: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

41

The Diffie-Hellman Key Exchange Protocol

Page 42: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

42

Example of D-H Key Exchange (1)

q=97 =5 XA = 36 XB=58

YA=536=50 mod 97YB=558=44 mod 97

K=(YB)XA mod 97 = 4436 = 75 nod 97K=(YA)XB mod 97 = 5058 = 75 nod 97

Page 43: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

43

Example of D-H Key Exchange (2)

Page 44: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

44

Hybrid Encryption Diffie-Hellman based hybrid encryption

systemA BYA

YBK=(YB)xA

=(YA)xB

Mod q

SK=h(K)128 – 256 bits

ESK(M)

SK can be a key of the AES symmetric cryptosystem

Page 45: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

45

The Man-in-the-Middle Attack (1)

Page 46: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

46

The Man-in-the-Middle Attack (2)

Page 47: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

47

The DH Problem and DL Problem (1)

Page 48: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

48

The DH Problem and DL Problem (2)

Example: a = loggh = log3 5 mod 19 = 4

Page 49: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

49

Importance of Arbitrary Instances for Intractability Assumptions

CRT

riai=ri

a (mod qi) = h(p-1)/qi mod pa=kiqi+ai

ri= g(p-1)/qi mod p

Page 50: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

50

Chinese Remainder Theorem (1)

Page 51: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

51

Chinese Remainder Theorem (2)

Page 52: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

52

Chinese Remainder Theorem (3)

Page 53: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

53

Example of CRT

9mod8

7mod0

5mod0

4mod3

x

x

x

x

2

3

3

3

1409/1260/

1807/1260/

2525/1260/

3154/1260/

4

3

2

1

4

3

2

1

y

y

y

y

mM

mM

mM

mM

35

1260mod5075

81402018030252333153

)/()/()/()/( 444333222111

cmMycmMycmMycmMyx

Page 54: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

54

ElGamal (1)

Page 55: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

55

ElGamal (2)

Page 56: 1 Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced.

56

Meet-in-the-middle attack & Active attack of ElGamal See Page 277 Example 8.8 Malice select

Malice sends (c1, c2’=rc2) to Alice Alice returns rm to Malice

*pFUr


Recommended