Skip to main content
3 of 3
edited title
user64494
  • 3.5k
  • 14
  • 22

How to find modulo inverse if two number are not relatively prime for Hill cipher?

While practicing for Hill Cipher I choose a random Key matrix of $ 2*2 $ given as follows : $ K = \begin{bmatrix}3&2\\1&0\\\end{bmatrix} $

Say the Text to Encrypt is ATTACK By using the Following Equation $ C=K * P \mod 26 $ I got the encrypted Text as MAFTAC, where

$C$ is Cipher Text Matrix

$K$ is Key Matrix

$P$ is Plain Text Matrix

Now while decrypting the Cipher text using equation $ P= K ^{-1} * C \mod 26 $.

I need to find $ K^{-1} = |K|^{-1} Adj A $ But The Multiplicative Inverse $ |K|^{-1}$ exist only if $ 26 $ and $|K|$ are relatively Prime. But In this case $|K|=-2= 24 \mod {26}$.

But 24 and 26 are not relatively Prime. Does That Mean The following Key Can't be used To Encrypt The Text?

Gaurav
  • 111
  • 3