CN108536651B - Method and apparatus for generating reversible modulo m matrix - Google Patents

Method and apparatus for generating reversible modulo m matrix Download PDF

Info

Publication number
CN108536651B
CN108536651B CN201810353990.5A CN201810353990A CN108536651B CN 108536651 B CN108536651 B CN 108536651B CN 201810353990 A CN201810353990 A CN 201810353990A CN 108536651 B CN108536651 B CN 108536651B
Authority
CN
China
Prior art keywords
matrix
modulo
reversible
row
order
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810353990.5A
Other languages
Chinese (zh)
Other versions
CN108536651A (en
Inventor
王防修
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Polytechnic University
Original Assignee
Wuhan Polytechnic University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Polytechnic University filed Critical Wuhan Polytechnic University
Priority to CN201810353990.5A priority Critical patent/CN108536651B/en
Publication of CN108536651A publication Critical patent/CN108536651A/en
Application granted granted Critical
Publication of CN108536651B publication Critical patent/CN108536651B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization

Abstract

The invention discloses a method and a device for generating a reversible mode m matrix. The method is based on the mathematical principle of the Jordan elimination method and the modulus m matrix, can generate the reversible modulus m matrix of any order in the real number range based on the improvement of the traditional Jordan elimination method, ensures that each element on the diagonal line must be coprime with the modulus m after the matrix row of the modulus m matrix is converted into the diagonal matrix, and can rapidly obtain the reversible modulus m matrix of any order by the irreversible modulus m matrix otherwise, thereby greatly meeting the requirement of practical application.

Description

Method and apparatus for generating reversible modulo m matrix
Technical Field
The invention relates to the field of information security, in particular to a method and a device for generating a reversible modulus m matrix.
Background
The reversible mode m matrix is widely applied to various fields, such as abstract algebra, power grid optimization, artificial intelligence and the like. Meanwhile, the method plays an important role in the field of information security, such as a cryptography protocol, key management and identity authentication, and a reversible modulo m matrix is required. However, at present, only the inverse of the low-order modulo-m matrix can be calculated manually, and at present, the reversible modulo-m matrix is randomly generated by using a recursive determinant method, and the time consumed in the production process increases with the increase of the orders of the modulo-m matrix, that is, the modulo-m matrix with higher order takes longer time in the generation process.
The reversible mode m matrix is very wide in application, but the problem of how to obtain a high-order reversible mode m matrix is not solved at present, so that the application of the reversible mode m matrix is limited to a certain extent. Therefore, how to obtain a high-order reversible mode m matrix quickly and efficiently is a technical problem which needs to be solved urgently at present.
Disclosure of Invention
The invention mainly aims to provide a method and a device for generating a reversible mode m matrix, and aims to solve the problem of how to quickly and efficiently obtain a high-order reversible mode m matrix in the prior art.
To achieve the above object, the present invention provides a method of generating a reversible modulo m matrix, the method comprising the steps of:
randomly generating n2Integer a having a value between 0 and m-1ijWherein i is an integer between 1 and n, and j is an integer between 1 and n;
according to the generated n2An integer aijCreating an n-order modulo-m matrix construction matrix a ═ aij)n×nWherein n represents the order n of the modulo m matrix,
Figure BDA0001634784950000011
the ith row and the jth column matrix elements of the modulo-m matrix are represented, i represents a row of the modulo-m matrix and j represents a column of the modulo-m matrix.
Let A be A(0)And A is(0)Is described as
Figure BDA0001634784950000012
Then
Figure BDA0001634784950000013
From A(0)Column 1 of (2) selects the elements that are interdependent with modulo m.
Traversing each element of the modulo m matrix, and returning to the random generation n if the element which is prime to the modulo m is not traversed2Integer a having a value between 0 and m-1ijA step (2);
or
Setting the traversed target matrix element as
Figure BDA0001634784950000021
When i ≠ 1, the matrix A is divided(0)Is reciprocal to the row 1 element, so that a new one
Figure BDA0001634784950000022
Becoming a main element;
determining the primary element
Figure BDA0001634784950000023
Is inverse to
Figure BDA0001634784950000024
By using
Figure BDA0001634784950000025
Multiplication matrix A(0)First row divider
Figure BDA0001634784950000026
All elements other than A, and from matrix A(0)The other row of (1) eliminates the row 1 element to become
Figure BDA0001634784950000027
Perform the operation first
Figure BDA0001634784950000028
Then from matrix A(0)Is subtracted from the a of the 1 st line (i ≠ 1) from the i-th line (i ≠ 1)i1Double, instant order
Figure BDA0001634784950000029
And is
Figure BDA00016347849500000210
Performing k-th elimination on the matrix, wherein k is more than or equal to 2 and less than or equal to n; wherein, after the k-1 th elimination, the given matrix A is completed(k-2)Is processed into the following forms
Figure BDA00016347849500000211
Wherein, the k step of eliminating the matrix comprises the following steps: from
Figure BDA00016347849500000212
Finding elements that are prime to modulo m
Figure BDA00016347849500000213
If the element is prime to the modulus m
Figure BDA00016347849500000214
If not, returning to the random generation n2Integer a having a value between 0 and m-1ijA step (2);
or
When i ≠ k, the element positions of ith row and kth row of the matrix are reciprocal
Figure BDA00016347849500000215
Contrary element of
Figure BDA00016347849500000216
Multiplication by the other elements of the k column by the k column, i.e. the operation to be performed is
Figure BDA00016347849500000217
Subtracting the k-th line from the other lines
Figure BDA00016347849500000218
Multiplication, i.e. the operation to be performed is
Figure BDA00016347849500000219
After repeating the steps for n times, the current matrix is finally processed into a diagonal matrix, and when the elements on the diagonal are coprime to m, the matrix A is determined to be an n-order reversible mode m matrix.
Furthermore, to achieve the above object, the present invention also proposes an apparatus for generating a reversible modulo m matrix, the apparatus comprising: a memory, a processor and a program stored on the memory and executable on the processor for generating a reversible modulo-m matrix, the program for generating a reversible modulo-m matrix being configured to implement the steps of the method for generating a reversible modulo-m matrix as described above.
The invention fully utilizes the mathematical principles of the Jordan elimination method and the modulus m matrix, solves the generation problem of the reversible modulus m matrix from the realization of theory and algorithm, enables the improved algorithm to generate the reversible modulus m matrix of any order in the real number range by improving the Jordan elimination method, enables each element on the diagonal to be coprime with the modulus m by the improved algorithm of the Jordan elimination method, otherwise, the modulus m matrix is irreversible, further can rapidly obtain the reversible modulus m matrix of any order, and greatly meets the requirement of practical application.
Drawings
FIG. 1 is a schematic structural diagram of an apparatus for generating a reversible modulo m matrix for a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a simulation diagram of the random generation of a 10-order modulo 546 matrix by the current recursive determinant method according to an embodiment of the present invention;
FIG. 3 is a simulation of randomly generating a matrix of modulo 678 of 200 th order using modified Jordan elimination in one embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an apparatus for generating a reversible modulo m matrix in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the apparatus for generating a reversible modulo m matrix may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration of the apparatus for generating a reversible mode m matrix shown in fig. 1 does not constitute a limitation of the apparatus for generating a reversible mode m matrix and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a user interface module, a network communication module, and a program for generating a reversible modulo m matrix.
In the apparatus for generating a reversible modulo m matrix shown in fig. 1, the processor 1001 and the memory 1005 in the apparatus for generating a reversible modulo m matrix according to the present invention may be provided in the apparatus for generating a reversible modulo m matrix, which calls the program for generating a reversible modulo m matrix stored in the memory 1005 by the processor 1001.
The procedure for generating the reversible mode m matrix of the present embodiment is based on the following algorithm derivation including definition and properties of the mode m matrix, the existence theorem of the reversible mode m matrix, the principle of the inverse matrix algorithm for solving the reversible mode m matrix using the modified lambda law, and the description of the algorithm for rapidly generating the reversible mode m matrix using the modified approximate elimination method.
It is understood that the definition and properties of the modulo m matrix are:
definition 1 if an n-th order matrix A (a)ij) Is an integer, then a is called an n-order integer matrix.
Definition 2 if a is an integer and b is a positive integer, then a modulo b by b modulo a mod e {0,1, …, b-1 }.
Definition 3 if a is an integer and b is a positive integer, then the greatest common divisor of a and b]gcd(a,b)∈{0,1,…,b-1}。
Definition 4 if an n-th order integer matrix A (mod m) is an invertible matrix and its inverse A-1(mod m) is also an n-order integer matrix, and A is called an n-order reversible modulo m matrix.
The theorem is that m is a positive integer and a is an integer. If m is the reciprocal of a, i.e., gcd (a, m) ═ 1, then the congruence equation ax ═ 1(mod m) has a unique solution, i.e.
Figure BDA0001634784950000051
s.t.aa-1=a-1a=1(mod m)。
Defining an elementary row (column) transformation of a 5-modulo-m matrix refers to applying the following transformation to the matrix:
(1) two rows (columns) of the transform mode m matrix;
(2) multiplying each element of a row (column) of the modulo-m matrix by an integer that is prime to modulo-m;
(3) one row (column) of a matrix of modulo m is multiplied by an integer and added to the other row (column), i.e. each element of one row (column) is multiplied by the integer and added to the corresponding element of the other row (column).
Defining 6 pairs of n-order identity matrices EnThe matrix obtained by applying an elementary transformation is called elementary matrix.
Let A be an n-order modulo m matrix, PijIs composed of EnThe ith row of (1) and the jth exchange of the resulting matrix, Di(k) From EnIs multiplied by k (where gcd (k, m) is 1), Ti,j(k) Is composed of EnThe matrix obtained by multiplying the jth row by k and adding to the ith row has the following properties:
(1)Pija (mod m) denotes exchanging the ith row with the jth row of the matrix A (mod m);
(2)APij(mod m) denotes swapping the ith and jth columns of matrix A (mod m);
(3)Di(k) a (mod m) denotes multiplying the ith row element of matrix a (mod m) by k, where k satisfies gcd (k, m) ═ 1;
(4)ADi(k) (mod m) denotes multiplying the i-th column element of matrix a (mod m) by k, where k satisfies gcd (k, m) 1;
(5)Ti,j(k) a (mod m) denotes multiplying the j row element of matrix A (mod m) by k and adding to the i row;
(6)ATi,j(k) (mod m) denotes the addition of the j column element of matrix A (mod m) multiplied by k to the i column.
Ti,j(k) A (mod m) denotes multiplying the j row element of matrix A (mod m) by k and adding to the i row;
Ti,j(k) a (mod m) denotes multiplying the j row element of matrix A (mod m) by k and adding to the i row;
Ti,j(k) a (mod m) denotes multiplying the jth row element of matrix A (mod m) by k and adding to itOn row i;
Ti,j(k) a (mod m) denotes multiplying the j row element of matrix A (mod m) by k and adding to the i row;
Ti,j(k) a (mod m) denotes multiplying the j row element of matrix A (mod m) by k and adding to the i row;
Ti,j(k) a (mod m) denotes multiplying the j row element of matrix A (mod m) by k and adding to the i row;
Ti,j(k) a (mod m) denotes multiplying the j row element of matrix A (mod m) by k and adding to the i row;
Ti,j(k) a (mod m) denotes multiplying the j row element of matrix A (mod m) by k and adding to the i row;
Ti,j(k) a (mod m) denotes multiplying the j row element of matrix A (mod m) by k and adding to the i row;
as understood from definitions 5 and 6, Pij、Di(k) And Ti,j(k) Are all elementary matrices.
Properties 1Pij、Di(k) And Ti,j(k) Are all reversible elementary modulo m matrix matrices, an
Figure BDA0001634784950000061
Figure BDA0001634784950000062
(where kk)-1=1(mod m))、
Figure BDA0001634784950000063
And (3) proving that: pi | Pij|=-1,|Di(k)|=k≠0(gcd(k,m)=1)),|Ti,j(k)|=1
∴Pij、Di(k) And Ti,j(k) Are all reversible elementary modulus m matrix matrices.
Figure BDA0001634784950000066
Figure BDA0001634784950000064
Figure BDA0001634784950000065
Theorem 1 if the determinant | a | ═ k (mod m) of the n-order modulo-m matrix a, and gcd (k, m) ═ 1, a can be transformed through a series of elementary transformations into an identity matrix E of order + nn
Theorem 2 if the n-th order modulo m matrix A can be transformed into the identity matrix E through a series of elementary transformationsnThen gcd (| a |, m) ═ 1.
A sufficient requirement that the theorem 3 n-th order modulo-m matrix a is an invertible matrix is that gcd (| a |, m) ═ 1.
2. Existence theorem of reversible m-matrix
Theorem 4 if the determinant | a | ═ k (mod m) of the modulo-m matrix a of order n, and gcd (k, m) ═ 1, a can be transformed through a series of elementary transformations into an identity matrix E of order n, En
And (3) proving that: is provided with
Figure BDA0001634784950000071
From | a | ═ k (mod m), gcd (k, m) ═ 1 and the nature of the determinant, it can be seen that the first row of a must have the elements and m interdependence (otherwise gcd (k, m) ≠ 1), provided that a is not provided11And mth (otherwise interchanging a row by row could make the first column element of the first row and mth). According to the theory of introduction,
Figure BDA0001634784950000072
(mod m) so the first row for A is multiplied by
Figure BDA0001634784950000073
To obtain
Figure BDA0001634784950000074
Wherein
Figure BDA00016347849500000710
From A1Row i minus a of row 1i1Multiple (i-2, …, n) by subtracting a 'of column 1 from column i'1iMultiple (i ═ 2, …, n), yielding:
Figure BDA0001634784950000075
wherein a'1j=aij-ai1a'1j i,j=2,3,…,n
Figure BDA0001634784950000076
It is clear that,
Figure BDA0001634784950000077
from gcd (k, m) to 1 and
Figure BDA0001634784950000078
is provided with
Figure BDA0001634784950000079
And gcd (| B |, m) ═ 1. Repeating the above steps for the matrix B (mod m) of order n-1, so as to convert A (mod m) into the unit matrix E of order nn
Theorem 5 if the n-th order modulo m matrix A can be transformed into the identity matrix E through a series of elementary transformationsnThen gcd (| a |, m) ═ 1.
And (3) proving that: setting elementary transformation C1,C2,…,Cs,CS+1,…,CtConverting the n-order modulo m matrix A into an identity matrix, i.e. C1…CsACS=1…Ct=EnThus having | C1|…|Cs||A||CS+1|…|Ct1. Due to | Pij|=-1,|Di(k)|=k,gcd(k,m)=1,|Ti,j(k) 1, | C1|…|CtAnd k. So that k | A | > 1 and gcd (k | A |, m) | 1, and gcd (k, m) | 1, so gcd (| A |, m)=1。
A sufficient requirement that the theorem 6 n-th order modulo-m matrix a is an invertible matrix is that gcd (| a |, m) ═ 1.
3 inverse matrix algorithm principle of solving reversible mode m matrix by using improved Lamm law
The classical lemm's law only finds the inverse of a real number range, whereas the inverse of a modulo m matrix is an integer range. The inverse of the lambda law tends to be approximate, while the inverse of the modulo m matrix must be exact. Therefore, the inverse matrix of the modulo-m matrix cannot be obtained without modifying the existing lamb law.
Setting n-order mode m matrix
Figure BDA0001634784950000081
And gcd (| A |, m) ═ 1, then A can be determined by modified Cram's law-1. The specific method comprises the following steps:
is provided with
Figure BDA0001634784950000082
Since gcd (| a |, m) ═ 1, a is reversible. Without being provided with
Figure BDA0001634784950000083
Then there is a modification of the Kram's law
Figure BDA0001634784950000084
Wherein A isijDenotes the ith column in A by ejReplacing the resulting matrix, i, j ═ 1,2, …, n.
∵gcd(|A|,m)=1,
Figure BDA0001634784950000086
s.t.|A||A|-11, thereby
Figure BDA0001634784950000085
Therefore, it is
xij=|A|-1|Aij|,i,j=1,2,…,n。
4 generating reversible modulus m matrix and inverse algorithm description of modulus m matrix
4.1 random Generation of invertible modulo m matrices
Step1, inputting the order number n of a matrix of a modulus m;
step 2 Generation of n2A random integer, then a matrix A is formed by the elements;
step 3, judging whether there is gcd (| A |, m) ═ 1, if yes, ending; otherwise, returning to the step 2.
4.2 inverse of the modulo m matrix
Step1, randomly generating an n-order reversible modulus m matrix A;
step 2 of obtaining | Aij|,i,j=1,2,…,n;
Step 3 of obtaining | A-1
Step 4 according to xij=|A|-1|AijI, j ═ 1,2, …, n calculates A-1The corresponding elements in (1).
Algorithm for fast generation of reversible modulo m matrix using improved approximate elimination
Theorem 7 if the n-th order modulo m matrix a satisfies gcd (| a |, m) ═ 1, then it can be obtained by matrix transformation
Figure BDA0001634784950000091
And is
Figure BDA0001634784950000092
And (3) proving that: from the nature of gcd (| a |, m) ≠ 1 and determinant, it can be seen that the first column of a must have the element and m interdependency (otherwise gcd (| a |, m) ≠ 1). Thus, interchanging A row by row may result in the first row and first column of elements
Figure BDA0001634784950000093
And mutilin. Without setting the switched matrix as
Figure BDA0001634784950000094
According to the theory of introduction,
Figure BDA0001634784950000095
thus is used
Figure BDA0001634784950000096
Ride a(0)Line 1 of
Figure BDA0001634784950000097
Other elements than the above elements to obtain
Figure BDA0001634784950000098
Wherein
Figure BDA0001634784950000099
From A1Row i minus row 1
Figure BDA00016347849500000910
Multiple (i ═ 2, …, n) to obtain:
Figure BDA00016347849500000911
wherein
Figure BDA00016347849500000912
And
Figure BDA00016347849500000913
thereby having
Figure BDA00016347849500000914
Figure BDA00016347849500000915
Gcd (| B |, m) ═ 1, where
Figure BDA0001634784950000101
By the same token, it can be deduced
Figure BDA0001634784950000102
Thereby having
Figure BDA0001634784950000103
Wherein
Figure BDA0001634784950000104
By analogy, can obtain
Figure BDA0001634784950000105
Is provided with
Figure BDA0001634784950000106
Theorem 8 if a modulo-m matrix is row transformed into a diagonal matrix, each element on the diagonal is prime to modulo-m, then the modulo-m matrix is a reversible modulo-m matrix.
And (3) proving that: let a be a diagonal element of the n-order modulo m matrix | A | after row transformation into a diagonal matrix11,a22,…,annAnd is and
Figure BDA0001634784950000107
there is gcd (a)ii,m)=1。
Figure BDA0001634784950000108
gcd(aii,m)=1
Figure BDA0001634784950000109
There is gcd (| a)iiI, m) ═ 1. Thereby to obtain
Figure BDA00016347849500001010
And also
Figure BDA00016347849500001011
Therefore, gcd (| a |, m) ═ 1. So gcd (| a |, m) ═ 1, i.e., a is an n-order invertible modulo m matrix.
Based on the hardware structure, algorithm derivation is adopted, and an embodiment of the method for generating the reversible mode m matrix is provided.
In this embodiment, the method includes the steps of:
the first substep: randomly generating an integer a with n multiplied by n values between 0 and m-1ij,i,j=1,2,…,n;
And a second substep: integer a from Step1ijI, j equals 1,2, …, n configuration matrix a equals (a)ij)n×n
And a third substep: for convenience of algorithm description, let A be A(0)And A is(0)Is described as
Figure BDA00016347849500001012
Then
Figure BDA00016347849500001013
From A(0)Column 1 of (2) selects the elements that are interdependent with modulo m. If no element is found that is modulo m, then Step1 is returned. Otherwise, let the found element be
Figure BDA00016347849500001014
When i ≠ 1, we first use matrix A(0)Is reciprocal to the row 1 element, so that a new one
Figure BDA00016347849500001015
Becomes the principal element and then proceeds to the elimination element, this hand being called the election element. Is provided with
Figure BDA00016347849500001016
Is inverse to
Figure BDA00016347849500001017
By using
Figure BDA00016347849500001018
Multiplication matrix A(0)First row divider
Figure BDA00016347849500001019
All elements other than A, and from matrix A(0)The other row of (1) eliminates the row 1 element to become
Figure BDA0001634784950000111
Perform the operation first
Figure BDA0001634784950000112
Then from matrix A(0)Is subtracted from the a of the 1 st line (i ≠ 1) from the i-th line (i ≠ 1)i1Double, instant order
Figure BDA0001634784950000113
And is
Figure BDA0001634784950000114
And a second substep: the k-th elimination (k is more than or equal to 2 and less than or equal to n)
Let the k-1 th elimination have been completed, i.e. after k-1 th elimination, the given matrix A(k-2)Is processed into the following forms
Figure BDA0001634784950000115
The k-th step of elimination is from
Figure BDA0001634784950000116
Finding elements that are prime to modulo m
Figure BDA0001634784950000117
If such an element is present
Figure BDA0001634784950000118
If not, then return to Step1 are provided. Otherwise, when i ≠ k, the element positions of the ith row and the kth row of the matrix are reciprocal. Followed by
Figure BDA0001634784950000119
Contrary element of
Figure BDA00016347849500001110
Multiplication by the other elements of the k column by the k column, i.e. the operation to be performed is
Figure BDA00016347849500001111
Then, subtracting the k-th line from the other lines
Figure BDA00016347849500001112
Multiplication, i.e. the operation to be performed is
Figure BDA00016347849500001113
After doing so n steps, the given matrix is finally processed into a diagonal matrix. Since the elements on the diagonal are all coprime to m, the matrix a is an n-order reversible modulo m matrix through which the data to be processed is encrypted.
Further, after the matrix a is successfully determined to be an n-order reversible modulo m matrix, the data to be processed may be encrypted by the n-order reversible modulo m matrix to generate encrypted data.
Further, after generating the encrypted data, the method further includes: and solving the inverse of the n-order reversible matrix modulo m, and decrypting the encrypted data through the inverse of the matrix modulo m to obtain the data to be processed.
It will be appreciated that the modulo-m matrix has been demonstrated in the above steps to be a reversible modulo-m matrix, so that the encrypted data can be decrypted by solving for the inverse of the modulo-m matrix to obtain the data to be processed, whereas for solving for the modulo-m matrix generated by improved approximation cancellation the inverse thereof can be solved by improved approximation cancellation.
Further, in order to further verify the feasibility of rapidly generating the reversible modulo m matrix based on the improved jordan elimination method in the above steps, the above improved jordan elimination method for rapidly generating the reversible modulo m matrix was tested in this embodiment.
For example, it is desirable to generate a 4 th order reversible modulo 256 matrix using modified Jordan elimination and verify that the matrix is reversible, by:
by the algorithm principle of the modified approximate elimination method, a 4-order reversible modulus 256 matrix is randomly generated
Figure BDA0001634784950000121
The verification process is as follows:
(1) step1
Figure BDA0001634784950000122
(2) Step 2
Figure BDA0001634784950000123
(3) Step 3
Figure BDA0001634784950000124
Figure BDA0001634784950000125
Figure BDA0001634784950000126
Figure BDA0001634784950000127
Gcd (| a |,256) ═ 1, i.e., a is a 4-order invertible modulo 256 matrix.
For another example, obtaining the inverse of the 4 th order reversible modulus 256 matrix generated in example 1 by a modified Jordan elimination method requires a specific process, which is specifically verified as follows:
(1) step1
Figure BDA0001634784950000131
(2) Step 2
Figure BDA0001634784950000132
(3) Step 3
Figure BDA0001634784950000133
(4) Step 4
Figure BDA0001634784950000134
Through back substitution, obtain
Figure BDA0001634784950000135
Further, on the basis of proving the feasibility of generating the reversible mode m matrix rapidly based on the above improved jordan elimination method, the present embodiment continuously proves that the generation speed of generating the reversible mode m matrix rapidly based on the above improved jordan elimination method is faster than that of the conventional technical solution at present, for example, the latest recursive determinant mode is adopted to randomly generate the reversible mode m matrix at present, and system tests show that the recursive determinant method can only obtain the reversible mode m matrix with the order not exceeding 10 relatively quickly, as shown in fig. 2, it takes 124112 milliseconds to generate a 10-order mode 546 matrix randomly by the recursive determinant method;
referring to FIG. 3, the present embodiment randomly generates a matrix of modulo 678 of 200 order by using the modified Jordan elimination method, which takes only 6390 ms; the matrix is established by adopting the same algorithm, and the higher the order of the matrix is, the slower the generation speed of the matrix is;
therefore, the improved approximation elimination method adopted in the present embodiment is far faster than the current latest recursive determinant method for generating reversible m-mode matrix.
The embodiment solves the generation problem of the reversible modulus m matrix from the realization of theory and algorithm by fully utilizing the approximation elimination method and the mathematical principle of the modulus m matrix. The conventional approximate elimination method can only solve the inverse of the matrix in the real number range, but cannot solve the inverse of the m-mode matrix in the integer range. By modifying the approximate elimination method, the modified algorithm can generate reversible modular m matrix of any order in an integer range. After the rows of the modulus m matrix are converted into the diagonal matrix by an improved approximate eliminating method, each element on the diagonal must be coprime with the modulus m, otherwise, the modulus m matrix is irreversible, so that the reversible modulus m matrix of any order can be quickly obtained, and the requirement of practical application is greatly met.
It is further noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of software products stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk), and including instructions for causing a device (e.g., a mobile phone, a server, an air conditioner, or a network device) to perform the methods according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (2)

1. A method of generating a reversible modulo m matrix, the method comprising:
the method comprises the following steps: randomly generating n2Integer a having a value between 0 and m-1ijWherein i is an integer between 1 and n, and j is an integer between 1 and n;
step two: according to the generated n2An integer aijCreating an n-order modulo-m matrix construction matrix a ═ aij)n×nWherein n represents the order n of the modulo m matrix,
Figure FDA0003338144490000011
an ith row and a jth column matrix element representing the modulo-m matrix, i representing a row of the modulo-m matrix and j representing a column of the modulo-m matrix;
step three: let A be A(0)And A is(0)Is described as
Figure FDA0003338144490000012
Then
Figure FDA0003338144490000013
From A(0)Column 1 ofSelecting an element which is prime to the modulus m;
traversing each element of the modulo m matrix, and returning to the random generation n if the element which is prime to the modulo m is not traversed2Integer a having a value between 0 and m-1ijA step (2);
otherwise
Setting the traversed target matrix element as
Figure FDA0003338144490000014
When i ≠ 1, the matrix A is divided(0)Is reciprocal to the row 1 element, so that a new one
Figure FDA0003338144490000015
Becoming a main element;
determining the primary element
Figure FDA0003338144490000016
Is inverse to
Figure FDA0003338144490000017
By using
Figure FDA0003338144490000018
Multiplication matrix A(0)First row divider
Figure FDA0003338144490000019
All elements other than A, and from matrix A(0)The other row of (1) eliminates the row 1 element to become
Figure FDA00033381444900000110
Perform the operation first
Figure FDA00033381444900000111
Then from matrix A(0)Minus a of line 1 from line i (i ≠ 1)i1Double, instant order
Figure FDA00033381444900000112
And is
Figure FDA00033381444900000113
Performing k-th elimination on the matrix, wherein k is more than or equal to 2 and less than or equal to n; wherein, after the k-1 th elimination, the given matrix A is completed(k-2)Is processed into A(k-1)
Figure FDA0003338144490000021
Wherein, the k step of eliminating the matrix comprises the following steps: from
Figure FDA0003338144490000022
Finding elements that are prime to modulo m
Figure FDA0003338144490000023
If the element is prime to the modulus m
Figure FDA0003338144490000024
If not, returning to the random generation n2Integer a having a value between 0 and m-1ijA step (2);
otherwise
When i ≠ k, the element positions of ith row and kth row of the matrix are reciprocal
Figure FDA0003338144490000025
Contrary element of
Figure FDA0003338144490000026
Multiplication by the other elements of the k column by the k column, i.e. the operation to be performed is
Figure FDA0003338144490000027
Subtracting the k-th line from the other lines
Figure FDA0003338144490000028
Multiplication, i.e. the operation to be performed is
Figure FDA0003338144490000029
After repeating the above steps n times, the current matrix is finally processed into a diagonal matrix, and when the elements on the diagonal are coprime to m, the matrix A is determined to be an n-order reversible mode m matrix, wherein n is a positive integer, namely the matrix A is a non-negative integer and generates an arbitrary-order reversible mode m matrix so as to remove the limitation on the application of the reversible mode m matrix;
after the matrix A is determined to be an n-order reversible mode m matrix, the method further comprises the following steps:
acquiring data to be processed, and encrypting the data to be processed according to the matrix A to generate encrypted data;
and acquiring the inverse of the matrix A, and decrypting the encrypted data according to the inverse of the matrix A to obtain the data to be processed.
2. An apparatus for generating a reversible modulo m matrix, comprising: a memory, a processor and a program stored on the memory and executable on the processor for generating a reversible modulo-m matrix, the program for generating a reversible modulo-m matrix being configured to implement the steps of the method for generating a reversible modulo-m matrix as claimed in claim 1.
CN201810353990.5A 2018-04-19 2018-04-19 Method and apparatus for generating reversible modulo m matrix Active CN108536651B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810353990.5A CN108536651B (en) 2018-04-19 2018-04-19 Method and apparatus for generating reversible modulo m matrix

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810353990.5A CN108536651B (en) 2018-04-19 2018-04-19 Method and apparatus for generating reversible modulo m matrix

Publications (2)

Publication Number Publication Date
CN108536651A CN108536651A (en) 2018-09-14
CN108536651B true CN108536651B (en) 2022-04-05

Family

ID=63478612

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810353990.5A Active CN108536651B (en) 2018-04-19 2018-04-19 Method and apparatus for generating reversible modulo m matrix

Country Status (1)

Country Link
CN (1) CN108536651B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111510292B (en) * 2020-04-22 2021-09-21 华南理工大学 Method, system, device and storage medium for randomly generating hill high-order key matrix

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1614922A (en) * 2003-11-03 2005-05-11 微软公司 Use of isogenies for design of cryptosystems
CN102822816A (en) * 2010-03-30 2012-12-12 国际商业机器公司 An efficient homomorphic encryption scheme for bilinear forms
CN103927290A (en) * 2014-04-18 2014-07-16 南京大学 Inverse operation method for lower triangle complex matrix with any order
CN105426345A (en) * 2015-12-25 2016-03-23 南京大学 Matrix inverse operation method
CN105701068A (en) * 2016-02-19 2016-06-22 南京大学 Cholesky matrix inversion system based on time division multiplexing technology
JP2017059048A (en) * 2015-09-17 2017-03-23 キヤノン株式会社 Arithmetic unit and operation method
CN106980602A (en) * 2017-03-16 2017-07-25 中国石油大学(华东) The processing of matrix inversion lemma zero mother's situation and a kind of method for solving inverse matrix that increases by degrees

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2777159A4 (en) * 2011-11-10 2016-07-13 Parallel Geometry Inc Method and system for coding information

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1614922A (en) * 2003-11-03 2005-05-11 微软公司 Use of isogenies for design of cryptosystems
CN102822816A (en) * 2010-03-30 2012-12-12 国际商业机器公司 An efficient homomorphic encryption scheme for bilinear forms
CN103927290A (en) * 2014-04-18 2014-07-16 南京大学 Inverse operation method for lower triangle complex matrix with any order
JP2017059048A (en) * 2015-09-17 2017-03-23 キヤノン株式会社 Arithmetic unit and operation method
CN105426345A (en) * 2015-12-25 2016-03-23 南京大学 Matrix inverse operation method
CN105701068A (en) * 2016-02-19 2016-06-22 南京大学 Cholesky matrix inversion system based on time division multiplexing technology
CN106980602A (en) * 2017-03-16 2017-07-25 中国石油大学(华东) The processing of matrix inversion lemma zero mother's situation and a kind of method for solving inverse matrix that increases by degrees

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于矩阵变换的图像置乱逆问题求解;邵利平 等;《电 子 学 报》;20080731;第36卷(第7期);1355-1363 *

Also Published As

Publication number Publication date
CN108536651A (en) 2018-09-14

Similar Documents

Publication Publication Date Title
JP6008316B2 (en) Secret sharing apparatus and secret sharing program
Pornin et al. More efficient algorithms for the NTRU key generation using the field norm
JP6730741B2 (en) Processing device, processing method, processing program, and cryptographic processing system
JP7164672B2 (en) Digital signature method, signature information verification method, related device and electronic device
CN113541946B (en) Multi-party security calculation method and device and electronic equipment
JP2022020067A (en) Digital signature method, signature information verification method, related device, and electronic device
CN105245343A (en) On-line off-line signature system and method based on multivariable cipher technology
JP2019095635A (en) Processing device, inference device, learning device, processing system, processing method, and processing program
CN114691167A (en) Method and device for updating machine learning model
JP7312293B2 (en) Digital signature method, signature information verification method, related device and electronic device
CN108536651B (en) Method and apparatus for generating reversible modulo m matrix
JP5689826B2 (en) Secret calculation system, encryption apparatus, secret calculation apparatus and method, program
Biksham et al. A lightweight fully homomorphic encryption scheme for cloud security
CN108509386B (en) Method and apparatus for generating reversible modulo m matrix
CN103929305A (en) SM2 signature algorithm implementation method
EP2899713B1 (en) Hash value calculation device, hash value calculation method and hash value calculation program
CN114817954A (en) Image processing method, system and device
KR102364047B1 (en) Method and apparatus for public-key cryptography based on structured matrices
CN114553505B (en) Method, device, storage medium and computing equipment for generating random numbers cooperatively by multiple parties
CN115276950B (en) Processing method and device of private data and computing equipment
JP6965125B2 (en) Key exchange system, key exchange method and key exchange program
CN108040068B (en) Quick access control system based on cloud security platform
Martínez-Martínez et al. A matrix numerical methods comparative study in modular inverse computation with a symmetric cryptography perspective
JP2010103623A (en) Group signature system, revocation information management device, member device, and revocation processing method and program
Rodríguez Lima Optimization of the McEliece cryptosystem

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant