349 crypto homework 3 solutions

4
Math 349 Cryptography, Fall 2011 Homework 3 solutions (1) (3 pts/part) Use Fermat’s Little Theorem to do the following. (a) Find the least residue of 9 794 modulo 73. (b) Find the solution to the congruence x 86 6(mod 29), if it exists. (c) Find the solution to the congruence x 39 3(mod 13), if it exists. Solution: (a) Since 73 is prime and 9 - 73, Fermat’s Little Theorem gives 9 72 1(mod 73). Then 9 794 = (9 72 ) 11 · 9 2 9 2 (mod 73) 8(mod 73). (b) Since 29 is prime, Fermat’s Little Theorem gives x 28 1(mod 29). Then x 86 =(x 28 ) 3 · x 2 x 2 (mod 29) and the solutions to the original equation are thus the same as the solutions to x 2 6(mod 29). By inspection, the solutions to this equation are x =8 and x = 21. (c) Much like in the previous problem, we get, by Fermat’s Little Theorem, x 39 =(x 12 ) 3 · x 3 x 3 (mod 13) so the solutions to the original equation are the same as the solutions to x 3 3(mod 13). However, by inspection we see that this equation has no solutions. (2) (5 pts) The congruence 7 1734250 1660565 (mod 1734251) is true. Can you conclude that 1734251 is a composite number? Solution: If 1734251 were prime, Fermat’s Little Theorem would apply since 1734251 - 7, and we would have 7 1734250 1(mod 1734251). It would then follow that 1660565 1(mod 1734251) since both 1660565 and 1 are congruent to 7 1734250 modulo 1734251. But this is clearly not true since 1734251 > 1660565 - 1 so it cannot be that 1734251 divides 1660565 - 1. (3) (5 pts) Use Euler’s Formula to find the least residue of 2 2007 modulo 15. Solution: (This is the same kind of a problem as (1)(a).) Since gcd(2, 15), Euler’s Formula applies. We have φ(15) = φ(3)φ(5) = 2 · 4=8, so 2 8 1(mod 15). Then 2 2007 = (2 8 ) 250 · 2 7 2 7 (mod 15) 8(mod 15). (4) (3 pts/part) (a) Find the value of φ(97). (b) Find the value of φ(8800).

Upload: jitender-kumar

Post on 18-Apr-2015

59 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 349 Crypto Homework 3 Solutions

Math 349 Cryptography, Fall 2011Homework 3 solutions

(1) (3 pts/part) Use Fermat’s Little Theorem to do the following.(a) Find the least residue of 9794 modulo 73.(b) Find the solution to the congruence x86 ≡ 6 (mod 29), if it exists.(c) Find the solution to the congruence x39 ≡ 3 (mod 13), if it exists.

Solution:(a) Since 73 is prime and 9 - 73, Fermat’s Little Theorem gives

972 ≡ 1 (mod 73).

Then9794 = (972)11 · 92 ≡ 92 (mod 73) ≡ 8 (mod 73).

(b) Since 29 is prime, Fermat’s Little Theorem gives

x28 ≡ 1 (mod 29).

Thenx86 = (x28)3 · x2 ≡ x2 (mod 29)

and the solutions to the original equation are thus the same as the solutions to

x2 ≡ 6 (mod 29).

By inspection, the solutions to this equation are x = 8 and x = 21.(c) Much like in the previous problem, we get, by Fermat’s Little Theorem,

x39 = (x12)3 · x3 ≡ x3 (mod 13)

so the solutions to the original equation are the same as the solutions to

x3 ≡ 3 (mod 13).

However, by inspection we see that this equation has no solutions.

(2) (5 pts) The congruence 71734250 ≡ 1660565 (mod 1734251) is true. Can you conclude that 1734251 is acomposite number?

Solution: If 1734251 were prime, Fermat’s Little Theorem would apply since 1734251 - 7, and we would have

71734250 ≡ 1 (mod 1734251).

It would then follow that1660565 ≡ 1 (mod 1734251)

since both 1660565 and 1 are congruent to 71734250 modulo 1734251. But this is clearly not true since 1734251 >1660565− 1 so it cannot be that 1734251 divides 1660565− 1.

(3) (5 pts) Use Euler’s Formula to find the least residue of 22007 modulo 15.

Solution: (This is the same kind of a problem as (1)(a).) Since gcd(2, 15), Euler’s Formula applies. We haveφ(15) = φ(3)φ(5) = 2 · 4 = 8, so

28 ≡ 1 (mod 15).

Then22007 = (28)250 · 27 ≡ 27 (mod 15) ≡ 8 (mod 15).

(4) (3 pts/part)(a) Find the value of φ(97).(b) Find the value of φ(8800).

Page 2: 349 Crypto Homework 3 Solutions

Solution:(a) Since 97 is a prime, φ(97) = 96.(b) Since 8800 = 25 · 52 · 11, we have φ(8800) = φ(25)φ(52)φ(11) = (25 − 24) · (52 − 5) · 10 = 3200.

(5) (5 pts) If m ≥ 3, explain why φ(m) is always even.

Solution: Suppose p is a prime factor of m and suppose it appears a times in the factorization of m, with a ≥ 1.Then φ(m) must contain a factor of pa− pa−1 by a formula we proved in class. But pa− pa−1 = pa−1(p− 1) isnecessarily even since if p is an odd prime, p− 1 is even so the product is even, and if p is 2, then the productis again clearly even. Thus φ(m) contains a factor of 2 and is therefore even.

(6) Suppose that p1, p2, ..., pr are the distinct primes that divide m.(a) (5 pts) Show that

φ(m) = m

(1− 1

p1

)(1− 1

p2

)· · ·

(1− 1

pr

).

(b) (3 pts) Use the formula from part (a) to compute φ(1, 000, 000).

Solution:(a) Suppose m = pa11 p

a22 · · · parr for some primes pi and positive integers ai. Then by properties of the Euler

Phi Function, we have

φ(m) = φ(pa11 pa22 · · · p

arr )

= φ(pa11 )φ(pa22 ) · · ·φ(parr ))

= (pa11 − pa1−11 )(pa22 − p

a2−12 ) · · · (parr − par−1

r )

= pa11

(1− 1

p1

)pa22

(1− 1

p2

)· · · parr

(1− 1

pr

)= pa11 p

a22 · · · p

arr

(1− 1

p1

)(1− 1

p2

)· · ·

(1− 1

pr

)= m

(1− 1

p1

)(1− 1

p2

)· · ·

(1− 1

pr

).

(b) Since 2 and 5 are the only primes dividing 1,000,000, we have

φ(1, 000, 000) = 1, 000, 000 ·(1− 1

2

)·(1− 1

5

)= 400, 000.

(We already computed φ(1, 000, 000) in class and this confirms what we found then.)

(7) (5 pts/part) Find all n satisfying the following equalities.(a) φ(n) = n

2 (Hint: Use the previous problem.)(b) φ(n) = φ(2n)(c) φ(n) = 12

Solution:(a) If φ(n) = n

2 , then, from the previous problem,

n

2= n

(1− 1

p1

)(1− 1

p2

)· · ·

(1− 1

pr

)or

1

2=

(1− 1

p1

)(1− 1

p2

)· · ·

(1− 1

pr

).

But this can only be true if the only prime factor of n is 2. Thus n must be of the form n = 2k for k ∈ N.

Page 3: 349 Crypto Homework 3 Solutions

(b) If n is odd, then gcd(2, n) = 1, so φ(2n) = φ(2)φ(n) = 1 · φ(n) = φ(n). If n is even, then it can bewritten as n = 2km where k ∈ N and m is odd. Then

φ(n) = φ(2km) = φ(2k)φ(m) = (2k − 2k−1)φ(m) = 2k−1φ(m).

On the other hand,

φ(2n) = φ(2 · 2km) = φ(2k+1m) = φ(2k+1)φ(m) = (2k+1 − 2k)φ(m) = 2kφ(m).

so φ(n) 6= φ(2n). Thus the equality we want holds if and only if n is odd.(c) First consider the following. Let n = pa. Using φ(pa) = pa(p− 1), it is not hard to see that

φ(n) = 12 ⇐⇒ n = 13,

φ(n) = 6 ⇐⇒ n = 7 or n = 9,

φ(n) = 2 ⇐⇒ n = 3 or n = 4,

φ(n) = 1 ⇐⇒ n = 2,

φ(n) = 3 has no solution.

Then if n = paqb and φ(n) = φ(paqb) = φ(pa)φ(qb) = 12, the possibilities are

φ(pa) = 6 and φ(qb) = 2 =⇒ n = 7 · 3 = 21 or n = 7 · 4 = 28 or n = 9 · 4 = 36,

φ(pa) = 12 and φ(qb) = 1 =⇒ n = 13 · 2 = 26.

If n = paqbrc and φ(n) = φ(paqbrc) = φ(pa)φ(qb)φ(rc) = 12, then the only possibility is given by

φ(pa) = 1, φ(qb) = 2, and φ(qb) = 6 =⇒ n = 2 · 3 · 7 = 42.

Since we cannot obtain 12 as a product of 4 distinct integers, these are the only possibilities. The completelist is thus

n = 13, 21, 26, 28, 36, 42.

(8) (4 pts/part) For each of the following, either prove the statement if it is true or provide a counterexample if itis false.(a) For all positive integers m and n, if gcd(m,n) = 1, then gcd(φ(m), φ(n)) = 1.(b) For all integers n ≥ 2, if n is composite, then gcd(n, φ(n)) > 1.(c) For all positive integers m and n, if m and n have the same prime divisors, then nφ(m) = mφ(n).

Solution:(a) This is false. Take m = 3 and n = 4. Then gcd(3, 4) = 1 but gcd(φ(m), φ(n)) = gcd(2, 2) = 2.(b) This is false. Take n = 15. Then n is composite and gcd(n, φ(n)) = gcd(15, 8) = 1.(c) This is true. If m and n have the same prime divisors, then, from an earlier problem,

φ(m)

m=

(1− 1

p1

)(1− 1

p2

)· · ·

(1− 1

pr

)=φ(n)

n,

which is exactly what we want.

(9) (5 pts) Find the smallest number which leaves a remainder of 3 when divided by 7 and leaves a remainder of 12when divided by 17. (You might use this problem as an opportunity to look up and learn the Linear CongruenceTheorem. Otherwise, mimic the way we solved a problem of this sort in class.)

Solution: This problem is asking for a solution to the system of congruences

x ≡ 3 (mod 7)

x ≡ 12 (mod 17).

Since 7 and 17 are relatively prime, Chinese Remainder Theorem says that this system has a solution (and thereis only one solution x with 0 ≤ x ≤ 7 · 17). From the first equation we have that x = 7y + 3 for some y ∈ Z.

Page 4: 349 Crypto Homework 3 Solutions

Plugging this into the second equation gives 7y+3 ≡ 12 (mod 17) or 7y ≡ 9 (mod 17). By Linear CongruenceTheorem or inspection, the solution is easily found to be y = 11. Thus x = 7 · 11 + 3 = 80 is a solution to theoriginal system.