The applications of non-square binary matrices span many domains including mathematics, error-correction coding, machine learning, data storage, navigation signals, and cryptography. In particular, they are employed in the McEliece and Niederreiter public-key cryptosystems. For the parity check matrix of these cryptosystems, a systematic non-square binary matrix with dimensions , , , there exist distinct inverse matrices. This article presents an algorithm to generate these matrices as well as a method to construct a random inverse matrix. Then it is extended to non-square matrices in arbitrary fields. This overcomes the limitations of the Moore-Penrose and Gauss-Jordan methods. The application to public-key cryptography is also discussed.
Inverses of systematic binary matrices play a crucial role in many applications in digital communications,1 navigation systems,2 data storage,3 and code-based cryptography.4 These matrices can be constructed using the Gauss-Jordan (GJ)5 and Moore-Penrose (MP)6,7 methods. An invertible matrix must have full rank. A matrix with rows and columns, , has full rank if its rows are linearly independent. The GJ algorithm is widely used to solve linear systems of equations of the form 8 and can be used to construct inverses of non-square matrices. The MP method provides a unique inverse matrix that has applications in data analysis and machine learning.9
Non-square binary matrices are important in several domains including error-correction coding and code-based cryptography.1011 In this article, a method is presented to construct all inverses of a binary matrix and an algorithm is given to provide a random inverse of a binary matrix. It is shown that this method is more efficient than the MP and GJ methods. Finite fields, also known as Galois fields (GFs), are fundamental mathematical structures with applications in various domains, including cryptography, signal processing, error correction, and data transmission.1213 In cryptography, finite fields play an important role, forming the basis of secure communication protocols and encryption algorithms. Elliptic curve cryptography14 and the advanced encryption standard heavily rely on arithmetic operations in finite fields to ensure robust security.15,16 Finite fields are also employed for Goppa codes,17 generalized Reed-Solomon (GRS) codes,17,18 and BCH codes.19
Broumandnia20 employed matrix inversion in to enhance digital image encryption, improving both security and encryption speed. The algorithm proposed by Tiplea and Dragoi21 for constructing inverses in finite fields depends on selecting an appropriate range transformation for each inverse. These algorithms simplify the construction of inverse matrices in various fields, including finite fields, real fields, and complex fields. Theyi divide the inverse matrix into two parts: one selected in a random base while the second, approximately half the size of the original matrix, is constructed. This significantly reduces the complexity of inverse matrix construction which is of great value when dealing with large matrices. In the analysis section, the limitations associated with GJ elimination when dealing with large-sized matrices22 and the challenges posed by the MP method in the context of finite fields21 will be discussed. The application of the proposed approach to public-key cryptography (PKC) is also considered.
Linear block codes
In communication systems, redundancy is employed to detect and correct errors caused by noisy channels. An encoder maps a message to a codeword , . A binary block code has distinct messages of length and thus codewords. A set of codewords is referred to as a block code, where is the length of a codeword and is the dimension of the code. A code is linear if its codewords form a vector subspace of dimension in the -dimensional vector space. Then a set of linearly independent codewords forms a generator matrix . A generator matrix in systematic form can be expressed as follows
where is the identity matrix and is a parity matrix so that
The parity check matrix satisfies the condition and is a basis for the dual space of the code .11 A parity check matrix in systematic form is given by
where is the transpose of .
Non-square inverse matrix
The parity check matrix is a full-rank binary matrix with dimensions , where and . Therefore, the inverse of the parity check matrix has dimensions and satisfies
This is a linear system with equations and variables. Consequently, there are solutions for . It was shown by Esmaeili23 that the inverse parity check matrix is not unique, and there are possible matrices.
Inverse matrix construction method
The equation is a linear system with equations and variables, resulting in more variables than equations. This article introduces a method to reduce the number of variables, thereby creating a linear system with equations and variables. This approach enables the construction of all inverse matrices for the parity check matrix . The proposed method is based on the observation that has columns, each of which can have values. This leads to a set of distinct vectors for each column in the matrix.
Let be a set of column vectors of length , , such that the th column of belongs to a set comprising column vectors, as shown below
Hence, there are columns in each set. Now considering that there are possibilities for a -bit representation, the are partitioned into two subsets, and . encompasses rows to , while includes rows to . The first subset, , comprises all possible binary vectors of length , ranging from all zeros to all ones. By defining the values of subset with dimensions , this approach effectively reduces to variables, resulting in a linearsystem with equations and variables. The subsets and can be represented as follows
The elements in , , and , must satisfy
Hence, when
and if
so that
When
and if
Similarly, the columns of must satisfy
so when the result is and when the result is . Thus, if
and if
Example
Consider a code with and having generator matrix
and
The sets of columns are , and resulting in possible matrices. The sets and can be expressed as
and
Combining and gives
For , we have
so
The elements of are
so
The elements of are
so
The elements of are
so
Hence, to construct inverses, we select a random column vector from each set, namely, , , and . With possible choices for each set, resulting in a total of possible .
Random inverse matrix construction
The inverse of a parity check matrix can be partitioned into two sections and , where comprises rows to and comprises rows to so that
A random inverse of a parity check matrix can be obtained using the following steps.
Select a random matrix with dimensions .
Construct the corresponding matrix with dimensions .
If and , consists of randomly selected binary vectors with rows. One such matrix is
The corresponding elements of are
where
and
In general, this can be expressed as
For example, in is given by
Let be a matrix consisting of column vectors, and be the matrix with entries determined based on . If and , then
so
which gives
Inverse matrix construction analysis
This section compares the computation time of the proposed algorithm for random inverse matrices with the MP method. Table 1 presents the computation time for several values of and . This shows that the proposed method has a lower time for all values.
Random inverse matrix computation time.
Matrix size
Moore-Penrose
(MP) (ms)
Proposed
(ms)
,
,
,
,
The computational complexity is now considered in terms of the number of arithmetic operations. To solve a system of equations with unknowns, the number of arithmetic operations needed to obtain the row echelon form (REF) with the GJ method is divisions, multiplications, and additions/subtractions.24 Then, the reduced REF is constructed to solve the system of linear equations which doubles the number of operations which gives a total of . Hence, for a parity check matrix with dimensions , the GJ computational complexity to obtain the inverse is (excluding the nullspace and vector set calculations). The MP algorithm requires arithmetic operations to obtain the full-rank matrix and an additional operations to obtain (excluding determinant calculations). Thus, the computational complexity for the MP method is . The proposed approach requires no arithmetic operations for constructing as it is determined through random selection. Constructing requires arithmetic operations. Table 2 presents the number of arithmetic operations required with the MP, GJ, and proposed algorithms for constructing a random inverse matrix. This shows that the proposed method has lower computational complexity.
Computational complexity for three algorithms.
GJ
MP
Proposed
Multiplication in with irreducible polynomial .
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
2
0
2
4
6
8
A
C
E
3
1
7
5
B
9
F
D
3
0
3
6
5
C
F
A
9
B
8
D
E
7
4
1
2
4
0
4
8
C
3
7
B
F
6
2
E
A
5
1
D
9
5
0
5
A
F
7
2
D
8
E
B
4
1
9
C
3
6
6
0
6
C
A
B
D
7
1
5
3
9
F
E
8
2
4
7
0
7
E
9
F
8
1
6
D
A
3
4
2
5
C
B
8
0
8
3
B
6
E
5
D
C
4
F
7
A
2
9
1
9
0
9
1
8
2
B
3
A
4
D
5
C
6
F
7
E
A
0
A
7
D
E
4
9
3
F
5
8
2
1
B
6
C
B
0
B
5
E
A
1
F
4
7
C
2
9
D
6
8
3
C
0
C
B
7
5
9
E
2
A
6
1
D
F
3
4
8
D
0
D
9
4
1
C
8
5
2
F
B
6
3
E
A
7
E
0
E
F
1
D
3
2
C
9
7
6
8
4
A
B
5
F
0
F
D
2
9
6
4
B
1
E
C
3
8
7
5
A
The proposed algorithm simplifies the construction of inverse matrices and can construct all inverses of a given non-square matrix in any field. In contrast, the MP method constructs pseudo-inverses, and as indicated by Tiplea and Dragoi,21 it encounters challenges with finite fields. GJ elimination encounters difficulties with large matrices as noted by Xin and George.22 The task of selecting row combinations using the GJ algorithm is known to be NP-hard, and the time complexity increases exponentially.22
Random inversion of non-systematic binary and finite fields matrix
Let a full rank non-square matrix with dimensions , , such that
where are matrices with rows and columns, respectively, such that , and are column vectors with rows, .
The , , and , , can be a null matrix and null vector , respectively. A full-rank matrix must have linearly independent column vectors . For example, the following matrix is a full rank matrix with rank where , , and are null matrices.
If is the inverse of , then with
where , are matrices with , ,, rows, respectively, such that , are the row vectors with columns, where .
Hence, is the inverse of so the product of and will result in the identity matrix
A random matrix can be generated by randomly selecting and constructing the corresponding row variables .
Define and as
Then
so the columns of are linearly independent, resulting in a determinant of . Therefore, is a nonsingular matrix. Consequently, by selecting random matrices , can be constructed as described. Note that for complex and real number inverse matrices, can be constructed using (20). For example, consider B with dimensions m = 5 and n = 9 such that
Then is
where can be randomly selected as
Given matrices and the inverse of is
Therefore, can be constructed as
whereHaving and , the inverse matrix can be constructed aswhere .
Finite field random inverse
A finite field has a finite number of elements and is also known as a Galois field denoted where is a prime number and is a positive integer. In , the elements are polynomials of degree less than with coefficients in . Addition and multiplication of polynomials are performed modulo an irreducible polynomial of degree . Table 3 illustrates multiplication in the finite field with irreducible polynomial .
Consider with matrix
so there is no and , , and areTherefore, can be constructed as
Now by random selection of and
can be constructed as
and is thenwhere in
Prime field random inverse
In a prime field , the elements are the integers less than with addition and multiplication modulo . For example, in , the elements are , and arithmetic is done modulo so in as .
The proposed method for constructing random inverse matrices can be employed with the PKC by Haidary Makoui et al.25 This involves the generation of public and private keys for encryption, decryption, digital signatures, and verification.
Public Key Infrustructure
generates a public key and a private key where is the key generation scheme.
The proposed algorithm uses the following matrices25:
Matrix of size .
Matrix of size ,
Non-singular scrambling matrix of size .
Permutation matrix of size .
Non-singular matrix of size .
Key Generation Algorithm
1. Obtain and for the block code .
2. Select a random inverse of the parity check matrix using a randomly generated matrix and constructing the corresponding matrix
3. Conceal the generator matrix in a similar manner to the McEliece cryptosystem
4. Apply matrices and to conceal
5. Digital signature verification requires
6. Construct a parity check matrix corresponding to
7. Public key: .
8. Private key: .
The public key satisfies the following relationships. The algorithms for signing, verification, and integrity check in the code-based digital signature scheme have the following relationships. The public key satisfies
The public key and are related as follows
There are possible inverse matrices so the probability of an adversary constructing a private key from the public key is .25 Thus, the probability of successful forgery by discovering the secret key is negligible for reasonable values of and .
PKC based on a dual inverse matrix uses a generalized non-square inverse matrix as in the code-based cryptosystem by Haidary Makoui et al.27 where the dual inverse matrix serves as both the transpose and inverse of the parity check matrix.
The probability of a ciphertext distinguishability attack against the McEliece code-based cryptosystem is .26 For the algorithm by Haidary Makoui et al.27 this is
Therefore, it provides greater security compared to the McEliece cryptosystem so smaller key sizes can be employed without compromising the security.
Conclusion
This article considered the construction of inverse matrices for a non-square matrix . The proposed approach involves column sets with column of corresponding to a subset of . This facilitates the construction of all possible inverse matrices. An algorithm was given to construct an inverse matrix from matrices and , where has random binary vectors and is obtained based on . The computational complexity of the proposed approach was shown to be lower than the MP and GJ methods. The extension to arbitary fields including finite fields was demonstrated. Finally, the application to PKC was illustrated.
Footnotes
Declaration of conflicting interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) received no financial support for the research, authorship and/or publication of this article.
ORCID iD
Farshid Haidary Makoui
Notes
References
1.
ShannonCE. A mathematical theory of communication. Bell Syst Tech J Jul 1948; 27(3): 379–423.
ThomasianA. Storage Systems: Organization, Performance, Coding, Reliability, and Their Data Processing. London, UK: Academic Press, 2011.
4.
SarafSDhingraSPinheiroG. Parallel algorithm for finding inverse of a matrix and its application in message sharing (coding theory). Int J Comput Applic Feb 2016; 136(9): 24–28.
5.
StanimirovićPSPetkovićMD. Gauss–Jordan elimination method for computing outer inverses. Appl Math Comput Jan 2013; 219(9): 4667–4679.
6.
BarataJCAHusseinMS. The Moore-Penrose pseudoinverse: A tutorial review of the theory. Braz J Phys Apr 2012; 42(1-2): 146–165.
7.
ChenHWangY. A family of higher-order convergent iterative methods for computing the Moore–Penrose inverse. Appl Math Comput Dec 2011; 218(8): 4012–4016.
8.
GuglielmiNOvertonMLStewartGW. An efficient algorithm for computing the generalized null space decomposition. SIAM J Matrix Anal Appl Jan 2015; 36(1): 38–54.
9.
TapsonJvan SchaikA. Learning the pseudoinverse solution to network weights. Neural NetwSep 2013; 45: 94–100.
10.
McElieceRJ. A public-key cryptosystem based on algebraic coding theory. Jet Propulsion Lab Jan-Feb 1978; DSN Tech Rep42-44: 114–116.
11.
NiederreiterH. Knapsack-type cryptosystems and algebraic coding theory. Probl Control Inf Theory1986; 15(2): 159–166.
12.
McElieceRJ. Finite Fields for Computer Scientists and Engineers. Berlin, Germany: Springer-Verlag, 1987.
13.
LidlRNiederreiterH. Finite Fields: Encyclopedia of Mathematics and Its Applications, vol. 20. Cambridge, UK: Cambridge University Press1997.
14.
LiBLieBZhangYet al. A novel and high-performance modular square scheme for elliptic curve cryptography over GF(p). IEEE Trans Circuits Syst II Express Briefs2019; 66(4): 647–651.
15.
PaarCPelzlJ. The Advanced Encryption Standard (AES). Understanding Cryptography, Berlin, Germany: Springer, pp. 87–121, 2015.
16.
DaemenJRijmenV. The Design of Rijndael. New York, NY, USA: Springer-Verlag, 2002.
17.
GaoYYueQHuangXet al. Hulls of generalized Reed-Solomon codes via Goppa codes and their applications to quantum codes. IEEE Trans Inf Theory, Oct 2021; 67(10): 6619–6626.
18.
WickerSBVijayVK. Reed-Solomon Codes and Their Applications. Wiley-IEEE Press,1994.
19.
JustesenJHoholdtT. A Course In Error-Correcting Codes. Helsinki, Finland: European Mathematical Society Publishing House, second edition, 2017.
20.
BroumandniaA. Image encryption algorithm based on the finite fields in chaotic maps. J Inf Secur Applic2020; 54: article 102553.
21.
TipleaFLDragoiVF. Generalized inverse based decoding. IEEE International Symposium on Information Theory, pp. 2791-2796, Jul 2022.
22.
XinFGeorgeH. On the worst-case complexity of integer Gaussian elimination. International Conference on Symbolic and Algebraic Computation, pp 28–31, Jul 1997.
23.
EsmaeiliM. Application of Linear Block Codes in Cryptography. PhD Dissertation Department of Electrical and Computer Engineering, University of Victoria, Victoria, BC, Canada, 2019.
24.
FarebrotherRW. Linear Least Squares Computations. Statistics Textbooks and Monographs, vol 91, London, UK: Taylor and Francis, 1988.
25.
Haidary MakouiFGulliverTADakhilaianM. A new code-based digital signature based on the McEliece cryptosystem. IET Commun Jun 2023; 17(10): 1199–1207.
Haidary MakouiFGulliverTADakhilaianM. Post Quantum code-based cryptosystems with dual inverse matrix. International Conference on Information Technology in Asia, pp.43–47, Oct 2023.