The structure of fiite rigs ad fiite expoetiatio The multiplicative residues We have see that the fiite rig Z p is a field, that is, every o-zero elemet of Z p has a multiplicative iverse It is a covetio to write Z p for the o-zero elemets {1, 2, 3,, p-1} Z p is the set of multiplicative residues modulo p Modular expoetiatio Public key cryptography explores the properties of the expoetiatio fuctio i Z p Defied as repeated multiplicatio: g 5 mod p := g g g g g mod p To expoetiate by egative values, expoetiate the iverse: g -3 := g -1 g -1 g -1 mod p 1
Expoet rules Additio/subtractio rules: g k g j = g k +j i Z g k g -j = g k-j i Z Multiplicatio rule: (g k ) j = g kj i Z No-prime modulus If is ot prime, the ot all o-zero elemets are ivertible I this case, we write Z for the ivertible elemets oly Examples: Z 14 = {1, 3, 5, 9, 11, 13} Z 15 = {1, 2, 4, 7, 8, 11, 13, 14} Geerators Cosider the followig: I Z 14 = {1, 3, 5, 9, 11, 13}; 3 2 =9 mod 14; 3 3 =13 mod 14; 3 4 = 11 mod 14; 3 5 = 5 mod 14; 3 6 = 1 mod 14 I Z 14 every elemet is a power of 3 We say that 3 is a geerator Do geerators always exist? 2
Prime modulus If is a prime, or twice a prime, the Z always has a geerator We have already see this for = 14 = 27 Otherwise, geerators do ot exist A importat case is whe = pq, where both p ad q are odd ad prime I this case, there is a elemet that geerates 1/2 of Z Example Z 15 = {1, 2, 4, 7, 8, 11, 13, 14} 2 1 =2 mod 15; 2 2 =4 mod 15; 2 3 =8 mod 15; 2 4 =1 mod 15 4 1 = 4 mod 15; 4 2 = 1 mod 15; 7 1 =7 mod 15; 7 2 =4 mod 15; 7 3 =13 mod 15; 7 4 =1 mod 15; 8 1 =8 mod 15; 8 2 =4 mod 15; 8 3 =2 mod 15; 8 4 =1 mod 15; 11 1 =11 mod 15; 11 2 = 1 mod 15; 13 1 =13 mod 15; 13 2 =4 mod 15; 13 3 =7 mod 15; 13 4 =1 mod 15; 14 1 = 14 mod 15; 14 2 =1 mod 15; No elemet is a geerator, as predicted Order of a elemet Take g i Z The list g 1, g 2,, g k, k = 1, 2, must evetually repeat Otherwise get ifiite sequece of elemets from a fiite set, a cotradictio Let g j = g k, j < k k = j + t g j = g k = g j+t ; g j = g j+t = g j g t ; g t = 1 Cacellatio rule applies because g is ivertible 3
Order (cotiued) We have show that: g is ivertible if ad oly if there is t > 1 such that g t = 1 mod Z Ideed, if g is ivertible we have show that t exists O the other had, if t exists, the g has a iverse, equal to g t-1 g g t-1 = g t = 1 i Z The smallest such t is the order of g Order of Z The order of a elemet ca also be defied as the size of the set geerated by it: t = order(g) = #{g, g 2, g 3,, g t = 1} The order of the group Z is simply its cardiality Z The fuctio ϕ() = Z is called the Euler totiet fuctio Euler totiet We kow that all o-zero residues modulo a prime p are ivertible I other words: ϕ(p) = p - 1, if p is a prime It is easy to see that, if = p q is a product of two primes, the ϕ() = (p - 1)(q - 1) = ϕ(p) ϕ(q) I geeral: ϕ() ϕ(m) = ϕ(m) if, m are relatively prime 4
Relatios betwee orders Fact: If g is a residue i Z, the order(g) divides ϕ() = order(z ) A importat special case is whe p is a prime I that case, order(g) divides p-1 g p-1 = (g t ) k = 1 k = 1 mod p; t = order(g) Fermat s Little Theorem The previous result is called Fermat s Little Theorem (FLT) For every o-zero g i Z p where p is a prime: g p-1 = 1 mod p This ca be geeralized for all g i Z p g p = g mod p Geeralizig FLT For ay fiite rig Z : g ϕ() = 1 mod, g i Z Proof will ot be give The special case = pq is importat Claim: If is a product of two primes: g ϕ()+1 = g mod, g i Z = {0, 1,, -1} 5
The Remaider Theorem I order to appreciate the structure of fiite rigs whe the modulus is composite, the remaider theorem applies: Give = s t, where GCD(s, t) = 1 For each elemet a mod, there correspods a uique pair (b mod s, c mod t) Example (CRT) = 15 = 35 a = 7 mod 15 correspods to (1 mod 3, 2 mod 5) To go from a mod to (b mod s, c mod t): Just compute b = a mod s, c = a mod t How to go backwards? Let σ represet s -1 mod t, τ represets t -1 mod s CRT backwards Give (b mod s, c mod t), compute a = c s σ + b t τ mod I other words a = c s σ + b t τ + k Cosider a mod s (similar for a mod t) a mod s = c s σ + b t τ + k s t mod s = b t τ mod s = b mod s 6
CRT backwards example give b = 1 mod 3, c = 5 mod 7 Compute 3-1 mod 7 = 5, as 35 = 1 mod 7 Compute 7-1 mod 3 = 1, as 7 = 1 mod 3 a =1 7 1 + 5 3 5 = 82 mod 21 = 19 mod 21 Returig to FLT for = pq To prove: g ϕ()+1 = g mod, g i Z = {0, 1,, -1}, whe = pq, ad p, q are primes For ivertible elemets, ie, GCD(g, ) = 1, it is the previous claim For g=0 mod, ie, GCD(g, ) = it is clear Cosider ow the case GCD(g, ) = p FLT (cotiued) By the CRT, g is defied by g is ivertible mod q g = 0 mod p We get that g q = g mod q g q = 0 = g mod p By backwards CRT, we get g q = g mod pq; g ϕ()+1 = g pq - p - q +2 = = g -p+2 (g q ) p-1 = g mod pq 7