I'm following along with my book. Here is an example of a plaintext attack from it:
It is known that:
plaintext = 'friday'
ciphertext= 'pqcfku'
$m$ = 2
We will use this to form the following matrix equation:
$$ C = PK $$ $$\pmatrix{5 & 16 \\ 2 & 5} = \pmatrix{5 & 17 \\ 8 & 3} K $$
Where $K$ is the key matrix. Note that $K = P^{-1} C$. To find that product, we must first find $P^{-1}$.
Now this is where I don't understand the book. The book says:
$$P^{-1} = \pmatrix{9 & 1 \\ 2 & 15}$$
First I tried verifying this in Mathematica. The command Inverse[{{15, 17}, {8, 3}}, Modulus -> 26]
yields an error saying there is no such inverse... bizarre. I then found this online calculator to do it, and it returns the result:
$$P^{-1} = \pmatrix{13 & 5 \\ 10 & 23}$$
A quick check tells us that BOTH these matrices are correct inverses mod 26. But, only the inverse provided by the book works in correctly computing the key, and thereby being able to break the cipher.
So... how can I conduct a plaintext attack in this manner? There appear to be multiple inverses. How do I know which one is "right"? And if I must brute force, how can I find ALL possible inverses?
Inverse[{{15, 17}, {8, 3}}, Modulus -> 26]
should beInverse[{{5, 17}, {8, 3}}, Modulus -> 26]
$\endgroup$