![[hw2.pdf]]
# My Answers
1. Rings:
1. Additive Inverse:
1. $\mathbb{Z}_m = 6$ $\{(0,0), (1, 5), (2, 4), (3, 3), (4, 2), (5, 1)\}$
2. $\mathbb{Z}_m = 11$ $\{(0,0), (1, 10), (2, 9), (3, 8), (4, 7), (5, 6), (6, 5), (7, 4), (8, 3), (9, 2), (10, 1)\}$
2. Multiplicative Inverse:
1. $\mathbb{Z}_m = 6$ $\{0\}$
2. $\mathbb{Z}_m = 11$ $\{0,2,4,6,8,10,12,13,14,16,18,20,22,24\}$
3. For $\mathbb{Z}_7$ all elements $a \in \mathbb{Z}_{7}$ $gcd(a, 7) = 1$ whereas for $\mathbb{Z}_{26}$ only a few numbers meet the criteria of $gcd(a, 26) = 1$
4. For $\mathbb{Z}_7 = \{(1,1), (3, 9), (5, 21), (7, 15), (11, 19), (15, 7), (17, 23), (19, 11), (21, 5), (23, 17)\}$ $\newline$ For $\mathbb{Z}_{26} = \{(1, 1), (2, 4), (3, 5), (6, 6), (5, 3), (4, 2)\}$
2. $a = 5$ for $\mathbb{Z}_{11}$ $a^{-1} = 9$ $\newline$ // $a = 5$ for $\mathbb{Z}_{12}$ $a^{-1} = 5$ $\newline$// $a = 5$ for $\mathbb{Z}_{13}$ $a^{-1} = 8$
3.
| m | Relative Prime Number | $\phi(m)$ |
| --- | ----------------------------------------- | --------- |
| 4 | 1, 3 | 2 |
| 5 | 1, 2, 3, 4 | 4 |
| 9 | 1, 2, 4, 5, 7, 8 | 6 |
| 26 | 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25 | 12 |
4. For an affine cipher $e_k = (ax + b) \% m$ , $a \in \mathbb{Z}_m$ such that $gcd(a, m) = 1$ there is no restriction on $b$. Therefore $a \in \phi(m)$ thus: Key space = $m * \phi(m)$ = $26 * 12 = 312$
5. Decrypted message: FIRST THE SENTENCE AND THEN THE EVIDENCE SAID THE QUEEN
6.
# Answer Sheet
![[hw2solution.pdf]]