2

How would you tackle the problem of finding the key (you don't know the length) to a Hill cipher when knowing only one 12-letter word of plaintext and its corresponding ciphertext?

CONVERSATION has been encoded as SQZHUSSUDYKP with standard alphabet (A=0, Z=25). The key, as I said, is unknown with unknown size.

I am not asking for a solution, but for tips and guidance. Any help will be much appreciated.

Patriot
  • 3,162
  • 3
  • 20
  • 66

1 Answers1

1

Assuming that $2\times2$ matrix is used, and the encryption starts from the first letter of the plaintext, the key can be found by just calculating the "encryption" with size of $4$ plain- and cryptotext block.

For example, for CONV $\rightarrow$ SQZH, it would go as follows:
$$\begin{pmatrix} 2 & 14 \\ 13 & 21 \end{pmatrix}\begin{pmatrix} a & b \\ c & d \end{pmatrix}= \begin{pmatrix} 18 & 16 \\ 25 & 7 \end{pmatrix}\pmod{26}$$

Then solving for $a,b,c,d$, the key $K$ is found. As here the plaintext matrix is invertible, one can compute

$$\begin{pmatrix} a & b \\ c & d \end{pmatrix}=\begin{pmatrix} 2 & 14 \\ 13 & 21 \end{pmatrix}^{-1} \begin{pmatrix} 18 & 16 \\ 25 & 7 \end{pmatrix}\pmod{26}$$

M.P
  • 225
  • 1
  • 8