A multi-source adversarial side channel analysis method for cryptographic algorithms based on random models
By introducing multi-source adversarial learning and conditional probability of normal distribution and designing a random model parameter iteration mechanism, the problem of noise interference is solved, and the modeling accuracy and key recovery efficiency of side channel analysis of cryptographic algorithms are improved.
Patent Information
- Application Number
- CN202411867324.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-12-18
AI Technical Summary
In the modeling process of cryptographic algorithm side channel analysis, the existing random model is interfered by noise factors, resulting in insufficient parameter accuracy and affecting the key recovery efficiency.
Multi-source adversarial learning is introduced. Through the conditional probability of normal distribution and KS test, a random model modeling parameter iteration mechanism is designed. Noise sources and energy sources are used for adversarial learning to improve parameter accuracy.
The modeling accuracy of the random model is improved, the difficulty of recovering the cryptographic algorithm key is reduced, the number of energy waveforms required for key recovery is reduced, and the analysis efficiency is improved.
Smart Images

Figure CN119788346B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of cryptography and multi-source side channel analysis, and more particularly to a multi-source adversarial side channel analysis method for cryptographic algorithms based on a random model. Background Art
[0002] Side-channel analysis, which analyzes physical information generated during the encryption process (such as electromagnetic radiation, power consumption, and time delays) to infer keys or other sensitive information, has become a potential threat. Because side-channel attacks can bypass mathematical complexity and directly obtain confidential data from leaked information on devices, cryptographic algorithm side-channel analysis is currently attracting widespread attention from researchers.
[0003] The development of side-channel analysis dates 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 developed rapidly, with the emergence of a growing number of new energy attack methods, such as correlation energy analysis, template attacks, collision attacks, and mutual information analysis (MIA).
[0004] Side channel analysis can be categorized into modeling and non-modeling approaches. A template attack is a modeling-based side channel attack. The basic idea is to use a reference device with key write access and nearly identical to the target device to create a template for specific information leaked during cryptographic operations. The template contains information about expected typical signals and the noise characteristics of that specific situation. A template can represent a cryptographic primitive operation, a key value, an intermediate value involving a key, or an intermediate value based on an energy model. The waveform captured by the target device is then matched against the established template to recover the key. The template attack process can be divided into two stages: template construction and template matching. In 2005, Schindler et al. proposed the stochastic model (SM) modeling approach, leveraging advanced stochastic methods to open up new approaches for optimizing the efficiency of differential side channel cryptanalysis of block ciphers. This stochastic model approximates the true leakage function within a suitable vector subspace. Unlike template attacks, only a covariance matrix is required to characterize the noise. Finally, the key is extracted based on deterministic data dependencies and the maximum likelihood principle. Schindler et al. successfully completed the practical application of random models in mask protection scenarios in 2008.
[0005] Stochastic models assume that true power leakage is related to every bit of the intermediate value. However, due to the presence of noise, it is impossible to completely derive a pure power leakage value from energy leakage. Therefore, the scaling coefficient parameters calculated using regression algorithms in existing stochastic modeling processes contain a large amount of noise interference. 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, thereby improving the modeling accuracy of the random model and realizing 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. Through this method, the multiple sources that make up the power consumption leakage can be accurately modeled, which helps 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 classical random model modeling, 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, and the embodiment of the present application provides at least a multi-source adversarial side channel analysis method for cryptographic algorithms based on random models, including the following steps:
[0008] Step 1: Initialize the model parameters. Randomly initialize the noise source and power source leakage model parameters and use them as the initial conditions for adversarial learning iterations.
[0009] Among them, the noise source leakage satisfies the mean value , the 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 ;
[0010] 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;
[0011] 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 and standard deviation are updated. , standard deviation , perform iterative updates;
[0012] Step 4: Loop through steps 2 and 3 until the leakage model parameters of the noise source and the power consumption source are no longer updated, thus obtaining the model parameters.
[0013] According to one aspect of the embodiments of the present disclosure, step 2 includes the following steps:
[0014] 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 ;
[0015] 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 ;
[0016] Among them, the analysis position of the algorithm is determined by the specific algorithm.
[0017] 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, recorded 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;
[0018] Among them, the regression method can be selected from the classical regression algorithms, including least squares regression, generalized linear regression, ridge regression, elastic net regression, and Lasso regression;
[0019] 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 proportional coefficient The score under the current random sampling will affect the proportional coefficient Make updates;
[0020] Among them, the proportional coefficient and The score calculation method is as follows:
[0021] First calculate , get 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 proportional coefficient score.
[0022] According to an example of an embodiment of the present disclosure, step 3 includes the following steps:
[0023] 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 ;
[0024] 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 ;
[0025] Step 3.3: For the bit matrix Calculate specific power leakage ; Calculate the noise contained in the collected energy based on power leakage ;
[0026] 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.
[0027] According to an example of an embodiment of the present disclosure, step 4 includes the following steps:
[0028] 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 steps 3 and 4, the counter Set to 0;
[0029] Step 4.2: Define the threshold ,when Repeat steps 3 and 4 when When it exits the loop, it is regarded as getting the parameters.
[0030] 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:
[0031] Define the discount factor ;
[0032] Proportional coefficient The iterative method is ;
[0033] mean The iterative method is: first calculate the mean of the current noise sequence, denoted as ,calculate ;
[0034] mean The iterative method is: first calculate the standard deviation of the current noise sequence, denoted as ,calculate .
[0035] This application has at least the following beneficial effects:
[0036] 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;
[0037] 2. Compared with the traditional random model, this method can accurately characterize the noise source model parameters;
[0038] 3. Compared with the parameters obtained by simple random model modeling, this method reduces the number of energy waveforms required to recover the key using the classic template-based DPA analysis method by 30%.
[0039] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and do not limit the technical solutions of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The above and other purposes, features, and advantages of the embodiments of the present disclosure will become more apparent through a more detailed description of the embodiments of the present disclosure in conjunction with the accompanying drawings. The accompanying drawings are intended 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 are not intended to limit the present disclosure. In the drawings, the same reference numerals generally represent the same components or steps.
[0041] Figure 1 It is the overall flow chart of the present invention;
[0042] Figure 2 It is a schematic diagram of the calculation process of the random model;
[0043] Figure 3 This is the AES-128 encryption process and DPA analysis location. DETAILED DESCRIPTION
[0044] The following will be combined with the accompanying drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the embodiments described are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of 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.
[0045] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application are further elaborated in detail below with reference to the accompanying drawings and examples. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. In the following description, "optional implementation methods" are involved, which describe a subset of all possible embodiments. However, it is understood that "optional implementation methods" can be the same subset or different subsets of all possible embodiments and can be combined with each other without conflict. The terms "first / second" involved are merely to distinguish similar objects and do not represent a specific order for the objects. It is understandable 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 commonly understood by technicians in the technical field of this application. The terms used herein are only for the purpose of describing the present application and are not intended to limit the present application.
[0046] like Figure 1 As shown, a multi-source adversarial side channel analysis method for cryptographic algorithms based on a random model includes the following steps:
[0047] Step 1: Initialize model parameters
[0048] The noise source and power source leakage model parameters are randomly initialized and used as the initial conditions for adversarial learning iterations.
[0049] Among them, we generally assume that the noise source leakage satisfies the mean value , the 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 ;
[0050] Step 2: Iteratively update the power consumption source parameter: proportional coefficient.
[0051] Based on the noise source leakage model, the power source model parameters (proportional coefficient ) for iterative updates.
[0052] Specifically, step 2 may include the following steps:
[0053] 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 ;
[0054] Step 2.2: Select the analysis position of the cryptographic algorithm, the output value of the S-box in the first round of the AES algorithm, and calculate the bit matrix of the intermediate value of the corresponding position based on the plaintext information sent, which is recorded as ;
[0055] 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, recorded 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;
[0056] Among them, the regression method can be selected from the classical regression algorithms, including least squares regression, generalized linear regression, ridge regression, elastic net regression, and Lasso regression;
[0057] Step 2.4:
[0058] 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 proportional coefficient The score under the current random sampling will affect the proportional coefficient Make updates;
[0059] Among them, the proportional coefficient and The score calculation method is as follows:
[0060] First calculate , get 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 proportional coefficient score.
[0061] Step 3: Iteratively update noise source parameters: mean and standard deviation .
[0062] 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:
[0063] Step 3.1: Randomly send a set of plaintext information to the energy harvesting platform with known cryptographic algorithm key again, denoted as , and collect the corresponding energy leakage information, recorded as ;
[0064] 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 ;
[0065] Step 3.3: For the bit matrix Calculate specific power leakage ; Calculate the noise contained in the collected energy based on power leakage ;
[0066] 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.
[0067] Example
[0068] A multi-source adversarial side channel analysis method for cryptographic algorithms based on random models. The specific algorithm flow is as follows: Figure 1 shown.
[0069] Taking AES-128 as an example, the algorithm process is as follows Figure 3 As shown. We use the low-noise dataset 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;
[0070] First, randomly initialize the noise source and power source leakage model parameters, including: proportional coefficient , mean , standard deviation Then randomly extract n energy traces and corresponding plaintext values from the data set and perform regression calculation 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 The higher the score value, the better the new scale factor value is. Then the new scale factor value is used to iterate the old scale factor value. If the score value is lower, no iteration is performed on the parameters.
[0071] 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, which is recorded as .like If >0.05, the parameters will not be updated. <0.05, the mean value is determined to be , standard deviation Not accurate, multiply by the discount factor Update to get a more reliable mean , standard deviation .
[0072] When the above update process is completed, it is considered that one round of model parameter iteration is completed. , mean , standard deviation When no more iterations are made, 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.
[0073] Template-based DPA analysis was used to recover the key from this dataset. Compared to the random model parameters obtained using traditional methods, the random model parameters obtained using this method reduced the number of waveforms required for key recovery by 30%.
[0074] 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.
[0075] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are 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. The description is relatively specific and detailed, but it cannot be understood as a limitation on 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 this application, several variations and improvements can be made, which all fall within the scope of protection of this application. Therefore, the scope of protection of this application should 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. 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 , the 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 is 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 standard deviation , perform iterative updates; Step 4: Loop through steps 2 and 3 until the leakage model parameters of the noise source and the power consumption source are no longer updated, thus obtaining the model parameters.
2. The method for multi-source countermeasures against 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, recorded 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 net 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 proportional coefficient The score under the current random sampling will affect the proportional coefficient Make updates; Among them, the proportional coefficient and The score calculation method is as follows: First calculate , get 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 proportional coefficient score.
3. The method for multi-source countermeasures against side channel analysis of cryptographic algorithms based on random models according to 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 countermeasures against side channel analysis of cryptographic algorithms based on a random model 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 steps 3 and 4, the counter Set to 0; Step 4.2: Define the threshold ,when Repeat steps 3 and 4 when When it exits the loop, it is regarded as getting the parameters.
5. A method for multi-source countermeasures against side channel analysis of cryptographic algorithms based on a random model as claimed in claim 2 or 3, characterized in that: In steps 2.4 and 3.4, parameter iteration includes the following steps: Define the discount factor ; Proportional coefficient 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