View
218
Download
3
Tags:
Embed Size (px)
Citation preview
COMP 170 L2Page 1
Part 2 of Course
Chapter 2 of Textbook
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
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
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
COMP 170 L2Page 5
Modular Arithmetic
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
COMP 170 L2Page 7
Modular Arithmetic
Applies also to the case when m is negative.
COMP 170 L2Page 8
Modular Arithmetic
Applies also to the case when m is negative.
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
COMP 170 L2Page 10
Modular Arithmetic/Properties
COMP 170 L2Page 11
Modular Arithmetic/Properties
Examples
COMP 170 L2Page 12
Intuition
Adding multiples of n to i changes the quotient, but not the remainder.
COMP 170 L2Page 13
COMP 170 L2Page 14
COMP 170 L2Page 15
Lemma 2.3 has a second part
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
COMP 170 L2Page 17
Modulo Arithmetic on the Set
Operations on
COMP 170 L2Page 18
COMP 170 L2Page 19
Laws of Arithmetic over Real Numbers
COMP 170 L2Page 20
Properties of Operations on
COMP 170 L2Page 21
COMP 170 L2Page 22
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
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
COMP 170 L2Page 25
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
COMP 170 L2Page 27
Private-Key Cryptography
COMP 170 L2Page 28
Caeser Cipher and Mod 26
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
COMP 170 L2Page 30
Caeser Cipher and Mod 26
COMP 170 L2Page 31
Encrypting/Decrypting as Functions
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
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
COMP 170 L2Page 34
Cryptography with Multiplication mod n
COMP 170 L2Page 35
Cryptography with Multiplication mod n
COMP 170 L2Page 36
Multiplicative Inverse Exists?
COMP 170 L2Page 37
Multiplicative Inverse Exists?
COMP 170 L2Page 38
Multiplicative Inverse Exists?
COMP 170 L2Page 39
Multiplicative Inverse Exists?
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
COMP 170 L2Page 41
Drawback of Private-Key Cryptosystem
COMP 170 L2Page 42
Public-Key Cryptosystem
COMP 170 L2Page 43
Public-Key Cryptosystem
COMP 170 L2Page 44
Public-Key Cryptosystem
COMP 170 L2Page 45
Public-Key Cryptosystem
COMP 170 L2Page 46
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.
COMP 170 L2
23-02-2010: RecapPage 48
COMP 170 L2
23-02-2010: RecapPage 49
COMP 170 L2
25-02-2010: Recap
COMP 170 L2
25-02-2010: Recap
Example of Private-Key cryptosystem Caeser Cipher: cryptosystem using addition mod n
COMP 170 L2
25-02-2010: Recap
L04: Examples on multiplicative inverse
L05:
When does multiplicative inverse exist?
How to find it?