15 251 Great Theoretical Ideas in Computer Science Number Theory Cryptography and RSA Lecture 15 October 13 2009 p 1 p 1 The reduced system modulo n Zn 0 1 2 n 1 Define operations n and n a n b a b mod n a n b a b mod n Zn 0 1 2 n 1 a n b a b mod n a n b a b mod n n and n are commutative and associative binary operators from Zn Zn Zn The reduced system Z6 0 1 2 3 4 5 0 1 2 3 4 5 0 0 1 2 3 4 5 1 1 2 3 4 5 0 2 2 3 4 5 0 1 3 3 4 5 0 1 2 4 4 5 0 1 2 3 5 5 0 1 2 3 4 An operator has the permutation property if each row and each column has a permutation of the elements For every n n on Zn has the permutation property 0 1 2 3 4 5 0 0 1 2 3 4 5 1 1 2 3 4 5 0 2 2 3 4 5 0 1 3 3 4 5 0 1 2 4 4 5 0 1 2 3 5 5 0 1 2 3 4 An operator has the permutation property if each row and each column has a permutation of the elements What about multiplication Does 6 on Z6 have the permutation property No 0 1 2 3 4 5 0 0 0 0 0 0 0 1 0 1 2 3 4 5 2 0 2 4 0 2 4 3 0 3 0 3 0 3 4 0 4 2 0 4 2 5 0 5 4 3 2 1 An operator has the permutation property if each row and each column has a permutation of the elements Fundamental lemma of plus minus and times modulo n If x y and a n b Then 1 x a n y b 2 x a n y b 3 x a n y b n Is there a fundamental lemma of division modulo n cx n cy x n y No When can t I divide by c If GCD c n 1 then you can t always divide by c Fundamental lemma of division modulo n If GCD c n 1 then ca n cb a n b So Consider the set Zn x Zn GCD x n 1 Multiplication over this set Zn will have the cancellation property Euler Phi Function n Define n size of Zn number of 1 k n that are relatively prime to n Z6 0 1 2 3 4 5 Z6 1 5 0 1 2 3 4 5 0 0 1 2 3 4 5 1 1 2 3 4 5 0 2 2 3 4 5 0 1 3 3 4 5 0 1 2 4 4 5 0 1 2 3 5 5 0 1 2 3 4 0 1 2 3 4 5 0 0 0 0 0 0 0 1 0 1 2 3 4 5 2 0 2 4 0 2 4 3 0 3 0 3 0 3 4 0 4 2 0 4 2 5 0 5 4 3 2 1 Z12 0 x 12 gcd x 12 1 1 5 7 11 12 4 12 1 5 7 11 1 1 5 7 11 5 5 1 11 7 7 7 11 1 5 11 11 7 5 1 Z5 1 2 3 4 Z5 0 5 1 2 3 4 1 1 2 3 4 2 2 4 1 3 3 3 1 4 2 4 4 3 2 1 For all primes p Zp Zp 0 since all 0 x p satisfy gcd x p 1 If p prime then p p 1 If p q distinct primes then pq p 1 q 1 If p prime then p2 What are the properties of Zn For n on Zn the following properties hold Closure x y Zn x n y Zn Associativity x y z Zn x n y n z x n y n z Commutativity x y Zn x n y y n x The additive inverse of a Zn is the unique b Zn such that a n b n 0 We denote this inverse by a It is trivial to calculate a n a Efficient algorithm to find multiplicative inverse a 1 from a and n Extended Euclidean Algorithm a n Get r s such that ra sn gcd a n 1 So ra n 1 Output r is the multiplicative inverse of a Zn 0 1 2 n 1 Zn x Zn GCD x n 1 Define n and n a n b a b mod n a n b a b mod n Zn n Zn n 1 Closed 1 Closed 2 Associative 2 Associative 3 0 is identity 3 1 is identity 4 Additive Inverses 4 Multiplicative Inverses 5 Cancellation 5 Cancellation 6 Commutative 6 Commutative c n a n b n c n a n c n b new stuff starts here Fundamental Lemmas until now For x y a b in Zn x n y and a n b Then 1 x a n y b 2 x a n y b 3 x a n y b For a b c in Zn then ca n cb a n b Fundamental lemma of powers If a n b Then xa n xb NO 2 3 5 but it is not the case that 22 3 25 By the permutation property two names for the same set Zn aZn where aZn a n x x Zn a Zn Example Z5 1 2 3 4 1 1 2 3 4 2 2 4 1 3 a 3 1 4 2 4 4 3 2 1 Two products on the same set Zn aZn aZn a n x x Zn a Zn x n ax as x ranges over Zn x n x asize of Zn 1 n asize of Zn a n Commutativity Cancellation 1 Euler s Theorem a Zn a n n 1 Fermat s Little Theorem p prime a Zp ap 1 p 1 Correct Fundamental lemma of powers Suppose x Zn and a b n are naturals If a n b Then xa n xb Equivalently xa n xa mod n Defining negative powers Suppose x Zn and a n are naturals x a is defined to be the multiplicative inverse of xa x a xa 1 Rule of integer exponents Suppose x y Zn and a b are integers xy 1 n x 1 y 1 Xa Xb n Xa b A note about exponentiation How do you calculate 26666666666661 mod 7 Fundamental lemma of powers Suppose x Zn and a n are naturals xa n xa mod n For x 2 Zx xa mod n xa mod n mod n Time to compute To compute ax mod n for a 2 Zn first get x x mod n By Euler s theorem ax ax mod n Hence we can calculate ax where x …
View Full Document
Unlocking...