Password algorithm multi-source countermeasure side channel analysis method based on random model
By introducing multi-source adversarial learning in the random model, and using normal distribution conditional probability and KS test for parameter iteration, the problem of low model modeling accuracy is solved, and the efficiency and quality of key recovery is improved.
Patent Information
- Application Number
- CN202411867324.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-12-18
AI Technical Summary
In the side channel analysis, the existing random models have low modeling parameters accuracy and difficult key recovery due to noise interference.
The idea of multi-source adversarial learning is introduced, through adversarial learning of noise sources and energy sources, using normal distribution conditional probability and KS test as the basis for judgment, a random model modeling parameter iteration mechanism is designed to improve modeling accuracy.
The multi-source modeling accuracy of the random model is improved, the parameter quality of key recovery is improved, the difficulty of channel analysis on the side of the cryptographic algorithm is reduced, and the number of energy waveforms required for key recovery is reduced.
Smart Images

Figure CN119788346A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of cryptography and multi-source side channel analysis, and more specifically, to a multi-source adversarial side channel analysis method for cryptographic algorithms based on a random model. Background Art
[0002] Side channel analysis is a potential threat that infers keys or other sensitive information by analyzing the physical information generated during the encryption process (such as electromagnetic radiation, power consumption, and time delay). Since side channel attacks can bypass mathematical complexity and directly obtain confidential data from information leaked by devices, cryptographic algorithm side channel analysis is currently receiving widespread attention from researchers.
[0003] The development of side channel analysis can be traced back to 1999, when Kocher first proposed an energy analysis method for cryptographic systems and successfully recovered the DES algorithm key using simple energy analysis and differential energy analysis. In the following years, energy analysis has developed rapidly, and more and more new energy attack methods have emerged, such as correlation energy analysis, template attack, collision attack, mutual information analysis (MIA), etc.
[0004] Side channel analysis can be divided into modeling and non-modeling side channel analysis. Template attack is a modeling side channel attack method. The basic idea is to use a reference device that has key write permission and is almost the same as the target device to establish a template for the special information leaked during the cryptographic operation. The template contains information about the expected typical signal and the noise representation of the specific situation. A template can represent a cryptographic primitive operation, a key value, an intermediate value with key participation, or an intermediate value based on an energy model, etc. Then, the waveform collected by the target device is matched according to the established template, and finally the key is recovered. The attack process of the template attack can be divided into two stages, the template construction stage and the template matching stage. In 2005, Schindler et al. proposed the stochastic model (SM) modeling method, which used advanced random methods to open up new ideas for optimizing the efficiency of differential side channel cryptanalysis of block ciphers. The stochastic model approximates the real leakage function in a suitable vector subspace. Unlike the template attack, only a covariance matrix is needed to characterize the noise characteristics. Finally, the key is extracted based on the deterministic data dependency and the "maximum likelihood principle". Schindler et al. successfully completed the practical application of random models in mask protection scenarios in 2008.
[0005] The random model assumes that the real power leakage is related to each bit value of the intermediate value. However, due to the existence of noise, we cannot completely obtain the pure power leakage value from the energy leakage. Therefore, the proportional coefficient parameters calculated by the regression algorithm in the existing random model modeling process contain a lot of noise factors. Summary of the invention
[0006] In view of this, the purpose of the present invention is to introduce the idea of multi-source adversarial learning into the random model modeling process, improve the modeling accuracy of the random model, and realize key recovery more efficiently.
[0007] The present invention uses noise sources and energy sources for adversarial learning, introduces the conditional probability of normal distribution and KS test as the basis for adversarial learning judgment, and independently designs a random model modeling parameter iteration mechanism to improve the accuracy of traditional random model parameters. This method can accurately model the multiple sources that make up the power consumption leakage, which is helpful to analyze the real power consumption leakage and convert it into a more intuitive mathematical formula, which helps to improve the accuracy of various methods related to random models and reduce the difficulty of side channel analysis of cryptographic algorithms. Compared with the modeling of classical random models, the present invention introduces the idea of multi-source adversarial, sets the basis for adversarial learning judgment, improves the multi-source modeling accuracy of random models, has higher parameter quality and lower difficulty of cryptographic algorithm key recovery. The embodiment of the present application at least provides a multi-source adversarial side channel analysis method for cryptographic algorithms based on random models, including the following steps: Step 1: Initialize the model parameters. Randomly initialize the noise source and power source leakage model parameters respectively, and use them as the initial conditions for adversarial learning iterations. Among them, the noise source leakage satisfies the mean value , standard deviation is The normal distribution of power consumption source leakage satisfies the random model, where the random model parameter is the proportional coefficient ; Therefore, the parameter initialized in step 1 is the proportional coefficient , mean , Standard Deviation ; Step 2: Iteratively update the power source parameters: proportional coefficient, based on the noise source leakage model, the power source model parameter proportional coefficient Perform iterative updates; Step 3: Iteratively update the noise source parameters: mean and standard deviation. Based on the power source leakage model, the noise source model parameters, mean , Standard Deviation , perform iterative updates; Step 4: The process of step 2 and step 3 is executed repeatedly until the leakage model parameters of the noise source and the power consumption source are no longer updated, that is, the model parameters are obtained.
[0008] According to one aspect of the embodiments of the present disclosure, it is provided that step 2 includes the following steps: Step 2.1: Randomly send a set of plaintext information to the energy harvesting platform with a known cryptographic algorithm key, denoted as , and collect the corresponding power consumption leakage information, recorded as ; Step 2.2: Select the analysis position of the cryptographic algorithm and calculate the bit matrix of the intermediate value expansion of the corresponding position according to the plaintext information sent, which is recorded as ; Among them, the analysis position of the algorithm is determined by the specific algorithm.
[0009] Step 2.3: The power source model satisfies the random model leakage, that is: , using regression methods to calculate the proportionality coefficient Fitting is performed, denoted as , calculate a new set of proportional coefficients , and calculate the scores of the new and old groups of proportional coefficients under the current random sampling conditions; Among them, the regression method can be selected from the classical regression algorithms, which include least squares regression, generalized linear regression, ridge regression, elastic network regression, and Lasso regression; Step 2.4: Calculate the scores of the new and old sets of proportional coefficients under the current random sampling conditions; if the new proportional coefficient Greater than the original proportionality factor The score under the current random sampling will affect the proportional coefficient Make updates; Among them, the proportionality coefficient and The score calculation method is as follows: First calculate , and obtain the same intermediate value in and The next two groups of real energy leakage; calculate again ,get and Next, we calculate the mean of the two noise sequences. , Standard Deviation The logarithm of the probability under the normal distribution is recorded as the proportionality coefficient score.
[0010] According to an example of an embodiment of the present disclosure, step 3 includes the following steps: Step 3.1: Randomly send a set of plaintext information to the energy harvesting platform with a known cryptographic algorithm key, denoted as , and collect the corresponding energy leakage information, recorded as ; Step 3.2: Select the analysis position of the cryptographic algorithm and calculate the bit matrix of the intermediate value expansion of the corresponding position according to the plaintext information sent, which is recorded as ; Step 3.3: For the bit matrix Calculate specific power leakage ; Calculate the noise contained in the collected energy based on power leakage ; Step 3.4: Use KS test to calculate whether the noise sequence meets the mean , Standard Deviation The normal distribution of ;like <0.05, then use the feature pair mean of the current noise sequence and standard deviation Perform iterative updates.
[0011] According to an example of an embodiment of the present disclosure, step 4 includes the following steps: Step 4.1: If the power source and noise source parameters are not updated in steps 3 and 4, the counter Add 1; if there is a parameter update for the power source or noise source parameters in step 3 and step 4, the counter Set to 0; Step 4.2: Define Thresholds ,when Repeat steps 3 and 4 when When the function is executed, the loop is jumped out and it is regarded as obtaining the parameters.
[0012] According to an example of an embodiment of the present disclosure, in step 2.4 and step 3.4, parameter iteration includes the following steps: Defining Discount Factors ; Scale factor The iterative method is ; Mean The iterative method is: first calculate the mean of the current noise sequence, denoted as ,calculate ; Mean The iterative method is: first calculate the standard deviation of the current noise sequence, denoted as ,calculate .
[0013] This application at least has the following beneficial effects: 1. This method makes full use of the model information of noise sources and power consumption sources, improves the accuracy of random model modeling parameters, and avoids accidental errors caused by random sampling of abnormal waveform energy values; 2. Compared with the traditional random model, this method has the advantage of accurately describing the noise source model parameters; 3. Compared with the parameters obtained by simple random modeling, this method reduces the number of energy waveforms required to recover the key using the classic template-based DPA analysis method by 30%.
[0014] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The above and other purposes, features and advantages of the embodiments of the present disclosure will become more apparent by describing the embodiments of the present disclosure in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0016] Figure 1 It is the overall flow chart of the present invention; Figure 2 It is a schematic diagram of the calculation process of the random model; Figure 3 It is the AES-128 encryption process and DPA analysis location. DETAILED DESCRIPTION
[0017] The technical solutions in the embodiments of the present disclosure will be described clearly and completely below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0018] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme of the present application is further elaborated in detail below in conjunction with the accompanying drawings and embodiments. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the following description, it is related to "optional implementation method", which describes a subset of all possible embodiments, but it can be understood that the "optional implementation method" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict. The term "first / second" involved is only to distinguish similar objects, and does not represent a specific order for the object. It can be understood that "first / second" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by technicians in the technical field of the present application. The terms used herein are only for the purpose of describing the present application and are not intended to limit the present application.
[0019] like Figure 1 As shown, a multi-source adversarial side channel analysis method for a cryptographic algorithm based on a random model includes the following steps: Step 1: Initialize model parameters The noise source and power source leakage model parameters are randomly initialized respectively and used as the initial conditions for adversarial learning iterations; Among them, we generally assume that the noise source leakage satisfies the mean value , standard deviation is The normal distribution of power consumption source leakage satisfies the random model, where the random model parameter is the proportional coefficient ; Therefore, the parameter initialized in step 1 is the proportional coefficient , mean , Standard Deviation ; Step 2: Iteratively update the power consumption source parameter: proportionality coefficient.
[0020] Based on the noise source leakage model, the power source model parameters (proportional coefficient ) for iterative updates.
[0021] Specifically, step 2 may include the following steps: Step 2.1: Randomly send a set of plaintext information to the energy harvesting platform with a known cryptographic algorithm key, denoted as , and collect the corresponding power consumption leakage information, recorded as ; Step 2.2: Select the analysis position of the cryptographic algorithm, the output value of the S-box of the first round of the AES algorithm, and calculate the bit matrix of the intermediate value of the corresponding position according to the plaintext information sent, which is recorded as ; Step 2.3: The power source model satisfies the random model leakage, that is: , using regression methods to calculate the proportionality coefficient Fitting is performed, denoted as , calculate a new set of proportional coefficients , and calculate the scores of the new and old groups of proportional coefficients under the current random sampling conditions; Among them, the regression method can be selected from the classical regression algorithms, which include least squares regression, generalized linear regression, ridge regression, elastic network regression, and Lasso regression; Step 2.4: Calculate the scores of the new and old sets of proportional coefficients under the current random sampling conditions; if the new proportional coefficient Greater than the original proportionality factor The score under the current random sampling will affect the proportional coefficient Make updates; Among them, the proportionality coefficient and The score calculation method is as follows: First calculate , and obtain the same intermediate value in and The next two groups of real energy leakage; calculate again ,get and Next, we calculate the mean of the two noise sequences. , Standard Deviation The logarithm of the probability under the normal distribution is recorded as the proportionality coefficient score.
[0022] Step 3: Iteratively update noise source parameters: mean and standard deviation .
[0023] Based on the power source leakage model, the noise source model parameters and mean , Standard Deviation , perform iterative update; specifically, step 3 may include the following steps: Step 3.1: Randomly send a set of plaintext information to the energy harvesting platform with a known cryptographic algorithm key again, denoted as , and collect the corresponding energy leakage information, recorded as ; Step 3.2: Select the analysis position of the cryptographic algorithm and calculate the bit matrix of the intermediate value expansion of the corresponding position according to the plaintext information sent, which is recorded as ; Step 3.3: For the bit matrix Calculate specific power leakage ; Calculate the noise contained in the collected energy based on power leakage ; Step 3.4: Use KS test to calculate whether the noise sequence meets the mean , Standard Deviation The normal distribution of ;like <0.05, then use the feature pair mean of the current noise sequence and standard deviation Perform iterative updates.
[0024] Example A multi-source adversarial side channel analysis method for cryptographic algorithms based on a random model. The specific algorithm flow is as follows: Figure 1 shown.
[0025] Taking AES-128 as an example, the algorithm flow is as follows Figure 3 As shown. We use the low-noise data set provided by the 9th National College Cryptography Mathematics Challenge as an example, and the algorithm analysis position is the first S-box output value in the first round. The single-byte key value k=0x72; First, randomly initialize the noise source and power source leakage model parameters, including: proportional coefficient , mean , Standard Deviation Then, n energy traces and corresponding plaintext values are randomly extracted from the data set, and regression calculation is performed to obtain a set of proportional coefficients , then calculate the noise sequence corresponding to the new and old proportional coefficients, and calculate the noise sequence at the mean , Standard Deviation The logarithm of the probability under the normal distribution of A higher score means that the new scale factor value is better, so the new scale factor value is used to iterate the old scale factor value. The lower the score value, the parameters are not iterated.
[0026] Then randomly extract n energy traces and corresponding plaintext values from the data set. ;and , get the current scale factor At this point, we believe that the noise sequence satisfies the mean , Standard Deviation Then use the KS test to determine whether the noise data sequence satisfies the corresponding normal distribution, denoted as .like >0.05, the parameters are not updated. <0.05, the mean value is determined , Standard Deviation Not accurate, multiply by the discount factor Update to get a more reliable mean , Standard Deviation .
[0027] After the above update process is completed, it is considered that a round of model parameter iteration is completed. , mean , Standard Deviation When no more iterations are performed, The counter counts up by 1. Define the threshold ,when When, that is, continuous When there is no iteration of model parameters in the round, the model parameters obtained at this time are used as the optimal parameters in the preliminary parameter fitting process.
[0028] Template-based DPA analysis is used for key recovery in this data set. Compared with the random model parameters obtained by traditional methods, the number of waveforms required for key recovery using the random model parameters obtained by this method is reduced by 30%.
[0029] It should be noted that the object information (including but not limited to the object's device information, corresponding personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the object or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0030] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. The above-mentioned embodiments only express several implementation methods of the present application, and their descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the patent of this application. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several deformations and improvements can be made, which all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be based on the attached claims.
Claims
1. A multi-source adversarial side channel analysis method for cryptographic algorithms based on a random model, characterized in that: The following steps are involved: Step 1: Initialize model parameters, wherein the initialization model parameters randomly initialize the noise source and power source leakage model parameters respectively, and use them as initial conditions for adversarial learning iterations; Among them, the noise source leakage satisfies the mean value , standard deviation is The power source leakage satisfies the random model, where the random model parameter is the proportional coefficient ; Therefore, the parameter initialized in step 1 is the proportional coefficient , mean , Standard Deviation ; Step 2: Iteratively update the power consumption source parameters: The iterative update of the power consumption source parameters is based on the noise source leakage model and the power consumption source model parameter proportional coefficient. Perform iterative updates; Step 3: Iteratively update the noise source parameters: The iterative update of the mean and standard deviation of the noise source parameters is based on the power source leakage model and the mean of the noise source model parameters. and standard deviation , perform iterative updates; Step 4: The process of step 2 and step 3 is executed repeatedly until the leakage model parameters of the noise source and the power consumption source are no longer updated, that is, the model parameters are obtained.
2. A method for multi-source adversarial side channel analysis of cryptographic algorithms based on a random model as claimed in claim 1, characterized in that: Step 2 includes the following steps: Step 2.1: Randomly send a set of plaintext information to the energy harvesting platform with a known cryptographic algorithm key, denoted as , and collect the corresponding power consumption leakage information, recorded as ; Step 2.2: Select the analysis position of the cryptographic algorithm and calculate the bit matrix of the intermediate value expansion of the corresponding position according to the plaintext information sent, which is recorded as ; Step 2.3: The power source model satisfies the random model leakage, that is: , using regression methods to calculate the proportionality coefficient Fitting is performed, denoted as , calculate a new set of proportional coefficients , and calculate the scores of the new and old groups of proportional coefficients under the current random sampling conditions; Among them, the regression method can be selected from the classical regression algorithms; the classical regression algorithms include least squares regression, generalized linear regression, ridge regression, elastic network regression, and Lasso regression; Step 2.4: Calculate the scores of the new and old sets of proportional coefficients under the current random sampling conditions; if the new proportional coefficient Greater than the original proportionality factor The score under the current random sampling will affect the proportional coefficient Make updates; Among them, the proportionality coefficient and The score calculation method is as follows: First calculate , and obtain the same intermediate value in and The next two groups of real energy leakage; calculate again ,get and Next, we calculate the mean of the two noise sequences. , Standard Deviation The logarithm of the probability under the normal distribution is recorded as the proportionality coefficient score.
3. The method for multi-source adversarial side channel analysis of cryptographic algorithms based on random models as claimed in claim 1, characterized in that: Step 3 includes the following steps: Step 3.1: Randomly send a set of plaintext information to the energy harvesting platform with a known cryptographic algorithm key, denoted as , and collect the corresponding energy leakage information, recorded as ; Step 3.2: Select the analysis position of the cryptographic algorithm and calculate the bit matrix of the intermediate value expansion of the corresponding position according to the plaintext information sent, which is recorded as ; Step 3.3: For the bit matrix Calculate specific power leakage ; Calculate the noise contained in the collected energy based on power leakage ; Step 3.4: Use KS test to calculate whether the noise sequence meets the mean , Standard Deviation The normal distribution of ;like <0.05, then use the feature pair mean of the current noise sequence and standard deviation Perform iterative updates.
4. The method for multi-source adversarial side channel analysis of cryptographic algorithms based on random models as claimed in claim 1, characterized in that: Step 4 includes the following steps: Step 4.1: If the power source and noise source parameters are not updated in steps 3 and 4, the counter Add 1; if there is a parameter update for the power source or noise source parameters in step 3 and step 4, the counter Set to 0; Step 4.2: Define Thresholds ,when Repeat steps 3 and 4 when When the loop is exited, it is regarded as obtaining the parameters.
5. A method for multi-source adversarial side channel analysis of cryptographic algorithms based on a random model as claimed in claim 2 or 3, characterized in that: In step 2.4 and step 3.4, parameter iteration includes the following steps: Defining Discount Factors ; Scale factor The iterative method is ; Mean The iterative method is: first calculate the mean of the current noise sequence, denoted as ,calculate ; Mean The iterative method is: first calculate the standard deviation of the current noise sequence, denoted as ,calculate .
Citation Information
Patent Citations
Side channel analysis method based on deep learning
CN111565189A
Hardware implementation method and system for AES (Advanced Encryption Standard) encryption algorithm capable of resisting side channel attack
CN115664634A
Side channel analysis method and device based on deep learning
CN117792610A
Side channel attack detection method and system based on deep learning
CN118337494A
Power consumption side channel analysis method and system based on cryptographic algorithm collision attack
CN118631419A