Chip electromagnetic side-channel analysis method, system and storage medium
The electromagnetic side channel analysis method constructed through stacked autoencoding neural network and clustering algorithm solves the problem of security evaluation when the password intermediate value cannot be obtained, and realizes automated and fast side channel security evaluation, reducing the intensity of analysis hypothesis.
Patent Information
- Application Number
- CN202310146465.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-21
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2043-02-21
AI Technical Summary
In the case where the password intermediate value cannot be obtained, it is difficult to effectively evaluate the side channel security protection performance of the chip, and the side channel analysis method based on deep learning depends on manual experience and an efficient feature extraction process.
The stack-type self-coding neural network technology and clustering algorithm are used to collect electromagnetic signals, build a self-coding network structure, and pre-train when the intermediate value data of the password is unknown, and the side channel security evaluation model is established using plain text data optimization training.
It realizes that the side channel leakage security of the chip is automatically evaluated without relying on the password intermediate value, which reduces the assumption strength of the channel measurement analysis, improves the analysis speed and success rate, and reduces interference to higher-order masks and noise.
Smart Images

Figure CN116260565B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of integrated circuit security performance detection, and in particular to a chip electromagnetic side channel analysis method, system and storage medium. Background Art
[0002] With the rapid development of the integrated circuit industry, digital integrated circuit chips have become increasingly widely used in various fields of modern technology, particularly in sensitive areas such as financial equipment, mobile communications, transportation, and energy. Integrated circuits are playing an increasingly important role in promoting social progress and economic development. At the same time, the demand for information security and identity authentication is also increasing. As a result, security components centered around cryptographic algorithms have gained widespread application. Cryptographic algorithm-based security components are typically implemented as software programs or hardware circuits on various hardware platforms, such as central processing units (CPUs), microcontrollers, and application-specific integrated circuits (ASICs). These cryptographic devices and software systems that run the cryptographic algorithms together constitute the entire cryptographic system.
[0003] Cryptography systems are an important safeguard for many facilities and applications, protecting their privacy from external theft. With the continuous improvement of computer computing power, traditional attack methods based on the Kerkhoff hypothesis and mathematical statistical analysis have gradually evolved into side-channel attacks that combine physical information leakage during the operation of cryptographic systems with algorithmic attacks. Many testing organizations have also made resisting side-channel attacks one of the basic requirements for determining whether cryptographic products are secure.
[0004] Side-channel analysis of cryptographic systems involves analyzing the physical implementation of cryptographic algorithms to determine secret information (such as keys) or assess their protection capabilities. Because side-channel information generated by chips during operation, such as power consumption, electromagnetic field, runtime, and acoustics, is correlated with the operations and operands performed by the system, which in turn depend entirely on the input secret information, it is possible to measure and analyze this physical information, which contains secret information, to recover sensitive variables and secret information within the system.
[0005] In recent years, researchers have proposed a series of side channel analysis methods based on deep learning. By establishing a model between intermediate values and input side channel information, they extract and learn side channel features, making it possible to directly guess the secret information of the cryptographic system by collecting a small amount of side channel information.
[0006] Currently, conventional side-channel attack techniques typically require obtaining the intermediate password values of the target device. This requires the attacker to fully control a compromised device in order to attack similar devices. The correlation between leaked electromagnetic information and sensitive information is a prerequisite for this attack method. Furthermore, while deep learning-based template attacks have been proven to be effective, in actual data collection and application, the low signal-to-noise ratio of raw side-channel data and the sparse temporal distribution of key features require extensive information preprocessing and feature extraction to obtain data useful for side-channel analysis. These preprocessing and extraction steps are prerequisites for successful side-channel analysis, but they vary depending on the specific analysis objectives and scenarios, relying heavily on manual experience and selection, and cannot be efficiently automated.
[0007] In the related art, the solutions recorded in the Chinese invention patent application documents with application publication numbers CN112615714A and CN113630235A are limited to the situation where the password intermediate values corresponding to the energy trajectory can be fully obtained for analysis, and are trained based on convolutional neural networks; and cannot be analyzed for the situation where a small number of password intermediate values can be obtained or no password intermediate values can be obtained.
[0008] The Chinese invention patent application document with application publication number CN107508678A discloses a side-channel attack method for the RSA mask defense algorithm based on machine learning. This scheme mainly uses a machine learning cluster analysis method for the RSA cryptographic algorithm. The RSA cryptographic algorithm is an asymmetric encryption algorithm and is significantly different from a symmetric encryption algorithm. Summary of the Invention
[0009] The technical problem to be solved by the present invention is how to evaluate the side channel security protection performance of a chip with unknown cryptographic intermediate value information.
[0010] The present invention solves the above technical problems through the following technical means:
[0011] In a first aspect, the present invention provides a chip electromagnetic side channel analysis method, the method comprising:
[0012] Collecting electromagnetic signals from the side channel of the target device, and extracting feature points of interest related to the side channel analysis target from the electromagnetic signals to construct a data set;
[0013] Based on the stacked autoencoding neural network technology, the data set is used as the input of the autoencoding network, and the electromagnetic signal is used as the output label of the autoencoding network to construct an autoencoding network structure;
[0014] When the password intermediate value data is unknown, a clustering algorithm is used to pre-train the autoencoder network structure to obtain a hypothesis model;
[0015] The hypothetical model is optimized and trained using plaintext data to obtain a network model for side channel security assessment.
[0016] Furthermore, collecting electromagnetic signals of the side channel of the target device and extracting feature points of interest related to the side channel analysis target from the electromagnetic signals to construct a data set includes:
[0017] running a cryptographic algorithm on the target device to collect electromagnetic signals generated during sensitive operations;
[0018] Extracting feature points of interest related to the side channel analysis target from the electromagnetic signal;
[0019] The data set is constructed based on the feature points of interest, and the data set is divided into a training set and a validation set in proportion.
[0020] Furthermore, the stacked autoencoding neural network technology uses the data set as the input of the autoencoding network and the electromagnetic signal as the output label of the autoencoding network to construct an autoencoding network structure, including:
[0021] The electromagnetic signal is used as the input of the first-layer autoencoder network, the feature points of interest in the data set are used as the output labels of the first-layer autoencoder network, and the mean square reconstruction error is minimized to reconstruct the loss function to train the autoencoder network of this layer, thereby obtaining a single-layer autoencoder network;
[0022] Each layer of the autoencoder network is trained with the output features of the previous layer of the autoencoder network as input, and a feature extraction layer consisting of multiple layers of the autoencoder network is obtained;
[0023] A fully connected layer is connected after the feature extraction layer to construct the autoencoding network structure.
[0024] Furthermore, extracting feature points of interest related to the side channel analysis target from the electromagnetic signal includes:
[0025] Dividing the electromagnetic signal into a number of analysis areas according to algorithm characteristics;
[0026] Extracting feature points of interest related to the side channel analysis target for electromagnetic signals in different analysis areas
[0027] Furthermore, the clustering algorithm is used to pre-train the autoencoder network structure to obtain a hypothesis model, including:
[0028] Specify the initial number of clusters in advance based on the analysis objectives;
[0029] Using the autoencoder network structure, features are extracted from the input electromagnetic signal, and the Euclidean distance between the extracted data features is used as an indicator to measure the similarity between different electromagnetic signals. The closer the distance, the higher the similarity between different electromagnetic signals.
[0030] Randomly select several electromagnetic signal data features as the mean vector of the initial cluster, i.e., the cluster center, and divide each data feature into the cluster closest to it;
[0031] Calculate the mean vector of all data features in each cluster as the new cluster center, and repeat the division and update operations until the positions of the cluster centers no longer change or the iteration limit is reached;
[0032] The obtained parameter set of the electromagnetic signal category divided according to the data characteristics is used as the hypothetical model.
[0033] Furthermore, the use of plaintext data to optimize and train the hypothetical model to obtain a network model for side channel security assessment includes:
[0034] The plaintext data is used to test the degree of correlation between the output secret information of the hypothetical model and the electromagnetic signal leaked by the target device, thereby optimizing the training of the hypothetical model and obtaining a network model for side channel security assessment.
[0035] Furthermore, when the password intermediate value data is obtained, the method further includes:
[0036] Determining whether the password intermediate value data exceeds a set threshold;
[0037] If so, optimizing and training the autoencoding network structure to obtain a network model for side channel security assessment;
[0038] If not, the clustering algorithm is used to pre-train the autoencoding network structure to obtain the hypothetical model, and the obtained cryptographic intermediate value data is used to optimize the training of the hypothetical model to obtain a network model for side channel security assessment.
[0039] Furthermore, the method further comprises:
[0040] Based on the verification set, the network model used for side channel security assessment is verified.
[0041] In a second aspect, the present invention provides a chip electromagnetic side channel analysis system, the system comprising:
[0042] An acquisition module is used to collect electromagnetic signals from the side channel of the target device and extract feature points of interest related to the side channel analysis target from the electromagnetic signals to construct a data set;
[0043] A network construction module is used to construct an autoencoding network structure based on a stacked autoencoding neural network technology, using the data set as the input of the autoencoding network and the electromagnetic signal as the output label of the autoencoding network;
[0044] A pre-training module, used for pre-training the autoencoder network structure using a clustering algorithm to obtain a hypothesis model when the password intermediate value data is unknown;
[0045] The optimization training module is used to optimize the hypothetical model using plaintext data to obtain a network model for side channel security assessment.
[0046] In a third aspect, the present invention proposes a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the chip electromagnetic side channel analysis method as described above is implemented.
[0047] The advantages of the present invention are:
[0048] (1) When the cryptographic intermediate value data cannot be obtained, the present invention uses a clustering algorithm to pre-train the autoencoder network structure, and uses the input plaintext data as the basis for verifying whether the analysis is correct. It can analyze the leakage information attributes of the device. Under the condition that it is difficult to obtain the cryptographic intermediate value as a label, it can achieve an assessment of the leakage security of the test channel to a certain extent, that is, the correlation between the key intermediate value and the electromagnetic signal is obtained without obtaining the sensitive information of the target device itself, thereby reducing the assumption strength of the test channel analysis and realizing weak assumption test channel analysis.
[0049] (2) The stacked autoencoding neural network technology is used to establish a connection between the input electromagnetic signal and itself, realize noise reduction and compression of the data dimension, and perform pre-classification. Finally, the neural network template analysis method is used to recover the secret information in the chip operation process. Based on the autoencoding technology, semi-supervised neural network training can be realized. Since the demand for the internal password intermediate value in the encryption process is not high when the electromagnetic signal is connected to itself, only a small amount of data is required to have a label value, and the rest of the data only needs a simple electromagnetic signal to achieve training, which greatly reduces the strength of the hypothesis.
[0050] (3) By dividing the electromagnetic signals collected over a long period of time into different analysis areas, the input data dimension of the neural network is reduced, and the feature extraction operation is better realized while performing segmented processing, which effectively improves the speed and analysis success rate of side channel analysis in the preprocessing stage. It has the advantages of fast convergence speed, not easy to fall into local minima, and automatic training optimization features.
[0051] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 1 is a flow chart of a chip electromagnetic side channel analysis method according to an embodiment of the present invention;
[0053] Figure 2 This is a schematic diagram of the overall process of the chip electromagnetic side channel analysis method proposed in one embodiment of the present invention;
[0054] Figure 3 It is a structural diagram of an electromagnetic side channel analysis system proposed in one embodiment of the present invention. DETAILED DESCRIPTION
[0055] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0056] like Figure 1 As shown, the first embodiment of the present invention provides an electromagnetic side channel analysis method, which includes the following steps:
[0057] S10, collecting electromagnetic signals from the side channel of the target device, and extracting feature points of interest related to the side channel analysis target from the electromagnetic signals to construct a data set;
[0058] S20. Based on the stacked autoencoding neural network technology, the data set is used as the input of the autoencoding network, and the electromagnetic signal is used as the output label of the autoencoding network to construct an autoencoding network structure;
[0059] S30, when the password intermediate value data is unknown, using a clustering algorithm to pre-train the autoencoder network structure to obtain a hypothetical model;
[0060] S40. Optimize and train the hypothetical model using plaintext data to obtain a network model for side channel security assessment.
[0061] When the password intermediate value data cannot be obtained, this embodiment uses a clustering algorithm to pre-train the autoencoder network structure, and uses the input plaintext data as the basis for verifying whether the analysis is correct. The leakage information attributes of the device can be analyzed. Under the condition that it is difficult to obtain the password intermediate value as a label, the security of the test channel leakage can be evaluated to a certain extent. That is, the correlation between the key intermediate value and the electromagnetic signal is obtained without obtaining the sensitive information of the target device itself, which reduces the assumption strength of the test channel analysis and realizes weak assumption test channel analysis.
[0062] In one embodiment, step S10 of collecting electromagnetic signals from the side channel of the target device and extracting feature points of interest related to the side channel analysis target from the electromagnetic signals to construct a data set specifically includes the following steps:
[0063] S11, running a block cipher algorithm on the target device to collect electromagnetic signals generated during sensitive operations;
[0064] Specifically, this embodiment runs symmetric encryption algorithms such as AES, DES, SM4 and other block cipher algorithms on the target device, and uses a multi-element side channel leakage collection system to collect electromagnetic signal energy traces during sensitive operations for subsequent feature point extraction operations.
[0065] S12, extracting feature points of interest related to the side channel analysis target from the electromagnetic signal;
[0066] It should be noted that the extraction of feature points of interest is the process of dividing the electromagnetic signal into regions. This process implements automated analysis based on different algorithms according to the time domain characteristics of the electromagnetic signal.
[0067] S13. Construct the data set based on the feature points of interest, and divide the data set into a training set and a validation set in proportion.
[0068] It should be noted that those skilled in the art can set the division ratio of the training set and the validation set according to actual needs, and this embodiment does not make any specific limitation.
[0069] In one embodiment, step S20: constructing an autoencoding network structure based on a stacked autoencoding neural network technology, using the data set as the input of the autoencoding network and the electromagnetic signal as the output label of the autoencoding network, specifically includes the following steps:
[0070] S21, using the electromagnetic signal as the input of a first-layer autoencoder network, using the feature points of interest in the data set as output labels of the first-layer autoencoder network, and calculating a reconstruction loss function by minimizing the mean square reconstruction error to train the autoencoder network of this layer, thereby obtaining a single-layer autoencoder network;
[0071] S22, each layer of the autoencoder network is trained by taking the output features of the previous layer of the autoencoder network as input, thereby obtaining a feature extraction layer composed of multiple layers of the autoencoder network;
[0072] S23. Connect a fully connected layer after the feature extraction layer to construct the autoencoding network structure.
[0073] It should be noted that, in this embodiment, the electromagnetic signal is used as the input of the first-layer autoencoder network, and the feature points of interest in the data set are used as the output labels of the first-layer autoencoder network. The first-order feature representation of the original input feature is obtained by training, and then the features output by the previous layer are used as the input of the next-layer autoencoder network for another autoencoding to obtain the second-order feature representation of the first-order feature. In this way, the autoencoder network is built layer by layer, and the output of the last layer of the autoencoder network is connected to the softmax classifier to construct a stacked autoencoder network as the feature extraction layer.
[0074] This embodiment is based on stacked autoencoder neural network technology, using an autoencoder to pre-train data layer by layer to obtain the network's initial weights and thresholds. The multi-layer neural network then uses backpropagation to adjust and optimize the entire network weights, performs noise reduction and feature extraction on the collected electromagnetic signals, and pre-classifies the data set based on the data characteristics of the electromagnetic signals themselves. Finally, a lightweight neural network is used to evaluate and analyze the collected electromagnetic signals to obtain the correlation between the leaked electromagnetic signals and the secret information.
[0075] Compared with the direct training of network parameters by convolutional neural networks, this embodiment adopts stacked autoencoder neural network technology to reduce the training cycle of the model and speed up the efficiency of model training. When a small number of password intermediate values can be obtained, the training time to achieve close performance is reduced by 20% compared with traditional network training iterations. At the same time, the advantages of automatic training optimization features of the autoencoder network can effectively reduce the protective effect of protection measures such as high-order masks and random delays, as well as the interference of noise. By comparing the data input before and after the noise reduction optimization of the autoencoder network, the method of feature extraction using the autoencoder network can effectively improve the analysis success rate of the model.
[0076] Furthermore, the stacked autoencoding technology employed builds a neural network layer by layer, using input as the output label. Each layer of the network performs both feature extraction and noise reduction, effectively improving the low signal-to-noise ratio of electromagnetic signals. Furthermore, in terms of network structure construction, the feature extraction process of convolutional neural networks relies on the size of the convolution kernel and the number of convolution layers. Wide-area perception requires larger convolution kernels or more convolution layers. Multi-layer perception autoencoding neural networks, however, can directly extract features over a larger time domain, thus addressing the sparse temporal distribution of key features.
[0077] In one embodiment, step S12, extracting feature points of interest related to the side channel analysis target from the electromagnetic signal, specifically includes the following steps:
[0078] Dividing the electromagnetic signal into a number of analysis areas according to algorithm characteristics;
[0079] For the electromagnetic signals in the different analysis areas, feature points of interest related to the side channel analysis target are extracted.
[0080] Specifically, the collected electromagnetic information is automatically analyzed, and the electromagnetic signal is divided into several analysis areas according to the algorithm characteristics. For example, the ten-round function in the design of the AES algorithm can be used to divide the electromagnetic signal into a noise area before encryption execution, a noise area after encryption execution, and an encryption target area that varies according to the algorithm based on the change of the electromagnetic amplitude over time in the electromagnetic signal waveform characteristics. In the AES algorithm, the analysis area is divided into a key expansion area and a ten-round encryption area, a total of eleven analysis areas. Two adjacent analysis areas will have overlapping intervals to improve robustness.
[0081] It's important to note that the analysis regions vary depending on the cryptographic algorithm being analyzed. For example, the AES algorithm has 10 rounds, which manifests as ten similar but not identical peaks in the electromagnetic signal. Therefore, the AES algorithm can be divided into the following: the pre-encryption noise region, the encryption region (key expansion region, ten rounds of the round, for a total of eleven regions), and the post-encryption noise region. After these regions are divided, target extraction can be performed based on the desired analysis objective. For example, to attack the S-box operation in the second round of encryption, the second round of encryption can be selected. This selection process is known as feature point selection, and feature extraction and attack are then performed on these feature point regions.
[0082] The process of building a stacked autoencoder network is to use the input signal as the label value for training. The process of building a stacked autoencoder neural network using the electromagnetic signals of the divided area is as follows: select the target analysis area, use the electromagnetic data in the analysis area as the input and label of the autoencoder network, train the hidden layer so that the output is close to the input data, and retain the first half of the hidden layer as the feature extraction layer.
[0083] This embodiment reduces the amount of input data and the dimensionality of the neural network input by dividing electromagnetic signals collected over a long period of time into several analysis regions. For example, for an electromagnetic signal with 100,000 data points, selecting 700 points within the target region as input can significantly reduce the amount of computation and improve network efficiency. Automated partitioning tools can also be used to avoid the inconvenience of manual partitioning. While segmenting, feature extraction is effectively implemented, effectively improving the speed and success rate of side-channel analysis in the preprocessing stage. The method has the advantages of fast convergence, resistance to local minima, and automatic training and feature optimization.
[0084] In one embodiment, the step S30 of pre-training the autoencoder network structure using a clustering algorithm to obtain a hypothesis model specifically includes the following steps:
[0085] S31. Specify the initial number of clusters n in advance according to the analysis objectives;
[0086] S32. Using the autoencoder network structure, extract features from the input electromagnetic signal, and use the Euclidean distance between the extracted data features as an indicator to measure the similarity between different electromagnetic signals in the data, where the closer the distance, the higher the similarity between different electromagnetic signals;
[0087] S33, randomly selecting n electromagnetic signal features as the mean vector of the initial cluster (i.e., cluster center);
[0088] S34, divide each feature into the cluster closest to it;
[0089] S35. Calculate the mean vector of all features in each cluster as the new cluster center;
[0090] S36. Repeat steps S34 and S35 until the positions of the cluster centers no longer change or the iteration limit is reached; the obtained parameter set for classifying electromagnetic signals according to the characteristics is the hypothesis model.
[0091] The feature extraction part of this hypothetical model is composed of the encoding part of the autoencoder network, and the classification part is implemented through the iteration of the clustering algorithm. It can analyze the input electromagnetic signal, but the correctness of the results still needs further verification, so an optimized training process is needed.
[0092] In one embodiment, the step S40 of optimizing and training the hypothetical model using plaintext data to obtain a network model for side channel security assessment is as follows:
[0093] The plaintext data is used to test the degree of correlation between the secret information output by the hypothetical model and the electromagnetic signal leaked by the target device, thereby optimizing the training of the hypothetical model and obtaining a network model for side channel security assessment.
[0094] Specifically, during the encryption calculation process, there is a certain data correlation between the input plaintext and the intermediate value of the password. Based on the hypothetical model, optimization training is performed for different plaintext input situations. The specific operation steps are as follows:
[0095] Input electromagnetic signal data with known plaintext information into the hypothesis model for training;
[0096] The clustering of electromagnetic signals with the same plaintext value is analyzed. If more than a set number of the same plaintext values are classified into the same category during the clustering process, it is determined that the correlation between the secret information and the electromagnetic signal leaked by the target device is high, and the device side channel security attribute is weak.
[0097] It should be noted that the set quantity described in this embodiment is an empirical value obtained through a large number of experiments and is not specifically limited thereto.
[0098] It should be noted that when the intermediate value of the password cannot be obtained, this embodiment uses the K-means clustering algorithm to pre-train the autoencoding network structure, and then optimizes the pre-trained network structure using the input plaintext as the basis for verifying whether the analysis is correct. The leakage information attributes of the device can be analyzed, thereby evaluating the strength of the electromagnetic side channel security protection capability of the device, reducing the assumption strength of the channel analysis, and preliminarily realizing weak assumption channel analysis.
[0099] In one embodiment, if Figure 2 As shown, when the password intermediate value data is obtained, the method further includes the following steps:
[0100] Determining whether the password intermediate value data exceeds a set threshold;
[0101] If so, optimizing and training the autoencoding network structure to obtain a network model for side channel security assessment;
[0102] If not, the clustering algorithm is used to pre-train the autoencoding network structure to obtain the hypothetical model, and the obtained cryptographic intermediate value data is used to optimize the training of the hypothetical model to obtain a network model for side channel security assessment.
[0103] Furthermore, the specific steps of optimizing and training the hypothesis model using the password intermediate value data include:
[0104] (1) The electromagnetic signal of the same password intermediate value is used as the input of the feature extraction layer to obtain the characteristic value of the electromagnetic signal, and the electromagnetic signal is divided into two parts, one for optimization training and the other for verification;
[0105] (2) Weight the optimized training data of the known password intermediate value and the mean vector of the unknown password intermediate value data, that is, the calculation method of the new cluster center is L = L 已知密码中间值+u L 未知密码中间值 , the u value depends on the ratio of known password intermediate value data to unknown password intermediate value data;
[0106] (3) Divide each unknown password intermediate value feature into the cluster closest to it;
[0107] (4) Repeat steps (2) to (3) until the positions of the cluster centers no longer change or the iteration limit is reached; input the data of the verification part of the known password intermediate value into the trained model, and use the number of eigenvalues of the same password intermediate value captured by the cluster center as the evaluation indicator.
[0108] (5) If the electromagnetic signal of the verification part has a large classification gap when input into the hypothesis model, the u value is reduced; clustering training is performed again to obtain a new clustering model until the accuracy of the known password intermediate value data reaches the index.
[0109] It should be noted that the set threshold described in this embodiment is the amount of password intermediate value data obtained through a large number of experiments for measuring. When only a small amount of password intermediate values can be obtained, a clustering algorithm is used to pre-train the autoencoder network structure, and then the known password intermediate values are used to optimize the hypothesis model for training to achieve effective analysis of the password intermediate values.
[0110] Furthermore, when the intermediate password value is fully obtained, there is no need to pre-train the autoencoder network structure. The network model for side channel security assessment can be obtained by directly optimizing and training the autoencoder network structure. The specific steps are as follows:
[0111] (1) The encoding part of the autoencoder network is used as the feature extraction layer, and the output value of the feature extraction is input into the fully connected layer. The parameters of the fully connected layer are trained and the probability vectors of each candidate key are output;
[0112] (2) Calculate the reconstruction loss function by minimizing the mean square reconstruction error and adjust the parameters of the fully connected layer by reverse gradient descent;
[0113] (3) Repeat the above steps until the iteration limit is reached or the accuracy of the validation set reaches the threshold, and the training model is obtained.
[0114] It should be noted that when only a small number of password intermediate values can be obtained, the K-means clustering algorithm is used to pre-train the autoencoding network structure, and then the existing password intermediate value information is used to perform side channel assessment on the information leakage security of the device and analyze its guessed key; when the password intermediate value cannot be obtained, the K-means clustering algorithm is used to pre-train the autoencoding network structure, and then the input plaintext is used as the basis for verifying whether the analysis is correct. The leakage information attributes of the device can be analyzed to evaluate the strength of the device's electromagnetic side channel security protection capability; when sufficient password intermediate values are obtained, the autoencoding network structure is directly optimized and trained to obtain a network model for side channel security assessment.
[0115] In one embodiment, after obtaining the network model for performing side channel security assessment, the method further includes the following steps:
[0116] Based on the verification set, the network model used for side channel security assessment is verified.
[0117] It should be noted that the validation set is used to evaluate the prediction results of the network model obtained through optimization training to verify whether the trained model can determine the degree of correlation of the target key or the intermediate value of the target system password based on the correlation calculation, thereby determining the electromagnetic side channel protection capability and security of the security chip.
[0118] like Figure 3 As shown, the second embodiment of the present invention provides a chip electromagnetic side channel analysis system, characterized in that the system includes:
[0119] An acquisition module 10 is configured to acquire electromagnetic signals from the side channel of a target device and extract feature points of interest related to the side channel analysis target from the electromagnetic signals to construct a data set;
[0120] A network construction module 20 is configured to construct an autoencoding network structure based on a stacked autoencoding neural network technology, using the data set as an input of the autoencoding network and the electromagnetic signal as an output label of the autoencoding network;
[0121] A pre-training module 30 is used to pre-train the autoencoder network structure using a clustering algorithm to obtain a hypothesis model when the password intermediate value data is unknown;
[0122] The optimization training module 40 is used to optimize and train the hypothetical model using plaintext data to obtain a network model for side channel security assessment.
[0123] When the password intermediate value data cannot be obtained, this embodiment uses a clustering algorithm to pre-train the autoencoder network structure, and uses the input plaintext data as the basis for verifying whether the analysis is correct. The leakage information attributes of the device can be analyzed. Under the condition that it is difficult to obtain the password intermediate value as a label, the security of the test channel leakage can be evaluated to a certain extent. That is, the correlation between the key intermediate value and the electromagnetic signal is obtained without obtaining the sensitive information of the target device itself, which reduces the assumption strength of the test channel analysis and realizes weak assumption test channel analysis.
[0124] In one embodiment, the acquisition module 10 specifically includes:
[0125] an acquisition unit, configured to run a cryptographic algorithm on the target device and acquire electromagnetic signals generated during sensitive operations;
[0126] a feature extraction unit, configured to extract feature points of interest related to a side channel analysis target from the electromagnetic signal;
[0127] The data set division unit is used to construct the data set based on the feature points of interest, and divide the data set into a training set and a validation set in proportion.
[0128] In one embodiment, the network construction module 20 is specifically configured to:
[0129] The electromagnetic signal is used as the input of the first-layer autoencoder network, the feature points of interest in the data set are used as the output labels of the first-layer autoencoder network, and the mean square reconstruction error is minimized to reconstruct the loss function to train the autoencoder network of this layer, thereby obtaining a single-layer autoencoder network;
[0130] Each layer of the autoencoder network is trained with the output features of the previous layer of the autoencoder network as input, and a feature extraction layer consisting of multiple layers of the autoencoder network is obtained;
[0131] A fully connected layer is connected after the feature extraction layer to construct the autoencoding network structure.
[0132] In one embodiment, the system further includes a signal division module, specifically configured to:
[0133] The electromagnetic signal is divided into several analysis areas according to the algorithm characteristics, so as to extract the feature points of interest related to the side channel analysis target for the electromagnetic signals in different analysis areas.
[0134] In one embodiment, the pre-training module 30 is specifically configured to perform the following steps:
[0135] Follow these steps:
[0136] S31. Specify the initial number of clusters n in advance according to the analysis objectives;
[0137] S32. Using the autoencoder network structure, extract features from the input electromagnetic signal, and use the Euclidean distance between the extracted data features as an indicator to measure the similarity between different electromagnetic signals in the data, where the closer the distance, the higher the similarity between different electromagnetic signals;
[0138] S33, randomly selecting n electromagnetic signal features as the mean vector of the initial cluster (i.e., cluster center);
[0139] S34, divide each feature into the cluster closest to it;
[0140] S35. Calculate the mean vector of all features in each cluster as the new cluster center;
[0141] S36. Repeat steps S34 and S35 until the positions of the cluster centers no longer change or the iteration limit is reached; the obtained parameter set for classifying electromagnetic signals according to the characteristics is the hypothesis model.
[0142] The feature extraction part of this hypothetical model is composed of the encoding part of the autoencoder network, and the classification part is implemented through the iteration of the clustering algorithm. It can analyze the input electromagnetic signal, but the correctness of the results still needs further verification, so an optimized training process is needed.
[0143] In one embodiment, the optimization training module 40 is specifically configured to:
[0144] The plaintext data is used to test the degree of correlation between the output secret information of the hypothetical model and the electromagnetic signal leaked by the target device, thereby optimizing the training of the hypothetical model and obtaining a network model for side channel security assessment.
[0145] In one embodiment, when the password intermediate value data is obtained, the system further includes:
[0146] A judgment module, used to judge whether the password intermediate value data exceeds a set threshold;
[0147] The optimization training module 40 is further configured to perform optimization training on the autoencoding network structure to obtain a network model for side channel security assessment when the judgment module outputs a yes result;
[0148] The pre-training module 50 is further configured to, when the judgment module outputs a negative result, execute the pre-training of the autoencoding network structure using the clustering algorithm to obtain the hypothesis model, and optimize the training of the hypothesis model using the obtained cryptographic intermediate value data to obtain a network model for side channel security assessment.
[0149] In one embodiment, the system further comprises:
[0150] The verification module is specifically used to verify the network model used for side channel security assessment based on the verification set.
[0151] It should be noted that the verified network model can be used to analyze the leakage information attributes of the target device, thereby evaluating the strength of the device's electromagnetic side channel security protection capabilities.
[0152] It should be noted that other embodiments or implementation methods of the chip electromagnetic side channel analysis system of the present invention can refer to the above-mentioned method embodiments, which will not be repeated here.
[0153] In a third aspect, the present invention further proposes a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the chip electromagnetic side channel analysis method as described in the first embodiment is implemented.
[0154] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0155] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.
[0156] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A chip electromagnetic side channel analysis method, characterized in that: The method comprises: Collecting electromagnetic signals from the side channel of the target device, and extracting feature points of interest related to the side channel analysis target from the electromagnetic signals to construct a data set; Based on the stacked autoencoding neural network technology, the data set is used as the input of the autoencoding network, and the electromagnetic signal is used as the output label of the autoencoding network to construct an autoencoding network structure; When the intermediate value data of the password is unknown, a clustering algorithm is used to pre-train the autoencoder network structure to obtain a hypothesis model, including: specifying the initial number of clusters in advance according to the analysis target; using the autoencoder network structure to extract features of the input electromagnetic signal, and using the Euclidean distance between the extracted data features as an indicator to measure the similarity between different electromagnetic signals, where the closer the distance, the higher the similarity between different electromagnetic signals; randomly selecting a number of electromagnetic signal data features as the mean vector of the initial cluster class as the cluster center, and dividing each data feature into the cluster closest to it; calculating the mean vector of all data features in each cluster as the new cluster center, and repeating the division and update operations until the position of each cluster center no longer changes or reaches the iteration limit; and using the obtained parameter set of the electromagnetic signal category divided according to the data features as the hypothesis model; The hypothetical model is optimized and trained using plaintext data to obtain a network model for side channel security assessment.
2. The chip electromagnetic side channel analysis method according to claim 1, characterized in that: The collecting of electromagnetic signals from the side channel of the target device and extracting feature points of interest related to the side channel analysis target from the electromagnetic signals to construct a data set includes: running a cryptographic algorithm on the target device to collect electromagnetic signals generated during sensitive operations; Extracting feature points of interest related to the side channel analysis target from the electromagnetic signal; The data set is constructed based on the feature points of interest, and the data set is divided into a training set and a validation set in proportion.
3. The chip electromagnetic side channel analysis method according to claim 1, characterized in that: The stacked autoencoding neural network technology uses the data set as the input of the autoencoding network and the electromagnetic signal as the output label of the autoencoding network to construct an autoencoding network structure, including: The electromagnetic signal is used as the input of the first-layer autoencoder network, the feature points of interest in the data set are used as the output labels of the first-layer autoencoder network, and the mean square reconstruction error is minimized to reconstruct the loss function to train the autoencoder network of this layer, thereby obtaining a single-layer autoencoder network; Each layer of the autoencoder network is trained with the output features of the previous layer of the autoencoder network as input, and a feature extraction layer consisting of multiple layers of the autoencoder network is obtained; A fully connected layer is connected after the feature extraction layer to construct the autoencoding network structure.
4. The chip electromagnetic side channel analysis method according to claim 2, characterized in that: The extracting feature points of interest related to the side channel analysis target from the electromagnetic signal includes: Dividing the electromagnetic signal into a number of analysis areas according to algorithm characteristics; For the electromagnetic signals in the different analysis areas, feature points of interest related to the side channel analysis target are extracted.
5. The chip electromagnetic side channel analysis method according to claim 1, characterized in that: The method of optimizing and training the hypothetical model using plaintext data to obtain a network model for side channel security assessment includes: The plaintext data is used to test the degree of correlation between the output secret information of the hypothetical model and the electromagnetic signal leaked by the target device, thereby optimizing the training of the hypothetical model and obtaining a network model for side channel security assessment.
6. The chip electromagnetic side channel analysis method according to claim 1, characterized in that: When the password intermediate value data is obtained, the method further includes: Determining whether the password intermediate value data exceeds a set threshold; If so, optimizing and training the autoencoding network structure to obtain a network model for side channel security assessment; If not, the clustering algorithm is used to pre-train the autoencoding network structure to obtain the hypothetical model, and the obtained cryptographic intermediate value data is used to optimize the training of the hypothetical model to obtain a network model for side channel security assessment.
7. The chip electromagnetic side channel analysis method according to claim 2, characterized in that: After obtaining the network model for performing side channel security assessment, the method further includes: Based on the verification set, the network model used for side channel security assessment is verified.
8. A chip electromagnetic side channel analysis system, characterized in that: The system comprises: An acquisition module is used to collect electromagnetic signals from the side channel of the target device and extract feature points of interest related to the side channel analysis target from the electromagnetic signals to construct a data set; A network construction module is used to construct an autoencoding network structure based on a stacked autoencoding neural network technology, using the data set as the input of the autoencoding network and the electromagnetic signal as the output label of the autoencoding network; A pre-training module is used to pre-train the autoencoder network structure using a clustering algorithm to obtain a hypothetical model when the intermediate value data of the password is unknown, including: specifying the initial number of clusters in advance according to the analysis target; using the autoencoder network structure to extract features of the input electromagnetic signal, and using the Euclidean distance between the extracted data features as an indicator to measure the similarity between different electromagnetic signals, where the closer the distance, the higher the similarity between different electromagnetic signals; randomly selecting a number of electromagnetic signal data features as the mean vector of the initial cluster class as the cluster center, and dividing each data feature into the cluster closest to it; calculating the mean vector of all data features in each cluster as the new cluster center, and repeating the division and update operations until the position of each cluster center no longer changes or reaches the iteration limit; and using the obtained parameter set of the electromagnetic signal category divided according to the data features as the hypothetical model; The optimization training module is used to optimize the hypothetical model using plaintext data to obtain a network model for side channel security assessment.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the chip electromagnetic side channel analysis method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Machine learning based side channel attack method for RSA mask defense algorithm
CN107508678A
Side channel analysis and model construction method and device
CN113630235A
Side channel curve processing method and device and electronic equipment
CN111680787A
Side channel analysis method and device, equipment, and storage medium
CN112615714A