Topic 12: Number Theory Basics (2)

Slides:



Advertisements
Similar presentations
1 Lect. 12: Number Theory. Contents Prime and Relative Prime Numbers Modular Arithmetic Fermat’s and Euler’s Theorem Extended Euclid’s Algorithm.
Advertisements

Chapter 4 Finite Fields. Introduction of increasing importance in cryptography –AES, Elliptic Curve, IDEA, Public Key concern operations on “numbers”
Cryptography and Network Security Chapter 4 Fourth Edition by William Stallings.
Chapter 4 – Finite Fields. Introduction will now introduce finite fields of increasing importance in cryptography –AES, Elliptic Curve, IDEA, Public Key.
1 Chapter 7– Introduction to Number Theory Instructor: 孫宏民 Room: EECS 6402, Tel: , Fax :
6/20/2015 5:05 AMNumerical Algorithms1 x x1x
Chapter 4 – Finite Fields Introduction  will now introduce finite fields  of increasing importance in cryptography AES, Elliptic Curve, IDEA, Public.
CS555Spring 2012/Topic 61 Cryptography CS 555 Topic 6: Number Theory Basics.
Lecture 3.2: Public Key Cryptography II CS 436/636/736 Spring 2012 Nitesh Saxena.
CS555Spring 2012/Topic 61 Cryptography CS 555 Topic 6: Number Theory Basics.
Cryptography Lecture 6 Stefan Dziembowski
Great Theoretical Ideas in Computer Science.
1 Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown Chapter 4 – Finite Fields.
Prelude to Public-Key Cryptography Rocky K. C. Chang, February
Prep Math Competition, Lec. 1Peter Burkhardt1 Number Theory Lecture 1 Divisibility and Modular Arithmetic (Congruences)
Fall 2002CS 395: Computer Security1 Chapters 4 and 8: The Mathematics Required for Public Key Cryptography In case you’re beginning to worry that this.
1 Network and Computer Security (CS 475) Modular Arithmetic and the RSA Public Key Cryptosystem Jeremy R. Johnson.
Network and Computer Security (CS 475) Modular Arithmetic
Cryptography and Network Security Chapter 4. Introduction  will now introduce finite fields  of increasing importance in cryptography AES, Elliptic.
Great Theoretical Ideas in Computer Science for Some.
Great Theoretical Ideas in Computer Science.
Great Theoretical Ideas In Computer Science Anupam GuptaCS Fall 2006 Lecture 15Oct 17, 2006Carnegie Mellon University Algebraic Structures: Groups,
CS Lecture 14 Powerful Tools     !. Build your toolbox of abstract structures and concepts. Know the capacities and limits of each tool.
Lecture 3.1: Public Key Cryptography I CS 436/636/736 Spring 2015 Nitesh Saxena.
15-499Page :Algorithms and Applications Cryptography II – Number theory (groups and fields)
Chapter 13 Mathematic Structures 13.1 Modular Arithmetic Definition 1 (modulo). Let a be an integer and m be a positive integer. We denoted by a mod m.
Great Theoretical Ideas in Computer Science.
Great Theoretical Ideas In Computer Science COMPSCI 102 Fall 2010 Lecture 16October 27, 2010Duke University Modular Arithmetic and the RSA Cryptosystem.
Great Theoretical Ideas in Computer Science.
Cryptography Lecture 14 Arpita Patra © Arpita Patra.
Divisibility and Modular Arithmetic
Chapter 4 With Question/Answer Animations 1. Chapter Motivation Number theory is the part of mathematics devoted to the study of the integers and their.
Great Theoretical Ideas in Computer Science.
Discrete Math II Howon Kim
Modular Arithmetic and the RSA Cryptosystem
B504/I538: Introduction to Cryptography
Great Theoretical Ideas in Computer Science
Advanced Algorithms Analysis and Design
Prelude to Public-Key Cryptography
Advanced Algorithms Analysis and Design
Lecture 3.2: Public Key Cryptography II
Numerical Algorithms x x-1 Numerical Algorithms
Great Theoretical Ideas In Computer Science
Number Theory and Modular Arithmetic
Numerical Algorithms x x-1
Applied Symbolic Computation (CS 300) Modular Arithmetic
Topic 6: Number Theory Basics
Cryptography Lecture 21.
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
Applied Symbolic Computation (CS 300) Modular Arithmetic
Modular Arithmetic and the RSA Cryptosystem
Great Theoretical Ideas in Computer Science
Systems Architecture I
Classical Ciphers – 2 CSCI284 Spring 2004 GWU
Applied Symbolic Computation (CS 300) Modular Arithmetic
Lecture 3.1: Public Key Cryptography I
Algorithmic Number Theory and Cryptography (CS 303) Modular Arithmetic
Great Theoretical Ideas in Computer Science
I. Finite Field Algebra.
Algebraic Structures: Group Theory
Applied Symbolic Computation (CS 300) Modular Arithmetic
Applied Symbolic Computation (CS 300) Modular Arithmetic
CSCI284 Spring 2009 GWU Sections 5.1, 5.2.2, 5.3
Applied Symbolic Computation (CS 300) Modular Arithmetic
Patrick Lee 12 July 2003 (updated on 13 July 2003)
Rayat Shikshan Sanstha’s S.M.Joshi College, Hadapsar -28
Clements MAΘ October 30th, 2014
Cryptography Lecture 17.
Cryptography Lecture 20.
Cryptography Lecture 19.
Presentation transcript:

Topic 12: Number Theory Basics (2) Cryptography CS 555 Topic 12: Number Theory Basics (2) CS555 Spring 2012/Topic 12 1

Outline and Readings Outline Readings: Groups Residue classes Euler Phi function Chinese remainder theorem Readings: Katz and Lindell: : 7.1.3, 7.1.4, 7.1.5, 7.2 CS555 Spring 2012/Topic 12 2

Group A group is a set G along with a binary operation  such that the following conditions hold (Closure):  g,h  G, g  h  G (Existence of an Identity): eG s.t. gG g  e = e  g = g (Existence of inverse): gG gG s.t. g  h = h  g = e (Associativity)  g1, g2, g3  G (g1  g2)  g3 = g1  (g2  g3 ) Example: (Z,+), (R,+), (Q+,), (Permutations,Composition) CS555 Spring 2012/Topic 12 3

Group Concepts When a group G has a finite number of elements, we say that G is a finite group, and |G| the order of the group. We say a group is abelian if the following holds (Commutativity:)  g,h  G, g  h = h  g We say that (H,) is a subgroup of (G,) if H is a subset of G, and (H,) is a group Find a subgroup of (Z,+) CS555 Spring 2012/Topic 12 4

Additive and Multiplicative Groups Additive group Use + to denote the operation Use 0 to denote the identity element Use –g to denote the inverse of g Use mg = mg = g+g+…+g (g occurs m times) Multiplicative group Use gh or simply gh to denote applying the operation Use 1 to denote the identity element Use g-1 to denote the inverse of g Use gm to denote g  g  …  g CS555 Spring 2012/Topic 12 5

Theorem 7.14 Theorem: Let G be a finite abelian group, and m=|G| be its order, then gG gm=1 Proof. Lemma: If ab=ac, then b=c. Let g1, g2, …, gm be all elements in G Then gg1, gg2, …, ggm must also be all elements in G g1g2  gm = (gg1)  (gg2) … (ggm) = gm g1g2  gm Thus gm=1 CS555 Spring 2012/Topic 12 6

Residue Classes Given positive integer n, congruence modulo n is an equivalence relation. This relation partition all integers into equivalent classes; we denote the equivalence class containing the number x to be [x]n, or [x] when n is clear from the context These classes are called residue classes modulo n E.g., [1]7=[8]7={…, -13,-6,1,8,15,22,…} CS555 Spring 2012/Topic 12 7

Modular Arithmetic in Zn Define Zn as the set of residue classes modulo n Z7 = {[0], [1], [2], …, [6]} Define two binary operators + and  on Zn Given [x], [y] in Zn, [x] + [y] = [x+y], [x]  [y] = [xy] E.g., in Z7: [3]+[4] = [0], [0]+[2] = [2]+[0] = [2], [5]+[6] = [4] (Zn,+) is a group of size n; (Zn,) is not a group Compute the table for Z4 CS555 Spring 2012/Topic 12 8

Properties of Modular Addition and Multiplication Let n be a positive integer and Zn be the set of residue classes modulo n. For all a, b, c  Zn a + b = b + a addition is commutative (a+b)+c = a+(b+c) addition is associative a + [0] = a exists addition identity [x] + [–x] = [0] exists additive inverse a  b = b  a multiplication is commutative (ab)c = a(bc) multiplication is associative a(b+c) = ab+ ac mult. distributive over add. a[1] = a exists multiplicative identity CS555 Spring 2012/Topic 12 9

Multiplicative Inverse Theorem: [x]n has a multiplicative inverse if and only if gcd(x,n) = 1 We use Zn* to denote the set of all residue classes that have a multiplicative inverse. What is Z15*? (Zn*,) is a group of size (n) . CS555 Spring 2012/Topic 12 10

The Euler Phi Function Definition Given an integer n, (n) = | Zn*| is the number of all numbers a such that 0 < a < n and a is relatively prime to n (i.e., gcd(a, n)=1). Theorem: If gcd(m,n) = 1, (mn) = (m) (n) Proof. There is a one-to-one mapping between Zmn* and Zm* Zn* x  (x mod m, x mod n) yn(n-1 mod m) + zm (y,z) CS555 Spring 2012/Topic 12 11

The Euler Phi Function Theorem: Formula for (n) Let p be prime, e, m, n be positive integers 1) (p) = p-1 2) (pe) = pe – pe-1 3) If then CS555 Spring 2012/Topic 12 12

Fermat’s Little Theorem If p is a prime number and a is a natural number that is not a multiple of p, then ap-1  1 (mod p) Proof idea: Corollary of Theorem 7.14 gcd(a, p) = 1, then the set { i  a mod p} 0< i < p is a permutation of the set {1, …, p-1}. otherwise we have 0<n<m<p s.t. ma mod p = na mod p, and thus p| (ma - na)  p | (m-n), where 0<m-n < p ) a  2a  … (p-1)a = (p-1)! ap-1  (p-1)! (mod p) Since gcd((p-1)!, p) = 1, we obtain ap-1  1 (mod p) CS555 Spring 2012/Topic 12 13

Euler’s Theorem Given integer n > 1, such that gcd(a, n) = 1 then a(n)  1 (mod n) Corollary of Theorem 7.14 Corollary Given integer n > 1, such that gcd(a, n) = 1 then a(n)-1 mod n is a multiplicative inverse of a mod n. Given integer n > 1, x, y, and a positive integers with gcd(a, n) = 1. If x  y (mod (n)), then ax  ay (mod n). CS555 Spring 2012/Topic 12 14

Consequence of Euler’s Theorem Principle of Modular Exponentiation Given a, n, x, y with n 1 and gcd(a,n)=1, if x  y (mod (n)), then ax  ay (mod n) Proof idea: ax = ak(n) + y = ay (a (n))k by applying Euler’s theorem we obtain ax  ay (mod p) CS555 Spring 2012/Topic 12 15

Chinese Reminder Theorem (CRT) Let n1, n2, ,,, nk be integers s.t. gcd(ni, nj) = 1 for any i  j. There exists a unique solution modulo n = n1 n2 … nk CS555 Spring 2012/Topic 12 16

Proof of CRT Consider the function : Zn Zn1 × Zn2 ×  × Znk (x) = (x mod n1, …, x mod nk) We need to prove that  is a bijection. For 1ik, define mi = n / ni, then gcd(mi,ni)=1 For 1ik, define yi = mi-1 mod ni Define function (a1,a2,…,ak) =  aimiyi mod n, this function inverts  aimiyi  ai (mod ni) aimiyi  0 (mod nj) where i  j CS555 Spring 2012/Topic 12 17

An Example Illustrating Proof of CRT Example of the mappings: n1=3, n2=5, n=15 m1=5, y1=m1-1 mod n1=2, 52 mod 3 = 1 m2=3, y2=m2-1 mod n2=2, 32 mod 5 = 1 (2,4) = (252 + 432) mod 15 = 44 mod 15 = 14 14 mod 3 = 2, 14 mod 5 = 4 CS555 Spring 2012/Topic 12 18

Example of CRT: x  5 (mod 7) x  3 (mod 11) x  10 (mod 13) n1=7, n2=11, n3=13, n=1001 m1=143, m2=91, m3=77 y1=143-1 mod 7 = 3-1 mod 7 = 5 y2=91-1 mod 11 = 3-1 mod 11 = 4 y3=77-1 mod 13 = 12-1 mod 13 = 12 x =(5×143×5 + 3×91×4 + 10×77×12) mod 1001 = 13907 mod 1001 = 894 CS555 Spring 2012/Topic 12 19

Coming Attractions … Message Authentication Code Reading: Katz & Lindell: 4.1~4.4 CS555 Spring 2012/Topic 12 20