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

  • Thread starter Thread starter DODGEVIPER13
  • Start date Start date
  • Tags Tags
    Inverse Modulus
Click For Summary
To find the inverse of the matrix A modulo 26, the determinant was calculated as -121, which is equivalent to 9 modulo 26. The Euclidean algorithm was applied to find the multiplicative inverse of 9 modulo 26, resulting in 3, as 9 multiplied by 3 equals 1 modulo 26. The adjoint matrix method was discussed, emphasizing that the inverse can be expressed as a multiple of the adjoint matrix. The final calculations confirmed that the inverse of A is correctly computed, leading to a successful demonstration of the matrix multiplication yielding the identity matrix modulo 26.
  • #31
A=9 b=2 c=1 d =15
 
Physics news on Phys.org
  • #32
<br /> \begin{pmatrix}<br /> 9 &amp; 2\\<br /> 1 &amp; 15\\<br /> \end{pmatrix}<br />
 
  • #33
Sweet man you are the best, so if I see this on the test I should follow the instructions you gave?
 
  • #34
Excellent!
Now demonstrate that the answer is correct:
<br /> \begin{pmatrix}<br /> 9 &amp; 2\\<br /> 1 &amp; 15\\<br /> \end{pmatrix}<br /> \begin{pmatrix}<br /> 5 &amp; 8\\<br /> 17 &amp; 3\\<br /> \end{pmatrix} = ?<br />
Remember this: When you do the adds and multiplies you can start by ignoring the modulo 26 arithmetic. But before you finish, bring everything back to 0 to 25.

For example, if you work it out and get this:
<br /> \begin{pmatrix}<br /> 1303 &amp; 2604\\<br /> 3905 &amp; 5206\\<br /> \end{pmatrix}<br />
Take the next step to bring it to modulo 26:
<br /> \begin{pmatrix}<br /> 1303 &amp; 2604\\<br /> 3905 &amp; 5206\\<br /> \end{pmatrix} = <br /> \begin{pmatrix}<br /> 3 &amp; 4\\<br /> 5 &amp; 6\\<br /> \end{pmatrix}<br />
 
  • #35
DODGEVIPER13 said:
Sweet man you are the best, so if I see this on the test I should follow the instructions you gave?
Once you demonstrate that your answer is correct (which it is), you will have achieved minimum rank at modulo 26 wizardry!
 
  • #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.
 
  • #37
<br /> \begin{pmatrix}<br /> 1303 &amp; 2604\\<br /> 3905 &amp; 5206\\ mod 26<br /> \end{pmatrix}<br />

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:
<br /> \begin{pmatrix}<br /> 3 &amp; 4\\<br /> 5 &amp; 6\\ mod 26<br /> \end{pmatrix}<br />
 
  • #38
Oh I guess I should have set the matrix

<br /> \begin{pmatrix}<br /> 1303 &amp; 2604\\<br /> 3905 &amp; 5206\\ mod 26<br /> \end{pmatrix}<br />

equal to the identity matrix:

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

<br /> \begin{pmatrix}<br /> 79 &amp; 78\\<br /> 260 &amp; 53\\<br /> \end{pmatrix}<br />
 
  • #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):
<br /> \begin{pmatrix}<br /> 4 (E) &amp; 7 (H)\\<br /> 16 (Q) &amp; 2 (C)\\<br /> \end{pmatrix}<br /> \begin{pmatrix}<br /> 5 &amp; 8\\<br /> 17 &amp; 3\\<br /> \end{pmatrix} = <br /> \begin{pmatrix}<br /> 9 (J) &amp; 1 (B)\\<br /> 10 (K) &amp; 4 (E)\\<br /> \end{pmatrix}<br />

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"
<br /> \begin{pmatrix}<br /> 4 (E) &amp; 13 (N)\\<br /> 2 (C) &amp; 17 (R)\\<br /> 24 (Y) &amp; 15 (P)\\<br /> 19 (T) &amp; 8 (I)\\<br /> 14 (O) &amp;13 (N)\\<br /> \end{pmatrix}<br /> \begin{pmatrix}<br /> 5 &amp; 8\\<br /> 17 &amp; 3\\<br /> \end{pmatrix} = <br /> \begin{pmatrix}<br /> 7 (H) &amp; 19 (T)\\<br /> 13 (N) &amp; 15 (P)\\<br /> 11 (L) &amp; 3 (D)\\<br /> 23 (X) &amp; 20 (U)\\<br /> 5 (F) &amp; 21 (V)\\<br /> \end{pmatrix}<br />
Cipher text is: "htnpldxufv"
<br /> \begin{pmatrix}<br /> 7 (H) &amp; 19 (T)\\<br /> 13 (N) &amp; 15 (P)\\<br /> 11 (L) &amp; 3 (D)\\<br /> 23 (X) &amp; 20 (U)\\<br /> 5 (F) &amp; 21 (V)\\<br /> \end{pmatrix}<br /> \begin{pmatrix}<br /> 9 &amp; 2\\<br /> 1 &amp; 15\\<br /> \end{pmatrix} = <br /> \begin{pmatrix}<br /> 4 (E) &amp; 13 (N)\\<br /> 2 (C) &amp; 17 (R)\\<br /> 24 (Y) &amp; 15 (P)\\<br /> 19 (T) &amp; 8 (I)\\<br /> 14 (O) &amp;13 (N)\\<br /> \end{pmatrix}<br />
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
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
14K
Replies
7
Views
2K
Replies
7
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 32 ·
2
Replies
32
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
4
Views
3K