CN108536651B - Method and apparatus for generating reversible modulo m matrix - Google Patents
Method and apparatus for generating reversible modulo m matrix Download PDFInfo
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/16—Matrix 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
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,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 asThenFrom 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 asWhen i ≠ 1, the matrix A is divided(0)Is reciprocal to the row 1 element, so that a new oneBecoming a main element;
By usingMultiplication matrix A(0)First row dividerAll elements other than A, and from matrix A(0)The other row of (1) eliminates the row 1 element to become
Perform the operation firstThen 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
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
Wherein, the k step of eliminating the matrix comprises the following steps: fromFinding elements that are prime to modulo mIf the element is prime to the modulus mIf 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 reciprocalContrary element ofMultiplication by the other elements of the k column by the k column, i.e. the operation to be performed is
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 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.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 (where kk)-1=1(mod m))、
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.
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。
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
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,(mod m) so the first row for A is multiplied byTo obtain
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:
wherein a'1j=aij-ai1a'1j i,j=2,3,…,n
It is clear that,from gcd (k, m) to 1 andis provided withAnd 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 matrixAnd 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
Since gcd (| a |, m) ═ 1, a is reversible. Without being provided with
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 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 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
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 elementsAnd mutilin. Without setting the switched matrix as
According to the theory of introduction,thus is usedRide a(0)Line 1 ofOther elements than the above elements to obtain
Gcd (| B |, m) ═ 1, where
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 andthere is gcd (a)ii,m)=1。gcd(aii,m)=1
There is gcd (| a)iiI, m) ═ 1. Thereby to obtainAnd alsoTherefore, 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 asThenFrom 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 beWhen i ≠ 1, we first use matrix A(0)Is reciprocal to the row 1 element, so that a new oneBecomes the principal element and then proceeds to the elimination element, this hand being called the election element. Is provided withIs inverse toBy usingMultiplication matrix A(0)First row dividerAll elements other than A, and from matrix A(0)The other row of (1) eliminates the row 1 element to become
Perform the operation firstThen 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
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
The k-th step of elimination is fromFinding elements that are prime to modulo mIf such an element is presentIf 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 byContrary element ofMultiplication by the other elements of the k column by the k column, i.e. the operation to be performed is
Then, subtracting the k-th line from the other linesMultiplication, i.e. the operation to be performed is
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
The verification process is as follows:
(1) step1
(2) Step 2
(3) Step 3
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
(2) Step 2
(3) Step 3
(4) Step 4
Through back substitution, obtain
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,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 asThenFrom 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 asWhen i ≠ 1, the matrix A is divided(0)Is reciprocal to the row 1 element, so that a new oneBecoming a main element;
By usingMultiplication matrix A(0)First row dividerAll elements other than A, and from matrix A(0)The other row of (1) eliminates the row 1 element to become
Perform the operation firstThen from matrix A(0)Minus a of line 1 from line i (i ≠ 1)i1Double, instant order
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)
Wherein, the k step of eliminating the matrix comprises the following steps: fromFinding elements that are prime to modulo mIf the element is prime to the modulus mIf 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 reciprocalContrary element ofMultiplication by the other elements of the k column by the k column, i.e. the operation to be performed is
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.
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)
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)
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)
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 |
-
2018
- 2018-04-19 CN CN201810353990.5A patent/CN108536651B/en active Active
Patent Citations (7)
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)
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 |