A neural network weight side channel recovery method based on deep learning
By using a deep learning-based approach and convolutional neural networks to analyze power consumption traces, the problem of power consumption trace synchronization was solved, achieving efficient and accurate neural network weight recovery, simplifying the side-channel analysis process, and improving the efficiency of security assessment.
Patent Information
- Application Number
- CN202411207960.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-08-30
AI Technical Summary
In existing technologies, it is difficult to perfectly synchronize the power consumption traces with the data processing process during the neural network weight recovery process, and the acquisition and processing of each trace may introduce errors, leading to increased recovery difficulty and reduced accuracy.
A deep learning-based approach is adopted, which constructs multiple subsets by repeatedly collecting power consumption traces, uses convolutional neural networks for dimensionality reduction and classification, establishes a detailed mapping relationship between waveform data and neural network weights, and trains an analysis model to recover the weights.
It achieves highly accurate and efficient neural network weight recovery, simplifies the side-channel analysis process, reduces complexity and technical barriers, and improves the efficiency of security assessment.
Smart Images

Figure CN119299125B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of artificial intelligence and security technology, and particularly relates to a neural network weight side channel recovery method based on deep learning. BACKGROUND
[0002] Side channel analysis (SCA) attack is an attack method that obtains the internal secret information of an encryption device by analyzing information leakage on the physical implementation, such as power consumption, electromagnetic radiation, execution time, etc. With the advent of the big data era, artificial intelligence technology is developing rapidly, and neural networks are gradually deployed on various types of platforms, such as some edge devices, embedded systems, and some low-power processors, etc. However, there are some underlying hardware security problems in embedded neural networks. In particular, embedded neural networks are vulnerable to SCA, and attackers can infer the privacy information of the model through physical access to the target device. Therefore, in order to protect the security and reliability of deep learning models in commercial applications, prevent intellectual property leakage and potential security threats, it is crucial to conduct security testing and evaluation through side channel analysis technology.
[0003] In the discussion of the method of recovering neural network weights, Batina et al. introduced an attack strategy based on correlation power analysis (CPA). The core goal of this strategy is to analyze the multiplication operation between the unknown weight weight and the known input input, i.e. m = weight * input. They adopted the Hamming weight (HW) model, which allows attackers to perform correlation analysis on a series of weight hypotheses with the activity changes of the predicted output m. Specifically, the attacker will calculate the Pearson correlation coefficient r(t, w) between each weight hypothesis w and the measured value t obtained through the side channel. As the number of measurements gradually increases, the correct weight value w will gradually emerge due to its higher correlation with the measurement data, and eventually stand out from the many incorrect weight hypotheses w* to become the most realistic weight value.
[0004] While CPA achieves high accuracy in weight recovery, it still has some limitations. Firstly, CPA relies primarily on the correlation between power traces and the Hamming weights during data processing. Aligning power traces is an essential step in CPA, aiming to synchronize operation records, eliminate timing deviations, improve signal-to-noise ratio, simplify the analysis process, reduce error correlation, and adapt to different hardware and software environments, thereby ensuring consistent and reliable analysis results. However, in practice, due to factors such as noise and device variations, power traces often fail to perfectly synchronize with the data processing process, making strict alignment difficult. This weakens the correlation between extracted features and actual weights. This directly impacts CPA accuracy and increases the difficulty of weight recovery. Secondly, CPA attacks require a large number of power traces for analysis, which undoubtedly increases the complexity of the attack and the amount of data required. The acquisition and processing of each power trace may introduce errors, and the cumulative effect of multiple power traces can amplify these errors, further affecting the final recovery results. Summary of the Invention
[0005] The present invention provides a neural network weight side channel recovery method based on deep learning, which solves the problems in the prior art that power consumption traces are often unable to be perfectly synchronized with the data processing process, and the collection and processing of each power consumption trace may introduce errors. While maintaining high accuracy, the present invention can infer the weights of each neuron in a multilayer perceptron (MLP) from a small number of power consumption traces, greatly improving the efficiency of side channel analysis.
[0006] The present invention provides a neural network weight side channel recovery method based on deep learning, the method comprising:
[0007] Collect the total power consumption trace T of the target device under different input signals multiple times, determine the power consumption trace t corresponding to a peak according to the total power consumption trace T, and construct multiple first subsets set according to the power consumption trace t i ; Among them, each first subset set i The weights are different, and the weights are related to the input signals;
[0008] Each of the first subsets set i Divide into the second subset set ij ; Wherein, the peak of the power consumption trace t of the target device corresponds to the neuron loaded on the MLP of the target device;
[0009] The plurality of first subsets set are evaluated by a test vector leakage evaluation method. idimension reduction is performed on the power consumption traces t in the set to obtain a leakage interval step, and data on each power consumption trace t is determined to correspond to multiple leakage intervals according to the leakage interval step;
[0010] A starting position is determined, and the multiple leakage intervals are processed according to the starting position and the leakage interval step to obtain a second leakage interval set;
[0011] The multiple leakage intervals are screened to obtain a second leakage interval set, a first data set is constructed using the second leakage interval set and a power consumption trace t corresponding to each data in the second leakage interval set, and a label of each data in the first data set is determined, a convolutional neural network is trained using the first data set and the label, and a first analysis model of all Hamming weights is obtained;
[0012] Data in the first data set are classified according to Hamming weights to obtain multiple third subsets, and a convolutional neural network is trained using multiple third subsets to obtain a second analysis model corresponding to each Hamming weight respectively;
[0013] According to the second subset set ij , the first analysis model and the second analysis model are used to calculate the weight of the corresponding neuron in the MLP in the target device.
[0014] In a possible implementation, the power consumption traces t of the target device are collected, and multiple first subsets set i are constructed according to the power consumption traces t, including:
[0015] A plurality of weights w and an input data set x are set;
[0016] Each input data in the input data set x is weighted using the plurality of weights w to obtain multiple input signals of the target device;
[0017] Multiple power consumption traces t corresponding to the multiple input signals are collected, and the power consumption traces t are classified according to different weights to obtain multiple first subsets set i .
[0018] In a possible implementation, each first subset set i is divided into a second subset set ij , including:
[0019] An input data set x of each first subset set set i is determined, each input data in the input data set x is input to the target device multiple times to obtain multiple power consumption traces t, and the power consumption traces t corresponding to the same input data are added to the first subset seti obtaining a preprocessing subset;
[0020] According to the principle of the same input data, the preprocessing subset is divided to obtain a second subset set ij .
[0021] In a possible implementation, the screening of the plurality of leakage intervals to obtain a second leakage interval set comprises:
[0022] A starting position is determined, and the plurality of leakage intervals are processed according to the starting position and the leakage interval step length to obtain a second leakage interval set.
[0023] In a possible implementation, each first subset set i is divided into a second subset set ij respectively; wherein the peak of the power consumption trace t corresponds to a neuron of the MLP loaded on the target device, comprising:
[0024] The second subset set ij is input into the first analysis model respectively to obtain a plurality of one-dimensional arrays aw ij corresponding to the second subset set i ; wherein the elements in the one-dimensional array aw i represent the probability of occurrence of each Hamming weight;
[0025] A first Hamming weight is determined according to the one-dimensional array aw i , and a corresponding second analysis model is determined according to the first Hamming weight, the second subset set ij is input into the second analysis model to obtain a plurality of one-dimensional arrays aw ij corresponding to the second subset set j ; wherein the elements in the one-dimensional array aw j represent the probability of occurrence of different weights;
[0026] The weight corresponding to the maximum value in the one-dimensional array aw j is determined as the weight of the corresponding neuron in the MLP of the target device.
[0027] In a possible implementation, the determination of the first Hamming weight according to the one-dimensional array aw i comprises:
[0028] The plurality of one-dimensional arrays aw i are subjected to logarithmic operation to obtain a first array set;
[0029] The array elements corresponding to the same index in the first array set are summed to obtain a second array;
[0030] Exponentially transforming the second array set to obtain a prediction probability distribution array, and determining a value with the maximum probability in the prediction probability distribution array as the first Hamming weight.
[0031] In a possible implementation, the formula for calculating the Hamming weight is represented as:
[0032] LabelHW = HW(m);
[0033] wherein HW(·) represents a Hamming function, m represents a sensitive value, m = c(x, w), c represents a constant, x represents input data, w represents a weight, and LabelHW represents a Hamming weight.
[0034] The one or more technical solutions provided in the present application have at least the following technical effects or advantages:
[0035] (1) The present application introduces a convolutional neural network to analyze power traces, solves the deficiency of the prior art in processing power trace alignment, directly realizes the ability to extract neural network weight information from power traces, greatly simplifies the process of side channel analysis, and reduces the complexity and technical threshold of analysis.
[0036] (2) The present application uses the strong learning ability of deep learning, and the model can establish a more refined and accurate mapping relationship between waveform data and neural network weights through a large amount of data training. This refined mapping relationship effectively improves the accuracy of weight recovery.
[0037] (3) The analysis model trained by the present application has strong generalization ability, so that only a small amount of power traces are needed to infer the weights of the neural network, which significantly improves the efficiency of side channel analysis compared with traditional methods. The efficient analysis process makes it possible to complete the security evaluation of large-scale neural networks in a shorter time. BRIEF DESCRIPTION OF DRAWINGS
[0038] Figure 1 A step flowchart of the neural network weight side channel recovery method based on deep learning provided for the embodiments of the present application is shown in the figure.
[0039] Figure 2 A power trace collection schematic diagram provided for the embodiments of the present application is shown in the figure.
[0040] Figure 3 A whole flowchart of the weight recovery provided for the embodiments of the present application is shown in the figure. DETAILED DESCRIPTION
[0041] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of the present invention.
[0042] The present invention provides a neural network weight side channel recovery method based on deep learning, such as Figure 1 As shown, the method includes the following steps S101 to S106.
[0043] S101, collect the total power consumption trace T of the target device under different input signals multiple times, determine the power consumption trace t corresponding to a peak according to the total power consumption trace T, and construct multiple first subsets set according to the power consumption trace t i ; Among them, each first subset set i The weights are different and are related to the input signal.
[0044] Specifically, in step S101, a plurality of first subsets set are constructed according to the power consumption trace t i ,include:
[0045] S1011, set multiple weights w and input data set x; here, the weights are 8-bit binary codes.
[0046] S1012 , using multiple weights w to weight each input data in the input data set x, to obtain multiple input signals of the target device.
[0047] S1013, collecting multiple power consumption traces t corresponding to multiple input signals, and classifying the power consumption traces t according to different weights to obtain multiple first subsets set i .
[0048] Exemplarily, the present invention uses an electromagnetic probe to collect power consumption traces, such as Figure 2 As shown, electromagnetic leakage information can be accurately measured in a non-invasive manner. By deploying a near-field probe to locate the local location of electromagnetic leakage and connecting the electromagnetic probe to an oscilloscope, real-time and dynamic monitoring of the development board's power consumption changes can be achieved.
[0049] This method is deeply based on the basic principle of electromagnetic radiation, and the power consumption state of the development board is presented in the form of intuitive electromagnetic signal, which comprehensively and deeply reveals the power consumption characteristics and electromagnetic radiation spectrum of the system. This feature not only enriches the dimension of side channel analysis, but also greatly improves the accuracy and comprehensiveness of data collection. At the same time, this scheme completely avoids physical modification of the target system, ensuring the non-destructive nature of the test. Therefore, it is widely applicable to various embedded systems and development boards, showing strong versatility and practicality.
[0050] The values of the weights and inputs are controlled to balance the distribution of Hamming weights, L power traces are collected for each Hamming weight, a total of 16*L power traces are collected, and the power traces t, inputs x, weights w and labels LabelHW are organized together. The present application designs 16 Hamming weights.
[0051] According to different weights, 256 first subsets set i i={1,2,…,256}. For each subset, there are 256 different input data x={0,1,2,…,255}.
[0052] S102, each first subset set i is divided into a second subset set ij ; wherein the peak of the power trace t of the target device corresponds to the neuron of the MLP loaded on the target device.
[0053] Specifically, in step S102, each first subset set i is divided into a second subset set ij , including steps S1021 to S1022.
[0054] S1021, determine the input data set x of each first subset set i , input each input data in the input data set x to the target device multiple times to obtain a plurality of corresponding power traces t, and add the power traces t corresponding to the same input data to the first subset set i to obtain a pretreatment subset.
[0055] S1022, according to the principle of the same input data, the pretreatment subset is divided to obtain a second subset set ij .
[0056] Exemplarily, according to different inputs, a second subset set ij i,j={1,2,…,256}. The second subset set ij contains 10 power traces.
[0057] S103, dimensionality reduction is performed on the power traces t in the plurality of first subsets set i to obtain leakage interval steps, and data on each power trace t is determined to correspond to a plurality of leakage intervals according to the leakage interval steps.
[0058] For example, Test Vector Leakage Assessment (TVLA) uses Welch's t-test to determine whether there is a dependency between the operands and the energy consumption. The present application determines the interval of the leakage point through TVLA analysis and divides the power traces in the corresponding interval.
[0059] Specifically, when implementing TVLA, each first subset set i is divided into two groups according to a preset Hamming value, and whether there is leakage is judged by checking the mean difference between the data on the power traces of the two groups. The null hypothesis of the test is that the means of the data on the power traces of the two groups are the same, that is, there is no leakage, and the alternative hypothesis is that the means of the data on the power traces of the two groups are different, that is, there is leakage. The calculation formula of the test statistic t value of TVLA is as follows:
[0060]
[0061] where (n0, μ0, S0 2 ) and (n1, μ1, S1 2 ) are the sample size, sample mean and sample variance of the energy consumption data of the two groups. In the analysis process of the energy trace, the TVLA method requires experimental test for each sampling point. In order to verify whether the data on the collected power traces is sufficient to support the conclusion of rejecting the null hypothesis, Welch's t-test is used as an evaluation method. When the test statistic t shows significant high positive and negative values, it indicates a high degree of distrust in the null hypothesis (i.e. no leakage). Specifically, if the t value at any sampling point exceeds the preset threshold limit, it is considered that there is a potential leakage phenomenon at that point.
[0062] The setting of the threshold value is directly related to the confidence level of rejecting the null hypothesis. A higher threshold value can reduce the risk of false judgment, but it may also lead to the neglect of real leakage; on the contrary, a too low threshold value may misreport leakage. Therefore, when setting the threshold value, it needs to be considered to ensure that it is neither too strict nor too loose.
[0063] To enhance the accuracy of the judgment, a double independent experiment design can be introduced in the TVLA process. This strategy requires that only in two independent experiments, the test statistic Q exceeds the set threshold value in the same direction (positive or negative), and the existence of leakage is finally confirmed. Such a double confirmation mechanism helps to improve the reliability and stability of the detection results.
[0064] According to the result of the TVLA analysis, a leakage interval of the same length is divided. Taking an attack point m 00 as an example, considering the first neuron, there are four multiplication operations: m i0 = w i0 * x0 , i ∈ {0, 1, 2, 3}, so there will be four peaks in the corresponding power trace analysis result, and the first peak corresponds to the leakage of m 00 . The first peak is amplified, and the position of the leakage point is observed. After multiple measurements, the size d of the leakage interval is finally determined.
[0065] After division, the size of the data set is greatly reduced, which not only improves the accuracy of the analysis result, but also reduces the requirement for computing resources.
[0066] S104, screening a plurality of leakage intervals to obtain a second leakage interval set, constructing a first data set by using the second leakage interval set and the power trace t corresponding to each data in the second leakage interval set, determining the labels of the data in the first data set, training the convolutional neural network by using the first data set and the labels, and obtaining a first analysis model f c (t) of all hamming weights.
[0067] Exemplarily, due to the influence of real factors, the side channel information utilized by the side channel attack will be accompanied by a certain amount of noise. However, since the design of the neural network depends on data and not on the probability distribution of noise, it has a certain robustness to different intensities and types of noise. The convolutional neural network (CNN) has efficient feature extraction capability and can automatically extract useful information from input data. For large-scale power consumption data, the convolutional neural network can also effectively remove noise and redundant information in the data through pooling operations. Therefore, the present application selects the convolutional neural network as the classifier.
[0068] Let the power trace have N traces, and the start value of the leakage interval of each power trace be s. Take the power trace in the interval s to s+d as the power consumption of m 00 . Take all N power traces in this interval to obtain a power trace t with a dimension of (N, d), denoted as trace. Then D train = {t i [s, s+d] | t ∈ trace}.
[0069] Exemplarily, based on the convolutional neural network, the training set D train is taken as the model input, and LabelHW 00 is taken as the label to train the model, and obtain an analysis model f c (t) of all hamming weights.
[0070] S105, classify the data in the first data set according to the Hamming weight to obtain a plurality of third subsets, and train the convolutional neural network using the plurality of third subsets respectively to obtain a second analysis model f corresponding to each Hamming weight k (t) (k = 1, 2, …, 14).
[0071] For example, the first data set needs to be grouped into a total of 14 groups (LabelHW 00 = 1, 2, …, 14), each group of power traces corresponds to the same Hamming weight, and 14 models f k (t) (k = 1, 2, …, 14) are trained using the 14 data sets. k (t) is used to distinguish all weights that satisfy LabelHW 00 = k.
[0072] S106, according to the second subset set ij , using the first analysis model and the second analysis model, the weight of the corresponding neuron in the MLP in the target device is calculated.
[0073] Specifically, in step S106, the second subset set ij is input into the first analysis model f c (t) and the second analysis model f k (t) (k = 1, 2, …, 14) to calculate the weight of the corresponding neuron in the MLP in the target device, including steps S1061 to S1063.
[0074] S1061, the second subset set ij is input into the first analysis model f c (t) to obtain a plurality of one-dimensional arrays aw ij corresponding to the second subset set i ; wherein the elements in the one-dimensional array aw i represent the probability of occurrence of each Hamming weight;
[0075] S1062, according to the one-dimensional array aw i determine the first Hamming weight, and according to the first Hamming weight determine the corresponding second analysis model f k (t) (k = 1, 2, …, 14), input the second subset set ij into the second analysis model f k (t) (k = 1, 2, …, 14) to obtain a plurality of one-dimensional arrays aw ij corresponding to the second subset set j ; wherein the one-dimensional array aw jThe elements in represent the probability of occurrence of different weights. Here, according to the one-dimensional array aw i Determine the first Hamming weight, including:
[0076] (1) For multiple one-dimensional arrays aw i Perform a logarithm operation to obtain a first array set.
[0077] (2) Sum the array elements corresponding to the same index in the first array set to obtain a second array.
[0078] (3) Performing an exponential transformation on the second array set to obtain a predicted probability distribution array, and determining the value with the largest probability in the predicted probability distribution array as the first Hamming weight.
[0079] S1063, determine the one-dimensional array aw j The weight corresponding to the maximum value.
[0080] In the present invention, the calculation formula of Hamming weight is expressed as:
[0081] LabelHW = HW(m);
[0082] Where HW(·) represents the Hamming function; m represents the sensitive value, m = c(x, w), c represents a constant; x represents the input data; w represents the weight, and LabelHW represents the Hamming weight.
[0083] For example, for set ij The power consumption trace t in the figure is used as f c The input and output of (t) are both one-dimensional arrays of length 16. i i={0,1,..,15}, corresponding to the probability of different Hamming weights. Specifically, to get the set ij The corresponding Hamming weight, the steps are as follows:
[0084] (1) For each aw i Array[p i,0 ,p i,1 ,…,p i,15 ] to obtain an array by taking the logarithm of the probability in the first array set. The first array in the first array set is represented as:
[0085] log(aw i )=[log(p i,0 ),log(p i,2 ),…,log(p i,15 )],i={0,1,2,…,15};
[0086] (2) For all log(aw i) array, the second array is specifically represented as:
[0087] (3) Then, aw new is subjected to exponential transformation to obtain a final prediction probability distribution array, and the prediction probability distribution array is represented as:
[0088] After the Hamming weight h∈{0,1,…,15} is obtained, a plurality of weight candidate values (except for h=0 and h=15) that meet the requirements can be obtained, and to obtain a unique correct weight value, the power consumption trace in set ij is sequentially taken as the input of the classifier f h (t), and the output is a one-dimensional array aw j , j={0,1,..,255}, corresponding to the probability of different weights. To obtain the final weight value of set ij , the steps are similar to the above steps abc. As shown in Fig. 2, it is a schematic diagram of the overall process of recovering the weight. Specifically, in the figure, Target Devlce represents the target device; Capture represents collection; Input represents input; Trained DL model represents a trained model to obtain a first analysis model; LabelHWk represents that the Hamming weight is equal to k; Trace represents the power consumption trace; and Weight represents the weight. Figure 3 Figure 3
[0089] In one specific embodiment provided by the present application, let the input be x, the weight be w, and the power consumption trace be t, define a sensitive intermediate value operation as c, then the sensitive value is m=c(x,w). The Hamming weight (HW) is the number of non-zero bits of a binary string, which can quantify the leakage of power consumption, and let LabelHW=HW(m).
[0090] By providing a series of random inputs and collecting power consumption data, the input x, weight w, power consumption trace t and corresponding label of each trace are organized together to form a training data set and a verification set. The data set is represented as:
[0091] D train 0 ={(x,w,t,LabelHW) k |k=1,2,…,N t};
[0092] The verification set is represented as:
[0093] D verify ={(x,w,t,LabelHW) k | k = 1, 2,..., N v};
[0094] where N t and N v represent the number of samples.
[0095] A known random input is provided to the target neural network, and the power consumption trace formed during the operation of each input is collected to form a test set D attack = {(x, t) k | k = 1, 2,..., N a}, where N a represents the number of samples. The input x i and the weight w ij are 8-bit integers ∈ [0, 255] ∩ N, and the attack point m ij ∈ [0, 65025] ∩ N.
[0096] The present application focuses on the multiplication of the first input and the weight in the first neuron, that is, the attack point m 00 . Since there are too many sampling points for each power consumption trace, some preprocessing operations are needed to reduce the dimension of the data. First, the location of the leakage point is determined, and then the corresponding leakage interval is separated out, which can achieve the purpose of dimension reduction. Taking the attack point m 00 as an example, first, different power consumption traces are obtained by providing known different non-zero inputs x0, then the leakage interval of each power consumption trace is separated out, and finally the classifier is trained on the power consumption traces labeled by LabelHW 00 to obtain a classification model, where LabelHW 00 ∈ [0, 15] ∩ N. When attacking, for a given power consumption trace, the classifier will output an array of size 16x1, representing the probability of 16 different labels. However, the Hamming weight of the intermediate value m 00 and the known non-zero input x0 cannot uniquely determine the weight w 00 (except for 0 and 255), because there are different weight assumptions that produce the same Hamming weight. Therefore, it is also necessary to train 14 classifiers f k (t) (k = 1, 2,..., 14), f k (t) is used to distinguish all weights that satisfy LabelHW 00 = k.
[0097] The neural network weight side channel recovery method based on deep learning can simplify the analysis process: by introducing a convolutional neural network to analyze the power trace, the present application successfully bypasses the shortcomings of the CPA (side channel analysis) method in processing power trace alignment, directly realizes the ability to extract neural network weight information from waveform data, greatly simplifies the process of side channel analysis, and reduces the complexity and technical threshold of analysis.
[0098] The neural network weight side channel recovery method based on deep learning can improve the accuracy of weight recovery: by using the strong learning ability of deep learning, the model can establish a more detailed and accurate mapping relationship between waveform data and neural network weights through a large amount of data training. This detailed mapping relationship effectively improves the accuracy of weight recovery.
[0099] The neural network weight side channel recovery method based on deep learning can improve the analysis efficiency: once the model is trained, its strong generalization ability enables the neural network weights to be inferred from only a small amount of power traces, which significantly improves the efficiency of side channel analysis compared to traditional methods. The efficient analysis process makes it possible to complete the security evaluation of large-scale neural networks in a shorter time.
[0100] The neural network weight side channel recovery method based on deep learning can enhance the security evaluation tool: as an innovative side channel analysis method, the successful application of the present application will inject new vitality into the field of neural network security evaluation, provide more powerful tool support, and help to discover potential security vulnerabilities and improve the protection capability of neural network models.
[0101] The various embodiments in the specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the difference from other embodiments. The whole or part of the present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, mobile communication terminals, multi-processor systems, microprocessor-based systems, programmable electronic devices, network PCs, small computers, large computers, distributed computing environments including any of the above systems or devices, etc.
[0102] The above examples are only used to illustrate the technical solutions of the present application, and are not limited to the present application; although the present application has been described in detail with reference to the foregoing examples, those skilled in the art should understand that they can modify the technical solutions recorded in the foregoing examples, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the present application.
Claims
1. A neural network weight side channel recovery method based on deep learning, characterized in that: include: Collect the total power consumption trace of the target device under different input signals multiple times , according to the total power consumption trace Determine the power consumption trace corresponding to a peak , and according to the power consumption trace Construct multiple first subsets ; Among them, each first subset The weights are different, and the weights are related to the input signals; Each of the first subsets Divide into the second subset ; Wherein, the power consumption trace The peak of corresponds to the neuron loaded on the MLP of the target device; The plurality of first subsets are evaluated by a test vector leakage evaluation method. Power consumption trace in Perform dimensionality reduction to obtain the leakage interval step length, and determine each power consumption trace based on the leakage interval step length The data above corresponds to multiple leakage intervals; The plurality of leakage intervals are screened to obtain a second leakage interval set, and the power consumption trace corresponding to each data in the second leakage interval set and the second leakage interval set is used. Constructing a first data set, determining a label for each data in the first data set, and training a convolutional neural network using the first data set and the label to obtain a first analysis model for all Hamming weights; Classifying the data in the first data set according to Hamming weight to obtain multiple third subsets, and using the multiple third subsets to train a convolutional neural network to obtain a second analysis model corresponding to each Hamming weight; According to the second subset , using the first analysis model and the second analysis model, calculate the weights of the corresponding neurons in the MLP in the target device.
2. The neural network weight side channel recovery method based on deep learning according to claim 1, characterized in that The power consumption trace Construct multiple first subsets ,include: Setting multiple weights and input data set ; Using the multiple weights For the input data set Each input data is weighted respectively to obtain multiple input signals of the target device; Collect multiple power consumption traces corresponding to the multiple input signals and the power consumption trace Classify according to different weights to obtain multiple first subsets .
3. The neural network weight side channel recovery method based on deep learning according to claim 1, characterized in that Each of the first subsets Divide into the second subset ,include: Determine each first subset The input data set , the input data set The input data in the above example are repeatedly input into the target device to obtain corresponding multiple power consumption traces. , the power consumption trace corresponding to the same input data Add to the first subset In the , the preprocessed subset is obtained; The pre-processed subset is divided according to the principle of the same input data to obtain the second subset .
4. The neural network weight side channel recovery method based on deep learning according to claim 1, characterized in that The screening of the multiple leakage intervals to obtain a second leakage interval set includes: A starting position is determined, and the multiple leakage intervals are processed according to the starting position and the leakage interval step to obtain a second leakage interval set.
5. The neural network weight side channel recovery method based on deep learning according to claim 1, characterized in that: According to the second subset , using the first analysis model and the second analysis model, calculating the weights of the corresponding neurons in the MLP in the target device, including: The second subset Input them into the first analysis model respectively, and obtain the second subset Corresponding multiple one-dimensional arrays ; Wherein, the one-dimensional array The elements in represent the probability of occurrence of each Hamming weight; According to the one-dimensional array Determine the first Hamming weight, and determine the corresponding second analysis model according to the first Hamming weight, and convert the second subset Input into the second analysis model, and obtain the second subset Corresponding multiple one-dimensional arrays , where the one-dimensional array The elements in represent the probability of occurrence of different weights; Determine the one-dimensional array The weight corresponding to the maximum value is used as the weight of the corresponding neuron in the MLP in the target device.
6. The neural network weight side channel recovery method based on deep learning according to claim 5, characterized in that: According to the one-dimensional array Determine the first Hamming weight, including: For the multiple one-dimensional arrays Perform a logarithm operation to obtain a first array set; Summing the array elements corresponding to the same index in the first array set to obtain a second array; Perform an exponential transformation on the second array set to obtain a predicted probability distribution array, and determine a value with the highest probability in the predicted probability distribution array as a first Hamming weight.
7. The neural network weight side channel recovery method based on deep learning according to claim 1, characterized in that: The calculation formula of the Hamming weight is expressed as: ; in, represents the Hamming function, Indicates sensitive value. , Represents a constant; Represents input data; represents the weight, represents the Hamming weight.
Citation Information
Patent Citations
Side channel analysis method based on deep learning
CN116388956A
Neural network model security assessment method and device and computer equipment
CN118069505A