A collision attack post-processing method and system based on a genetic algorithm

By combining genetic algorithms to optimize the collision attack process, the inefficiency of traditional collision attacks in large-scale datasets and complex encryption environments is solved, achieving fast and accurate key location and improving the security assessment efficiency of modern encryption technologies.

CN119449262BActive Publication Date: 2026-03-31WUHAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-14
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Traditional collision attacks are inefficient when dealing with large-scale datasets or low-quality data, and are difficult to deal with modern encryption technologies such as AES and RSA. They are also susceptible to noise and environmental changes, making them difficult to apply effectively in practical security assessments.

Method used

By combining genetic algorithms with collision attack techniques, and optimizing the key candidate evaluation and selection strategy, the correct key can be quickly located by sorting and optimizing the collision values ​​using genetic algorithms.

Benefits of technology

It significantly improves the efficiency and accuracy of collision attacks, reduces attack time, and enhances application effectiveness in complex encrypted environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119449262B_ABST
    Figure CN119449262B_ABST
Patent Text Reader

Abstract

The application provides a collision attack post-processing method and system based on a genetic algorithm. A plurality of groups of random plaintexts are obtained first, and corresponding power traces are obtained by encryption through a cryptographic algorithm; correlation-enhanced collision attacks are performed on the random plaintexts and the power traces to obtain possibility rankings of pairwise key byte collision values; average values of energy traces of each group of power traces are calculated, and square sums of energy trace differences between key bytes are calculated; collision values between pairwise key bytes are confirmed according to a theoretical distribution of the square sums; the pairwise key byte collision values are rearranged, and the values marked as collisions are moved forward, and the values not marked as collisions are moved backward; initial populations are input into a genetic algorithm framework for evolution, and selection, crossover and mutation operations are implemented until an evolution generation reaches a threshold value or a correct collision chain is found, and the individual with the highest fitness is output as a result. The application significantly improves the efficiency and accuracy of the collision attack by optimizing the evaluation and selection strategy of key candidates.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cryptanalysis technology, and in particular to a collision attack post-processing method and system based on genetic algorithms. Background Technology

[0002] Collision attacks are a common analytical technique in side-channel analysis, and they have shown unique effectiveness in combating modern cryptographic systems with high security requirements.

[0003] The core principle of collision attacks is to compare the outputs of two or more encryption operations, looking for any identical results or patterns. These similarities may reveal the key or partial key information used in the encryption process. Specifically, in side-channel attacks, analysts utilize physical information such as power consumption traces to monitor the physical behavior of the device during the execution of the encryption algorithm. By statistically analyzing the data and corresponding physical traces in the encryption operations, attackers can identify the interactions between single bytes or multiple bytes in the key, thereby inferring the key itself.

[0004] While collision attacks have demonstrated effectiveness both theoretically and practically, they have significant limitations when dealing with large-scale datasets or low-quality data. Traditional collision attacks typically require vast amounts of data and high-precision measurements, which may be difficult to achieve in practice. Furthermore, when facing modern encryption technologies such as AES and RSA, which are designed with strong collision resistance, traditional methods are often inefficient, time-consuming, and susceptible to noise and environmental changes, limiting their application scope and effectiveness in practical security assessments. Summary of the Invention

[0005] The purpose of this invention is to provide a collision attack post-processing method and system based on genetic algorithms, which significantly improves the efficiency and accuracy of collision attacks by optimizing the key candidate evaluation and selection strategy during the attack process.

[0006] The core idea of ​​this invention is to improve the efficiency and accuracy of side-channel attacks by combining genetic algorithms with collision attack techniques. Specifically, this invention uses a genetic algorithm to optimize and filter potential key collision values ​​generated during the collision attack process. First, random plaintext is encrypted and power consumption traces are collected. These data are used to perform an enhanced collision attack to generate an initial key byte collision ranking. Then, the genetic algorithm is used to sort and optimize these collision values. Through selection, crossover, and mutation operations, the optimal collision chain is continuously evolved to find the best one. This allows for the rapid and accurate location of the correct key in large amounts of data, significantly improving the effectiveness of traditional collision attacks in complex encryption environments.

[0007] The technical solution of this invention is a collision attack post-processing method based on a genetic algorithm, which specifically includes the following steps:

[0008] Step 1: Obtain multiple sets of random plaintext, encrypt each set of random plaintext using a cryptographic algorithm to obtain the power trace of each set of random plaintext;

[0009] Step 2: Perform a correlation-enhanced collision attack on the random plaintext and power consumption trace to obtain a ranking of the probability of collision values ​​between pairs of key bytes;

[0010] Step 3: Calculate the average value of the energy trace for each power trace corresponding to each group of random plaintext, and calculate the sum of the squares of the differences in energy traces between each pair of key bytes;

[0011] Step 4: Sum of the squared differences in the energy traces between each pair of key bytes The theoretical distribution confirms the collision values ​​between pairs of key bytes;

[0012] Step 5: Rearrange the values ​​of the key bytes that collide in pairs, and move the values ​​marked as colliding in Step 4 forward and the values ​​marked as non-colliding backward.

[0013] Step 6: Input the initial population into the genetic algorithm framework for evolution, and perform selection, crossover and mutation operations in each evolution;

[0014] Step 7: When the number of generations reaches the threshold or the correct collision chain is found, end the genetic algorithm and output the individual with the highest fitness as the result;

[0015] As a preferred embodiment, each set of random plaintext in step 1 is defined as follows:

[0016]

[0017] Among them, P i This represents the i-th random plaintext set in the dataset, where each random plaintext set contains N1 bytes.

[0018] Each power trace corresponding to each group of random plaintexts in step 1 consists of multiple power consumption information.

[0019] The number of power traces in each group of random plaintexts described in step 1 is consistent with the number of S-boxes N used in the encryption algorithm. Each data point represents the first round of execution of the S-box.

[0020] The power trace for each group of random plaintexts mentioned in step 1 is defined as follows:

[0021] The power trace for each group corresponding to the i-th group of random plaintext is defined as follows:

[0022]

[0023] in, This represents the j-th power information in each power trace corresponding to the i-th group of random plaintext, with the corresponding plaintext byte value being p. j ;

[0024] Since there is only one key for encrypting each set of random plaintext, it is represented as follows: The number of bytes N1 for both plaintext and key is determined by the corresponding encryption algorithm;

[0025] As a preferred embodiment, step 2 involves performing a correlation-enhanced collision attack on the random plaintext and power consumption trace, as follows:

[0026]

[0027] That is, if the XOR value of the two plaintext bytes is equal to the XOR value of the corresponding two key bytes, the XOR value of each pair of key bytes is the collision between the two key bytes. Then, the XOR value of each pair of plaintext bytes is the probability ranking of the collision value between each pair of key bytes.

[0028] Preferably, step 3 involves calculating the average energy trace of each power trace corresponding to each group of random plaintext, defined as follows:

[0029]

[0030] in, This represents the total number of energy traces corresponding to the value m of the j-th plaintext byte. This represents the mean of all traces corresponding to the value of the j-th plaintext byte being m. This represents the j-th power information in each power trace corresponding to the i-th group of random plaintext, and the plaintext byte value corresponding to this power information is m;

[0031] The sum of the squared differences in the energy traces between the key bytes mentioned in step 3 is shown in the following formula:

[0032]

[0033] in, This indicates that when the i-th key byte value and the j-th key byte value collide, their XOR value is δ. i,j At that time, the sum of the squares of the differences in the corresponding energy traces, This indicates that the XOR value of the collision between the i-th key byte value and the j-th key byte value is δ. i,j The number of energy traces. Indicates having 2 8 A finite field of n elements, where each element can be viewed as an 8-bit binary number, i.e., 0-255. δ i,j This represents the XOR operation between the i-th plaintext byte value and the j-th plaintext byte value, and its value is between 0 and 255. It is the XOR operator;

[0034] Preferably, step 4 is as follows:

[0035] In the correct key, let the collision between the i-th key byte value and the j-th key byte value be δ. i,j * For each set of power traces corresponding to each set of random plaintext obtained in step 1, multiple samplings with replacement are performed. Based on the calculation method in step 3, the collision δ between the i-th key byte value and the j-th key byte value of multiple correct keys is calculated. i,j * Below in This indicates that the value of the j-th plaintext byte is... The mean of all corresponding energy traces.

[0036] In theory, Where Q represents the number of samples drawn, σ N It can be calculated that under this sample The variance was obtained based on... From the theoretical distribution, we can derive the result described in step S3. It follows a chi-square distribution with 256 degrees of freedom, i.e.

[0037] First, calculate the 95% left confidence interval of the chi-square distribution. Then, randomly draw the same number of energy trace samples as the previous samples with replacement, and calculate the value of δ. i,j The value ranges from 0 to 255. And perform hypothesis testing based on the confidence interval, if δ i,j When = a, If the value falls within the rejection domain, then the probability that the XOR of the i-th key byte value and the j-th key byte value is 'a' is considered very small; if If it falls within the receiving region, the corresponding collision value δ will be... i,j Marked as a collision.

[0038] Preferably, step 5 is as follows:

[0039] Combining the probability ranking of pairwise key byte collision values ​​in the relevant enhanced collision attack described in step 2, and the hypothesis test results described in step 4, the pairwise key byte collision values ​​are rearranged. That is, based on the probability ranking of pairwise key byte collision values, the values ​​marked as collisions in step 4 are moved forward, and the values ​​marked as non-collisions are moved backward.

[0040] The population size for the genetic algorithm is specified as n. pop The initialization operation involves selecting the top n collision rankings after rearrangement. pop A collision chain;

[0041] Preferably, the fitness described in step 7 is defined as follows:

[0042] The number of collisions in the current individual is determined by the labeling result of the XOR value of the collision in the hypothesis test in step 4. That is, for a collision value in a collision chain, it is determined whether the collision value falls in the rejection region. If it does not fall in the rejection region, it is considered that a collision has occurred. The number of collisions is accumulated as the fitness of the individual.

[0043] This invention provides a collision attack post-processing system based on a genetic algorithm, specifically including:

[0044] The power consumption acquisition module for each group of random plaintext is used to acquire multiple groups of random plaintext, encrypt each group of random plaintext using a cryptographic algorithm to obtain the power consumption trace of each group of random plaintext.

[0045] The probability ranking calculation module is used to perform correlation-enhanced collision attacks on random plaintext and power traces to obtain the probability ranking of collision values ​​between pairs of key bytes.

[0046] The energy trace difference square calculation module calculates the average value of the energy trace for each power trace corresponding to each group of random plaintext, and calculates the sum of the squared differences of the energy traces between each pair of key bytes;

[0047] The collision value confirmation module is used to confirm the collision value between pairs of key bytes based on the theoretical distribution of the sum of the squares of the differences in energy traces between pairs of key bytes.

[0048] The collision value shifting module is used to rearrange the values ​​of the key bytes that collide, shifting the values ​​marked as collisions in step 4 forward and the values ​​marked as non-collisions backward.

[0049] The genetic algorithm initialization module is used to input the initial population into the genetic algorithm framework for evolution. Each evolutionary step involves selection, crossover, and mutation operations.

[0050] The iterative output module is used to terminate the genetic algorithm and output the individual with the highest fitness as the result when the number of generations reaches a threshold or the correct collision chain is found.

[0051] The advantages of this invention are: high attack efficiency, which significantly improves the evaluation and selection speed of key candidates and reduces attack time by optimizing the post-processing of collision attacks through genetic algorithms; adaptive evolution, in which the selection, crossover and mutation operations of the genetic algorithm framework enable the algorithm to adaptively find the optimal solution, improving its ability to handle complex scenarios; and strong systematicity, as this invention provides a systematic genetic algorithm processing framework that integrates random plaintext generation, power consumption analysis, collision value rearrangement and key candidate search, making it convenient for practical applications. Attached Figure Description

[0052] Figure 1 : Flowchart of the method according to an embodiment of the present invention.

[0053] Figure 2 : A schematic diagram of the selection operation in an embodiment of the present invention.

[0054] Figure 3 : A schematic diagram of the cross operation in an embodiment of the present invention.

[0055] Figure 4 : A schematic diagram of the mutation operation in an embodiment of the present invention. Detailed Implementation

[0056] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0057] In specific implementation, the method proposed in the technical solution of this invention can be automatically executed by those skilled in the art using computer software technology. System devices for implementing the method, such as computer-readable storage media storing the corresponding computer program of the technical solution of this invention and computer equipment including the computer program running the corresponding computer program, should also be within the protection scope of this invention.

[0058] The following is in conjunction with the appendix Figure 1-4 The specific implementation of this invention is a collision attack post-processing method and system based on a genetic algorithm, as detailed below:

[0059] The specific implementation of the method of the present invention is a collision attack post-processing method based on a genetic algorithm, such as... Figure 1 As shown, it specifically includes:

[0060] Step 1: Obtain multiple sets of random plaintext, encrypt each set of random plaintext using a cryptographic algorithm to obtain the power trace of each set of random plaintext;

[0061] Each set of random plaintext mentioned in step 1 is defined as follows:

[0062]

[0063] Among them, P i This represents the i-th random plaintext group in the dataset. One random plaintext group contains N1 bytes. Here we take the AES-128 algorithm as an example, where N1 = 16.

[0064] Each power trace corresponding to each group of random plaintexts in step 1 consists of multiple power consumption information.

[0065] The number of power traces in each group of random plaintexts described in step 1 is consistent with the number of S-boxes N used in the encryption algorithm. Each data represents the first round of execution of the S-box. Here we take the AES-128 algorithm as an example, N=16.

[0066] The power trace for each group of random plaintexts mentioned in step 1 is defined as follows:

[0067] The power trace for each group corresponding to the i-th group of random plaintext is defined as follows:

[0068]

[0069] in, This represents the j-th power information in each power trace corresponding to the i-th group of random plaintext, with the corresponding plaintext byte value being p. j , where p j The value of is an integer between 0 and 255;

[0070] Since there is only one key for encrypting each set of random plaintext, it is represented as follows: The number of plaintext and key bytes N1 is determined by the corresponding encryption algorithm. Here we take the AES-128 algorithm as an example, N1 = 16.

[0071] Step 2: Perform a correlation-enhanced collision attack on the random plaintext and power consumption trace to obtain a ranking of the probability of collision values ​​between pairs of key bytes;

[0072] Step 2 describes performing a correlation-enhanced collision attack on the random plaintext and power consumption trace, as follows:

[0073]

[0074] That is, if the XOR value of the two plaintext bytes is equal to the XOR value of the corresponding two key bytes, the XOR value of each pair of key bytes is the collision between the two key bytes. Then, the XOR value of each pair of plaintext bytes is the probability ranking of the collision value between each pair of key bytes.

[0075] Step 3: Calculate the average value of the energy trace for each power trace corresponding to each group of random plaintext, and calculate the sum of the squares of the differences in energy traces between each pair of key bytes;

[0076] Step 3 involves calculating the average energy trace of each power trace corresponding to each group of random plaintext, defined as follows:

[0077]

[0078] in, This represents the total number of energy traces corresponding to the value m of the j-th plaintext byte. This represents the mean of all traces corresponding to the value of the j-th plaintext byte being m. This represents the j-th power information in each power trace corresponding to the i-th group of random plaintext, and the plaintext byte value corresponding to this power information is m;

[0079] The sum of the squared differences in the energy traces between the key bytes mentioned in step 3 is shown in the following formula:

[0080]

[0081] in, This indicates that when the i-th key byte value and the j-th key byte value collide, their XOR value is δ. i,j At that time, the sum of the squares of the differences in the corresponding energy traces, This indicates that the XOR value of the collision between the i-th key byte value and the j-th key byte value is δ. i,j The number of energy traces. Indicates having 2 8 A finite field of n elements, where each element can be viewed as an 8-bit binary number, i.e., 0-255. δ i,j This represents the XOR operation between the i-th plaintext byte value and the j-th plaintext byte value, and its value is between 0 and 255. It is the XOR operator;

[0082] Step 4: Sum of the squared differences in the energy traces between each pair of key bytes The theoretical distribution confirms the collision values ​​between pairs of key bytes;

[0083] Step 4 is described in detail below:

[0084] In the correct key, let the collision between the i-th key byte value and the j-th key byte value be δ. i,j * For each set of power traces corresponding to each set of random plaintext obtained in step 1, multiple samplings with replacement are performed. Based on the calculation method in step 3, the collision δ between the i-th key byte value and the j-th key byte value of multiple correct keys is calculated. i,j * Below in This indicates that the value of the j-th plaintext byte is... The mean of all corresponding energy traces.

[0085] In theory, Where Q represents the number of samples drawn, σ N It can be calculated that under this sample The variance was obtained based on... From the theoretical distribution, we can derive the result described in step S3. It follows a chi-square distribution with 256 degrees of freedom, i.e.

[0086] First, calculate the 95% left confidence interval of the chi-square distribution. Then, randomly draw the same number of energy trace samples as the previous samples with replacement, and calculate the value of δ. i,j The value ranges from 0 to 255. And perform hypothesis testing based on the confidence interval, if δ i,j When = a, If the value falls within the rejection domain, then the probability that the XOR of the i-th key byte value and the j-th key byte value is 'a' is considered very small; if If it falls within the receiving region, the corresponding collision value δ will be... i,j Marked as a collision.

[0087] Step 5: Rearrange the values ​​of the key bytes that collide in pairs, and move the values ​​marked as colliding in Step 4 forward and the values ​​marked as non-colliding backward.

[0088] Step 5 is described in detail below:

[0089] Combining the probability ranking of pairwise key byte collision values ​​in the relevant enhanced collision attack described in step 2, and the hypothesis test results described in step 4, the pairwise key byte collision values ​​are rearranged. That is, based on the probability ranking of pairwise key byte collision values, the values ​​marked as collisions in step 4 are moved forward, and the values ​​marked as non-collisions are moved backward.

[0090] The population size for the genetic algorithm is specified as n. pop In this example, n pop =50, the initialization operation is to select the top n of the collision rankings after rearrangement. pop A collision chain;

[0091] Step 6: Input the initial population into the genetic algorithm framework for evolution. Each evolutionary step involves selection, crossover, and mutation operations. The processes of selection, crossover, and mutation are as follows: Figure 2 , 3 As shown in Figure 4;

[0092] Step 7: When the number of generations reaches the threshold or the correct collision chain is found, end the genetic algorithm and output the individual with the highest fitness as the result;

[0093] The fitness mentioned in step 7 is defined as follows:

[0094] The number of collisions in the current individual is determined by the labeling result of the XOR value of the collision in the hypothesis test in step 4. That is, for a collision value in a collision chain, it is determined whether the collision value falls in the rejection region. If it does not fall in the rejection region, it is considered that a collision has occurred. The number of collisions is accumulated as the fitness of the individual.

[0095] The specific implementation of the system of the present invention is a collision attack post-processing system based on a genetic algorithm, specifically including:

[0096] The power consumption acquisition module for each group of random plaintext is used to acquire multiple groups of random plaintext, encrypt each group of random plaintext using a cryptographic algorithm to obtain the power consumption trace of each group of random plaintext.

[0097] The probability ranking calculation module is used to perform correlation-enhanced collision attacks on random plaintext and power traces to obtain the probability ranking of collision values ​​between pairs of key bytes.

[0098] The energy trace difference square calculation module calculates the average value of the energy trace for each power trace corresponding to each group of random plaintext, and calculates the sum of the squared differences of the energy traces between each pair of key bytes;

[0099] The collision value confirmation module is used to confirm the collision value between pairs of key bytes based on the theoretical distribution of the sum of the squares of the differences in energy traces between pairs of key bytes.

[0100] The collision value shifting module is used to rearrange the values ​​of the key bytes that collide, shifting the values ​​marked as collisions in step 4 forward and the values ​​marked as non-collisions backward.

[0101] The genetic algorithm initialization module is used to input the initial population into the genetic algorithm framework for evolution. Each evolutionary step involves selection, crossover, and mutation operations.

[0102] The iterative output module is used to terminate the genetic algorithm and output the individual with the highest fitness as the result when the number of generations reaches a threshold or the correct collision chain is found.

[0103] The table shows the results of running the genetic algorithm framework proposed in this invention on different datasets. The table lists the time required for 100 generations of evolution and the success rate of recovering the correct key.

[0104] Table 1: Comparison of Experimental Results of Genetic Algorithms

[0105]

[0106] The experimental results show that the framework proposed in this invention has a fast running time, generally evolving 100 generations within 1 second, and a high key recovery success rate of over 90%.

[0107] It should be understood that any parts not described in detail in this specification belong to the prior art.

[0108] It should be understood that the above description of the preferred embodiments is quite detailed, but it should not be considered as a limitation on the scope of protection of this invention. Those skilled in the art, under the guidance of this invention, can make substitutions or modifications without departing from the scope of protection of the claims of this invention, and all such substitutions or modifications fall within the scope of protection of this invention. The scope of protection of this invention should be determined by the appended claims.

Claims

1. A collision attack post-processing method based on genetic algorithm, characterized in that, The method comprises the following steps: Step 1: obtaining a plurality of groups of random plaintexts, and encrypting each group of random plaintexts through a cryptographic algorithm to obtain each group of power consumption traces of each group of random plaintexts; Step 2: performing a correlation-enhanced collision attack on the random plaintexts and the power consumption traces to obtain a possibility ranking of two-by-two key byte collision values; Step 3: calculating an average value of an energy trace of each group of power consumption traces corresponding to each group of random plaintexts, and calculating a sum of squares of differences of energy traces between two-by-two key bytes; Step 4: Confirm the collision value between the pairwise key bytes according to the sum of square of difference of energy trace between pairwise key bytes theoretical distribution of the sum of square of difference of energy trace between pairwise key bytes Step 5: rearranging the two-by-two key byte collision values, moving the values marked as collisions in step 4 forward, and moving the values not marked as collisions backward; Step 6: inputting an initial population into a genetic algorithm framework for evolution, and performing selection, crossover and mutation operations each time evolution is implemented; Step 7: when the evolution algebra reaches a threshold value or a correct collision chain is found, ending the genetic algorithm, and outputting a current individual with the highest fitness as a result; The average value of the energy trace of each group of power consumption traces corresponding to each group of random plaintexts in step 3 is defined as follows: wherein, represents the total number of energy traces corresponding to the th plaintext byte value . represents the mean value of all energy traces corresponding to the th plaintext byte value . represents the th power consumption information in each group of power consumption traces corresponding to the th group of random plaintexts, and the plaintext byte value corresponding to the power consumption information is ; The sum of squares of differences of energy traces between key bytes in step 3 is shown in the following formula: in, Indicates when the first The key byte value and the first The collision of key byte values, their XOR value is... At that time, the sum of the squares of the differences in the corresponding energy traces, Indicates that the first The key byte value and the first The collision XOR value of each key byte value is The number of energy traces; Indicates having A finite field of elements, where each element can be viewed as an 8-bit binary number, i.e., 0-255; Indicates the first The first plaintext byte value and the first The XOR operation of the plaintext byte values ​​takes a value between 0 and 255. It is the XOR operator; The step 4 is specifically as follows: In the correct key, let the collision of the first key byte value and the first key byte value be , and the collision of the first key byte value and the first key byte value be . , where represents the average of all power traces corresponding to the first plaintext byte value being . In theory, where represents the number of samples extracted, can be obtained by calculating the variance of under this sample; according to the theoretical distribution of , it can be concluded that obeys the chi-square distribution with 256 degrees of freedom, that is ; First, the left confidence interval of 95% of the chi-square distribution is calculated, then the same number of energy trace samples as before is randomly selected with replacement, and the chi-square value is calculated The value is 0-255 corresponding to , and the hypothesis test is carried out according to the confidence interval. If , Fall in the rejection region, it is considered that the XOR value of the first Key byte value and the first Key byte value is very small ; If Fall in the acceptance region, the corresponding collision value Is marked as a collision.

2. The post-processing method of the collision attack based on the genetic algorithm according to claim 1, characterized in that: Each group of random plaintexts in step 1 is defined as follows: , wherein, represents the i-th byte in the data set of random plaintext, 1 group of random plaintext contains bytes; Each group of power consumption traces corresponding to each group of random plaintexts in step 1 is composed of a plurality of power consumption information; The number of power consumption trace midpoints in each group of power consumption traces corresponding to each group of random plaintexts described in step 1 and the number of S-boxes used by the encryption algorithm Consistently, each data represents the first round execution process of the S-box. Each group of power consumption traces corresponding to each group of random plaintexts in step 1 is defined as: The first Each group of power traces corresponding to a group of random plaintexts is defined as follows: wherein, represents the first group of random plaintext corresponding to each group of power consumption traces of the first power consumption information in the first group of power consumption traces, and the corresponding plaintext byte value is Since there is only one key for each group of random plaintext encrypted, denoted as , the number of plaintext and key bytes are determined by the corresponding encryption algorithm.

3. The post-processing method of the collision attack based on the genetic algorithm according to claim 2, characterized in that: The correlation-enhanced collision attack on the random plaintexts and the power consumption traces in step 2 is specifically as follows: , That is, the two-byte XOR value of the plaintext is equal to the two-byte XOR value of the corresponding key, and the two-by-two key byte XOR value is the collision between the two key bytes, so that the two-by-two plaintext byte XOR value is obtained, that is, the possibility ranking of the two-by-two key byte collision value.

4. The post-processing method of the collision attack based on the genetic algorithm according to claim 3, characterized in that: The step 5 is specifically as follows: In combination with the possibility ranking of the two-by-two key byte collision value in the correlation-enhanced collision attack in step 2 and the result of the hypothesis test in step 4, the two-by-two key byte collision values are rearranged, that is, on the basis of the possibility ranking of the two-by-two key byte collision value, the values marked as collisions in step 4 are moved forward, and the values not marked as collisions are moved backward; The population size of the genetic algorithm is defined as The initialization population operation is to select the rearranged collision rank of the collision chain.

5. The post-processing method of the collision attack based on the genetic algorithm according to claim 4, characterized in that: The fitness in step 7 is defined as follows: The number of collisions in the current individual is determined by the marking result of the collision XOR value in the hypothesis test in step 4, that is, for a collision value in a collision chain, it is determined whether the collision value falls within a rejection region, and if not, it is considered that a collision has occurred, and the number of collisions is accumulated as the fitness of the individual.

6. A collision attack post-processing system based on genetic algorithm, characterized in that, It comprises: A random plaintext power consumption obtaining module is configured to obtain a plurality of groups of random plaintexts, and encrypt each group of random plaintexts through a cryptographic algorithm to obtain each group of power consumption traces of each group of random plaintexts; A possibility ranking calculation module is configured to perform a correlation-enhanced collision attack on the random plaintext and the power traces to obtain a possibility ranking of the pairwise key byte collision values; An energy trace difference square calculation module is configured to calculate the average value of the energy trace of each group of power traces corresponding to each group of random plaintexts, and calculate the sum of the energy trace difference squares between the pairwise key bytes; A collision value confirmation module is configured to confirm the collision value between the pairwise key bytes according to the theoretical distribution of the sum of the energy trace difference squares between the pairwise key bytes; A collision value moving module is configured to rearrange the pairwise key byte collision values, and move the values marked as collisions by the collision value confirmation module forward, and move the values not marked as collisions backward; A genetic algorithm initialization module is configured to input an initial population into a genetic algorithm framework for evolution, and perform selection, crossover and mutation operations in each evolution; An iteration output module is configured to end the genetic algorithm when the evolution generation reaches a threshold or a correct collision chain is found, and output the individual with the highest current fitness as a result. The average value of the energy trace of each group of power traces corresponding to each group of random plaintexts calculated by the energy trace difference square calculation module is defined as follows: wherein, represents the number of the th clear text byte value total number of the corresponding energy traces, represents the number of the th clear text byte value average value of all the corresponding energy traces, represents the number of the th group of random clear texts corresponding to the th power consumption information in each group of power consumption traces, and the clear text byte value corresponding to the power consumption information is ; The sum of the energy trace difference squares between the key bytes calculated by the energy trace difference square calculation module is shown as follows: wherein, represents the difference square sum of the energy traces when the collision of the first key byte value and the second key byte value, whose XOR value is ; represents the number of energy trace strips satisfying the collision XOR value of the first key byte value and the second key byte value is ; represents a finite field with elements, each element can be regarded as an 8-bit binary number, i.e. 0-255; represents the XOR of the first plaintext byte value and the second plaintext byte value, the value is between 0-255, is an XOR operator; The collision value confirmation module is specifically as follows: In the correct key, let the collision of the first key byte value and the first key byte value be , the energy trace corresponding to each group of random plaintext obtained in each group of power consumption acquisition module is sampled multiple times, and according to the calculation method in the energy trace difference square calculation module, the collision of the first key byte value and the first key byte value under multiple correct keys is calculated , , wherein represents the mean value of all energy traces corresponding to the first plaintext byte value . In theory, where represents the number of samples extracted, can be obtained by calculating the variance of under this sample; according to the theoretical distribution of , it can be concluded that obeys the chi-square distribution with 256 degrees of freedom, that is ; First, calculate the 95% left confidence interval of the chi-square distribution. Then, randomly draw the same number of energy trace samples as the previous samples with replacement, and calculate the... The value ranges from 0 to 255. And perform hypothesis testing based on the confidence interval, if hour, If it falls within the rejection domain, then the first... The key byte value and the first The XOR value of each key byte is taken as... The possibility is very small; if If it falls within the receiving region, then the corresponding collision value will be... Marked as a collision.

Citation Information

Patent Citations

  • Correlation enhanced collision energy attack method based on genetic algorithm

    CN114389789A

  • Secure hash operations in a trusted execution environment

    EP3506561A1