$K,P,C$ are $ 2*2$ matrices such that $(KP)$ $ (mod 26) $ $ = $ $ C $
For example we have $ P $ $ = $ $\begin{bmatrix} 8 & 17 \\ 13 & 4 \\ \end{bmatrix} $ and $ C $ $ = $ $\begin{bmatrix} 7 & 22 \\ 20 & 21 \\ \end{bmatrix} $ . I want to find $ K $ .
The approach I am using is first I find $ P^{-1} $ .
$E = P^{-1} $ $ mod (26) $ $ = $ $\begin{bmatrix} 4 & 13 \\ 9 & 8 \\ \end{bmatrix} $
$R = det(P) $ $ mod (26) $ $ = 19 $ . $Modular$ $inverse$ of $R$ w.r.t to $26$ is $11$
So $ K = (R*(CE))mod(26) $
$ K $ $ = $ $\begin{bmatrix} 16 & 25 \\ 21 & 2 \\ \end{bmatrix} $ but the answer is $ K $ $ = $ $\begin{bmatrix} 22 & 3 \\9 & 6 \\ \end{bmatrix} $.
What is my error ? What is the correct way to find $K$ ?
Well. Like you said $\det(P)^{-1}\equiv 11\text{ mod } 26$ which means \begin{align} P^{-1} \equiv 11 \begin{bmatrix} 4 & -17\\ -13 & 8 \end{bmatrix} \equiv \begin{bmatrix} 18 & 21\\ 13 & 10 \end{bmatrix} \text{ mod } 26. \end{align}
Finally, we see that \begin{align} CP^{-1} = \begin{bmatrix} 7 & 22\\ 20 & 21 \end{bmatrix} \begin{bmatrix} 18 & 21\\ 13 & 10 \end{bmatrix} \end{align} which is the desired answer.