A Hill Cipher over the above $27$-symbol alphabet: $A=0$, $B=1,\ldots,Z=25,$ Space$=26$, was used to produce the ciphertext:


Please decipher the text.

  • 1
    $\begingroup$ The comment above $\uparrow$ is not an advice, but the content of the text. $\ddot\smile$ $\endgroup$ – user228113 Mar 8 '18 at 18:33
  • $\begingroup$ I'm stuck on how to obtain the deciphering key i know it should be a 2x2 matrix $\endgroup$ – Pkr96 Mar 8 '18 at 18:35

Step 1 is to convert the text to numbers in $\mathbb{Z}_{27}$. Call the result $(c_0, c_1, c_2, c_3, \ldots)$

Call the decryption matrix (which you need)

$$D = \begin{bmatrix}x &y \\ u & v\ \end{bmatrix}$$

for definitess. For every possibility of $(x,y) \in \mathbb{Z}_{27}^2$, compute the supposed partial plain text (we get the even indexed plain text, because we only do one row at the time) $P(x,y) = (p_0, p_2 ,p_4, \ldots)$ where $p_{2i} = x\cdot c_{2i} + y \cdot c_{2i+1} \bmod 27$. Assign a point score $+2$ or more to spaces and 'e's that occur in $P(x,y)$, and minus points to q's and x's etc. Or do a $\chi^2$-matching score if you prefer. Probably one $(x,y)$ row will jump out, and be correct.

Then do the same for $(u,v)$ and the odd-places plaintext.

Alternatively, if you know the text is English and not to strange, you can for each position $i$ supose that $c_{i} c_{i+1} c_{i+2} c_{i+3}$ corresponds to $(19, 7, 4, 26)$ (or "the "), which gives 4 assumed equations in the 4 unknowns $(x,y,u,v)$, and which you can solve modulo $27$, and if solvable test it on another part of the text. If it fails try another position. Etc.

Both solutions will involve some programming of course, unless you're very patient.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.