1

I'm trying to learn how to do 2x2 hill ciphers, but I'm stuck. Through Euclidean' s algorithm I got 0=4-2*2=4-2(22-5*4) down to -13*22+11*26. The problem is when I multiply 13 by my key [1/2 3/2], it simplifies to [13/0 13/0] and none of my plaintext is what it should be. I saw somewhere that you can only take the inverse if it's a coprime but then what am I supposed to do?

Thank you to everyone who responded, sorry I'm new to this website so I did a few things wrong. I researched more and I think a better way to ask my question is what do I do when decrypting a 2x2 hill cipher and the determinant is a number that you can't inverse mod 26.

  • 1
    Why is your key a vector? It should be a $2 \times 2$ matrix. – Randall Nov 04 '21 at 02:17
  • 2
    Welcome to Mathematics Stack Exchange. Yes, $22$ is not invertible mod $26$, because $\gcd(22,26)=2\gt1$. Your tag is inappropriate – J. W. Tanner Nov 04 '21 at 02:18
  • 1
    Also, what are you trying to do, encrypt a message? Decrypt? If decrypting, you should provide your key matrix and ciphervector. Yes, you need to invert your key matrix, so you'll need the determinant, etc..... – Randall Nov 04 '21 at 02:18
  • 3
    The math in your question does not display the way you intended. Try MathJax instead: https://math.stackexchange.com/help/notation – David K Nov 04 '21 at 02:25
  • I understand the how the equation works, but how do I know when to use it, and what do I do if I can't use it. – John Cantwell Nov 05 '21 at 00:49

0 Answers0