Suppose $M_1$ and $M_2$ are linear transformations which operate on blocks of two letters, as represented by two integers chosen in the usual way (A=0, B=1, ..., Z=25), and treated as a vector. It is known that $M_1(\unicode{x201C}\textrm{BA"})=\unicode{x201C}\textrm{TR"}$, $M_1(\unicode{x201C}\textrm{AB"})=\unicode{x201C}\textrm{IL"}$, $M_2(\unicode{x201C}\textrm{BA"})=\unicode{x201C}\textrm{BI"}$, and $M_2(\unicode{x201C}\textrm{AB"})=\unicode{x201C}\textrm{LL"}$.
Find the matrix forms for both $M_1$ and $M_2$
In a similar way, noting that $B=1$, $I=8$, and $L=11$, we have
$$M_2= \begin{bmatrix} 1 & 11\\ 8 & 11 \end{bmatrix}$$Use the matrix form of $M_2 \pmod{26}$ to encrypt the message "NUMBERTHEORYROCKSX"
Now, reducing this vector$\pmod{26}$, so that we can interpret it as a pair of letters, we have
$$\begin{pmatrix}233\\324\end{pmatrix} \equiv \begin{pmatrix}25\\12\end{pmatrix} \pmod{26}$$This in turn yields the encrypted block of letters "ZM".
Doing this for each block of two letters in our message, and then putting the encrypted blocks together in the same order, yields the ciphertext: "ZMXDJLSVCEVKPEIWLH"
Find the matrix form for the composition $M_1$ and $M_2$, $\pmod{26}$
Use the composition found in (d) to encrypt the message "NUMBERTHEORYROCKSX". Compare your answer with the answer to part (c).
Note, this yields the same encrypted block of two letters, "ZL", arrived at by first encrypting "NU" by $M_2$ and then by $M_1$. The rest of the blocks of letters behave in a similar manner, when the composition is applied to them. So our final encrypted message is the same as before: "ZLTIZOQRSALZFNQOFE"
Find the matrix form for the inverse$\pmod{26}$ of the composition found in (d), and show that when it is applied to the answer to (c), the original message "NUMBERTHEORYROCKSX" is revealed. Does encrypting a message twice with this type of encryption make things more difficult for the person trying to break the code?
we will need to first find the multiplicative inverse of 21$\pmod{26}$. Of course, if $x$ is the multiplicative inverse of 21$\pmod{26}$, then
$$21x \equiv 1 \pmod{26}$$Solving this linear congruence in the usual way, we find $x \equiv 5 \pmod{26}$. So, the matrix form of the inverse of the composition$\pmod{26}$ is given by:
$$\begin{bmatrix}5 & 11\\1 & 22\end{bmatrix}^{-1} = 5\begin{bmatrix}22 & -11\\-1 & 5\end{bmatrix} = \begin{bmatrix}110 & -55\\-5 & 25\end{bmatrix} \equiv \begin{bmatrix}6 & 23\\21 & 25\end{bmatrix}$$Now, applying this inverse matrix to the first two-letter block,"ZL", of our encrypted message, we arrive at
$$\begin{bmatrix}6 & 23\\21 & 25\end{bmatrix} \begin{pmatrix}25\\11\end{pmatrix} = \begin{pmatrix}403\\800\end{pmatrix} \equiv \begin{pmatrix}13\\20\end{pmatrix}$$which gets interpreted as the letters "NU". Note these are the first two letters of our original message. Applying the inverse matrix to the rest of the two-letter blocks yields similar results. Taken all together, our original message, "NUMBERTHEORYROCKSX" is revealed.