Find 160 mod 9, the remainder r with 0 ≤ r < 9.
Number theory & modular arithmetic worksheet with answers
1.Easy
a = 160n = 9
160 mod 9 =
2.Easy
Use Euclid’s algorithm to find gcd(385, 273).
a = 385b = 273
gcd(385, 273) =
3.Medium
Find the inverse of 35 modulo 83: the number x with 0 < x < 83 and 35·x ≡ 1 (mod 83).
a = 35n = 83
35−1 mod 83 =
4.Medium
Find the inverse of 29 modulo 61: the number x with 0 < x < 61 and 29·x ≡ 1 (mod 61).
a = 29n = 61
29−1 mod 61 =
5.Hard
Encrypt the message m = 223 with the RSA public key (n, e) = (247, 17). Find the ciphertext c.
n = 247e = 17m = 223
c =
6.Hard
An RSA key uses the primes p = 11 and q = 13 and the public exponent e = 23. Find the private exponent d (0 < d < φ(n)).
p = 11q = 13e = 23
d =
Answer key
- 1. 160 mod 9 = 7
- 2. gcd(385, 273) = 7
- 3. 35−1 mod 83 = 19
- 4. 29−1 mod 61 = 40
- 5. c = 110
- 6. d = 47
Full step-by-step solutions: practise this topic on examproblems.com.