Answer the question
In order to leave comments, you need to log in
How to calculate the inverse of a matrix such that it is integer and non-negative?
In general, according to the Hill cryptosystem, for decryption, you need to calculate the inverse key matrix, but not a simple one, but a golden integer and non-negative .
It turned out to find an integer, but negative. And it becomes negative due to the fact that we make a matrix of algebraic additions from the original.
Example:
|3 3| - initial matrix A
|2 5|
|5 2| - matrix of minors M
|3 3|
|5 -2| - matrix of algebraic additions M'
|-3 3|
|5 -3| - transposed matrix ( M' )^t
|-2 3|
m = 34 (alphabet)
det = 3*5 - 3*2 = 9
det^-1 (inverse determinant) such that: det * det^-1 mod m = 1
9 * 19 mod 34 = 1
det^-1 = 19
A^-1= det^-1 * ( M' )^t mod m
It turns out:
|27 -23|
| -4 23|
It works only on a part of bigrams, that is, every other time. It needs to be somehow converted to non-negative. Tell me how this can be done.
Answer the question
In order to leave comments, you need to log in
It was just necessary to add the negative numbers to the size of the alphabet:
|27 -23+34|
| -4+34 23|
It turns
out |27 11|
| 30 23|
Add the second row to the first, and then the first to the second, and you have a positive matrix.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question