
70 Cryptography with Open-Source Software
has a determinant (mod 26) of 17, which is relatively prime to 26. And so its
inverse exists:
P
−1
=
2 23 9
17 14 24
12 13 20
.
Then the corresponding matrix C will consist of columns 3, 4 and 5 of the
ciphertext:
C =
18 1 7
5 16 1
20 5 10
.
Finally, the enciphering matrix M can b e obtained:
M = CP
−1
=
137 519 326
294 352 449
245 660 660
=
7 25 14
8 14 7
11 10 6
(mod 26).
Inverting matrices modulo 26
Given a square matrix, such as the matrix A used above, how can its
inverse modulo 26 be c omputed? Recall from basic linear algebra that the
inverse of a matrix A can be defined as
A
−1
=
1
det(A)
adj(A)
where adj(A) is the ...