A multi-label learning based side-channel analysis method for different devices

By constructing a cross-device side-channel analysis model through multi-label learning and convolutional neural networks, the problem of constructing a side-channel analysis model under different devices is solved, which improves attack efficiency and reduces training time.

CN116366229BActive Publication Date: 2026-07-21GUILIN UNIV OF ELECTRONIC TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUILIN UNIV OF ELECTRONIC TECH
Filing Date
2023-04-03
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing technologies make it difficult to build effective side-channel analysis models on different devices, resulting in low attack efficiency and increased model building and training time.

Method used

A multi-label learning approach is adopted, which selects time sample points according to the shortest principle to construct a multi-label dataset for different devices, and uses a convolutional neural network CNNbest to build a multi-label model. The model is trained and optimized by combining a binary classification cross-entropy loss function and a sigmoid activation function.

Benefits of technology

This enables attacks to be performed using a single model on different devices, improving attack efficiency, reducing model building and training time, and lowering model complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116366229B_ABST
    Figure CN116366229B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of information security, and in particular to a multi-label learning based side-channel analysis method for different devices, which first proposes a shortest principle to form the energy traces corresponding to the single-byte key labels of each device according to the characteristics of the energy trace data sets collected under different devices and the requirements for deep learning training, and forms a multi-label data set for different devices, then applies the multi-label learning technology to the side-channel environment, realizes the algorithm adaptation method of multi-label learning based on a convolutional neural network, further sets various hyperparameter combinations to optimize the multi-label learning model, and finally uses the corresponding test sets under each device to evaluate the byte key attack effect of the multi-label model on the cryptographic algorithm under different devices, so as to verify the generalization ability of the multi-label learning model. The present application enables a single model to perform attacks on the same cryptographic algorithm under different devices, increases the attack efficiency, and reduces the model construction and training time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information security technology, and specifically to a method for cross-device side-channel analysis based on multi-label learning. Background Technology

[0002] Side channel analysis (SCA) is a form of cryptanalysis attack that attempts to recover keys by analyzing the relationship between the current consumed or electromagnetic power generated when a device is running a cryptographic algorithm and performing operations and processing data.

[0003] Because designers of cryptographic algorithms have proposed a series of hardware and software protection methods to counter side-channel analysis, such as masking, power trace jitter, mask protection, virtual manipulation, and virtual clocks, traditional side-channel analysis methods have become increasingly difficult. Given the powerful fitting and generalization capabilities of deep learning models, researchers have begun applying deep learning techniques to side-channel environments. They have found that deep learning-based side-channel analysis methods can learn directly from raw power consumption information, and do not require manually designed features and assumptions, making attacks easier to implement. Secondly, deep learning models directly learn pre-target labels, eliminating the need for approximate models compared to template attacks. Finally, in a side-channel environment, the softmax function of deep learning is used to perform probabilistic attacks at the output layer, determining the correct key for guessing by ranking the scores of candidate keys.

[0004] Generally, the goal of deep learning-based side-channel analysis is to design models and attack methods targeting single-byte keys of encryption algorithms on the same device. However, for the same encryption algorithm on different devices, the differences introduced by the devices require building multiple models and training and optimizing them, which increases the time cost. Summary of the Invention

[0005] The purpose of this invention is to provide a cross-device side-channel analysis method based on multi-label learning, which aims to enable a single model to attack the same cryptographic algorithm on different devices, thereby increasing attack efficiency and reducing model building and training time.

[0006] To achieve the above objectives, this invention provides a method for cross-device side channel analysis based on multi-label learning, comprising the following steps:

[0007] We propose the shortest principle to construct a multi-label dataset for different devices;

[0008] A method adapted from a multi-label learning algorithm is used to solve the problem of single-byte key recovery under side-channel inter-device conditions. A multi-label model is constructed based on the convolutional neural network CNNbest.

[0009] Multi-label model training optimization to find the optimal combination of hyperparameters;

[0010] To evaluate the ability of the multi-label model for different devices to recover cryptographic algorithm keys, tests were conducted using corresponding test sets.

[0011] Optionally, when using deep learning for single-byte key recovery tasks in side-channel attacks, time sample points from a region with high signal-to-noise ratio during the corresponding byte key operation are typically selected to form the energy trace, thus constituting the model's dataset. However, in the process of constructing multi-label datasets on different devices, the hardware differences, acquisition devices and methods, and specific implementations of cryptographic algorithms brought about by different devices not only result in different numbers of time sample points forming the energy traces in the datasets of each device, but also in different degrees of correlation between the time sample points on the energy traces and their labels.

[0012] Therefore, when training sets from different devices are fed into the same model for training, the time sample points that make up the energy trace must first enable the model to learn the feature relationships between the labels and the time sample points effectively. Secondly, the number of time sample points input into the model for each device's energy trace needs to be equal, thus retaining the highly correlated time sample points for each device's energy trace within a limited number of time sample points. This satisfies the requirement for the same input dimension size for energy traces across devices in deep learning, and also filters out the low-correlation time sample points, which may contain some time sample points unrelated to the key, since each energy trace in the public dataset may contain some. This allows the model to better converge to the true leakage function distribution, reducing model complexity and increasing attack success rate.

[0013] This patent proposes the principle of shortest length. When using public datasets for side-channel analysis, although the energy trace contains peak time samples with high signal-to-noise ratio (SNR) between a single-byte key tag and time samples for model training and testing, these energy traces also contain many time samples with very low correlation to the tags, which has the opposite effect on model training. By using the principle of shortest length, the shortest selected energy trace length from each dataset is used as the dimension for the input layer of the multi-label model. This avoids an excessively large energy trace dimension in the input model, which would make the model complex and difficult to train. Retaining highly correlated time samples within a limited number improves model efficiency. Furthermore, because of differences in implementation methods and protection measures on different devices, the correlation between energy trace time samples and their tags varies. Using SNR as a uniform measure of whether time samples are selected across different devices is unreasonable.

[0014] The process of selecting time sample points for energy traces in multi-label datasets across different devices involves first determining the multi-label set based on the characteristics of the cryptographic algorithm, then selecting time sample points from energy traces on different devices while retaining time sample points that are highly correlated with the labels, and finally using certain rules to select time sample points for each dataset on different devices to form energy traces, thereby forming the training and testing sets of the multi-label dataset.

[0015] Optionally, in selecting time sample points for energy traces from different devices, the shortest principle is adopted, specifically including the following steps:

[0016] Calculate the signal-to-noise ratio between the energy trace time sample points and the labels in the public dataset for each device;

[0017] The minimum number of energy trace time sample points in the public dataset under each device is taken as the length of the energy trace in the multi-label dataset, denoted as Points;

[0018] For datasets with more energy trace time sample points than the minimum value in the public datasets of various devices, retain the time sample points with the largest signal-to-noise ratio (SNR) and discard the other time sample points.

[0019] Optionally, the process of calculating the signal-to-noise ratio between the energy trace time sample points and the labels in the public dataset for each device includes the following steps:

[0020] All energy traces are classified according to their corresponding key tags, and energy traces with the same tag are placed in the same group. M(Lt|Z) can be used to represent the group of energy traces with tag Z, and Lt represents the original energy trace.

[0021] For different labels, energy trace matrices will be obtained respectively. The variance and mean of all matrices will be calculated column by column, resulting in a variance matrix Var(M(Lt|Z)) and a mean matrix E(M(Lt|Z)) of size |K|*PointsNum, where |K| is the size of the energy trace label value range and PointsNum represents the number of time sample points of the energy trace.

[0022] The mean array E(Var(M(Lt|Z)) is obtained by taking the mean of the variance matrix Var(M(Lt|Z))) by column, and the variance array Var(E(M(Lt|Z)) is obtained by taking the variance of the mean matrix E(M(Lt|Z)) by column. Both have a length of PointsNum.

[0023] According to the signal-to-noise ratio (SNR) calculation formula, the variance array Var(E(M(Lt|Z)) and the mean array E(Var(M(Lt|Z))) are divided bitwise to obtain the SNR array of length PointsNum. SNR represents the signal-to-noise ratio of the dataset label corresponding to the device to all time sample points on its energy trace.

[0024] Optionally, and generally, deep learning-based side-channel attacks against traditional single-byte keys are typically single-label multi-class classification models. These models use Softmax as the activation function for the final output layer and a multi-class cross-entropy loss function as the loss function. The output layer contains C neurons corresponding to C classes. This invention employs an algorithmic adaptation based on convolutional neural networks to address the multi-label problem in side-channel attacks. This involves differences in the loss function and activation function used in model construction compared to models built targeting single-byte keys.

[0025] The specific network model uses Sigmoid as the activation function in the final output layer. In multi-label tasks, each sample can belong to multiple labels, and the output layer needs to output multiple probability values ​​to represent the likelihood of each label. The Sigmoid function maps output values ​​to the range of 0 to 1, and can be considered as a probability value, so Sigmoid can be used as the activation function for the output layer. The Softmax activation function, however, can only output a single probability value and cannot be directly used in multi-label tasks. The Softmax function compresses each element of a vector to the range [0,1], and the sum of all elements is 1, which can be seen as probability normalization for each element.

[0026] Secondly, the binary cross-entropy (BCE) loss function is used to optimize the model. In the side-channel environment, the tags corresponding to each byte key and their corresponding byte key sequence numbers are independent, and the tags are also independent of their corresponding byte key sequence numbers. In the multi-label task adapted from the first-order policy algorithm, each tag is treated as an independent binary classification problem, that is, the binary classification problem of each tag can be regarded as two independent categories: positive class and negative class. Therefore, for each tag, the binary cross-entropy loss function can be used to train the model. For a sample, if it belongs to the i-th tag, it is regarded as positive class, otherwise it is regarded as negative class. Assuming there are m samples and n tags, the goal of model training is to minimize the average binary cross-entropy loss of all tags. Then the average binary cross-entropy loss of all tags is:

[0027]

[0028] Among them, y ij ∈{0,1} indicates whether the i-th sample belongs to the j-th label. Let represent the probability that the i-th sample belongs to the j-th label, and n represent the number of samples corresponding to the j-th label.

[0029] As can be seen from the above formula, this loss function is the average of the binary cross-entropy loss function for each label. In other words, if the binary classification loss function for each label is effective for model optimization, then the entire loss function is also effective for the model to converge to the correct space. Therefore, the process of building a multi-label model based on the convolutional neural network CNNbest includes the following steps:

[0030] First, the main structure of the multi-label model is built based on the convolutional neural network. The convolutional neural network consists of an input layer, five convolutional blocks, an unfolded layer, a fully connected layer, a fully connected layer, and an output layer. The convolutional block consists of a convolutional layer, an activation layer with ReLU activation function, and an average pooling layer.

[0031] Set the loss function to the binary classification cross-entropy loss function, and the activation function of the final output layer to Sigmoid;

[0032] Finally, the number of nodes in the output layer is set to C, where C is the sum of |K| and |D|.

[0033] Optional, the multi-label model training and optimization process includes the following steps:

[0034] The energy traces and labels of the obtained multi-label training set are shuffled synchronously;

[0035] Adjust the network model by setting different epoach, learning rate, backpropagation algorithm and optimizer function;

[0036] Training stops when the loss function reaches its minimum, satisfying the loss function expression. The loss function expression is:

[0037]

[0038] Where, n p Let x represent the number of multi-label training sets, where x i Let y represent the i-th energy trace. i This represents the multi-label corresponding to the i-th energy trace.

[0039] Optionally, during the multi-label model testing and evaluation for different devices, the test sets of energy traces randomly collected from different devices with fixed plaintext keys are first input into the multi-label model. Then, for each energy trace under each device, a probability vector is obtained. The input of the entire test set will result in a two-dimensional matrix M of size Q×C, where Q is the number of energy traces in the test set and C is the number of categories. Further, the multi-label model divides the output. The first |K| columns of the matrix correspond to the probability matrix of candidate keys under different devices, and the last |D| columns are the probability matrix of predicted energy traces belonging to different devices. Finally, maximum likelihood estimation is used to calculate the score of each candidate key corresponding to the energy trace and the score of the energy trace belonging to each candidate device.

[0040] This invention provides a multi-label learning-based method for cross-device side-channel analysis. First, multi-label learning technology is applied to the side-channel environment. Time sample points are selected based on energy traces from different devices, and specific rules are used to filter these time sample points to form energy traces, thus creating a multi-label dataset. Simultaneously, a multi-label model is designed based on the convolutional neural network CNNbest. The model is trained and optimized using a corresponding training set, and then the generalization ability of the multi-label model is evaluated using a test set. The score is used to test whether the multi-label model can guess the encryption algorithm. This invention enables a single model to perform attacks on the same encryption algorithm across different devices, increasing attack efficiency and reducing model construction and training time. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 This is a flowchart illustrating a cross-device side-channel analysis method based on multi-label learning according to the present invention.

[0043] Figure 2 This is the convolutional neural network model structure used in this invention. Detailed Implementation

[0044] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0045] Please see Figure 1This invention provides a method for cross-device side channel analysis based on multi-label learning, comprising the following steps:

[0046] S1: Propose the shortest principle to construct a multi-label dataset for different devices;

[0047] S2: The method of adapting a multi-label learning algorithm is used to solve the problem of single-byte key recovery under side-channel inter-device conditions. A multi-label model is built based on the convolutional neural network CNNbest.

[0048] S3: Multi-label model training optimization to find the optimal combination of hyperparameters;

[0049] S4: To evaluate the ability of the multi-label model for different devices to recover cryptographic algorithm keys, tests were conducted using the corresponding test sets.

[0050] The following provides further explanation in conjunction with the specific implementation steps:

[0051] The multi-label dataset construction process in step S1 is as follows:

[0052] (1.1) For a multi-tag set of different devices, it includes the tag corresponding to the energy trace and the corresponding device number. The device number is used to distinguish that the energy trace comes from different devices. Let K represent the tag set corresponding to the energy trace, D represent the device number set, and n represent the number of devices, then we have the following equations (1) and (2):

[0053] K = {k|0≤k<256} (1)

[0054] D = {d|0≤d<n} (2)

[0055] Therefore, for an energy trace originating from different devices, it will be labeled with two tags: the key tag corresponding to the energy trace itself, and the device number corresponding to the energy trace. Thus, any energy trace can be represented by equation (3):

[0056] (k i ,d i (3)

[0057] Where, k i d represents the tag corresponding to the energy trace key of the i-th energy trace from a certain device. i This represents the device number corresponding to the i-th energy trace.

[0058] But k i With d i The presence of identical areas in the tags leads to ambiguity when tagging energy traces. To resolve this issue, |K| is added to the device number when tagging, thus avoiding the problem. Multiple tags for energy traces from different devices can be obtained from equation (4):

[0059] (k i ,d i +|K|)(4)

[0060] Where |K| represents the range of values ​​for the energy trace tag.

[0061] In the AES cryptographic algorithm, |K| is 256. Furthermore, when using an identity model to label energy traces, the multi-labeled energy trace is shown in equation (5):

[0062] (z(k ij ,p ij ),256+d)(5)

[0063] Where, k ij p ij Let be the j-th key byte and the j-th plaintext byte corresponding to the i-th energy trace, respectively. z(k,p) is the marking function for each device, where k is the byte key corresponding to the energy trace and p is the plaintext corresponding to the energy trace.

[0064] (1.2) In order to ensure that the energy traces of various devices can be trained in the same model while retaining time sample points that are highly correlated with the labels, this patent proposes the shortest principle for selecting time sample points for energy traces in multi-label datasets, which can be described in the following steps:

[0065] (1.2.1) Calculate the signal-to-noise ratio between the energy trace time sample points and the labels in the public dataset for each device;

[0066] The calculation formula is as follows, as shown in Proof (6):

[0067]

[0068] Where Var represents the column variance calculation function, E represents the column mean calculation function, and M(Lt|Z) represents the energy trace grouping with label Z.

[0069] Based on the formula described above, the calculation process of the energy trace time sample point and tag signal-to-noise ratio under various devices can be described as follows:

[0070] 1) Classify all energy traces according to their corresponding labels, and put energy traces with the same label into the same matrix, where the number of time sample points of energy traces is represented by PointsNum;

[0071] 2) For different tags, energy trace matrices will be obtained respectively. The variance and mean of all matrices will be calculated column by column, resulting in a variance matrix E(M(Lt|Z)) and a mean matrix Var(M(Lt|Z)) of size |K|*PointsNum; where |K| is the size of the energy trace tag value range.

[0072] 3) From the variance matrix and mean matrix obtained in step 2), the mean of the variance matrix is ​​calculated column by column to obtain E(E(M(Lt|Z))), and the variance of the mean matrix is ​​calculated column by column to obtain E(Var(M(Lt|Z))), both with a length of PointsNum;

[0073] 4) According to the signal-to-noise ratio calculation formula, divide the variance array and the mean array bitwise to obtain the signal-to-noise ratio (SNR) array of length PointsNum. SNR represents the signal-to-noise ratio of the dataset label corresponding to the device to all time sample points on its energy trace.

[0074] (1.2.2) The minimum number of energy trace time sample points in the public dataset under each device is taken as the length of the energy trace in the multi-label dataset, denoted as Points;

[0075] (1.2.3) For datasets where the number of energy trace time sample points in the public dataset of each device is greater than the minimum value Points, retain the time sample points with the largest signal-to-noise ratio value Points, and discard the other time sample points.

[0076] The specific implementation process of the above steps:

[0077] (1) Calculate the signal-to-noise ratio of time sample points and labels on the energy traces of each dataset according to step (1.2.1). In order to retain the most relevant time sample points, retain the first points according to the signal-to-noise ratio value.

[0078] (2) After sorting the signal-to-noise ratio values, record the time sample index of the first Points largest signal-to-noise ratio value;

[0079] (3) According to the subscript array obtained in (2), traverse the subscript array to take the time sample point corresponding to each energy trace in each dataset to form a new energy trace dataset;

[0080] (1.3) The public dataset is used to form new energy traces and labels them, namely the label corresponding to the energy trace itself and the number of the device corresponding to the energy trace;

[0081] (1.4) After forming new datasets from the training sets of the public datasets under each device according to the above steps, they are then merged together to form the training set of the multi-label dataset. However, the multi-label test set is formed by forming new test sets from the test sets of each public dataset to facilitate subsequent model testing. The number of multi-label datasets from different devices is the sum of the training sets under each device, and the multi-label test set is a new test set generated for each device.

[0082] In step S2, a multi-label model is designed based on the convolutional neural network CNNbest. The specific steps are as follows:

[0083] (2.1) The model is a convolutional neural network, consisting of an input layer, five convolutional blocks, an unwrap layer, a fully connected layer, another fully connected layer, and an output layer. Each convolutional block comprises a convolutional layer, a ReLU activation layer, and an average pooling layer, as detailed below. Figure 2 As shown;

[0084] (2.2) To address the multi-label, multi-class classification problem in deep learning, an algorithm adaptation is required. Before model training, the loss function is set to the binary cross-entropy loss function, and the activation function of the final output layer is Sigmoid.

[0085] (2.3) The number of nodes in the final output layer of the model is set to C, where C is the sum of |K| and |D|.

[0086] The multi-label model training process in step S3 includes the following steps:

[0087] (3.1) The energy traces and labels of the multi-label training set obtained above are synchronously shuffled;

[0088] (3.2) Adjust the network model by setting different epoach, learning rate, backpropagation algorithm and optimizer function;

[0089] (3.3) Stop model training when the loss function reaches its minimum value and θ satisfies the following equation.

[0090]

[0091] Where θ represents the model parameter space, and n p Let x represent the number of multi-label training sets, where x i Let y represent the i-th energy trace. i This represents the multi-label corresponding to the i-th energy trace.

[0092] Step S4 involves multi-label model testing and evaluation for different devices. The testing process includes the following steps:

[0093] (4.1) Obtain new test sets for each device in step S1 and input them into the multi-label model respectively;

[0094] (4.2) For each energy trace, a probability vector of length C will be obtained. Therefore, for the Q energy traces in the test set under each device, a probability matrix of size Q×C will be obtained. This multi-label model predicts two label values. The output matrix is ​​then split into two two-dimensional probability matrices according to their corresponding columns. The first |K| columns correspond to the candidate key probability matrix for the energy trace, and the last |D| columns correspond to the device number key matrix. The probability matrices for the candidate keys and the probability matrices for the key sequence numbers obtained in the test set under device number d are as follows:

[0095]

[0096]

[0097] in, Let be a probability vector of length |K| obtained from the i-th energy trace with device number d. Let be a probability vector of length |D| obtained from the i-th energy trace with device number d.

[0098] (4.3) For the probability matrices obtained from the test sets under each device, take the |K| column and the last |D| column respectively to obtain the energy trace candidate key probability matrix and the candidate device number probability matrix. Calculate the score of each candidate key and the corresponding number score of the energy trace in the test sets under each device according to the maximum likelihood, as expressed by equations (10) and (11):

[0099]

[0100]

[0101] in, This represents the probability that the candidate key for the i-th energy trace in the test set with device number d is j. Let represent the probability that the candidate device number of the i-th energy trace in the test set with device number d is k, where 0≤j<|K|, 0≤k<|D|.

[0102] Then, the score vector for the corresponding device will be obtained. Sort in reverse order. The first-ranked guess is the most likely to be correct, and the last-ranked guess is the least likely to be correct. Guess Entropy (GE) is generally used to evaluate the security of the side-channel model for cryptographic algorithms implemented on a device. Guess Entropy is defined as the average rank of correctly guessed targets. When GE = 0, it indicates a correct guess.

[0103] (4.4) For each device's test set, repeating steps (4.1), (4.2), and (4.3) will recover the byte key corresponding to the energy trace of each device's test set and its corresponding correct device number. Among them, the energy trace with the largest number of energy traces used to guess the correct candidate key and the correct energy trace device number for the corresponding device is used to evaluate the attack capability of the multi-label model against that device, even if GE=0.

[0104] Specifically, firstly, test sets of energy traces randomly collected from different devices with fixed plaintext keys are input into the model. Then, for each energy trace under each device, a probability vector is obtained. The entire test set input results in a two-dimensional matrix M of size Q×C, where Q is the number of energy traces in the test set and C is the number of categories. Unlike single-label multi-class classification, this requires the model output to be partitioned, mapping it to each candidate key byte. The first |K| columns of this matrix correspond to the candidate key probability matrix under different devices, and the last |D| columns are the probability matrix of the predicted energy trace belonging to different devices. Finally, maximum likelihood estimation is used to calculate the score of each energy trace corresponding to each candidate key and the score of the energy trace belonging to each candidate device.

[0105] In summary, the present invention has the following advantages compared with the prior art:

[0106] (1) A single model was implemented to attack the single-byte key of cryptographic algorithms on different devices, so as to recover the key without increasing the training time.

[0107] (2) It greatly reduces the side-channel analysis based on deep learning, and saves time in model building and training for single-byte key models of different devices;

[0108] (3) Effectively extract highly correlated time sample points to form energy traces, reducing the number of energy traces required to successfully recover a single key and the model complexity.

[0109] The above description discloses only one preferred embodiment of the present invention, and should not be construed as limiting the scope of the present invention. Those skilled in the art will understand that all or part of the processes of the above embodiments can be implemented, and equivalent changes made in accordance with the claims of the present invention are still within the scope of the invention.

Claims

1. A method for cross-device side-channel analysis based on multi-label learning, characterized in that, Includes the following steps: We propose the shortest principle to construct a multi-label dataset for different devices; The shortest principle specifically includes the following steps: Calculate the signal-to-noise ratio between the energy trace time sample points and the labels in the public dataset for each device; The minimum number of energy trace time sample points in the public dataset under each device is taken as the length of the energy trace in the multi-label dataset, denoted as Points; For datasets with more energy trace time sample points than the minimum value in the public datasets of various devices, retain the time sample points with the largest signal-to-noise ratio (SNR) and discard the other time sample points. A method adapted from a multi-label learning algorithm is used to solve the problem of single-byte key recovery under side-channel inter-device communication. A multi-label model is constructed based on the convolutional neural network CNNbest. The multi-label learning algorithm adaptation method adopts a convolutional neural network-based algorithm adaptation method to handle the multi-label problem in the side channel. The output layer uses Sigmoid as the activation function, and the loss function uses the binary classification cross-entropy loss function to optimize the model. Multi-label model training optimization to find the optimal combination of hyperparameters; To evaluate the ability of the multi-label model for different devices to recover cryptographic algorithm keys, tests were conducted using corresponding test sets.

2. The cross-device side-channel analysis method based on multi-label learning as described in claim 1, characterized in that, In constructing the heterogeneous multi-label dataset, the first step is to determine the multi-label set based on the characteristics of cryptographic algorithms under different devices. Then, time sample points under the energy traces of different devices are selected, while retaining time sample points that are highly correlated with the labels. Finally, time sample points under the corresponding devices are selected according to certain rules to form the energy traces, thereby forming the training set and test set of the heterogeneous multi-label dataset.

3. The cross-device side-channel analysis method based on multi-label learning as described in claim 2, characterized in that, The process of calculating the signal-to-noise ratio between the energy trace time sample points and the labels in the public dataset for each device includes the following steps: All energy traces are categorized according to their corresponding labels, with energy traces of the same label grouped together. This can be represented by M(Lt|Z) to denote the group of energy traces labeled Z, where Lt represents the original energy trace, i.e., the trace with size Z. The matrix, where n represents the number of energy traces labeled Z, and PointsNum represents the number of time sample points of the energy trace; For different tags, an energy trace matrix will be obtained. The variance and mean of all matrices will be calculated column by column, resulting in a variance matrix Var(M(Lt|Z)) and a mean matrix E(M(Lt|Z)) of size |K|*PointsNum, where |K| is the size of the energy trace tag value range. The mean array E(Var(M(Lt|Z)) is obtained by taking the mean of the variance matrix Var(M(Lt|Z)) by column, and the variance array Var(E(M(Lt|Z)) is obtained by taking the variance of the mean matrix E(M(Lt|Z)) by column. Both have a length of PointsNum. According to the signal-to-noise ratio (SNR) calculation formula, the variance array Var(E(M(Lt|Z)) and the mean array E(Var(M(Lt|Z))) are divided bitwise to obtain the SNR array of length PointsNum. SNR represents the signal-to-noise ratio of the dataset label corresponding to the device to all time sample points on its energy trace.

4. The cross-device side-channel analysis method based on multi-label learning as described in claim 3, characterized in that, The process of building a multi-label model based on the convolutional neural network CNNbest includes the following steps: The multi-label model is constructed using the convolutional neural network CNNbest, which consists of an input layer, five convolutional blocks, an unfolded layer, a fully connected layer, a fully connected layer, and an output layer. Each convolutional block consists of a convolutional layer, an activation layer with ReLU activation function, and an average pooling layer. The loss function is set to the binary cross-entropy loss function, and the activation function of the final output layer is Sigmoid. Finally, the number of output layer nodes is set to C, where C is the sum of |K| and |D|, and |D| is the number of target devices.

5. The cross-device side-channel analysis method based on multi-label learning as described in claim 4, characterized in that, The process of training and optimizing a multi-label model includes the following steps: The energy traces and labels of the obtained multi-label training set are shuffled synchronously; Adjust the network model by setting different epoach, learning rate, backpropagation algorithm and optimizer function; Until the loss function reaches its minimum value, If the loss function is satisfied, then model training stops. The loss function is: in, The number of multi-label training sets is represented by the number of sets. This represents the i-th energy trace. This represents the multi-label corresponding to the i-th energy trace.

6. The cross-device side-channel analysis method based on multi-label learning as described in claim 5, characterized in that, In evaluating the multi-label model for different devices, the test sets of energy traces randomly collected from different devices with fixed plaintext keys are first input into the multi-label model. Then, for each energy trace under each device, a probability vector is obtained. The input of the entire test set results in a two-dimensional matrix M of size Q×C, where Q is the number of energy traces in the test set and C is the number of categories. Further, the multi-label model divides the output. The first |K| columns of the matrix correspond to the probability matrix of candidate keys under different devices, and the last |D| columns are the probability matrix of predicted energy traces belonging to different devices. Finally, maximum likelihood estimation is used to calculate the score of each candidate key corresponding to the energy trace and the score of the energy trace belonging to each candidate device.