Side channel attack method and system based on machine learning

Through a machine learning method based on convolutional neural networks, the problem that traditional side-channel attacks are difficult to recover keys in complex environments is solved. It is possible to efficiently and accurately locate the starting point of encryption operations and recover keys in the presence of random delays, thereby improving the automation and accuracy of side-channel attacks.

CN120675693APending Publication Date: 2025-09-19NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510921571.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-04
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Traditional side-channel attack methods are difficult to recover encryption keys stably and efficiently when faced with complex encryption environments and protection measures, especially in the presence of random delays.

Method used

A machine learning method based on convolutional neural networks is adopted to build a convolutional neural network model through data preprocessing and feature extraction. It can automatically locate the starting point of the encryption operation from the side channel data and recover the encryption key in the presence of random delays.

Benefits of technology

It achieves efficient and accurate positioning of the starting point of encryption operations and recovery of keys in complex environments, reduces the workload of manual feature engineering, improves the automation level and accuracy of attacks, and lowers the threshold for side-channel attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120675693A_ABST
    Figure CN120675693A_ABST
Patent Text Reader

Abstract

The invention provides a side channel attack method and system based on machine learning. According to the method, side channel information (such as power consumption, electromagnetic radiation and the like) leaked in the operation process of encryption equipment is analyzed by utilizing an advanced machine learning technology, particularly a neural network, so that an encryption key is deduced. The system comprises a data set loading module, a neural network training module, a waveform and plaintext input module, a reasoning module, a CPA attack module and the like, and all the modules work cooperatively to realize an efficient side channel attack process. According to the method, the problem of complicated manual feature extraction and analysis in the traditional side channel attack is solved, the attack efficiency and accuracy are improved, and the method has good portability and usability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to side-channel attack technology in the field of information security, and in particular to a side-channel attack method and system based on machine learning. Background Art

[0002] In modern cryptography, despite the mathematical security of encryption algorithms, their physical implementations can reveal side-channel information. This information encompasses physical characteristics such as power consumption fluctuations, electromagnetic radiation changes, and time delays during device operation. Attackers can exploit this information to launch side-channel attacks and infer encryption keys. Traditional side-channel attack methods, such as differential power analysis (DPA) and correlation power analysis (CPA), rely on a deep understanding of the physical characteristics of encryption devices and complex statistical analysis, making the process cumbersome and time-consuming. Furthermore, the increasing prevalence of protection strategies such as random delays significantly reduces the effectiveness of these traditional methods. Random delays disrupt the consistency of side-channel data by inserting unpredictable time intervals between encryption operations, making it difficult for traditional methods to accurately identify key characteristics of encryption operations, and thus making it difficult for attackers to successfully recover the key.

[0003] The rapid development of machine learning technology has opened up new avenues for side-channel attacks. Machine learning models, such as convolutional neural networks (CNNs), leverage their superior feature extraction and pattern recognition capabilities to automatically mine hidden features in side-channel data, significantly improving the automation and efficiency of attacks. However, existing technologies still have significant shortcomings when dealing with advanced protection measures such as random delays, making it difficult to reliably and efficiently recover keys in complex environments. Summary of the Invention

[0004] This invention aims to overcome the limitations of traditional side-channel attack methods when faced with complex encryption environments and protective measures, providing an efficient, accurate, and automated side-channel attack method and system based on machine learning. The core innovation of this invention lies in the use of machine learning techniques, specifically convolutional neural networks (CNNs), to automatically extract features from side-channel data and locate the starting point of encryption operations. This allows for effective recovery of encryption keys even in the presence of protective measures such as random delays.

[0005] A side channel attack method based on machine learning, comprising the following steps:

[0006] Step 1: Collect the side channel information dataset generated by the encryption device during operation and pre-process the collected dataset to generate training data that adapts to the input requirements of the machine learning model;

[0007] Step 2: Build and train a convolutional neural network model to automatically learn and extract features from the preprocessed data and establish an associated mapping relationship between them and the encryption key;

[0008] Step 3: Input the waveform file and plaintext file of the encrypted device to be attacked into the trained convolutional neural network model for inference, identify the starting point of the cryptographic operation and classify, segment and align the data;

[0009] Step 4: Perform a correlation power analysis attack based on the result of the inference processing to determine the most likely key waveform and then output the final guessed encryption key.

[0010] In order to optimize the technical solution, the further improvement plans adopted are as follows:

[0011] In step one, the side channel information includes power consumption data, electromagnetic radiation data, and time delay data. The data set is preprocessed by cleaning and normalizing the data.

[0012] The specific methods for cleaning and normalizing the data are:

[0013] First, a Kalman filter is used to denoise the side channel information dataset. By building a state-space model of the signal and using a recursive algorithm to estimate the signal state in real time, the random noise component is removed while maintaining the dynamic characteristics of the signal.

[0014] Then, Butterworth low-pass filtering is used to remove high-frequency interference components in the signal;

[0015] Finally, continuous wavelet transform is used to further denoise and extract features from the data;

[0016] After completing the above denoising process, the data is normalized by using the Z-score normalization method to calculate the mean and standard deviation of each power consumption curve, and the data is transformed into a distribution with zero mean and unit variance.

[0017] In step 2, the convolutional neural network model adopts a deep residual learning architecture to alleviate the gradient vanishing problem of deep networks by adding shortcut connections between convolutional layers.

[0018] The architecture of a convolutional neural network model includes an input layer, at least one convolutional layer, at least one pooling layer, a fully connected layer, and an output layer, where:

[0019] The input layer is used to receive the preprocessed side channel data window;

[0020] The convolution layer uses a one-dimensional convolution operation and uses multiple convolution kernels to slide on the time axis to extract local features;

[0021] The pooling layer is used to reduce the data dimension, reduce the amount of calculation, and enhance the robustness of features;

[0022] The fully connected layer maps the extracted features to an output space related to the key. By learning the complex mapping relationship between features and keys, it predicts the encryption key. The activation function of the fully connected layer uses softmax to output the probability distribution of key guesses.

[0023] The output layer is used to generate classification or regression values ​​representing the key guessing results. For classification problems, the number of neurons in the output layer corresponds to the number of possible key values, and the softmax activation function is used to output the probability of each key value. For regression problems, the number of neurons in the output layer is determined according to the key representation method, and the activation function is a linear function, which directly outputs the estimated value of the key.

[0024] The side-channel attack method can still locate the starting point of the cryptographic operation and recover the encryption key even when the encryption device implements random delay countermeasures. The specific implementation method is as follows:

[0025] When collecting side channel information data sets generated by encryption equipment during operation, the data sampling rate is increased and the collection time is extended to ensure that signal samples containing complete encryption operation signals are obtained in the presence of random delays. During data preprocessing, an adaptive signal enhancement algorithm is used to compress or expand the collected signals on the time axis, correct the signal deformation caused by random delays, and restore the original characteristics of the signals. During the convolutional neural network model training phase, noise samples simulating random delays are introduced into the training data to enhance the model's robustness to random delays. During the inference phase, a sliding window mechanism is used to sample the input data at multiple locations. Combined with the classification probability distribution of the model output, the post-processing algorithm is used to comprehensively determine the starting point of the cryptographic operation.

[0026] The post-processing algorithm includes dynamic programming algorithm and threshold judgment method.

[0027] A side-channel attack system based on machine learning, comprising: a data acquisition module, a data preprocessing module, a model training module, an inference module, and an attack execution module;

[0028] The data acquisition module is connected to the hardware interface of the encryption device, collects side channel information in real time during the operation of the encryption device, and stores it digitally to provide raw data support for subsequent processing;

[0029] The data preprocessing module is connected to the data acquisition module and is responsible for preprocessing the collected data;

[0030] The model training module is connected to the data preprocessing module and is used to build and train a convolutional neural network model to mine the relationship between features and keys in the data;

[0031] The inference module is connected to the model training module and is used to perform real-time analysis and key guessing of newly collected side channel data;

[0032] The attack execution module is connected to the reasoning module and is used to execute the correlation power consumption analysis attack according to the reasoning result and output the attack result.

[0033] Compared with the prior art, the present invention has the following significant advantages:

[0034] 1. This invention leverages the automatic feature extraction capabilities of machine learning models to reduce the workload of manual feature engineering and improve attack efficiency. Furthermore, the model's parallel computing architecture enables it to rapidly process large amounts of data, meeting the demands of real-time attacks.

[0035] 2. The machine learning model of this invention can learn the complex nonlinear characteristic relationships in side-channel data and is highly robust to noise and interference in the data. Even in the presence of protective measures such as random delays, it can accurately locate the starting point of the encryption operation and recover the encryption key, significantly improving the accuracy of the attack.

[0036] 3. The present invention achieves a high degree of automation in the entire attack process from data collection to key recovery, reducing manual intervention and reliance on experience, lowering the threshold for side-channel attacks, and enabling more security researchers to easily carry out encryption system security assessments. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 The side channel attack data processing and CNN training process diagram of the present invention is shown in the figure. In the figure, c1 corresponds to the encryption operation, c0 is the non-encryption operation, swc is the sliding window classification process, t0 is used to indicate the starting position of the encryption operation, t i Used to indicate the starting position of the i-th encryption operation, t n Used to indicate the starting position of the nth encryption operation.

[0038] Figure 2 This is a schematic diagram of the one-dimensional CNN model architecture of the present invention, where w represents the input window and y represents the classification score. DETAILED DESCRIPTION

[0039] The embodiments of the present invention are described in further detail below with reference to the accompanying drawings.

[0040] A side channel attack method based on machine learning of the present invention comprises the following steps:

[0041] 1. Collect side channel information datasets generated by encryption devices during operation. Side channel information includes but is not limited to power consumption data, electromagnetic radiation data, and time delay data. Preprocess the collected datasets, including data cleaning, normalization, and feature engineering operations, to generate training data that meets the input requirements of machine learning models.

[0042] In the data preprocessing stage, a hybrid denoising method is used to reduce the noise of the data. The hybrid denoising method includes a combination of Kalman filtering, Butterworth low-pass filtering and continuous wavelet transform. Specifically:

[0043] The Kalman filter estimates the state of side channel data through a recursive algorithm and uses prior knowledge and observation data to update the filter gain in real time. It has a good suppression effect on random noise such as Gaussian noise while maintaining the dynamic characteristics of the signal. It is suitable for processing side channel data with time-varying characteristics.

[0044] The Butterworth low-pass filter allows low-frequency signals to pass through and filters out high-frequency noise based on the set cutoff frequency. Its flat frequency response curve and linear phase characteristic can effectively avoid signal distortion, remove high-frequency interference components and improve data quality while retaining the key features of encryption operations.

[0045] The continuous wavelet transform decomposes the signal into wavelet basis functions of different scales and positions. By selecting the appropriate wavelet basis and threshold, it suppresses high-frequency noise while preserving the signal's abrupt and detailed characteristics. For non-stationary side channel signals, it provides excellent time-frequency localization analysis and is suitable for processing cryptographic operation signals with abrupt and transient characteristics.

[0046] 2. Build and train a convolutional neural network (CNN) model to automatically learn to extract features from the preprocessed data and establish a mapping relationship between them and the encryption key. The encoder parameters of the model are as follows: code size of 32, number of base filters of 16, convolution kernel size of 64, stride of 1, number of groups of 1, number of blocks of 2, downsampling interval of 3, increase filter interval of 1, batch normalization, internal dropout ratio of 0.3, and final dropout ratio of 0.2.

[0047] The architecture of the CNN model includes an input layer, at least one convolutional layer, at least one pooling layer, a fully connected layer, and an output layer, where:

[0048] The input layer receives preprocessed side channel data windows. Its dimensions are flexibly configured based on the data sampling rate and the operating characteristics of the encryption algorithm to ensure that the model can fully capture the key characteristics of the encryption operation.

[0049] The convolution layer uses a one-dimensional convolution operation, sliding multiple convolution kernels along the time axis to extract local features. The size and number of convolution kernels are determined through experimental optimization to strike a balance between feature extraction capability and computational complexity. The convolution operation is usually followed by an activation function (such as ReLU) to introduce nonlinear characteristics and enhance the model's ability to express complex features.

[0050] The pooling layer is used to reduce data dimensionality, reduce computational effort, and enhance feature robustness. Maximum pooling or average pooling is typically used, with the pooling window size and step size set based on data characteristics and model requirements to ensure that key features are retained and redundant information is effectively compressed.

[0051] The fully connected layer maps the extracted features to an output space related to the key. By learning the complex mapping relationship between features and keys, it predicts the encryption key. The number of neurons in the fully connected layer is appropriately configured based on the feature dimension and the size of the key space. The activation function uses softmax to output the probability distribution of key guesses.

[0052] The output layer generates classification or regression values ​​representing the key guess results. For classification problems, the number of neurons in the output layer corresponds to the number of possible key values, and a softmax activation function is used to output the probability of each key value. For regression problems, the number of neurons in the output layer is determined by the key representation method, and the activation function can be a linear function, directly outputting the estimated value of the key.

[0053] In this paper, the CNN model adopts a deep residual learning architecture. By adding shortcut connections between convolutional layers, it can effectively alleviate the vanishing gradient problem of deep networks and improve the model's training efficiency and performance. The depth and width of the model can be flexibly adjusted according to the specific attack task and computing resources to adapt to encryption algorithms of varying complexity and side-channel data characteristics.

[0054] 3. Input the waveform file and plaintext file of the encrypted device to be attacked into the trained CNN model for inference, identify the starting point of the cryptographic operation and classify, segment and align the data;

[0055] 4. Perform a Correlation Power Analysis (CPA) attack based on the results of the inference processing, calculate indicators such as the Pearson coefficient to determine the most likely key waveform, and then output the final guessed encryption key.

[0056] The method of the present invention can accurately locate the starting point of cryptographic operations and recover encryption keys even when the encryption device implements random delay countermeasures. The specific implementation method is as follows:

[0057] During the data acquisition phase, the data sampling rate is increased and the acquisition time is extended to ensure that the encryption operation signal can be fully captured. Even in the presence of random delays, sufficient signal samples can be obtained.

[0058] In the data preprocessing stage, an adaptive signal enhancement algorithm is used to compress or expand the collected signal on the time axis, correct the signal deformation caused by random delay, and restore the original characteristics of the signal;

[0059] During the CNN model training phase, noise samples simulating random delays are introduced into the training data to enhance the model's robustness to random delays. The features learned by the model have a certain degree of invariance, and can still accurately identify encryption operation features under certain signal deformations.

[0060] During the inference phase, a sliding window mechanism is used to sample the input data at multiple locations. Combined with the classification probability distribution of the model output, the starting point of the cryptographic operation is comprehensively determined through post-processing algorithms (such as dynamic programming and threshold judgment), effectively overcoming the uncertainty caused by random delays.

[0061] Furthermore, to further improve the model's adaptability to random delays, an attention mechanism can be introduced into the model architecture, enabling the model to automatically learn and focus on key feature areas of encryption operations while ignoring irrelevant information introduced by random delays. The attention mechanism can be implemented by adding an attention weight calculation module after the convolutional or fully connected layers. The weight calculation is based on the feature importance score, enhancing important features and suppressing unimportant features, thereby improving the model's feature discrimination and anti-interference capabilities.

[0062] The present invention also discloses a side channel attack system based on machine learning, which includes a data acquisition module, a data preprocessing module, a model training module, an inference module and an attack execution module;

[0063] The data acquisition module is used to obtain and initially store side-channel information from encryption devices. This module can be connected to the hardware interfaces of various encryption devices. Through high-precision data acquisition equipment (such as oscilloscopes and probes), it collects side-channel information such as power consumption and electromagnetic radiation in real time during the operation of the encryption device, and digitally stores this information to provide raw data support for subsequent processing.

[0064] The data preprocessing module, connected to the data acquisition module, is responsible for preprocessing the collected data, including cleaning, normalization, and feature engineering. The module has multiple built-in data processing algorithms that can automatically detect and remove outliers, fill missing values, and normalize data to a specific range. At the same time, through feature extraction and selection algorithms, it preliminarily screens feature dimensions related to encryption operations, improving data quality and model training efficiency.

[0065] The model training module, connected to the data preprocessing module, is used to build and train the CNN model to mine the features and key associations in the data. This module provides a visual interface and configuration files for users to flexibly define the CNN model's architectural parameters and training hyperparameters (such as learning rate and batch size). It also integrates multiple optimization algorithms (such as Adam and SGD) and loss functions (such as cross-entropy loss and mean squared error), monitors the training process in real time, and automatically saves the best model.

[0066] The inference module, connected to the model training module, is used to perform real-time analysis and key guessing on newly collected side-channel data. The module loads the trained CNN model, performs forward propagation calculations on the input data, outputs the key guess result and its confidence level, and automatically determines whether the attack is successful based on the user-defined threshold.

[0067] The attack execution module, connected to the inference module, executes the CPA attack based on the inference results and outputs the attack results. This module implements the complete CPA attack process, including key steps such as data alignment, correlation calculation, and key ranking. It also provides a visual interface to display the attack process and results, helping users intuitively evaluate the attack effectiveness.

[0068] Through a modular design, this system organically integrates all aspects of side-channel attacks, automating the entire process from data collection to key recovery. The modules feature clear interfaces and collaborative functionality, offering excellent scalability and ease of use. It is applicable to various types of encryption devices and attack scenarios, providing security researchers with an efficient and convenient tool for side-channel attack assessment. The model training module supports a variety of model architectures and configuration parameters, allowing users to quickly adjust the model to suit different attack tasks through simple configuration file modifications or through a visual interface.

[0069] The present invention is explained below with specific embodiments:

[0070] Data preprocessing: Data preprocessing is a key step to improve model performance and attack effectiveness. Taking power consumption data as an example, Kalman filtering is first used to denoise the raw data. Kalman filtering establishes a state space model of the signal and uses a recursive algorithm to estimate the state of the signal in real time. It can effectively remove random noise components such as Gaussian noise while keeping the dynamic characteristics of the signal unchanged. Specific parameter settings can be adjusted according to the actual data characteristics. For example, setting the state transfer matrix and observation matrix, and selecting the appropriate initial state estimate and covariance matrix to achieve the best filtering effect. State update equation and measurement update equation:

[0071] x k =A k x k-1 +B k u k +w k

[0072] z k =H k x k +v k

[0073] Where x k is the state vector at time k, x k-1 is the state vector at time k-1, A k is the state transition matrix, B k is the control input matrix, u k is the control vector, w k is the process noise, z k is the measurement vector, H k is the measurement matrix, v k is the measurement noise;

[0074] Next, a Butterworth low-pass filter is used to remove high-frequency interference components from the signal. Taking the power consumption data of the AES encryption algorithm as an example, the cutoff frequency is set to 10kHz, allowing low-frequency signals to pass through and filtering out high-frequency noise. The Butterworth filter has a flat frequency response curve and a linear phase characteristic. It can effectively filter out high-frequency noise while retaining the low-frequency characteristics of the signal, such as high-frequency fluctuations caused by power supply noise and electromagnetic interference. For non-stationary signals, adaptive filtering technology can also be used to adjust the filter parameters in real time according to the signal to enhance the filtering effect. The Butterworth low-pass filter transfer function is:

[0075]

[0076] Where H(s) is the transfer function of the system, s is the complex frequency variable, and ω c is the cutoff frequency, n is the order of the filter;

[0077] Finally, the continuous wavelet transform is used to further denoise and extract features from the data. Taking the db4 wavelet as an example, the signal is decomposed into wavelet basis functions of different scales. By setting a threshold (such as a soft threshold or a hard threshold), the noise wavelet coefficients are removed, retaining the key features of the signal. For encryption operation signals with sudden and transient characteristics, the wavelet transform can provide good time-frequency localization analysis and extract subtle features from the signal. For the S-box operation in the AES algorithm, the wavelet transform can highlight the transient characteristics of its power consumption changes, providing more valuable feature information for subsequent model training. The continuous wavelet transform formula is:

[0078]

[0079] Where f(t) is the input signal, ψ * is the complex conjugate of the wavelet basis function, a is the scale parameter, b is the translation parameter, W f (a,b) are the continuous wavelet transform coefficients of the input signal f(t) at scale parameter a and shift parameter b.

[0080] After completing the aforementioned denoising process, the data is normalized. Using Z-score normalization, the mean and standard deviation of each power consumption curve are calculated, transforming the data into a distribution with zero mean and unit variance. This eliminates the influence of different dimensions and magnitudes, improving the model's convergence speed and generalization capabilities. For a set of power consumption data from AES encryption operations, Z-score normalization results in a more concentrated data distribution, allowing the model to more quickly learn the characteristic patterns in the data.

[0081] Model training: The model training phase is one of the core parts of this invention. A convolutional neural network model based on machine learning is constructed, and the design of the model architecture refers to the idea of ​​the ResNet residual network. Taking the ResNetTimeSeriesClassifier model in this invention as an example, its specific architecture is as follows:

[0082] The model's input layer receives a window of preprocessed side-channel data. The window size can be flexibly configured based on the data sampling rate and the characteristics of the encryption algorithm. For example, for power consumption data from the AES encryption algorithm, the window size can be set to 20,000 samples to ensure coverage of the full encryption cycle. The input data has a shape of (n_samples, 1, n_length), where n_samples represents the number of samples, 1 represents single-channel data, and n_length represents the data length.

[0083] The first convolutional layer (first_block_conv) of the model uses the Conv1dPadSame layer, with a convolution kernel size of 64, a stride of 1, 1 input channel, and 16 output channels. This layer extracts local features of the data through convolution operations and uses padding technology to ensure that the output data length is consistent with the input data length. For example, for the input power consumption data window, the first convolution layer can extract 16 different feature channels, each corresponding to a feature extracted by the convolution kernel. The convolution operation formula is:

[0084]

[0085] Where, is the output of the i-th convolution kernel at position j after the l-th convolution operation, is the weight of the i-th convolution kernel in the l-th layer, is the input of layer l-1 at position j, K is the size of the convolution kernel, is the bias term.

[0086] The model contains multiple residual blocks (ResidualBlock), each of which consists of two convolutional layers, a batch normalization layer, an activation function, a pooling layer, etc. During the training process, the model calculates the output through forward propagation, uses the cross-entropy loss function (CrossEntropyLoss) to calculate the error between the predicted result and the actual label, and adjusts the weight parameters of the model through the Adam optimization algorithm. For example, the initial learning rate of the model is set to 0.001, the batch size is set to 256, and 500 batches are trained per epoch. The model monitors the training loss and validation loss in real time during training. When the validation loss no longer decreases for 5 consecutive epochs, the early stopping mechanism is triggered and training is stopped to prevent overfitting. Pooling operation formula and activation function formula:

[0087]

[0088] in, is the output of the i-th channel at position j after the l-th layer pooling operation, s is the size of the pooling window, It is the output of the i-th channel at position j after the l-th layer activation function.

[0089] Inference and positioning: During the inference phase, the waveform file and plaintext file of the device to be attacked are input into the trained convolutional neural network model. The model classifies the data using sliding window technology to identify the starting point of the cryptographic operation. The size and step size of the sliding window can be adjusted according to the operating characteristics of the encryption algorithm and the data sampling rate. For example, for the power consumption data of the AES encryption algorithm, the sliding window size is set to 20,000 sampling points and the step size is set to 1,000 sampling points. The model classifies the data in each window and outputs the probability value of whether the window contains the starting point of the cryptographic operation. Sliding window classification formula:

[0090]

[0091] Where, is the classification score at the k-th sliding window ω, CNN classify represents the trained CNN classification model, is the input data at the kth sliding window.

[0092] After the model outputs the classification probability distribution, the post-processing algorithm is used to further optimize the positioning results of the cryptographic operation starting point. Taking the threshold judgment as an example, the probability threshold is set to 0.8, and the window position above the threshold is determined as the starting point of the encryption operation. At the same time, the dynamic programming algorithm is used to consider the correlation and continuity between adjacent windows to comprehensively determine the starting point sequence of the cryptographic operation. For example, for continuous high-probability windows, the dynamic programming algorithm will merge them into a complete encryption operation interval, effectively overcoming the uncertainty caused by random delays. The threshold judgment formula in the post-processing algorithm is:

[0093]

[0094] Where, L k is the label of whether the kth position is the starting point of the cryptographic operation (1 for yes, 0 for no), and θ is the set threshold.

[0095] CPA attack: After completing the positioning of the starting point of the cryptographic operation and data alignment, the processed data is used for CPA attack. According to the intermediate value model of the AES encryption algorithm, the expected power consumption model corresponding to different key guess values ​​is generated. For example, for the first round of SubBytes operation of the AES algorithm, the S-box output corresponding to each key guess value is calculated, and the expected power consumption value is generated based on the S-box output. These expected power consumption models are correlated with the actual power consumption data collected, and statistical indicators such as the Pearson coefficient are calculated. The Pearson correlation coefficient formula is used to calculate the correlation between the expected power consumption and the actual power consumption. The larger the absolute value of the correlation coefficient, the higher the possibility of the corresponding key byte. Pearson correlation coefficient formula:

[0096]

[0097] Where r XY is the Pearson correlation coefficient, which is used to measure the linear correlation between variables X and Y, where X and Y are two variables (power consumption data and key guess value). and are their means, X i and Y i Represents the specific observation value of the i-th data point of variables X and Y respectively, and N is the number of data points.

[0098] Finally, the key guesses are ranked according to their correlation coefficients to determine the most likely key. For each of the 16 key bytes in the AES algorithm, their correlation coefficients are calculated, and the top-ranked key guesses are output for further analysis and verification by security researchers.

[0099] The above are merely preferred embodiments of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions based on the principles of the present invention are within the scope of protection of the present invention. It should be noted that for those skilled in the art, various improvements and modifications that do not depart from the principles of the present invention should be considered within the scope of protection of the present invention.

Claims

1. A side channel attack method based on machine learning, characterized in that: The following steps are involved: Step 1: Collect the side channel information dataset generated by the encryption device during operation and pre-process the collected dataset to generate training data that adapts to the input requirements of the machine learning model; Step 2: Build and train a convolutional neural network model to automatically learn and extract features from the preprocessed data and establish an associated mapping relationship between them and the encryption key; Step 3: Input the waveform file and plaintext file of the encrypted device to be attacked into the trained convolutional neural network model for inference, identify the starting point of the cryptographic operation and classify, segment and align the data; Step 4: Perform a correlation power analysis attack based on the result of the inference processing to determine the most likely key waveform and then output the final guessed encryption key.

2. A side channel attack method based on machine learning according to claim 1, characterized in that: In step 1, the side channel information includes power consumption data, electromagnetic radiation data, and time delay data, and the data set is preprocessed by cleaning and normalizing the data.

3. A side channel attack method based on machine learning according to claim 2, characterized in that: The specific methods for cleaning and normalizing the data are: First, a Kalman filter is used to denoise the side channel information dataset. By building a state-space model of the signal and using a recursive algorithm to estimate the signal state in real time, the random noise component is removed while maintaining the dynamic characteristics of the signal. Then, Butterworth low-pass filtering is used to remove high-frequency interference components in the signal; Finally, continuous wavelet transform is used to further denoise and extract features from the data; After completing the above denoising process, the data is normalized by using the Z-score normalization method to calculate the mean and standard deviation of each power consumption curve, and the data is transformed into a distribution with zero mean and unit variance.

4. A side channel attack method based on machine learning according to claim 3, characterized in that: In step 2, the convolutional neural network model adopts a deep residual learning architecture to alleviate the gradient vanishing problem of deep networks by adding shortcut connections between convolutional layers.

5. A side channel attack method based on machine learning according to claim 4, characterized in that: The architecture of a convolutional neural network model includes an input layer, at least one convolutional layer, at least one pooling layer, a fully connected layer, and an output layer, where: The input layer is used to receive the preprocessed side channel data window; The convolution layer uses a one-dimensional convolution operation and uses multiple convolution kernels to slide on the time axis to extract local features; The pooling layer is used to reduce the data dimension, reduce the amount of calculation, and enhance the robustness of features; The fully connected layer maps the extracted features to an output space related to the key. By learning the complex mapping relationship between features and keys, it predicts the encryption key. The activation function of the fully connected layer uses softmax to output the probability distribution of key guesses. The output layer is used to generate classification or regression values ​​representing the key guessing results. For classification problems, the number of neurons in the output layer corresponds to the number of possible key values, and the softmax activation function is used to output the probability of each key value. For regression problems, the number of neurons in the output layer is determined according to the key representation method, and the activation function is a linear function, which directly outputs the estimated value of the key.

6. A side channel attack method based on machine learning according to claim 5, characterized in that: The side-channel attack method can still locate the starting point of the cryptographic operation and recover the encryption key even when the encryption device implements random delay countermeasures. The specific implementation method is as follows: When collecting side channel information data sets generated by encryption equipment during operation, the data sampling rate is increased and the collection time is extended to ensure that signal samples containing complete encryption operation signals are obtained in the presence of random delays. During data preprocessing, an adaptive signal enhancement algorithm is used to compress or expand the collected signals on the time axis, correct the signal deformation caused by random delays, and restore the original characteristics of the signals. During the convolutional neural network model training phase, noise samples simulating random delays are introduced into the training data to enhance the model's robustness to random delays. During the inference phase, a sliding window mechanism is used to sample the input data at multiple locations. Combined with the classification probability distribution of the model output, the post-processing algorithm is used to comprehensively determine the starting point of the cryptographic operation.

7. A side channel attack method based on machine learning according to claim 6, characterized in that: The post-processing algorithm includes a dynamic programming algorithm and a threshold judgment method.

8. A side channel attack system based on machine learning, characterized in that: include: Data acquisition module, data preprocessing module, model training module, inference module and attack execution module; The data acquisition module is connected to the hardware interface of the encryption device, collects side channel information in real time during the operation of the encryption device, and stores it digitally to provide raw data support for subsequent processing; The data preprocessing module is connected to the data acquisition module and is responsible for preprocessing the collected data; The model training module is connected to the data preprocessing module and is used to build and train a convolutional neural network model to mine the relationship between features and keys in the data; The inference module is connected to the model training module and is used to perform real-time analysis and key guessing of newly collected side channel data; The attack execution module is connected to the reasoning module and is used to execute the correlation power consumption analysis attack according to the reasoning result and output the attack result.