Side channel attack resistant mask protection method and system based on cyclic matrix

By using a mask protection method based on cyclic matrix in the AES algorithm, a random matrix and a permutation array are generated, and matrix cyclic shift and S-box random calculations are performed, the security risks of the AES algorithm when facing side channel attacks are solved, and effective defense of contralateral channel attacks is realized.

CN119583050AActive Publication Date: 2025-03-07NO 30 INST OF CHINA ELECTRONIC TECH GRP CORP
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411574875.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-03-07
Estimated Expiration
2044-11-06

AI Technical Summary

Technical Problem

The prior art is difficult to effectively defend against side channel attacks, especially in IoT devices, where AES algorithms have security risks when facing side channel attacks.

Method used

The anti-side channel attack mask protection method based on the cyclic matrix is ​​adopted. By generating a random matrix and a random permutation array, the matrix cyclic shift is performed to generate a mask set, and the S-box is calculated in the AES encryption algorithm, and the intermediate value masks at different positions are added to protect the intermediate value.

Benefits of technology

It effectively reduces the success rate of side channel attacks, enhances the AES algorithm's ability to resist side channel attacks in IoT devices, and improves data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119583050A_ABST
    Figure CN119583050A_ABST
Patent Text Reader

Abstract

The invention discloses a side channel attack resistant mask protection method and system based on a cyclic matrix, and relates to a data security technology, and the method comprises the steps: generating a random matrix, and generating a random permutation array based on the generated random matrix, the random matrix only comprising elements 1 and 0; generating a mask set by cyclic shift of the matrix based on the generated random matrix; and according to the generated random permutation array, performing out-of-order calculation of the S box in an AES encryption algorithm, and adding masks in intermediate values at different positions based on the generated mask set. According to the method, the mask set is updated through cyclic shift of the matrix, meanwhile, the permutation array is generated through the matrix and used for out-of-order calculation of the S box, finally, different masks are added to the intermediate values at different positions, and the purpose of protecting the intermediate values is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data security technology, and in particular to a circulant matrix-based anti-side channel attack mask protection method and system. Background Art

[0002] Side channel attacks were proposed by Kocher in the 1990s. With the development of side channel technology, the threat of side channel attacks to the security of cryptographic devices has increased day by day, and now it has become an important field of cryptographic research. When implementing side channel attacks, the attacker builds a suitable model by counting the thermal power consumption data leaked during the encryption and decryption operations of the cryptographic device, finds the statistical relationship between different power consumption information and encryption and decryption data, and thus guesses the correct key and plaintext. It has been proved that many cryptographic devices cannot resist power consumption attacks, which forces the design of cryptographic algorithms to turn to the direction of anti-side channel. There are two main types of power consumption attacks. The first is simple power consumption attack (SPA), which directly observes the waveform trend after obtaining the power consumption curve of the cryptographic device to guess the key. The second is power consumption attack based on statistics, such as correlation power attack (CPA) and differential power consumption attack (DPA). Among them, CPA has been widely studied because of its easy implementation, simplicity and effectiveness, and it is also an attack method that must be focused on in the design of cryptographic algorithms.

[0003] Since block ciphers are fast for encryption and decryption, they are widely used in various IoT devices. Insecure working environments make side-channel attacks a greater threat to such devices. A block cipher algorithm is a symmetric encryption algorithm that groups plaintext data, combines each group of data with a corresponding key, and then performs multiple rounds of iterations. A block cipher algorithm generally consists of three sub-algorithms: a key expansion algorithm, an encryption algorithm, and a decryption algorithm. Block ciphers have a variety of structures, but they must all meet the design principles of obfuscation and diffusion. Taking the SPN (Substitution-Permutation Network) structure as an example, the round function consists of a nonlinear obfuscation layer and a linear diffusion layer. The round functions are iterated in sequence to form an encryption or decryption algorithm. The AES cryptographic algorithm is a typical SPN structure algorithm. Its encryption algorithm is as follows: Figure 1 As shown in the figure, the S-box is the only nonlinear component in the AES algorithm and is also the key location for energy leakage in side-channel attacks. Therefore, the protection of the S-box is particularly important.

[0004] There are three versions of the AES algorithm, namely AES-128, AES-192 and AES-256. The three versions represent different key lengths and iteration rounds. The AES-128 block length is 128 bits and iterates 10 rounds; the AES-192 block length is 192 bits and iterates 12 rounds; the AES-256 block length is 256 bits and iterates 14 rounds. The present invention takes AES-128 as the object, with a block length of 128 bits, and a 4×4 state matrix composed of 8-bit numbers as elements. All operations in the round function of AES are performed on the state matrix. In the first round, the plaintext matrix is ​​first XORed with the round key, and then S-box transformation, row shift, and column mixing are performed; the intermediate rounds perform S-box transformation, row shift, column mixing, and round key XOR in turn; the final round performs S-box transformation, row shift, and round key XOR. The AES algorithm is still safe in theory, but there have been many successful cases of side channel attacks on the AES algorithm, and there are already a series of mature attack methods for IoT devices equipped with the AES algorithm. Therefore, it is very necessary to design anti-side channel protection for the AES algorithm running on small cryptographic devices in the IoT. Summary of the invention

[0005] The embodiment of the present application provides a mask protection method and system against side channel attacks based on a circulant matrix, which updates the mask set by cyclic shift of the matrix, and uses the matrix to generate a permutation array for out-of-order calculation of the S-box, and finally adds different masks to the intermediate values ​​at different positions, thereby achieving the purpose of protecting the intermediate values.

[0006] The embodiment of the present application provides a mask protection method against side channel attacks based on a circulant matrix, including:

[0007] Generate a random matrix, and generate a random permutation array based on the generated random matrix, wherein the random matrix only contains 1 and 0 elements;

[0008] Based on the generated random matrix, a mask set is generated by cyclic shift of the matrix;

[0009] According to the generated random permutation array, the S-box is calculated in a disordered order in the AES encryption algorithm, and masks are added based on the intermediate values ​​of the generated mask set at different positions.

[0010] Optionally, generate a random matrix including:

[0011] Repeatedly generating a unit matrix of a preset order, and performing multiple random transformations on the unit matrix to obtain a random reversible matrix;

[0012] The obtained multiple random reversible matrices are combined into a high-order matrix as a random matrix.

[0013] Optionally, generating a random permutation array based on the generated random matrix includes:

[0014] Randomly generated numbers

[0015] Given a number of initialized random arrays associated with the random matrix;

[0016] Select a reversible matrix according to the generated number b to update the random array;

[0017]

[0018] Output gets a randomly permuted array.

[0019] Optionally, based on the generated random matrix, generating a mask set by cyclic shift of the matrix includes:

[0020] Using the random matrix as a generator matrix of a random mask;

[0021] Each row of the generator matrix i , each column col i As a Boolean function truth table, convert them into corresponding decimal numbers in the set order to obtain the random mask value m j , i is the number of rows or columns of the generated matrix;

[0022] Concatenate the mask value m obtained based on the generator matrix j , to obtain a random mask set mask = mask r ||mask c , where mask r To generate each row of the matrix i The obtained mask value, mask c To generate each column col of the matrix i The obtained mask value;

[0023] Generate a random offset R, and the random matrix is ​​cyclically shifted as a whole according to the random offset R to obtain a new matrix M R , the new matrix M R Used to generate a new mask set.

[0024] Optionally, performing random calculation of S-boxes in the AES encryption algorithm according to the generated random permutation array, and adding masks based on the intermediate values ​​of the generated mask set at different positions includes:

[0025] The masks in the first round of AES encryption include:

[0026] According to the matrix M 0 As a generator matrix of random mask, and, generate random offset R1;

[0027] Generate a A random permutation P on ;

[0028] XOR the given plaintext state matrix with the mask matrix by element position to get the initialized data matrix mask0 is the matrix M 0 The resulting mask matrix;

[0029] Initialize the data matrix and combine it with the round key to get the input matrix of the S box

[0030] Let S(x) be the S-box of AES, S m (x) is the S-box calculated with mask, then the input and output of the masked S-box in the first round of encryption satisfies:

[0031]

[0032] where t∈{0,1,…,15}, It is a number input, using random permutation P to execute out of order;

[0033] For the overall input data The output of the new S-box is represented by

[0034]

[0035] Execute row shift SR and column mix MC, including:

[0036]

[0037] Add the next round's round key and get

[0038] Remove the output mask of the S-box

[0039] Add the next round of input masks

[0040] Optionally, performing random calculation of S-boxes in the AES encryption algorithm according to the generated random permutation array, and adding masks based on the intermediate values ​​of the generated mask set at different positions includes:

[0041] The masks in the AES intermediate round encryption include:

[0042] The input data matrix of the i-th round is The random matrix M is calculated according to R i Into a new mask matrix, and then generate a random offset Ri+1 , the matrix M i The resulting mask matrix is:

[0043]

[0044] The input data is XORed with the mask, and the input of the S-box is

[0045] For the overall input data The newly calculated S-box satisfies:

[0046]

[0047] Data is obtained after row shift and column mixing

[0048]

[0049] Add the next round's round key to get

[0050] Remove the output mask of the S-box

[0051] Add the next round of input masks

[0052]

[0053] Optionally, performing random calculation of S-boxes in the AES encryption algorithm according to the generated random permutation array, and adding masks based on the intermediate values ​​of the generated mask set at different positions includes:

[0054] The masks in AES tail round encryption include:

[0055] The input data matrix for this round is The random matrix M is calculated according to R i Into a new mask matrix, and then generate a random offset R i+1 , the matrix M i The resulting mask matrix is:

[0056]

[0057] The input data is XORed with the mask, and the input of the S-box is

[0058] Generate a A random permutation Q on ;

[0059] S(x) is the S-box of AES, S m (x) is the S-box calculated with mask. The input and output of the masked S-box in the final round of encryption satisfy:

[0060]

[0061] where t∈{0,1,…,15}, It is a number input, using random permutation Q out of order execution;

[0062] For the overall input data The S-box meets the following requirements:

[0063]

[0064] The data is obtained after row shifting:

[0065]

[0066] Adding a round key

[0067] Remove the output mask of the S-box:

[0068]

[0069] Output the encrypted ciphertext state matrix

[0070] An embodiment of the present application also proposes a circulant matrix-based anti-side channel attack mask protection system, including a processor and a memory, wherein a computer program is stored on the memory, and when the computer program is executed by the processor, the steps of the circulant matrix-based anti-side channel attack mask protection method as described above are implemented.

[0071] The method of the embodiment of the present application updates the mask set by circular shifting of the matrix, and uses the matrix to generate a permutation array for the out-of-order calculation of the S box, and finally adds different masks to the intermediate values ​​at different positions, thereby achieving the purpose of protecting the intermediate values.

[0072] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0074] Figure 1 AES encryption algorithm flow chart of the prior art

[0075] Figure 2 The following is a flowchart of the AES algorithm masking solution based on the circulant matrix according to an embodiment of the present application;

[0076] Figure 3 The following is a schematic diagram of the generation of a random 0 and 1 matrix according to an embodiment of the application;

[0077] Figure 4 Schematic diagram of the generation of a random permutation array according to an embodiment of the application. DETAILED DESCRIPTION

[0078] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0079] The present application embodiment provides a mask protection method against side channel attacks based on a circulant matrix, such as Figure 2 As shown, the following steps are included:

[0080] In step S101, a random matrix is ​​generated, and a random permutation array is generated based on the generated random matrix, wherein the random matrix only contains 1 and 0 elements. In some examples, generating the random matrix includes:

[0081] Repeatedly generate a unit matrix of a preset order, and perform multiple random transformations on the unit matrix to obtain a random reversible matrix. This application and subsequent examples use the construction of an 8th-order 0, 1 matrix to generate 16 mask values ​​as an example, and other applications can be adjusted according to actual needs. In the specific example, generating a random matrix includes: generating a 4th-order unit matrix, performing 32 random row transformations on the matrix, and obtaining a random reversible matrix.

[0082] The obtained multiple random reversible matrices are combined into a high-order matrix as a random matrix. Based on the above example, Figure 3 As shown, repeat step 1 4 times to obtain 4 reversible matrices M0, M1, M2, M3, which are combined into an 8-order matrix The matrix is ​​written in bits as:

[0083]

[0084] In some embodiments, generating a random permutation array based on the generated random matrix includes:

[0085] Randomly generated numbers

[0086] Given a number of initialized random arrays associated with the random matrix, for example, based on the aforementioned example, initialize the random array S=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15].

[0087] Select a reversible matrix according to the generated number b to update the random array;

[0088]

[0089] in M b mod 4 means from Select a 4-order reversible matrix, operator represents an affine transformation, such as Figure 4 As shown, the final output is a random permutation array.

[0090] In step S102, based on the generated random matrix, a mask set is generated by cyclic shift of the matrix.

[0091] In some embodiments, generating a mask set based on the generated random matrix by cyclic shift of the matrix includes:

[0092] The random matrix is ​​used as a generator matrix of a random mask. Based on the above example, a 0, 1 random matrix M with a size of 8×8 is set as a generator matrix of a random mask.

[0093] Each row of the generator matrix i (i∈{0,1,2,3,4,5,6,7}), each column col i As a Boolean function truth table, convert them into corresponding decimal numbers in the set order to obtain the random mask value m j (j∈{0,1,2,3,4,5,6,7}), for example, convert the left high bit and the right low bit into the corresponding 8-bit decimal number to obtain 8 random mask values ​​m j (j∈{0,1,2,3,4,5,6,7}), m j (j∈{8,9,10,11,12,13,14,15}), respectively recorded as array mask r , array mask c , i is the number of rows or columns of the generated matrix.

[0094] Concatenate the mask value m obtained based on the generator matrix j , to obtain a random mask set mask = mask r ||mask c , where mask r To generate each row of the matrixi The obtained mask value, mask c To generate each column col of the matrix i The obtained mask value.

[0095] Generate a random offset R, which is required to be R≤32 for an 8-order matrix. The random matrix is ​​cyclically shifted as a whole according to the random offset R to obtain a new matrix M. R , the new matrix M R Used to generate a new mask set.

[0096] In step S103, according to the generated random permutation array, the S-box is calculated in a disordered manner in the AES encryption algorithm, and masks are added based on the intermediate values ​​of the generated mask set at different positions.

[0097] In some embodiments, performing random calculation of S-boxes in an AES encryption algorithm according to the generated random permutation array, and adding masks based on intermediate values ​​of the generated mask set at different positions includes:

[0098] The masks in the first round of AES encryption include:

[0099] According to the matrix M 0 As the generator matrix of the random mask, and to generate the random offset R1, R1≤32 is required.

[0100] Generate a A random permutation P on ;

[0101] X is a 4×4 plaintext state matrix, each element of the matrix is ​​8 bits. The given plaintext state matrix and the mask matrix are XORed by element position to obtain the initialized data matrix mask0 is the matrix M 0 The resulting mask matrix:

[0102]

[0103] Initialize the data matrix and combine it with the round key to get the input matrix of the S box

[0104] Let S(x) be the S-box of AES, S m (x) is the S-box calculated with mask, then the input and output of the masked S-box in the first round of encryption satisfies:

[0105]

[0106] where t∈{0,1,…,15}, It is a number input, and is executed out of order using random permutation P.

[0107] For the total 128 bits of input data The output of the new S-box is represented by

[0108]

[0109] The row shift (expressed as SR) and column mix (expressed as MC) operations are linear transformations, and the data already contains a mask, so the corresponding transformations are directly performed to obtain:

[0110]

[0111] Add the next round's round key and get

[0112] Remove the output mask of the S-box

[0113] Add the next round of input masks

[0114] In some embodiments, performing random calculation of S-boxes in an AES encryption algorithm according to the generated random permutation array, and adding masks based on intermediate values ​​of the generated mask set at different positions includes:

[0115] The masks in the AES intermediate round encryption include:

[0116] The input data matrix of the i-th round is The random matrix M is calculated according to R i Into a new mask matrix, and then generate a random offset R i+1 , the matrix M i The resulting mask matrix is:

[0117]

[0118] The input data is XORed with the mask, and the input of the S-box is

[0119] For the total 128 bits of input data The newly calculated S-box satisfies:

[0120]

[0121] The data is obtained after shifting rows and mixing columns:

[0122]

[0123] Add the next round's round key to get

[0124] Remove the output mask of the S-box

[0125] Add the next round of input masks

[0126]

[0127] In some embodiments, performing random calculation of S-boxes in an AES encryption algorithm according to the generated random permutation array, and adding masks based on intermediate values ​​of the generated mask set at different positions includes:

[0128] The masks in AES tail round encryption include:

[0129] The input data matrix for this round is The random matrix M is calculated according to R i Into a new mask matrix, and then generate a random offset R i+1 , the matrix M i The resulting mask matrix is:

[0130]

[0131] The input data is XORed with the mask, and the input of the S-box is

[0132] Generate a A random permutation Q on ;

[0133] S(x) is the S-box of AES, S m (x) is the S-box calculated with mask. The input and output of the masked S-box in the final round of encryption satisfy:

[0134]

[0135] where t∈{0,1,…,15}, It is a number input, using random permutation Q out of order execution;

[0136] For the total 128 bits of input data The S-box meets the following requirements:

[0137]

[0138] The data is obtained after row shifting:

[0139]

[0140] Adding a round key

[0141] Remove the output mask of the S-box:

[0142]

[0143] Output the encrypted ciphertext state matrix

[0144] This application proposes a low-entropy mask protection scheme for the AES algorithm, which can defend against first-order CPA attacks while using smaller random numbers and implementation costs. And an implementation method combining the mask scheme with the AES algorithm is given to ensure the security of sensitive data during encryption and decryption, and reduce the implementation cost of traditional masks. This application introduces a 64-bit random 0, 1 matrix to achieve random generation and update of a mask set with a mask entropy of 4. Compared with traditional lookup table masks, it greatly reduces the implementation cost and can resist first-order CPA attacks, with strong security.

[0145] An embodiment of the present application also proposes a circulant matrix-based anti-side channel attack mask protection system, including a processor and a memory, wherein a computer program is stored on the memory, and when the computer program is executed by the processor, the steps of the circulant matrix-based anti-side channel attack mask protection method as described above are implemented.

[0146] It should be noted that in the various embodiments of the present application, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0147] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0148] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0149] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A mask protection method against side channel attacks based on circulant matrices, characterized in that: include: Generate a random matrix, and generate a random permutation array based on the generated random matrix, wherein the random matrix only contains 1 and 0 elements; Based on the generated random matrix, a mask set is generated by cyclic shift of the matrix; According to the generated random permutation array, the S-box is calculated in a disordered order in the AES encryption algorithm, and masks are added based on the intermediate values ​​of the generated mask set at different positions.

2. The circulant matrix-based anti-side channel attack mask protection method according to claim 1, characterized in that: Generating a random matrix involves: Repeatedly generating a unit matrix of a preset order, and performing multiple random transformations on the unit matrix to obtain a random reversible matrix; The obtained multiple random reversible matrices are combined into a high-order matrix as a random matrix.

3. The circulant matrix-based anti-side channel attack mask protection method according to claim 2, characterized in that: Generating a random permutation array based on a generated random matrix includes: Randomly generated numbers Given a number of initialized random arrays associated with the random matrix; Select a reversible matrix according to the generated number b to update the random array; Output gets a randomly permuted array.

4. The circulant matrix-based anti-side channel attack mask protection method according to claim 3, characterized in that: Based on the generated random matrix, through the cyclic shift of the matrix, the mask set is generated including: Using the random matrix as a generator matrix of a random mask; Each row of the generator matrix i , each column col i As a Boolean function truth table, convert them into corresponding decimal numbers in the set order to obtain the random mask value m j , i is the number of rows or columns of the generated matrix; Concatenate the mask value m obtained based on the generator matrix j , to obtain a random mask set mask = mask r ||mask c , where mask r Generate each row of the matrix i The obtained mask value, mask c To generate each column col of the matrix i The obtained mask value; Generate a random offset R, and the random matrix is ​​cyclically shifted as a whole according to the random offset R to obtain a new matrix M R , the new matrix M R Used to generate a new mask set.

5. The circulant matrix-based anti-side channel attack mask protection method according to claim 4, characterized in that: According to the generated random permutation array, the S-box is calculated in a disordered manner in the AES encryption algorithm, and masks are added based on the intermediate values ​​of the generated mask set at different positions, including: The masks in the first round of AES encryption include: According to the matrix M 0 As a generator matrix of random mask, and, generate random offset R1; Generate a A random permutation P on ; XOR the given plaintext state matrix with the mask matrix by element position to get the initialized data matrix mask0 is the matrix M 0 The resulting mask matrix; Initialize the data matrix and combine it with the round key to get the input matrix of the S box Let S(x) be the S-box of AES, S m (x) is the S-box calculated with mask, then the input and output of the masked S-box in the first round of encryption satisfies: where t∈{0,1,…,15}, It is a number input, using random permutation P to execute out of order; For the overall input data The output of the new S-box is represented by Execute row shift SR and column mix MC, including: Add the next round's round key and get Remove the output mask of the S-box Add the next round of input masks 6. The circulant matrix-based anti-side channel attack mask protection method according to claim 5, characterized in that: According to the generated random permutation array, the S-box is calculated in a disordered manner in the AES encryption algorithm, and masks are added based on the intermediate values ​​of the generated mask set at different positions, including: The masks in the AES intermediate round encryption include: The input data matrix of the i-th round is The random matrix M is calculated according to R i Into a new mask matrix, and then generate a random offset R i+1 , the matrix M i The resulting mask matrix is: The input data is XORed with the mask, and the input of the S-box is For the overall input data The newly calculated S-box satisfies: Data is obtained after row shift and column mixing Add the next round's round key to get Remove the output mask of the S-box Add the next round of input masks 7. The circulant matrix-based anti-side channel attack mask protection method according to claim 6, characterized in that: According to the generated random permutation array, the S-box is calculated in a disordered manner in the AES encryption algorithm, and masks are added based on the intermediate values ​​of the generated mask set at different positions, including: The masks in AES tail round encryption include: The input data matrix for this round is The random matrix M is calculated according to R i Into a new mask matrix, and then generate a random offset R i+1 , the matrix M i The resulting mask matrix is: The input data is XORed with the mask, and the input of the S-box is Generate a A random permutation Q on ; S(x) is the S-box of AES, S m (x) is the S-box calculated with mask. The input and output of the masked S-box in the final round of encryption satisfy: where t∈{0,1,…,15}, It is a number input, using random permutation Q out of order execution; For the overall input data The S-box meets the following requirements: The data is obtained after row shifting: Adding a round key Remove the output mask of the S-box: Output the encrypted ciphertext state matrix 8. A mask protection system against side channel attacks based on circulant matrices, characterized in that: The invention comprises a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the steps of the circulant matrix-based anti-side channel attack mask protection method as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Software mask defense scheme capable of preventing attack on advanced encryption standard (AES) algorithm based on power analysis

    CN103795527A

  • Side channel energy analysis method for ZUC cryptographic algorithm with mask protection

    CN104811295A

  • Highly efficient mask protection method for linear part of AES algorithm

    CN109617667A

  • dynamic path S box and an AES encryption circuit capable of defending power consumption attack

    CN109818732A

  • Information encryption method and system based on AES algorithm and related component

    CN110071794A