0

I have a key

$$K=\begin{pmatrix} 2 & 1\\ 3 & 4 \end{pmatrix}$$

The $K$ is invertible, so we can find the chipertext from that key.

I want to encrypt "il" with Hill Chiper. We know il=(8,11). And what i got after encrypted it was (23,0) that is become "XA".

Then, i tried to decrypted it. First, i found the inverse matrix on $\mathbb z_{26}$ which is

$$K^{-1}=\begin{pmatrix} 6 & 21\\ 11 & 16 \end{pmatrix}$$

But i got (8,15) instead of (8,11).

Is my inverse matrix wrong or i encrypted it wrong?

Please help me, where is my mistake?

Thanks

Ethan Bolker
  • 95,224
  • 7
  • 108
  • 199
user516076
  • 2,200
  • Are you aware of the definition of an inverse matrix? Have you checked whether your matrix is in fact an inverse of $K$? – joriki Mar 14 '20 at 01:21
  • No, it's operated on modulo 26 – user516076 Mar 14 '20 at 01:56
  • Indeed, you mentioned that in the question. It's wrong nevertheless, as you could have easily seen yourself by computing $K^{-1}K$ and finding that it's not the identity. – joriki Mar 14 '20 at 07:27

1 Answers1

1

The determinant is $8-3=5$.

$5 \cdot 5 \equiv -1\pmod {26}$, hence $5^{-1} \equiv -5 \pmod{26}$.

$$K^{-1}=(-5)\begin{bmatrix} 4 & \color{red}{-}1 \\ \color{red}{-}3 & 2\end{bmatrix}=\begin{bmatrix} 6 & \color{red}5 \\ \color{red}{-11} & 16\end{bmatrix}$$

Siong Thye Goh
  • 149,520
  • 20
  • 88
  • 149
  • No. It must be positive – user516076 Mar 14 '20 at 01:56
  • 1
    just add $26$ and take modulo ? – Siong Thye Goh Mar 14 '20 at 01:56
  • One last question please. So, my previous answer is operatimg the inverse of matrix first until i get the result. And surely the entries are fractions arent they? Then, i take the modulo 26 in the last action. Why this gives me a different result? I'm assuming for example $$\frac2 3 \mod 26$$ is equivalent with $$3x=2\mod 26$$ – user516076 Mar 14 '20 at 02:19
  • hmm....I can't understand your question, is it possible that you can elaborate? It might be that you have just made a computational error? – Siong Thye Goh Mar 14 '20 at 02:35
  • Anyway, i just found the answer by myself. Thanks for your answer. It helps a lot – user516076 Mar 14 '20 at 02:45