I have an encrypted message (26 letter English) that was encrypted by an affine cipher. I know the first two letters of the plaintext are "th" which map to "AE" in the ciphertext. When I try to create a system of equations to try and get an encryption key, I hit a problem.
t=19 --> A=0 && h=7 --> E=4
So I create the system of equations
- 19a + b = 0
- 7a + b = 4
Subtracting I get
- 12a = -4
Now I can't invert 12 in Mod 26 so I have no idea where to go from here.. This was how I was taught to solve it in class.
$$12a = -4 + 26k$$
$$ 6a = -2 + 13k$$
$$6a \equiv -2 \pmod {13}$$
$$12a \equiv -a \equiv -4 \pmod {13}$$
$$a \equiv 4 \pmod {13}$$
Hence Case 1: $a \equiv 4 \pmod {26}$ or Case 2: $a \equiv 17 \pmod {26}$.
Now you can explore the corresponding value for $b$ for each case.