We assume that the message $$!IWGVIEX!ZRADRYD$$ has been encrypted using Hill Cipher and with the correspondence $A=0,...,Z=25,\ \_=26, ? =27,!=28$. We know that the last five letters of plaintext are sender's signature $MARIA$.
We want to find the deciphering matrix and read the message.
My attempt: At first we suppose that $m=2,\ P=C=\Bbb{Z}_{29}$ and $K=\mathrm{GL_2}(\Bbb{Z_{29}})$. By the hypothesis, we know that $MARIA \leftrightarrow ADRYD \iff (12,0,17,8,0)\leftrightarrow (0,3,17,24,17)$.
This implies that, if we assume that the key matrix is $A\in \mathrm{GL_2}(\Bbb{Z_{29}})$, the diciphering function is $$ E_A: (\Bbb{Z}_{29})^2 \longrightarrow (\Bbb{Z}_{29})^2,\\ (12,0)\mapsto (12,0)\cdot A =(0,3), \\ (17,8) \mapsto (17,8)\cdot A=(17,24) $$ so, $ \begin{pmatrix} 12 & 0 \\ 17 & 8 \end{pmatrix} \cdot A = \begin{pmatrix} 0 & 3 \\ 17 & 24 \end{pmatrix} $. We define $B:=\begin{pmatrix} 12 & 0 \\ 17 & 8 \end{pmatrix}$. Then, $\det B=9 \in U_{29} \iff B \in \mathrm{GL}(\Bbb{Z_{29}})$. Also, $\mathrm{adj} B= \begin{pmatrix} 8 & 0 \\ 12 & 12 \end{pmatrix} $ and $9^{-1}=13 \in U_{29}$. So, $$B^{-1}=13 \begin{pmatrix} 8 & 0 \\ 12 & 12 \end{pmatrix} = \begin{pmatrix} 9 & 0 \\ 11 & 11 \end{pmatrix}.$$ And from this, $$A = \begin{pmatrix} 9 & 0 \\ 11 & 11 \end{pmatrix} \cdot \begin{pmatrix} 0 & 3 \\ 17 & 24 \end{pmatrix} = \begin{pmatrix} 0 & 27 \\ 13 & 7 \end{pmatrix} \in \mathrm{GL}(\Bbb{Z_{29}}). $$
But if we use this matrix as a key and encipher the word $MARIA$, we will not take the word $ADRYD$ that we expect, so something is wrong. Is this method correct? Do I miss something?
Thank you.