## 希爾密碼

I$\sqcup$NEED$\sqcup$HELP.

I$\sqcup$N   EED   $\sqcup$HE   LP.

$\displaystyle \left[\!\!\begin{array}{r} 8\\ 28\\ 13 \end{array}\!\!\right],~\left[\!\!\begin{array}{c} 4\\ 4\\ 3 \end{array}\!\!\right],~\left[\!\!\begin{array}{r} 28\\ 7\\ 4 \end{array}\!\!\right],~\left[\!\!\begin{array}{c} 11\\ 15\\ 26 \end{array}\!\!\right]$

$\displaystyle A=\left[\!\!\begin{array}{crr} 4&9&-2\\ 3&5&7\\ 1&-6&11 \end{array}\!\!\right]$

\displaystyle\begin{aligned} \left[\!\!\begin{array}{crr} 4&9&-2\\ 3&5&7\\ 1&-6&11 \end{array}\!\!\right]\left[\!\!\begin{array}{rcrc} 8&4&28&11\\ 28&4&7&15\\ 13&3&4&26 \end{array}\!\!\right]&=\left[\!\!\begin{array}{rcrr} 258&46&167&127\\ 255&53&147&290\\ -17&13&30&27 \end{array}\!\!\right]\\ &\equiv\left[\!\!\begin{array}{ccrr} 26&17&22&11\\ 23&24&2&0\\ 12&13&1&27 \end{array}\!\!\right]\pmod{29}.\end{aligned}

. XM   RYN   WCB   LA?

$\displaystyle \mathbb{F}_p=\mathbb{Z}/p\mathbb{Z}=\{0,1,2,\ldots,p-1\}$

\displaystyle\begin{aligned} A^{-1}&=19\left[\!\!\begin{array}{rrr} \left|\!\!\begin{array}{rr} 5&7\\ -6&11 \end{array}\!\!\right|&-\left|\!\!\begin{array}{rr} 9&-2\\ -6&11 \end{array}\!\!\right|&\left|\!\!\begin{array}{cr} 9&-2\\ 5&7 \end{array}\!\!\right|\\ &&\\ -\left|\!\!\begin{array}{cr} 3&7\\ 1&11 \end{array}\!\!\right|&\left|\!\!\begin{array}{cr} 4&-2\\ 1&11 \end{array}\!\!\right|&-\left|\!\!\begin{array}{cr} 4&-2\\ 3&7 \end{array}\!\!\right|\\ &&\\ \left|\!\!\begin{array}{cr} 3&5\\ 1&-6 \end{array}\!\!\right|&-\left|\!\!\begin{array}{cr} 4&9\\ 1&-6 \end{array}\!\!\right|&\left|\!\!\begin{array}{cc} 4&9\\ 3&5 \end{array}\!\!\right| \end{array}\!\!\right]=19\left[\!\!\begin{array}{rrr} 97&-87&73\\ -26&46&-34\\ -23&33&-7 \end{array}\!\!\right]\\ &=\left[\!\!\begin{array}{rrr} 1843&-1653&1387\\ -494&874&-646\\ -437&627&-133 \end{array}\!\!\right]\equiv\left[\!\!\begin{array}{crc} 16&0&24\\ 28&4&21\\ 27&18&12 \end{array}\!\!\right]\pmod{29}.\end{aligned}

\displaystyle\begin{aligned} \left[\!\!\begin{array}{crc} 16&0&24\\ 28&4&21\\ 27&18&12 \end{array}\!\!\right]\left[\!\!\begin{array}{ccrr} 26&17&22&11\\ 23&24&2&0\\ 12&13&1&27 \end{array}\!\!\right]&=\left[\!\!\begin{array}{rrcc} 704& 584& 376& 824\\ 1072& 845& 645& 875\\ 1260& 1047& 642& 621 \end{array}\!\!\right]\\ &=\left[\!\!\begin{array}{rcrc} 8&4&28&11\\ 28&4&7&15\\ 13&3&4&26 \end{array}\!\!\right]\pmod{29} .\end{aligned}

$\displaystyle P=\begin{bmatrix} 15&19&14\\ 14&14&15\\ 19&15&19 \end{bmatrix},~~C=\left[\!\!\begin{array}{rcr} 3&27&8\\ 16&0&18\\ 24&13&17 \end{array}\!\!\right]$

$\displaystyle P^{-1}=\left[\!\!\begin{array}{crr} 20&19&13\\ 22&22&0\\ 13&14&13 \end{array}\!\!\right]$

$\displaystyle A=CP^{-1}=\left[\!\!\begin{array}{ccc} 758& 763& 143\\ 554& 556& 442\\ 987& 980& 533\\ \end{array}\!\!\right]\equiv\left[\!\!\begin{array}{crr} 4& 9& 27\\ 3& 5& 7\\ 1& 23& 11\\ \end{array}\!\!\right]\pmod{29}$

$\displaystyle \left[\!\!\begin{array}{crr} 4&9&-2\\ 3&5&7\\ 1&-6&11 \end{array}\!\!\right]\equiv\left[\!\!\begin{array}{crr} 4& 9& 27\\ 3& 5& 7\\ 1& 23& 11\\ \end{array}\!\!\right]\pmod{29}$

[1] 維基百科：替換式密碼
[2] 維基百科：進階加密標準