Method, system and device for recovering information key on electromagnetic side of cryptographic device and medium
Through the improved residual neural network model and activation function MetaAcon-C, the problem of poor key recovery effect in the existing technology is solved, and the efficient key recovery effect is achieved, and the accuracy and stability of key recovery are improved.
Patent Information
- Application Number
- CN202510700760.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-07-18
AI Technical Summary
The existing key recovery model cannot effectively fit complex nonlinear mapping relationships using ReLU functions, resulting in poor key recovery effects.
The residual neural network Resnet is used as the basic model, and the activation function MetaAcon-C is used to replace the original activation function in Resnet, a deep inference model is constructed, and the correlation between historical electromagnetic side information and key is calculated through the Pearson correlation coefficient, and the key recovery is carried out in combination with real-time electromagnetic side information.
Improve the performance of key recovery, can quickly find the sampling points most relevant to the key, accurately capture the deep features between the electromagnetic side information and the key, and achieve high-accurate key recovery.
Smart Images

Figure CN120342607A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of electromagnetic side-channel information analysis of cryptographic devices, and particularly relates to a method, system, device and medium for recovering keys from electromagnetic side-channel information of cryptographic devices. Background Art
[0002] With the booming development of information industries such as the Internet of Things, cloud computing, big data, artificial intelligence, and 5G communication, more and more intelligent devices have entered the lives of the public. At the same time, while these intelligent devices bring convenience to people's lives, the security problems they face have increasingly become the focus of attention.
[0003] Side-channel attack is a type of cryptographic analysis and an important part of the development of cryptographic technologies. All along, the development of cryptographic analysis technologies has greatly promoted the iterative upgrade of cryptographic algorithms, promoted the continuous improvement and innovation of related cryptographic products with cryptographic algorithms as the core, and contributed to the development of the commercial cryptography industry; at the same time, it has also effectively improved the ability in the detection of cryptographic algorithms and related products, laying an important technical foundation for establishing a sound and authoritative cryptographic detection and certification system.
[0004] Traditional side-channel attack means include electromagnetic attack, power consumption attack, and timing attack. The electromagnetic side-channel information analysis technology has the advantages of being non-invasive, highly concealed, easy to implement, and having good analysis effects at the same time. It is one of the main ways to conduct side-channel attacks currently. The side-channel analysis system based on electromagnetic information is mainly divided into two steps. The first is the acquisition of electromagnetic side-channel information, and the second is the recovery of key information. Among them, the recovery of key information depends on the performance of the recovery method. The commonly used key recovery model uses a residual neural network to complete key recovery. Its use of the ReLU function cannot effectively fit complex non-linear mapping relationships, resulting in poor key recovery effects. Summary of the Invention
[0005] In order to overcome the deficiencies of the above-mentioned existing technologies, the present invention provides a method for recovering keys from electromagnetic side-channel information of cryptographic devices, including the following steps:
[0006] Obtain the historical electromagnetic side-channel information leaked during the execution of encryption by the cryptographic device and its corresponding historical key; calculate the Pearson correlation coefficient between the historical electromagnetic side-channel information and the corresponding historical key to obtain the correlation interval of the key;
[0007] Based on the residual neural network Resnet as the basic model, use the activation function MetaAcon-C to replace the original activation function in Resnet to obtain a deep inference model;
[0008] Input the historical electromagnetic side information and its corresponding historical key into the deep inference model for pre-training. During the pre-training process, use MetaAcon-C to learn the non-linear features of the input data, simulate the signal of the input data, and dynamically adjust the parameters of the deep inference model to obtain a pre-trained deep inference model;
[0009] Collect the real-time electromagnetic side information leaked when the cryptographic device performs encryption, combine the real-time electromagnetic side information with the correlation interval of the key to obtain the sampling points corresponding to the real-time electromagnetic side information and the correlation interval, input the data of the sampling points into the pre-trained deep inference model, and use the deep inference model to capture the deep features between the real-time electromagnetic side information and the corresponding key to obtain the recovered key.
[0010] Preferably, the Pearson correlation coefficient between the historical electromagnetic side information and the corresponding historical key is calculated specifically through the following formula:
[0011]
[0012] where r j is the correlation coefficient, X ij is the value of the i-th sample on the j-th feature, is the mean of the j-th feature, y i is the label of the i-th sample, is the mean of the labels, n represents the number of samples, the value range of j is [1, m], and m represents the number of sample points.
[0013] Preferably, before calculating the Pearson correlation coefficient between the historical electromagnetic side information and the corresponding historical key, it also includes performing standardization processing, low-pass filtering operation, and time-frequency conversion operation on the historical electromagnetic side information.
[0014] Preferably, the historical electromagnetic side information leaked when the cryptographic device performs encryption and its corresponding historical key are specifically collected through a PicoScope5244A oscilloscope, and the data is collected from the first 3 rounds of encryption operations of the Simeck32 / 64 algorithm.
[0015] The present invention also provides a cryptographic device electromagnetic side information key recovery system, including:
[0016] An information collection module, configured to obtain the historical electromagnetic side information leaked when the cryptographic device performs encryption and its corresponding historical key; calculate the Pearson correlation coefficient between the historical electromagnetic side information and the corresponding historical key to obtain the correlation interval of the key;
[0017] A model construction module, which is used to take the Residual Neural Network (Resnet) as the basic model, replace the original activation function in Resnet with the activation function MetaAcon-C, and obtain a deep inference model;
[0018] A key interval acquisition module, which is used to input the historical electromagnetic side information and its corresponding historical key into the deep inference model for pre-training. During the pre-training process, MetaAcon-C is used to learn the non-linear features of the input data, simulate the signal of the input data, and dynamically adjust the parameters of the deep inference model to obtain a pre-trained deep inference model;
[0019] A key recovery module, which is used to collect the real-time electromagnetic side information leaked when the cryptographic device performs encryption, combine the real-time electromagnetic side information with the correlation interval of the key to obtain the sampling points corresponding to the real-time electromagnetic side information and the correlation interval, input the data of the sampling points into the pre-trained deep inference model, and use the deep inference model to capture the deep features between the real-time electromagnetic side information and the corresponding key to obtain the recovered key.
[0020] The present invention also provides a computer device, including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the method for recovering the key of the electromagnetic side information of the cryptographic device.
[0021] The present invention also provides a computer-readable storage medium, which stores a computer program, and the computer program is suitable for being loaded by a processor to execute the method for recovering the key of the electromagnetic side information of the cryptographic device.
[0022] The method for recovering the key of the electromagnetic side information of the cryptographic device provided by the present invention has the following beneficial effects:
[0023] By using the activation function MetaAcon-C to replace the original activation function in Resnet, the present invention can obtain a deep inference model; by inputting the historical electromagnetic side information and its corresponding historical key into the deep inference model for training, during the pre-training process of the deep inference model, the activation function MetaAcon-C can fit more complex non-linear relationships and dynamically adjust the parameters of the deep inference model, thereby improving the key recovery performance; by inputting the real-time electromagnetic side information into the pre-trained deep inference model and combining it with the correlation interval of the key, the sampling points most relevant to the key can be quickly found; by inputting the data of the sampling points into the pre-trained deep inference model, the deep features between the electromagnetic side information and the corresponding key can be captured, and the recovered key can be accurately obtained. Description of the Drawings
[0024] To more clearly illustrate the embodiments of the present invention and their design solutions, the accompanying drawings required for this embodiment will be briefly introduced below. The accompanying drawings in the following description are only partial embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0025] Figure 1 It is a flowchart for the automatic acquisition of information leakage on the side of the cryptographic device of the present invention and the online real-time recovery of the key;
[0026] Figure 2 It is a framework diagram of the automatic information acquisition system on the side of the cryptographic device of the present invention;
[0027] Figure 3 It is a flowchart for the cryptographic device to collect electromagnetic side information of the present invention;
[0028] Figure 4 It is a structure diagram for feature extraction using a deep learning network of the present invention;
[0029] Figure 5 It is a schematic diagram for the training of the deep learning network model of the present invention. Specific Embodiments
[0030] In order to enable those skilled in the art to better understand the technical solutions of the present invention and implement them, the present invention will be described in detail below in conjunction with the accompanying drawings and specific embodiments. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and cannot be used to limit the protection scope of the present invention.
[0031] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "axial", "radial", "circumferential", etc. is based on the orientation or positional relationship shown in the accompanying drawings. It is only for the convenience of describing the technical solutions of the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention.
[0032] In addition, terms such as "first", "second", etc. are for descriptive purposes only and should not be construed as indicating or implying relative importance. In the description of the present invention, it should be noted that unless otherwise clearly specified or defined, the terms "connected" and "connected to" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances. In the description of the present invention, unless otherwise stated, the meaning of "a plurality of" is two or more, which will not be elaborated here.
[0033] Embodiment
[0034] The present invention provides a method for recovering the electromagnetic side information key of a cryptographic device, specifically as Figure 1 shown, including the following steps:
[0035] Step 1: Obtain the historical electromagnetic side information leaked when the cryptographic device performs encryption and its corresponding historical key.
[0036] The devices used in the present invention for collecting electromagnetic side information include an encryption device, a portable oscilloscope, a signal amplifier, an electromagnetic probe, and a host computer. As Figure 2 shown, both the historical electromagnetic side information and the real-time electromagnetic side information collected by the present invention are obtained through the above devices. As Figure 3 shown, the process of collecting information through the above devices is as follows: The encryption device is responsible for executing the encryption instructions from the host computer and generating trigger information at the same time, and sending the key information back to the host computer through the serial port; the oscilloscope intercepts the electromagnetic side information by collecting the trigger signal when the encryption device performs encryption; the amplifier is responsible for amplifying the electromagnetic signal for easy collection; the host computer automatically controls the collection process by sending instructions and receiving the returned information.
[0037] In terms of the interaction between the host computer and the encryption device, the IIC or UART protocol can be used for data transmission (only one protocol can be supported for work at the same time). The parameters that can be set in the visual UI interface of this part include: user-defined input keys and the key mode randomly generated by the system, checking the communication serial port, and the user can check the status of the serial port, such as the baud rate and key verification. The logs of these operations can be displayed in the log output area.
[0038] In terms of the interaction between the host computer and the oscilloscope, the two communicate through USB3.0 to complete data transmission. The acquisition channel, trigger channel, number of sampling points of the oscilloscope, as well as the unit time, offset voltage, and unit voltage of the sampling channel; the trigger delay and trigger voltage of the trigger channel and other parameters can be set through the built-in code in this part.
[0039] Step 2: Data preprocessing.
[0040] When the cryptographic device performs encryption or decryption operations, electric current will be generated inside its chip, thereby generating relevant electromagnetic signals. These electromagnetic signals generally show a certain correlation with the encryption operation or the change of the internal register value. Therefore, it is necessary to preprocess the collected electromagnetic side information, specifically: filtering processing, normalization processing, and time-frequency conversion processing operations.
[0041] Specifically, Z-zero normalization processing is used to normalize the mean and standard deviation of the original data of the electromagnetic side information. The processed data conforms to the standard normal distribution, that is, the mean is 0 and the standard deviation is 1. Its conversion function is:
[0042]
[0043] Among them, u is the average value of the sample data, σ is the standard deviation of the sample data, x represents the original data sample, and x ' represents the calculated data sample.
[0044] Step 3: Based on the residual neural network Resnet as the basic model, use the activation function MetaAcon-C to replace the original activation function in Resnet to obtain a deep inference model.
[0045] The present invention optimizes and improves based on the residual neural network Resnet as the basic model, introduces a new activation function MetaAcon-C to replace the original activation function, and obtains a deep inference model.
[0046] Specifically, the deep inference model is composed of an input layer, a feature extraction module, a dropout layer, a pooling layer, and a fully connected layer. Among them, the structure of the feature extraction module is as Figure 4 shown. In the feature extraction module, the input features pass through 2 alternately arranged convolutional layers (Conv1D), 2 normalization layers (BN), and 2 MetaAconC layers and are output and added to the features that have undergone 1 convolutional operation. Such a design can preserve the original features while extracting deep features, effectively solving the problem of gradient disappearance or explosion. The parameters and their quantities of each layer of the deep inference model are shown in Table 1. The input data size is 1875, and the output is 16 classifications.
[0047] Table 1 Model parameter structure
[0048]
[0049]
[0050] Step 4: Input the historical electromagnetic side information and its corresponding historical key into the deep inference model for pre-training. During the pre-training process, use the activation function MetaAcon-C to capture the deep features between the historical electromagnetic side information and the corresponding key, and calculate the Pearson correlation coefficient between the historical electromagnetic side information and the corresponding historical key to obtain the correlation interval of the key.
[0051] (1) Use the Pytorch deep learning framework to train the obtained deep inference model. The specific process is as follows:
[0052] Obtain the historical electromagnetic side information and the corresponding historical key leaked when the cryptographic device performs encryption. Specifically, the dataset used was collected using a PicoScope5244A oscilloscope on a single-chip microcomputer STC12C5A60S2. Focus on the first 3 rounds of encryption operations of the Simeck32 / 64 algorithm. There are a total of 6000 energy traces, with 27125 points for each energy trace, divided into two parts: 5000 Profiling_traces (training set) and 1000 Attack_Traces (test set).
[0053] (2) Preprocess the collected data, input the preprocessed data into the deep inference model, train the deep inference model, calculate the Pearson correlation coefficient between the historical electromagnetic side information and the corresponding historical key correlation points, and use the Pearson correlation coefficient method to measure the degree of linear correlation between the key and the energy trace, so as to find the correlation interval of the key. Specifically, it is carried out through the following formula:
[0054]
[0055] where r j is the correlation coefficient, X ij is the value of the i-th sample on the j-th feature, is the mean of the j-th feature, y i is the label of the i-th sample, is the mean of the labels, n represents the number of samples, the value range of j is [1, m], and m represents the number of sample points.
[0056] (3) Model conversion: Use the API provided by Pytorch to convert the deep inference model into an ONNX format model. During the conversion process, it is necessary to limit the input and output sizes of the model.
[0057] (4) Model deployment: Deploy the deep inference model after format conversion to the host computer. When the host computer receives an instruction, it automatically reads the collected data, performs inference on the CPU using ONNX Runtime, and returns the key recovery result.
[0058] Through the activation function MetaAcon-C, the present invention can adaptively select whether to activate neurons, greatly improving the network's non-linear ability and enhancing the accuracy of the deep inference model in recognition. In addition, the obtained deep inference model can effectively solve the problems of gradient disappearance or gradient explosion, thereby completing the key classification and recognition task with high accuracy and generalization. Compared with ordinary convolutional neural networks, the deep inference model of the present invention also has the advantages of being easy to train and having relatively stable performance. The training results of the deep inference model of the present invention are shown in Figure 5 .
[0059] Step 5: Collect the real-time electromagnetic side information leaked when the password device performs encryption, input the real-time electromagnetic side information into the pre-trained deep inference model, obtain the sampling points corresponding to the correlation interval between the real-time electromagnetic side information and the key, and obtain the restored key.
[0060] The real-time electromagnetic side information includes the key expansion part and the encryption part of the simeck encryption algorithm executed by the encryption device, and the present invention uses the sampling points of the key expansion part of the encryption algorithm to complete the key recovery. The encryption interval is used to extract the sampling points of the key expansion part from the real-time electromagnetic side information.
[0061] For example: An electromagnetic side information includes 10,000 sampling points, and these sampling points correspond to the complete encryption process of the encryption algorithm. Taking the simeck encryption algorithm of the present invention as an example, these sampling points mainly correspond to the encryption process (5,000 points) and the key expansion process (5,000 points) of the simeck encryption algorithm. However, to recover the key, it is easiest according to the sampling points corresponding to the key expansion part. To find the 5,000 points corresponding to the key expansion from these 10,000 points, the correlation interval needs to be used for extraction.
[0062] Input the real-time electromagnetic side information into the pre-trained deep inference model and perform 100 online experiments. The key recovery accuracy results are shown in Table 2.
[0063] Table 2 Key Recovery Accuracy
[0064] Sub - key Sub - key 1 Sub - key 2 Sub - key 3 Sub - key 4 Accuracy rate 99.7% 99.5% 100% 99.3%
[0065] The present invention also provides a key recovery system for the electromagnetic side information of a password device, including:
[0066] An information collection module, used to obtain the historical electromagnetic side information leaked when the password device performs encryption and its corresponding historical key; calculate the Pearson correlation coefficient between the historical electromagnetic side information and the corresponding historical key to obtain the correlation interval of the key;
[0067] A model construction module, which is used to take the Residual Neural Network (Resnet) as the basic model and replace the original activation function in Resnet with the activation function MetaAcon-C to obtain a deep inference model;
[0068] A key interval acquisition module, which is used to input the historical electromagnetic side information and its corresponding historical key into the deep inference model for pre-training. During the pre-training process, MetaAcon-C is used to learn the non-linear features of the input data, simulate the signal of the input data, and dynamically adjust the parameters of the deep inference model to obtain a pre-trained deep inference model;
[0069] A key recovery module, which is used to collect the real-time electromagnetic side information leaked when the cryptographic device performs encryption, combine the real-time electromagnetic side information with the correlation interval of the key to obtain the sampling points corresponding to the real-time electromagnetic side information and the correlation interval, input the data of the sampling points into the pre-trained deep inference model, and use the deep inference model to capture the deep features between the real-time electromagnetic side information and the corresponding key to obtain the recovered key.
[0070] Through this system, the recovery of the key can be completed in real time online, which helps to evaluate the security of the cryptographic chip and its system, thus ensuring the overall system security of the cryptographic device.
[0071] The present invention also provides a computer device, including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the method for recovering the key from the electromagnetic side information of the cryptographic device.
[0072] The present invention also provides a computer-readable storage medium, which stores a computer program, and the computer program is suitable for being loaded by a processor to execute the method for recovering the key from the electromagnetic side information of the cryptographic device.
[0073] The above embodiments are only preferred specific embodiments of the present invention, and the protection scope of the present invention is not limited thereto. Any simple changes or equivalent replacements of the technical solutions that can be obviously obtained by those skilled in the art within the technical scope disclosed by the present invention all belong to the protection scope of the present invention.
Claims
1. A method for recovering the key of electromagnetic side information of a cryptographic device, characterized in that, It includes the following steps: Obtain the historical electromagnetic side information leaked during the encryption execution of the cryptographic device and its corresponding historical key; calculate the Pearson correlation coefficient between the historical electromagnetic side information and the corresponding historical key to obtain the correlation interval of the key; Based on the residual neural network Resnet as the basic model, use the activation function MetaAcon-C to replace the original activation function in Resnet to obtain a deep inference model; Input the historical electromagnetic side information and its corresponding historical key into the deep inference model, and pre-train the deep inference model. During the pre-training process, use MetaAcon-C to learn the non-linear features of the input data, simulate the signal of the input data, and dynamically adjust the parameters of the deep inference model to obtain a pre-trained deep inference model; Collect the real-time electromagnetic side information leaked during the encryption execution of the cryptographic device, combine the real-time electromagnetic side information with the correlation interval of the key to obtain the sampling points corresponding to the real-time electromagnetic side information and the correlation interval, input the data of the sampling points into the pre-trained deep inference model, and use the deep inference model to capture the deep features between the real-time electromagnetic side information and the corresponding key to obtain the recovered key.
2. The electromagnetic side information key recovery method for a cryptographic device according to claim 1, wherein The calculation of the Pearson correlation coefficient between the historical electromagnetic side information and the corresponding historical key is specifically carried out through the following formula: Among them, r j is the correlation coefficient, X ij is the value of the i-th sample on the j-th feature, is the mean value of the j-th feature, y i is the label of the i-th sample, is the mean value of the labels, n represents the number of samples, the value range of j is [1, m], and m represents the number of sample points.
3. The electromagnetic side information key recovery method for a cryptographic device according to claim 1, wherein Before calculating the Pearson correlation coefficient between the historical electromagnetic side information and the corresponding historical key, it also includes performing normalization processing, low-pass filtering operation and time-frequency conversion operation on the historical electromagnetic side information.
4. The method for recovering the electromagnetic side information key of the cryptographic device according to claim 1, characterized in that The obtaining of the historical electromagnetic side information leaked during the encryption execution of the cryptographic device and its corresponding historical key is specifically collected by a PicoScope5244A oscilloscope, and the data is collected from the first 3 rounds of encryption operations of the Simeck32 / 64 algorithm.
5. A cryptographic device electromagnetic side information key recovery system, characterized in that, It includes: An information collection module, which is used to obtain the historical electromagnetic side information leaked during the encryption execution of the cryptographic device and its corresponding historical key; calculate the Pearson correlation coefficient between the historical electromagnetic side information and the corresponding historical key to obtain the correlation interval of the key; A model construction module, which is used to use the residual neural network Resnet as the basic model and use the activation function MetaAcon-C to replace the original activation function in Resnet to obtain a deep inference model; A key interval obtaining module, which is used to input the historical electromagnetic side information and its corresponding historical key into the deep inference model, pre-train the deep inference model, and during the pre-training process, use MetaAcon-C to learn the non-linear features of the input data, simulate the signal of the input data, and dynamically adjust the parameters of the deep inference model to obtain a pre-trained deep inference model; A key recovery module, which is used to collect the real-time electromagnetic side information leaked during the encryption execution of the cryptographic device, combine the real-time electromagnetic side information with the correlation interval of the key to obtain the sampling points corresponding to the real-time electromagnetic side information and the correlation interval, input the data of the sampling points into the pre-trained deep inference model, and use the deep inference model to capture the deep features between the real-time electromagnetic side information and the corresponding key to obtain the recovered key.
6. A computer device, characterized in that, It includes a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the method for recovering the electromagnetic side information key of the cryptographic device according to any one of claims 1-4.
7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and the computer program is adapted to be loaded by a processor to execute the method for recovering the electromagnetic side information key of the cryptographic device according to any one of claims 1-4.