Cryptography and Network Security
Assignment 2 Solutions
1) Euler's Totient Function phi(N):
N = 17 -> phi(17) = 16 (since 17 is prime)
N = 42 -> phi(42) = 42 × (1 - 1/2) × (1 - 1/3) × (1 - 1/7) = 12
N = 25 -> phi(25) = 25 × (1 - 1/5) = 20
2)
a) Additive inverse of 27 mod 100 = 100 - 27 = 73
Multiplicative inverse: 27 * x === 1 mod 100 -> x = 63
b) phi(101) = 100, phi(102) = 34, phi(500) = 200
3) Euler's theorem: a^phi(n) === 1 mod n -> a^-1 === a^(phi(n) - 1) mod n
Z*_9: phi(9) = 6
Inverses of 1-8 (mod 9):
1 -> 1, 2 -> 5, 4 -> 7, 5 -> 2, 7 -> 4, 8 -> 8
4)
a) 6^-1 mod 7 = 6
b) 7^-1 mod 15 = 13
c) 19^-1 mod 101 = 64
d) 97^-1 mod 100 = 97
5)
a) x === 4100 mod 7 -> x = 2
b) 9x === 13 mod 17 -> x = 3
c) 5x === 13 mod 17 -> x = 11
d) 7x === 11 mod 13 -> x = 2
6) GF(2^4), irreducible f(x) = x^4 + x + 1:
a) x^-1 and x^-3 (using polynomial inversion)
b) x^2 / (x^3 + x^2 + 1)
c) (x^3 + x^2 + x) / (x^2 + x + 1)
7)
a) GCD(726, 1144) = 22
b) GCD(2184, 16170) = 6
c) GCD(113, 13) = 1
8) Extended Euclidean:
GCD(654,123) = 3 -> u = -7, v = 37 (654*(-7) + 123*37 = 3)
9)
a) 13^-1 mod 31 = 12
b) 111^-1 mod 4111 = 3535
10)
a) y^2 === 3 mod 143 -> y = 25, 118
b) y^2 === 421 mod 693 -> y = 127, 566
11) CRT:
x === 3 mod 5
x === 1 mod 7
x === 6 mod 8
Solution: x === 103 mod 280