Transcript
Page 1: CIS 5371 Cryptography

Introduction to Number Theory

1

Page 2: CIS 5371 Cryptography

Preview• Number Theory Essentials• Congruence classes, Modular arithmetic• Prime numbers challenges• Fermat’s Little theorem• The Totient function• Euler's Theorem• Quadratic residuocity• Foundation of RSA

2

Page 3: CIS 5371 Cryptography

Number Theory Essentials

3

• Fundamental theorem of arithmetic: Every positive integer has a unique factorization that is a product of prime powers.

Page 4: CIS 5371 Cryptography

4

8 7

5

6

0

4

3 2

19

10

11

1213

14 ……..

.. .

…….. ……..

1 6 11 (mod 5)

……..

Page 5: CIS 5371 Cryptography

Modular arithmetic

5

Page 6: CIS 5371 Cryptography

The integers modulo n a,b,n I, a b mod n iff n | (a-b) *

28 6 mod 11: (28-6)/11 = 2 I

219 49 mod 17: (219-49)/17 = 12 I

Symmetry: If a b mod n then b a mod n

Transitivity: If a b mod n and b c mod n then a c mod n

* n divides (a-b)

6

Page 7: CIS 5371 Cryptography

Modular arithmetic:notation

Form: a b mod n (congruence relation) a = b mod n (modulus operator)

indicates that the integers a and b fall into the same congruence class modulo n

= means that integer a is the reminder of the division of integer b by integer n.

Example: 14 2 mod 3 and 2 = 14 mod 3

7

Page 8: CIS 5371 Cryptography

Modular arithmetic & cryptography

Modular computations can be utilized to scramble data.

Cryptographic systems utilize modular (or elliptic curve (EC)) arithmetic.

Several cryptographic systems use prime modulus arithmetic.

8

Page 9: CIS 5371 Cryptography

Prime Number Challenges

1. Finding large prime numbers.

2. Recognizing large numbers as prime.

9

Page 10: CIS 5371 Cryptography

How Do We Find Large Prime Numbers?

Look them up ?

Compute them ?

Do they REALLY have to be prime?

10

Page 11: CIS 5371 Cryptography

11

Finding large primes

m

Page 12: CIS 5371 Cryptography

Fermat's Little Theorem

12

0

Page 13: CIS 5371 Cryptography

Let p = 5, pick values for a: a =2: 24 = 16 mod 5 = 1 a =3: 34 = 81 mod 5 = 1 a =4: 44 = 256 mod 5 = 1

13

Page 14: CIS 5371 Cryptography

Let p = 11, pick values a :

• a=3: 310 = 59049 mod 11 = 1

• a=5: 510 = 9765625 mod 11 = 1

• a=7: 710 = 282475249 mod 11 = 1

• a=8: 810 = 1073741824 mod 11 = 1

14

Page 15: CIS 5371 Cryptography

15

Page 16: CIS 5371 Cryptography

16

Page 17: CIS 5371 Cryptography

17

Page 18: CIS 5371 Cryptography

Exponentiations

18

3811502 mod 751 == 3812 * 381750 * 381750 mod 751= 3812 mod 751 * 1 mod 751= 145161 mod 751= 218

Page 19: CIS 5371 Cryptography

Exponentiations

19

a p-1 1 mod p

• 713 mod 11 x

• 710 mod 11* 73 mod 11 x

• 1 mod 11 * 73 mod 11 x

• 73 mod 11 x

• 343 mod 11 2

Page 20: CIS 5371 Cryptography

The totient function (n)

20

Page 21: CIS 5371 Cryptography

Deriving (n) Primes: (p) = p-1

Product of 2 primes: (pq) = (p-1)(q-1)

General case (i.e. for all integers x) = ?

21

Page 22: CIS 5371 Cryptography

Deriving (n)Product of 2 relatively prime numbers

if gcd (m,n) = 1, then: (mn) = (m) * (n) 15 = 3*5 and Example: (15)=2*4=8

22

Page 23: CIS 5371 Cryptography

23

Page 24: CIS 5371 Cryptography

Quadratic Residuosity• An integer a is a quadratic residue with

respect to n if:• a is relatively prime to n and • there exists an integer b such that: a = b2 mod n

• Quadratic Residues for n = 7: QR(7)={1, 2, 4}• a = 1: b = 1 (12 = 1 mod 7), 6, 8, 13, 15, 16, 20, 22, …• a = 2: b = 3 (32 = 2 mod 7), 4, 10, 11, 17, 18, 24, 25, …• a = 4: b = 5, 9, 12, 19, 23, 26, …

• Notice that 2, 3, 5, and 6 are not QR mod 7.• QR(n) forms a group with respect to

multiplication.24

Page 25: CIS 5371 Cryptography

The Foundation of RSA x y mod n = x (y mod (n)) mod n The proof of this follows from Euler's

Theorem If y mod (n) = 1,

then for any x : xy mod n = x mod n If we can choose e and d such that

ed = 1 mod (n) then we can encrypt by raising x to the e th

power and decrypt by raising to the d th power.

25


Top Related