Method for disturbing side channel attack of AES (Advanced Encryption Standard) algorithm of system on chip
Through the exclusive OR operation of pseudo-random number generator and true random number generator and dynamic Sbox switching, the power-side channel attack problem of AES algorithm in the on-chip system is solved, and data security and performance are achieved.
Patent Information
- Application Number
- CN202411192773.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-11-22
AI Technical Summary
The prior art is difficult to effectively defend against power-side channel attacks by AES algorithms in systems on chips, and the defense equipment is complex and inefficient.
The exclusive OR operation of the pseudo-random number generator and the true random number generator generates a high-quality random number sequence as the input of the AES algorithm, and dynamically switches the implementation method of Sbox, increasing the randomness of the AES module to interfere with power-consumption-side channel attacks .
It realizes effective defense against power-side channel attacks of the AES algorithm, ensures data security, and reduces overhead on-chip performance and area.
Smart Images

Figure CN119004560A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of system-on-chip cryptographic information security, and in particular to a method for disrupting a side channel attack on an AES algorithm of a system-on-chip. Background Art
[0002] Encryption algorithm is a very important part in the field of system-on-chip information security. Its main purpose is to ensure the integrity, availability and confidentiality of system-on-chip data. With the rapid development of the system-on-chip industry and the continuous improvement of informatization in today's society, the issue of system information security has become increasingly important.
[0003] At present, there are many effective encryption standards in the field of information security of chip systems to protect confidential data from threats. Symmetric encryption algorithms refer to the use of the same key for encryption and decryption operations. Common symmetric encryption algorithms include AES, DES, RC4, and SM4. These algorithms run very fast and are easy to implement. They are suitable for encrypting large quantities of data in chip systems. Among them, the AES algorithm has undergone a long standardization process and is currently the most widely used symmetric encryption algorithm. There are three versions: 128-bit, 192-bit, and 256-bit AES encryption algorithms, which can work at high speed even when the chip system is not fast and the memory is limited.
[0004] Side channel attacks refer to attack methods that use the time, power consumption, electromagnetic radiation, etc. in the system-on-chip as a basis to obtain confidential information in the system-on-chip. Although the AES cryptographic algorithm uses a series of operations such as Sbox permutation and shift based on mathematics, making it difficult to crack from a theoretical perspective, in practical applications, the system-on-chip device may leak a variety of information such as running time, energy consumption, sound information, electromagnetic waves, etc. when working. Attackers can collect and analyze this information to crack the key.
[0005] There are many defense devices for power consumption side-channel attacks on the AES algorithm, but most of the specific implementation devices for on-chip systems are complex and inefficient. Summary of the invention
[0006] In order to solve the above technical problems, the present invention provides a method for disrupting the side channel attack of the AES algorithm of the system on chip, and the side channel attack method takes into account the defense success rate of the power consumption side channel attack and the performance overhead of the system on chip in practical applications, and comprises the following steps:
[0007] St1: Pseudo-random number generators PR0 and PR1 are XORed with the true random number generator TR through the output of selector M0, and the resulting random number sequence is used as the input of the look-aside module of the AES algorithm;
[0008] St2: Low bit output of the true random number generator TR, used to control the selector M1 of the AES module to switch Sbox;
[0009] In St1, first, one of the two pseudo-random number outputs is selected through M0. M0 is determined by the highest bit of the true random number TR. When the logic is 0, PR0 is selected, otherwise PR1 is selected. The output of M0 is XORed with the true random number output to obtain a true random number sequence with high randomness quality, which is then used in the look-aside module of AES. The look-aside module is a pseudo-AES encryption and decryption module. It has the same plaintext input as the true AES algorithm and uses the true random number sequence of the corresponding bit as the key for calculation, but its output is shielded.
[0010] Due to the existence of the look-aside module, when the side channel attacker collects power consumption, he collects the power consumption of the look-aside module and the real AES algorithm. The key of the look-aside module is random, so it makes the total power consumption random, thereby interfering with the power consumption side channel attack.
[0011] In St2, the AES module Sbox uses two different implementations and is randomly selected using true random numbers. Because the two Sbox implementations have different power consumption relative to the circuit, the collected Sbox power consumption is also random, thus interfering with power consumption side channel attacks.
[0012] In one embodiment of the present invention, the pseudo-random number generators PR0 and PR1 of St1 are both implemented in hardware using linear feedback shift registers; at the same time, the pseudo-random number generators PR0 and PR1 of St1 are configured to generate pseudo-random numbers with three different data bit widths of 128 bits, 192 bits and 256 bits.
[0013] In one embodiment of the present invention, the initial seed of the pseudo-random number generator PR0 of St1 comes from the true random number generator TR; the initial seed of the pseudo-random number generator PR1 of St1 comes from the pseudo-random number generator PR0.
[0014] In one embodiment of the present invention, the true random number generator TR is generated by 13 ring oscillator circuits, has two outputs CH0 and CH1, and is configured to obtain true random numbers with three different data bit widths of 128 bits, 192 bits and 256 bits.
[0015] In one embodiment of the present invention, the selector M0 is determined by the highest bit of the true random number TR. When it is logic 0, PR0 is selected, otherwise PR1 is selected. At the same time, the result of M0 is XOR-operated with the true random number as the input of the look-aside module of the final AES algorithm.
[0016] In one embodiment of the present invention, the look-aside module is a pseudo AES algorithm module, which uses true random number sequences of different bits to perform AES algorithm encryption and decryption operations; and the output of the look-aside module is shielded by hardware.
[0017] In one embodiment of the present invention, the difference between the Sbox types in the AES module lies in the hardware implementation method, which is divided into two implementation methods: lookup table (Lut) and logic gate (Logic); the Sbox controls the selector M1 through the low 4 bits of TR to randomly switch the corresponding Sbox to the implementation method of the logic gate or the lookup table.
[0018] The above technical solution of the present invention has the following advantages compared with the prior art:
[0019] 1. The side channel attack method described in the present invention is designed to resist the side channel attack of the AES algorithm of the system on chip, disrupts the power consumption side channel attack, makes it invalid, and ensures the data security of the AES algorithm of the system on chip.
[0020] 2. The device-level method proposed in the present invention is easy to implement and makes reasonable use of existing hardware resources without requiring large-scale changes to the system-on-chip hardware.
[0021] 3. Based on the first and second points, the present invention successfully defends against side channel attacks while causing a more acceptable impact on the area and performance of the on-chip system. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to make the contents of the present invention more clearly understood, the present invention is further described in detail below based on specific embodiments of the present invention in conjunction with the accompanying drawings.
[0023] Figure 1 It is a flow chart of the side channel attack against the AES algorithm in the present invention;
[0024] Figure 2 It is a schematic diagram of the implementation principle of the true random number generator of the present invention;
[0025] Figure 3 It is a schematic diagram of the implementation principle of the pseudo-random number generator of the present invention;
[0026] Figure 4 It is the overall framework and flow chart of the method for disrupting the side channel attack of the AES algorithm of the system on chip of the present invention;
[0027] Figure 5 It is a flow chart for realizing St2 described in the present invention. DETAILED DESCRIPTION
[0028] like Figure 4 As shown, this embodiment provides a method for disrupting a side channel attack of an AES algorithm of a system on chip, wherein the side channel attack method takes into account both the success rate of the defense of the power consumption side channel attack and the performance overhead of the system on chip in practical applications, and comprises the following steps:
[0029] St1: Pseudo-random number generators PR0 and PR1 are XORed with the true random number generator TR through the output of selector M0, and the resulting random number sequence is used as the input of the look-aside module of the AES algorithm;
[0030] St2: The low bit output of the true random number generator TR is used to control the selector M1 of the AES module to switch the Sbox.
[0031] The principle of power consumption side channel attack:
[0032] The basic principle of power consumption side channel attack is that there is usually a strong correlation between the power consumption characteristics of the device when processing information and the data processed by the logic unit in the circuit. For example, Figure 1 A typical side channel attack process is shown. First, the attacker selects the Sbox in the AES cryptographic algorithm and determines a suitable output intermediate value as the attack point. In order to accurately find this attack point, the attacker needs to obtain a known plaintext and a key to be recovered in advance, so as to derive the corresponding Sbox output.
[0033] Next, the second step is to use a specific acquisition device to record the energy consumption of the cryptographic device during operation. This process involves obtaining the power consumption curve during the encryption process, and combining it with the plaintext obtained in the first step and the key to be attacked to form the basic information required for the side channel attack.
[0034] On this basis, the attacker will use the corresponding leakage model to calculate the correlation coefficient between each guessed key and each sampling point in the power consumption curve. By observing the correlation coefficient, the key corresponding to the maximum value is found, which is the correct encryption key, thus completing the attack. The common leakage model is expressed as:
[0035] P=αHD(x,y)+β
[0036] Where α and β are constants. Specifically, if the intermediate value stored in the register before refreshing is x, and the intermediate value stored after refreshing is y, the Hamming distance between them is HD(x,y), and P is the power consumption value. If the intermediate value stored in the register before refreshing is x, and the intermediate value stored after refreshing is y, the power consumption can be estimated through the above model.
[0037] Based on the above principles of power consumption side channel attacks, we can summarize and design two main countermeasures to disrupt the attack.
[0038] First: Increase the randomness of the energy trajectory of the AES algorithm.
[0039] In order to quantify the power consumption change, we can use the power consumption model to express the relationship between the power consumption and the intermediate value. Assume that the power consumption model is:
[0040] P=αHD(x,y)+β
[0041] Where: HD(x,y) is the Hamming distance between the intermediate values x and y, which can be calculated by the following formula:
[0042]
[0043] Here, n is the number of digits, x i and i are the values of x and y at the i-th position, respectively, and α and β are constants related to hardware characteristics.
[0044] By introducing a variable key for the AES algorithm, applying the random sequence R generated by the random number generator to update the current key K:
[0045]
[0046] In the encryption process, K′ is used to replace K, so that the power consumption trajectory of each encryption presents different changes to ensure the randomness of the circuit operation. The implementation principle of the true random number generator is as follows Figure 2 As shown. For the implementation of the true random number generator, it is assumed that its random sequence can achieve a randomness of 2^16. In addition, it is assumed that the noise value generated by the seed of the pseudo-random number generator is slightly lower than the true random number, but by properly selecting the parameters α and β, the overall power consumption value can maintain effective randomness.
[0047] Many factors need to be considered during design, such as circuit stability and operating temperature. This solution uses two pseudo-random number generators to improve the quality of the random sequence generated by the true random number generator. Figure 3 As shown, the pseudo-random number generator generates pseudo-random numbers using a 256-bit linear feedback shift register, and further enhances its randomness through a random seed provided by a true random number.
[0048] The true random sequence will be applied to the look-aside module of AES. As a pseudo-AES encryption and decryption module, this module has the same plaintext input, but uses the corresponding true random number bits as the key for calculation, and shields the output results. Through the existence of the look-aside module, when the attacker collects power consumption, the data collected contains the power consumption of the look-aside module and the real AES algorithm, making the overall power consumption random, thereby interfering with the power consumption side channel attack.
[0049] Second: Disrupt the energy trajectory of Sbox
[0050] In the process of disturbing Sbox, the power consumption characteristics can be changed by dynamically selecting the implementation of Sbox. Set a switching condition, such as TR output based on the lower 4 bits. Assume that the output of TR is D TR :
[0051] When D TR mod 16=c, where c is the number of the currently selected Sbox (from 0 to 15), then Sbox c and the adjacent Sbox c-1 and Sbox c+1 are switched to a lookup table (LUT) implementation.
[0052] The power consumption characteristics of Sbox can be expressed as:
[0053] P Sbox =β Sbox f(c)+∈
[0054] where f(c) is the energy consumption function associated with the Sbox number (each Sbox can have different power consumption characteristics), and ∈ is a noise term representing the random power consumption introduced when the switching condition is met.
[0055] With respect to the two anti-attack strategies mentioned above, the implementation scheme described in this embodiment is relatively concise. By using only two 256-bit shift registers to construct a pseudo-random number generator, the true random sequence is disturbed, and at the same time, the existing true random number generator is used to generate pseudo-random number seeds, which effectively improves the quality of the true and pseudo-random sequences. In addition, during the execution of the AES module, some LUT-type Sboxes are used, which successfully achieves interference with the Sbox while maintaining low hardware overhead.
[0056] Obviously, the above embodiments are merely examples for clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from these are still within the protection scope of the invention.
Claims
1. A method for disrupting a side channel attack on an AES algorithm of a system on chip, wherein the side channel attack method takes into account both the success rate of the defense against the power consumption side channel attack and the performance overhead of the system on chip in practical applications, and is characterized in that: The steps include: St1: Pseudo-random number generators PR0 and PR1 are XORed with the true random number generator TR through the output of selector M0, and the resulting random number sequence is used as the input of the look-aside module of the AES algorithm; St2: The low bit output of the true random number generator TR, used to control the selector M1 of the AES module to switch the Sbox; In St1, one of the two pseudo-random number outputs is first selected through M0. M0 is determined by the highest bit of the true random number TR. When it is logically 0, PR0 is selected, otherwise PR1 is selected. The output of M0 is XORed with the true random number output to obtain a true random number sequence with high randomness quality, which is then used in the look-aside module of the AES algorithm. In St2, the Sbox of the AES module uses two different implementations and is randomly selected using true random numbers.
2. The side channel attack method according to claim 1, characterized in that: The pseudo-random number generators PR0 and PR1 of St1 are both implemented in hardware using linear feedback shift registers; at the same time, the pseudo-random number generators PR0 and PR1 of St1 are configured to generate pseudo-random numbers with three different data bit widths: 128bit, 192bit and 256bit.
3. The side channel attack method according to claim 2, characterized in that: The initial seed of the pseudo-random number generator PR0 of St1 comes from the true random number generator TR; the initial seed of the pseudo-random number generator PR1 of St1 comes from the pseudo-random number generator PR0.
4. The side channel attack method according to claim 3, characterized in that: The true random number generator TR is generated by 13 ring oscillator circuits, has two outputs CH0 and CH1, and is configured to obtain true random numbers with three different data bit widths of 128bit, 192bit and 256bit.
5. The side channel attack method according to claim 1, characterized in that: Selector M0 is determined by the highest bit of the true random number TR. When it is logic 0, PR0 is selected, otherwise PR1 is selected. At the same time, the result of M0 is XORed with the true random number as the input of the look-aside module of the final AES algorithm.
6. The side channel attack method according to claim 5, characterized in that: The look-aside module is a pseudo-AES algorithm module that uses true random number sequences of different bits to perform AES algorithm encryption and decryption operations; and the output of the look-aside module is shielded by hardware.
7. The side channel attack method according to claim 1, characterized in that: The difference between the Sbox types in the AES module lies in the hardware implementation method, which is divided into two implementation methods: lookup table and logic gate. The Sbox controls the selector M1 through the low 4 bits of TR, randomly switching the corresponding Sbox to the implementation method of logic gate or lookup table.
Citation Information
Cited By
Random clock generation device and clock signal output method
CN119336125A
Method and system for resisting side channel attack based on power consumption disorder
CN121966831A
A method and system for resisting side channel attacks based on power consumption chaos
CN121966831B
