1 / 50

Page 1

Page 1. Part IV of Course. Objective: Application of Number Theory in Computer security. Number theory has a long history E.g.: Chinese Remainder Theorem: 2300 years old. Regarded as useless until recently. L13: Intro to Crypto and Modulus. Objective:

jchen
Download Presentation

Page 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Page 1 Part IV of Course • Objective: Application of Number Theory in Computer security. • Number theory has a long history • E.g.: Chinese Remainder Theorem: 2300 years old • Regarded as useless until recently

  2. L13: Intro to Crypto and Modulus • Objective: • Basic Number Theory concepts for Part II • Introduction to Cryptography • Reading • Textbook, pp. 89-102

  3. Outline • Outline • Modular Arithmetic: mod n • Operations on the set Zn • Introduction Cryptography • Private-Key Cryptography • Caesar cipher: Using addition mod n • Crypto using multiplication mod n • Public-Key Cryptography

  4. Modular Arithmetic Page 6 6 5 4 5 2 5 2 5 2 4 1 2 5 0 25 mod 5 = 0 25 mod 4 = 1 Dividend = Quotient x Divisor + Remainder

  5. Euclid’s Division Theorem • If m = n q’ + r’, 0<= r’ <n • Then q’=q, r’=r • Examples • m=25, n=4 • 25 = 4 x 6 +1 • q=6, r=1 • m=-25, n=4 • -25 = 4 x (-7) +3 • q=-7, r=3 • Will be proved later

  6. Modular Arithmetic • Applies also to the case when m is negative. * 25 mod 4 = 1 because 25 = 4 * 6 + 1 , and 25 = 4 * q + r cannot be satisfied for 0 ≤ r < 1 , i.e. r = 0

  7. Modular Arithmetic • Applies also to the case when m is negative. * - 25 mod 4 = 3 because - 25 = 4 * (- 7) + 3 , and - 25 = 4 * q + r cannot be satisfied for 0 ≤ r < 3 , i.e. r = 0,1,2

  8. Modular Arithmetic/Simple Properties • Note • [-25 mod 4] = 4 - [25 mod 4] • In general 25 Mod 4 = 1 - 25 mod 4 = 3 Example: 5 mod 4 = 1, (-5) mod 4 = 3 6 mod 4 = 2, (-6) mod 4 = 2

  9. Modular Arithmetic/Properties Page 11 21 mod 9 = 38 mod 9 = 3 2 (21 + 38 ) mod 9 = 59 mod 9 = 5 So ( 21 + 38 ) mod 9 = ( 21 mod 9 ) + ( 38 mod 9 ) ( a + b) mod n = ( a mod n ) +( b mod n ) True in General ? No! Counter Example ≠ ( 2 mod 9) + ( 8 mod 9 ) ( 2 + 8 ) mod 9 2 + 8 1 10

  10. Modular Arithmetic/Properties Examples Page 12 25 mod 4 = 1 1 ( 25 + 2 * 4 ) mod 4 = 33 mod 4 = ( 25 – 3 * 4 ) mod 4 = 13 mod 4 = 1

  11. Intuition • Adding multiples of n to i changes the quotient, but not the remainder. +1 +4 +4

  12. Page 14 Proof of Lemm 2.2 * From (*) we get i + kn = n· (q + k) + r (***) 0 ≤ r <n * By Euclid’s Division theorem, Exist unique q ,r (0 ≤ r < n ) s.t i = n*q + r ( * ) * By definition of mod, i mod n = r * Because of ( ** ),( *** ) r’ = r ( Division Theorem ) * Similarly ,exists unique q’, r’ ( 0 ≤ r’ < n ) s.t. i + kn = n · q’ + r’ ( ** ) * That is i mod n = ( i + kn ) mod n * By definition of mod (i + kn ) mod n = r’ Proved

  13. Lemma 2.3 has a second part

  14. Modular Arithmetic/Properties Page 11 • An additional property • (i mod mn) mod n = i mod n • Proof: • i = qmn + s, 0<=s<mn • s =pn + r, 0<=r <n. • Then: (i mod mn) mod n =r • On the other hand • i = (qm+p)n + r, 0<=r<n • So, i mod n = r • The equation is proved.

  15. L09: Intro to Crypto and Modulus • Modular Arithmetic: mod n • Operations on the set • Introduction Cryptography • Private-Key Cryptography • Caesar cipher: Using addition mod n • Cryto using multiplication mod n • Public-Key Cryptography

  16. Modulo Arithmetic on the Set • Operations on

  17. Page 19 n = 12 Examples of “+ n ”, “ ·n ” 3 +n5 = ( 3 + 5) mod n = 8 mod 12 = 8 7 +n8 = ( 7 + 8 ) mod 12 = 3 2 ·n 4 = 2 · 4 mod n = 8 mod 12 = 8 3 ·n 4 = 3 · 4 mod n = 12 mod 12 = 0 3 ·n 5 = 3

  18. Laws of Arithmetic over Real Numbers

  19. Properties of Operations on Page 21 * ·n commutative a ·n b = a · b mod n = b · a mod n = b ·n a * +n commutative a +n b = ( a + b ) mod n = ( b + a ) mod n = b +n a

  20. Properties of Operations on • Does each • Has additive inverse? • Yes. -x mod n • Has multiplicative inverse? • Major question to be discussed later.

  21. L09: Intro to Crypto and Modulus • Modular Arithmetic: mod n • Operations on the set • Introduction Cryptography • Private-Key Cryptography • Caesar cipher: Using addition mod n • Cryto using multiplication mod n • Public-Key Cryptography

  22. L09: Intro to Crypto and Modulus • Modular Arithmetic: mod n • Modulo arithmetic on the set • Introduction Cryptography • Private-Key Cryptography • Caesar cipher: Using addition mod n • Crypto using multiplication mod n • Public-Key Cryptography

  23. Private-Key Cryptography

  24. Caeser Cipher and Mod 26

  25. Caeser Cipher and Mod 26 • Encrypting • Decrypting: • E.G. s=2 • Plaintext message: SEA 18 4 0 • Cipher text: • Decrypted message:

  26. Caeser Cipher and Mod 26 Page 31 * Plaintext: SEA18 4 0 * Encrypt: ( n + 13 ) mod 26 5 17 13 * Decrypt: ( n’ – 13 ) mod 26 ( 5 – 13 ) mod 26 = -8 mod 26 = ( -8 = 26 · ( -1) + 18 ) 18 ( 17 – 13 ) mod 26 = 4 Get back 18 4 0 S E A

  27. Caeser Cipher

  28. Encrypting/Decrypting as Functions

  29. L09: Intro to Crypto and Modulus • Modular Arithmetic: mod n • Operations on the set • Introduction Cryptography • Private-Key Cryptography • Caesar cipher: Using addition mod n • Crypto using multiplication mod n • Public-Key Cryptography

  30. Cryptography with Multiplication mod n • Also possible to implement crypto system using multiplication mod n • Need to deal with an important new issue. • Plaintext: 5 7 8 • Ciphertext: 1 11 4

  31. Cryptography with Multiplicationmod n Page 36 Encrypt: f (x) = a ·n x Decrypt ? n = 12 , a = 6 X = 3 →6*3 mod 12 = 6 f g →(6÷6 )mod 12 = 1 X’ = 6 Naive idea: x ·n a =( x · a) mod n Define: x ÷n a =( x ÷ a) mod n Don’t get back 3 ! ÷n not well defined 1÷n 6 = (1 ÷ 6) mod n Decrypt: g (x’) = x’ ÷n a = 0.166 mod n Not integer

  32. Cryptography with Multiplicationmod n Page 37 Another idea: If exists b∈zn, s.t. b·n a = 1 Can set : g (x’) = b ·n x’ f x → a ·n x Encrypt: g → Decrypt: x’ = a ·n x b ·n ( a·n x ) = ( b ·n a ) ·n x Works ! = x = 1 ·n x b: inverse of a in zn denoted by a a exist ? -1 -1 -1 f exist ? g: inverse of f denoted by f -1

  33. Multiplicative Inverse Exists?

  34. Multiplicative Inverse Exists?

  35. Multiplicative Inverse Exists?

  36. Multiplicative Inverse Exists?

  37. L09: Intro to Crypto and Modulus • Modular Arithmetic: mod n • Operations on the set • Introduction Cryptography • Private-Key Cryptography • Caesar cipher: Using addition mod n • Crypto using multiplication mod n • Public-Key Cryptography

  38. Drawback of Private-Key Cryptosystem

  39. Public-Key Cryptosystem

  40. Public-Key Cryptosystem

  41. Public-Key Cryptosystem Page 46 Conditions for public-key Crpto system to work * SB ( PB ( M )) = M * This is not easy PB, PB( M ) => M PB => SB Very hard to prevent PB => SB

  42. Public-Key Cryptosystem

  43. Is Public-Key Cryptosystem Possible? • Need a function whose inverse is DIFFICULT to compute without private key. Sounds almost impossible. • In 1970’s, Rivest, Shamir and Adelman figured out how to do this using modular arithmetic • The result: RSA public-key crypto-system. L11 Conditions for public-key Crypto System to work * SB (PB( M )) = M * This is not easy PB, PB( M )=> M PB => SB

More Related