How to find the enciphering matrix?

810 Views Asked by At

For this question I am not sure if I am doing it right. Here is what I have so far. Can anyone please help me out?

If the message UVZR.YH VOYYMNTOSIJXVV was received and it is known that the Hill 2-cipher was used to encipher it and it is also known that the message starts with the word DEAR, find the enciphering matrix.

The alphabet is the one used in cryptograhpy and hill 2-ciphers.

$A[4, 5] = [21, 22]$

$A[1, 18] = [26, 18]$

1

There are 1 best solutions below

13
On BEST ANSWER

Note that "DEAR" corresponds to the two vectors $\begin{bmatrix}4\\5\end{bmatrix}$ and $\begin{bmatrix}1\\18\end{bmatrix}$, if we use the alphabet "_ABCDEFGHIJKLMNOPQRSTUVWXYZ.," (underscore for space) where the alphabet length is $29$ (so we are working in $\mathbb{Z}_{29}$ with our linear algebra). The ciphertext starts with "UVZR" which corresponds to $\begin{bmatrix}21\\22\end{bmatrix}$ and $\begin{bmatrix}26\\18\end{bmatrix}$ under that same alphabet.

So if $E$ is the enciphering matrix we have the matrix equation

$$E\begin{bmatrix}4& 1\\ 5 & 18\ \end{bmatrix} = \begin{bmatrix}21 & 26\\22&18 \end{bmatrix}$$

So that $$E = \begin{bmatrix}21 & 26\\ 22&18 \end{bmatrix}{\begin{bmatrix}4& 1\\ 5 & 18\ \end{bmatrix}}^{-1}$$

That last matrix has determinant $4 \cdot 18 -5 = 9 \pmod{29}$, which has inverse $13$ modulo 29 (as $9 \times 13 = 117 = 4\times 29 + 1 \equiv 1$; apply the extended Euclidean algorithm to compute it), so that

$${\begin{bmatrix}4& 1\\ 5 & 18\ \end{bmatrix}}^{-1} = 13 \cdot \begin{bmatrix} 18 & -1\\-5 & 4\end{bmatrix}= \begin{bmatrix} 2 & 16\\22 & 23\end{bmatrix}$$

all modulo $29$ of course. Now find $E$ and then $D$, as its inverse.

I did and found a meaningful message.