comp 170 l2 page 1 part 2 of course chapter 2 of textbook
Post on 20-Dec-2015
218 views
TRANSCRIPT
![Page 1: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/1.jpg)
COMP 170 L2Page 1
Part 2 of Course
Chapter 2 of Textbook
![Page 2: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/2.jpg)
COMP 170 L2Page 2
Part 2 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
![Page 3: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/3.jpg)
COMP 170 L2Page 3
Part 2 of Course
Part 2 of course: Show how to make e-commerce secure using Number theory. Three logic lectures: L04-L06
![Page 4: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/4.jpg)
COMP 170 L2Page 4
L04: Intro to Crypto and Modulus
Objective: Basic mathematical concepts for Part 2 Introduction to Cryptography
Outline 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
![Page 5: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/5.jpg)
COMP 170 L2Page 5
Modular Arithmetic
![Page 6: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/6.jpg)
COMP 170 L2Page 6
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
![Page 7: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/7.jpg)
COMP 170 L2Page 7
Modular Arithmetic
Applies also to the case when m is negative.
![Page 8: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/8.jpg)
COMP 170 L2Page 8
Modular Arithmetic
Applies also to the case when m is negative.
![Page 9: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/9.jpg)
COMP 170 L2Page 9
Modular Arithmetic/Simple Properties
Note
[-25 mod 4] = 4 - [25 mod 4]
In general
Example: 5 mod 4 = 1, (-5) mod 4 = 3
6 mod 4 = 2, (-6) mod 4 = 2
![Page 10: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/10.jpg)
COMP 170 L2Page 10
Modular Arithmetic/Properties
![Page 11: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/11.jpg)
COMP 170 L2Page 11
Modular Arithmetic/Properties
Examples
![Page 12: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/12.jpg)
COMP 170 L2Page 12
Intuition
Adding multiples of n to i changes the quotient, but not the remainder.
![Page 13: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/13.jpg)
COMP 170 L2Page 13
![Page 14: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/14.jpg)
COMP 170 L2Page 14
![Page 15: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/15.jpg)
COMP 170 L2Page 15
Lemma 2.3 has a second part
![Page 16: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/16.jpg)
COMP 170 L2Page 16
L04: 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
![Page 17: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/17.jpg)
COMP 170 L2Page 17
Modulo Arithmetic on the Set
Operations on
![Page 18: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/18.jpg)
COMP 170 L2Page 18
![Page 19: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/19.jpg)
COMP 170 L2Page 19
Laws of Arithmetic over Real Numbers
![Page 20: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/20.jpg)
COMP 170 L2Page 20
Properties of Operations on
![Page 21: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/21.jpg)
COMP 170 L2Page 21
![Page 22: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/22.jpg)
COMP 170 L2Page 22
![Page 23: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/23.jpg)
COMP 170 L2Page 23
Does each
Has additive inverse? Yes. -x mod n
Has multiplicative inverse? Major question to be discussed later.
Properties of Operations on
![Page 24: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/24.jpg)
COMP 170 L2Page 24
L04: 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
![Page 25: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/25.jpg)
COMP 170 L2Page 25
![Page 26: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/26.jpg)
COMP 170 L2Page 26
L04: 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
![Page 27: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/27.jpg)
COMP 170 L2Page 27
Private-Key Cryptography
![Page 28: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/28.jpg)
COMP 170 L2Page 28
Caeser Cipher and Mod 26
![Page 29: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/29.jpg)
COMP 170 L2Page 29
Caeser Cipher and Mod 26
Encrypting
Decrypting:
E.G. s=2 Plaintext message: SEA 18 4 0
Cipher text: 20 6 2
Decrypted message: 18 4 0
![Page 30: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/30.jpg)
COMP 170 L2Page 30
Caeser Cipher and Mod 26
![Page 31: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/31.jpg)
COMP 170 L2Page 31
Encrypting/Decrypting as Functions
![Page 32: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/32.jpg)
COMP 170 L2Page 32
L04: 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
![Page 33: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/33.jpg)
COMP 170 L2Page 33
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
![Page 34: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/34.jpg)
COMP 170 L2Page 34
Cryptography with Multiplication mod n
![Page 35: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/35.jpg)
COMP 170 L2Page 35
Cryptography with Multiplication mod n
![Page 36: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/36.jpg)
COMP 170 L2Page 36
Multiplicative Inverse Exists?
![Page 37: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/37.jpg)
COMP 170 L2Page 37
Multiplicative Inverse Exists?
![Page 38: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/38.jpg)
COMP 170 L2Page 38
Multiplicative Inverse Exists?
![Page 39: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/39.jpg)
COMP 170 L2Page 39
Multiplicative Inverse Exists?
![Page 40: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/40.jpg)
COMP 170 L2Page 40
L04: 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
![Page 41: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/41.jpg)
COMP 170 L2Page 41
Drawback of Private-Key Cryptosystem
![Page 42: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/42.jpg)
COMP 170 L2Page 42
Public-Key Cryptosystem
![Page 43: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/43.jpg)
COMP 170 L2Page 43
Public-Key Cryptosystem
![Page 44: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/44.jpg)
COMP 170 L2Page 44
Public-Key Cryptosystem
![Page 45: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/45.jpg)
COMP 170 L2Page 45
Public-Key Cryptosystem
![Page 46: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/46.jpg)
COMP 170 L2Page 46
![Page 47: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/47.jpg)
COMP 170 L2Page 47
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. L06.
![Page 48: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/48.jpg)
COMP 170 L2
23-02-2010: RecapPage 48
![Page 49: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/49.jpg)
COMP 170 L2
23-02-2010: RecapPage 49
![Page 50: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/50.jpg)
COMP 170 L2
25-02-2010: Recap
![Page 51: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/51.jpg)
COMP 170 L2
25-02-2010: Recap
Example of Private-Key cryptosystem Caeser Cipher: cryptosystem using addition mod n
![Page 52: COMP 170 L2 Page 1 Part 2 of Course Chapter 2 of Textbook](https://reader036.vdocument.in/reader036/viewer/2022062714/56649d435503460f94a1ec9b/html5/thumbnails/52.jpg)
COMP 170 L2
25-02-2010: Recap
L04: Examples on multiplicative inverse
L05:
When does multiplicative inverse exist?
How to find it?