How Do You Find the Inverse of a Matrix Modulo 26?

In summary, the conversation is about finding the inverse of a given matrix A mod 26. The person is confused about the Euclidean algorithm and how to proceed with finding the inverse. Another person suggests using modulo 26 arithmetic to solve for the inverse and provides an example. The conversation ends with the person asking for clarification and further explanation.
  • #36
DODGEVIPER13 said:
Sweet man you are the best, so if I see this on the test I should follow the instructions you gave?
To answer your question directly, yes. I imagine it's an open book exam, your arithmetic has been solid, and I think you're ok with the steps that need to be followed. So you should be set.
 
Physics news on Phys.org
  • #37
[tex]
\begin{pmatrix}
1303 & 2604\\
3905 & 5206\\ mod 26
\end{pmatrix}
[/tex]

1303 mod 26 = 1303/26 = 50.11538-50= .11538*26 = 3

2604 mod 26 = 2604/26 = 100.15384-100 = .15384*26 = 4

3905 mod 26 = 3905/26 = 150.192307-150 = .192307*26 = 5

5206 mod 26 = 5206/26 = 200.2307-200 = .2307*26 = 6

The result is:
[tex]
\begin{pmatrix}
3 & 4\\
5 & 6\\ mod 26
\end{pmatrix}
[/tex]
 
  • #38
Oh I guess I should have set the matrix

[tex]
\begin{pmatrix}
1303 & 2604\\
3905 & 5206\\ mod 26
\end{pmatrix}
[/tex]

equal to the identity matrix:

[tex]
\begin{pmatrix}
1 & 0\\
0 & 1\\ mod 26
\end{pmatrix}
[/tex]
 
  • #39
You need to do the matrix multiplication. Multiply what you calculated as the matrix inverse with the original matrix:
[tex]
\begin{pmatrix}
9 & 2\\
1 & 15\\
\end{pmatrix}
\begin{pmatrix}
5 & 8\\
17 & 3\\
\end{pmatrix} = ?
[/tex]
Do you know how to do a matrix multiply?
 
  • #40
Yes sir sorry for the late reply:

[tex]
\begin{pmatrix}
79 & 78\\
260 & 53\\
\end{pmatrix}
[/tex]
 
  • #41
ahhh now I take the mod 26 of each number and compare to the unit matrix correct?
 
  • #42
Hey I have a question what does finding the inverse actually mean in regards to cryptography? More specifically the Hill cipher. I have done another problem and checked it but I don't actually know what I am finding?
 
  • #43
DODGEVIPER13 said:
ahhh now I take the mod 26 of each number and compare to the unit matrix correct?
That is 100% correct. And as you can probably see - it works out to the unit matrix. Congratulations!
 
  • #44
DODGEVIPER13 said:
Hey I have a question what does finding the inverse actually mean in regards to cryptography? More specifically the Hill cipher. I have done another problem and checked it but I don't actually know what I am finding?
Knowing how to invert a matrix is critical to the Hill cipher - otherwise you won't be able to decode the message.
 
  • #45
So let's says the message was originally this: EHQC what would the new matrix give IBAO?
 
  • #46
This is assuming the numbers correspond to the letters of the alphabet
 
  • #47
DODGEVIPER13 said:
So let's says the message was originally this: EHQC what would the new matrix give IBAO?
By my calculations (using Excel spread sheet):
[tex]
\begin{pmatrix}
4 (E) & 7 (H)\\
16 (Q) & 2 (C)\\
\end{pmatrix}
\begin{pmatrix}
5 & 8\\
17 & 3\\
\end{pmatrix} =
\begin{pmatrix}
9 (J) & 1 (B)\\
10 (K) & 4 (E)\\
\end{pmatrix}
[/tex]

edit-----
I just noticed where you got EHQC. I was assigning 0, 1, 2, ... 25 to A, B, C, ... Z. You're assigning 1, 2, 3, ... 0.
Your EHQC is the original matrix and your IBAO is the inverse.

I thought you were trying to encode "EHQC" using the matrix as a cypher.

IMRR MIUTBZFN
 
Last edited:
  • #48
Here's an example of how you would use it to code and decode:

Plain text: "encryption"
[tex]
\begin{pmatrix}
4 (E) & 13 (N)\\
2 (C) & 17 (R)\\
24 (Y) & 15 (P)\\
19 (T) & 8 (I)\\
14 (O) &13 (N)\\
\end{pmatrix}
\begin{pmatrix}
5 & 8\\
17 & 3\\
\end{pmatrix} =
\begin{pmatrix}
7 (H) & 19 (T)\\
13 (N) & 15 (P)\\
11 (L) & 3 (D)\\
23 (X) & 20 (U)\\
5 (F) & 21 (V)\\
\end{pmatrix}
[/tex]
Cipher text is: "htnpldxufv"
[tex]
\begin{pmatrix}
7 (H) & 19 (T)\\
13 (N) & 15 (P)\\
11 (L) & 3 (D)\\
23 (X) & 20 (U)\\
5 (F) & 21 (V)\\
\end{pmatrix}
\begin{pmatrix}
9 & 2\\
1 & 15\\
\end{pmatrix} =
\begin{pmatrix}
4 (E) & 13 (N)\\
2 (C) & 17 (R)\\
24 (Y) & 15 (P)\\
19 (T) & 8 (I)\\
14 (O) &13 (N)\\
\end{pmatrix}
[/tex]
Plain text: "encryption"

If you want to change the encryption code, you generate a new matrix and its inverse.
 
  • #49
Ok thanks this clears it up
 
Back
Top