A side channel black box attack method, device, equipment and storage medium
By collecting side-channel information and using feature selection and deep learning models to generate attack models, the problem of needing to understand the leakage operation of encryption algorithms in existing technologies is solved, and the universality and efficiency of side-channel attacks are realized.
Patent Information
- Application Number
- CN202211246984.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-12
- Publication Date
- 2026-03-17
- Estimated Expiration
- 2042-10-12
AI Technical Summary
Existing side-channel attack methods require understanding the leakage operations of encryption algorithms, which takes a lot of time and effort, and can only target specific leakage operations, thus having a limited scope of application.
By collecting side-channel information, using a feature selection model to determine feature points, generating feature vectors, cropping and labeling the training dataset, training an attack model using a deep learning model, generating a probability vector for the key, and directly performing a side-channel black-box attack.
It achieves the universality and efficiency of side-channel attacks, avoids the review of encryption algorithm code, and improves attack efficiency and applicability.
Smart Images

Figure CN115694923B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information security, and in particular to a side-channel black-box attack method, apparatus, device, and storage medium. Background Technology
[0002] Side-channel attacks are an effective attack method against cryptographic hardware, and their effectiveness has been verified on various chip platforms and cryptographic algorithms. Template attacks are considered a particularly effective method. In recent years, with the development of artificial intelligence technology, deep learning methods have been introduced into template attacks as statistical modeling attacks to enhance their effectiveness. However, deep learning requires parameter tuning and training of neural networks. Existing attack methods require prior knowledge of the cryptographic algorithm's leakage operations and modeling of the intermediate values of these leakage operations to achieve a side-channel attack. However, finding these leakage operations requires attackers with extensive knowledge and experience, expending significant time and effort, which severely impacts the efficiency of side-channel attacks. Furthermore, side-channel attacks can only target specific leakage operations, limiting their applicability. Summary of the Invention
[0003] To address the shortcomings of the prior art, this invention provides a side-channel black-box attack method, apparatus, device, and storage medium, achieving the universality of side-channel attacks and improving their efficiency.
[0004] This invention provides a side-channel black-box attack method, the method comprising:
[0005] Side channel information is collected according to the preset first acquisition scheme, and the feature points where side channel leakage occurs are determined using the preset feature selection model. Feature vectors are generated based on the determined feature points.
[0006] Training data is collected according to a preset second acquisition scheme, and the training data is cropped according to the feature vector to obtain a training dataset. The training dataset is then labeled.
[0007] The deep learning model is trained based on the labeled training dataset to generate the attack model;
[0008] Data is collected according to the preset third acquisition scheme, and an attack dataset is generated by cropping the feature vector. The attack dataset is then input into the attack model to generate a probability vector for the key. The key with the highest score is used as the attack key to complete the side-channel black-box attack.
[0009] Preferably, the step of acquiring side-channel information according to a preset first acquisition scheme, determining feature points where side-channel leakage occurs using a preset feature selection model, and generating feature vectors based on the determined feature points specifically includes:
[0010] The first acquisition scheme, based on the preset plaintext key crossover order, number of plaintext key groups, and plaintext key data, acquires the side-channel information during the operation of the cryptographic algorithm. The side-channel information includes power consumption and electromagnetic information.
[0011] The collected side-channel information is divided into n groups: T1, T2, ... T n (n≥2), where t1~T n It is an encrypted fixed plaintext F1~F n The side-channel information collected in real time, each group of side-channel information contains K power consumption data points, which include power consumption trajectories or electromagnetic trajectories, denoted as... Each trajectory has Q sampling points, which are Q original features, among which
[0012]
[0013] The maximum correlation minimum redundancy algorithm is used to calculate the mRMR value of Q sampling points of each power consumption data in the collected side channel information, and the sampling points with mRMR values not less than the first threshold are determined. The power consumption data of the m sampling points determined from K power consumption data in n sets of side channel information is taken as the power consumption dataset T.
[0014] The calculated power consumption dataset T is used to train a support vector machine to obtain the weights calculated for m sampling points. The m sampling points are then sorted according to their weights to generate a feature vector t*, where m>0.
[0015] As a preferred embodiment, the step of collecting training data according to a preset second acquisition scheme, cropping the training data according to the feature vector to obtain a training dataset, and labeling the training dataset specifically includes:
[0016] Plaintext vector P using side-channel information train and key vector The second sampling scheme is set to collect N samples in a fully random manner. train Side channel information as training data T train ;
[0017] Select the top n features of feature vector t* t Each feature point is paired with training data T train Pruning is performed to obtain the training dataset. Set the attack unit to n per attack. attack Each plaintext P train and key k train The corresponding label set at each position has n. bit / n attack n bit For training dataset The plaintext vector P corresponding to each power consumption data point train and key vector K train The number of bits, for each plaintext P train and key k train The label corresponding to position i is set to label. i :
[0018] in, N is the side channel information collected. train Power consumption data, This is the power consumption data after cropping; and These are the plaintext and key corresponding to position i, respectively.
[0019] Preferably, the step of training the deep learning model based on the labeled training dataset to generate the attack model specifically includes:
[0020] The Conformer training model is built based on deep learning, and an additional one-dimensional convolutional layer is constructed as the encoding layer of the model.
[0021] The labeled training dataset is input into the constructed Conformer training model for training, and the model generated after training is used as the attack model.
[0022] Preferably, the step of collecting data according to a preset third acquisition scheme, generating an attack dataset by pruning the feature vector, inputting the attack dataset into the attack model to generate a key probability vector, and using the key with the highest score as the attack key to complete the side-channel black-box attack specifically includes:
[0023] Using preset data collection quantity and plaintext P attack The third sampling scheme is set to collect N samples using a fully random method. attack Power consumption data;
[0024] Based on the first n of the feature vectors t N feature points attack The power consumption data is truncated, and the truncated N data is obtained. attack Power consumption data as attack dataset The attack dataset is input into the attack model, and the probability vector of the key corresponding to the attack dataset is output to determine each key. i Score S(key) i );
[0025] Use the key with the highest score as the attack key to complete the side-channel black-box attack;
[0026] in, It is the trimmed power consumption data for each individual key. i Score It is a key i The probability vector.
[0027] This invention also provides a side-channel black box attack device, the device comprising:
[0028] The data acquisition module is used to acquire side channel information according to a preset first acquisition scheme, determine the feature points where side channel leakage occurs using a preset feature selection model, and generate feature vectors based on the determined feature points.
[0029] The data labeling module is used to collect training data according to a preset second collection scheme, trim the training data according to the feature vector to obtain a training dataset, and label the training dataset with labels.
[0030] The data training module is used to train the deep learning model based on the labeled training dataset and generate the attack model.
[0031] The attack module is used to collect data according to a preset third acquisition scheme, and generate an attack dataset by cropping the feature vector. The attack dataset is then input into the attack model to generate a probability vector for the key. The key with the highest score is used as the attack key to complete the side-channel black-box attack.
[0032] As a preferred embodiment, the data acquisition module is specifically used for:
[0033] The first acquisition scheme, based on the preset plaintext key crossover order, number of plaintext key groups, and plaintext key data, acquires the side-channel information during the operation of the cryptographic algorithm. The side-channel information includes power consumption and electromagnetic information.
[0034] A fixed plaintext and a random plaintext are generated, the plaintext is encrypted, and the collected side-channel information is divided into n groups: T1, T2, ... T based on the encrypted plaintext. n (n≥2), where T1~T n It is an encrypted fixed plaintext F1~F n The side-channel information collected in real time, each group of side-channel information contains K power consumption data points, which include power consumption trajectories or electromagnetic trajectories, denoted as... Each trajectory has Q sampling points, which are Q original features, among which
[0035] The maximum correlation minimum redundancy algorithm is used to calculate the mRMR value of Q sampling points of each power consumption data in the collected side channel information, and the sampling points with mRMR values not less than the first threshold are determined. The power consumption data of the m sampling points determined from K power consumption data in n sets of side channel information is taken as the power consumption dataset T.
[0036] The calculated power consumption dataset T is used to train a support vector machine to obtain the weights calculated for m sampling points. The m sampling points are then sorted according to their weights to generate a feature vector t*, where m > 0.
[0037] Preferably, the data annotation module is specifically used for:
[0038] Plaintext vector P using side-channel information train and key vector K train The second sampling scheme is set to collect N samples in a fully random manner. train Side channel information as training data T train ;
[0039] Select the top n features of feature vector t* t Each feature point is paired with training data T train Pruning is performed to obtain the training dataset. Set the attack unit to n per attack. attack Each plaintext p train and key k train The corresponding label has n bits / nattacks, where n bits is the training dataset. The plaintext vector P corresponding to each power consumption data point train and key vector K train The number of bits, for each plaintext P train and key k train The label corresponding to position i is set to label. i :
[0040] in, N is the side channel information collected. train Power consumption data, This is the power consumption data after cropping; and These are the plaintext and key corresponding to position i, respectively.
[0041] As a preferred embodiment, the data training module specifically addresses the following:
[0042] The Conformer training model is built based on deep learning, and an additional one-dimensional convolutional layer is constructed as the encoding layer of the model.
[0043] The labeled training dataset is input into the constructed Conformer training model for training, and the model generated after training is used as the attack model.
[0044] Preferably, the attack module is specifically used for:
[0045] Using preset data collection quantity and plaintext P attack The third sampling scheme is set to collect N samples using a fully random method. attack Power consumption data;
[0046] Based on the first n of the feature vectors t N feature points attack The power consumption data is truncated, and the truncated N data is obtained. attack Power consumption data as attack dataset The attack dataset is input into the attack model, and the probability vector of the key corresponding to the attack dataset is output to determine each key. i Score S(key) i );
[0047] Use the key with the highest score as the attack key to complete the side-channel black-box attack;
[0048] in, It is the trimmed power consumption data for each individual key. i Score It is a key i The probability vector.
[0049] This invention also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a side-channel black-box attack method as described in any of the above embodiments.
[0050] This invention also provides a computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the device containing the computer-readable storage medium to execute a side-channel black-box attack method as described in any of the above embodiments.
[0051] This invention provides a side-channel black-box attack method, apparatus, device, and storage medium. The method involves: acquiring side-channel information according to a preset first acquisition scheme; determining feature points indicating side-channel leakage using a preset feature selection model; generating feature vectors based on these feature points; acquiring training data according to a preset second acquisition scheme; trimming the training data using the feature vectors to obtain a training dataset; labeling the training dataset; training a deep learning model using the labeled training dataset to generate an attack model; acquiring data according to a preset third acquisition scheme; generating an attack dataset through feature vector trimming; inputting the attack dataset into the attack model to generate a key probability vector; and using the key with the highest score as the attack key to complete the side-channel black-box attack. Compared with existing technologies, this method achieves universality in side-channel attacks and improves their efficiency. Attached Figure Description
[0052] Figure 1 This is a flowchart of a side-channel black-box attack method provided by an embodiment of the present invention;
[0053] Figure 2 This is a flowchart illustrating a side-channel black-box attack method according to another embodiment of the present invention;
[0054] Figure 3 This is a schematic diagram of the structure of a side-channel black box attack device provided in an embodiment of the present invention;
[0055] Figure 4 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present invention. Detailed Implementation
[0056] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. In fact, countless specific implementation schemes can be differentiated by selecting various different filters, subset generation strategies, and classifiers. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0057] See Figure 1 This is a flowchart of a side-channel black-box attack method provided by an embodiment of the present invention, the method including S1 to S4:
[0058] S1. Acquire side channel information according to the preset first acquisition scheme, determine the feature points where side channel leakage occurs using the preset feature selection model, and generate feature vectors based on the determined feature points.
[0059] S2, collect training data according to the preset second acquisition scheme, trim the training data according to the feature vector to obtain a training dataset, and label the training dataset;
[0060] S3, train the deep learning model based on the labeled training dataset to generate the attack model;
[0061] S4. Data is collected according to the preset third acquisition scheme, and an attack dataset is generated by cropping the feature vector. The attack dataset is input into the attack model to generate a probability vector of the key. The key with the highest score is used as the attack key to complete the side-channel black-box attack.
[0062] In this specific implementation, side channel information is collected according to a predetermined first acquisition scheme. The acquisition scheme includes the setting scheme of the acquisition quantity and the plaintext key. A specific feature selection technique is used to extract the feature points of side channel leakage in the power consumption data and generate a feature vector.
[0063] The model used in the existing technology for side-channel evaluation is adopted as the feature selection model in this application. The feature vector is determined based on the feature points of detected information leakage, and more valuable features are extracted, namely the feature points of side-channel leakage, so that the power consumption data can be used for subsequent black-box attacks.
[0064] After obtaining the feature vectors, training is required based on them. During the training phase, training data needs to be collected according to a pre-defined second acquisition scheme. This scheme includes settings for the number of data points and the plaintext key. Once the acquisition scheme is set, training data is collected according to the scheme. The collected training data is then pruned based on the feature vectors obtained during the feature selection phase. The pruned training data is the training dataset. The power consumption data after feature extraction allows for direct labeling of the training dataset based on the plaintext key information.
[0065] Build the deep learning model required for training, train the built deep learning model based on the training dataset, and use the trained model as the attack model.
[0066] According to the preset third data acquisition scheme, which includes the settings for the number of data to be acquired and the plaintext, data is acquired according to the third acquisition scheme. The acquired data needs to be pruned based on the feature vector obtained in the feature selection stage to obtain the pruned attack dataset. After obtaining the attack dataset, it is input into the trained attack model to obtain the probability vector of the key. The key with the highest score is used as the attack key to complete the side-channel black-box attack.
[0067] The side-channel black-box attack method proposed in this invention eliminates the need for black-box attacks that require examining the implementation code of encryption algorithms, power leakage models, or manual identification of these models. By extracting feature-rich power consumption data, the training dataset can be directly labeled based on plaintext / ciphertext and a function of the key. Deep learning techniques are then used to classify the extracted features according to the labels. Finally, the classification results of the attack dataset are used to determine sensitive information in the encryption process. Feature selection technology removes noise and redundancy from the power consumption data, effectively extracting more valuable features. This scheme does not employ any power consumption model but uses a novel data processing and labeling method, making the power consumption data more suitable for black-box attacks. This new labeling method effectively solves the problem of existing side-channel attacks requiring significant time and effort to obtain leaked operations. Compared to existing techniques that require prior knowledge of the encryption algorithm's implementation code and attack specific implementations for each algorithm, this scheme offers the advantages of black-box attack capabilities and versatility, enabling general, efficient, and convenient side-channel black-box attacks.
[0068] In another embodiment provided by the present invention, step S1 specifically includes:
[0069] The first acquisition scheme, based on the preset plaintext key crossover order, number of plaintext key groups, and plaintext key data, acquires the side-channel information during the operation of the cryptographic algorithm. The side-channel information includes power consumption and electromagnetic information.
[0070] The collected side-channel information is divided into n groups: T1, T2, ... T n (n≥2), where T1~T n It is an encrypted fixed plaintext F1~F n The side-channel information collected in real time, each group of side-channel information contains K power consumption data points, which include power consumption trajectories or electromagnetic trajectories, denoted as... Each trajectory has Q sampling points, which are Q original features, among which
[0071]
[0072] The maximum correlation minimum redundancy algorithm is used to calculate the mRMR value of Q sampling points of each power consumption data in the collected side channel information, and the sampling points with mRMR values not less than the first threshold are determined. The power consumption data of the m sampling points determined from K power consumption data in n sets of side channel information is taken as the power consumption dataset T.
[0073] The calculated power consumption dataset T is used to train a support vector machine to obtain the weights calculated for m sampling points. The m sampling points are then sorted according to their weights to generate a feature vector t*, where m > 0.
[0074] In this specific implementation, a first acquisition scheme for side-channel data is determined, including the plaintext key crossover order, the number of plaintext key groups, and the plaintext key data settings. The crossover order of power consumption data affects the feature selection result. Side-channel data is acquired according to the first acquisition scheme, and the side-channel information includes power consumption and electromagnetic information.
[0075] The collected side-channel information is divided into n groups: T1, T2, ... T n (n≥2), where T1~T n It is an encrypted fixed plaintext F1~F n The side-channel information collected in real time, each group of side-channel information contains K power consumption data points, which include power consumption trajectories or electromagnetic trajectories, denoted as... Each trajectory has Q sampling points, which are Q original features, among which
[0076]
[0077] The maximum correlation minimum redundancy (mRMR) algorithm is used to calculate the mRMR values of Q sampling points of power consumption data. m features with mRMR values equal to or greater than 0.15 are selected. The power consumption data of m sampling points determined from K power consumption data in n sets of side channel information is used as the power consumption dataset T. The resulting power consumption dataset T contains K power consumption data, and each power consumption data has m features.
[0078] The power consumption dataset T, calculated using the maximum correlation minimum redundancy algorithm, is used to train a support vector machine (SVM). The weights calculated for m sampling points are obtained, and the m sampling points are sorted according to their weights to generate a feature vector t*, where m > 0.
[0079] This embodiment directly uses plaintext / ciphertext and key values as training labels. It employs a specific feature selection technique to find power leakage points related to the plaintext / ciphertext and key. Specifically, feature points are extracted using an evaluation dataset. The extracted feature results are used to rank the side-channel leakage of each feature point in the power data. The higher the ranking, the more severe the side-channel leakage of that feature point. Based on the severity of the side-channel leakage, a feature vector t* with n feature points is determined. Subsequently, the collected data is pruned using the feature vector to extract more valuable feature points, effectively reducing the amount of data and improving attack efficiency.
[0080] In another embodiment provided by the present invention, step S2 specifically includes:
[0081] Plaintext vector P using side-channel information train and key vector K train Nt was collected using a second, fully random sampling scheme. rain Side channel information as training data T train ;
[0082] Select the top n features of feature vector t* t Each feature point is paired with training data T train Pruning is performed to obtain the training dataset. Set the attack unit to Each plaintext P train and key k train The corresponding label set at each position has n. bit / n attack n bit For training dataset The plaintext vector P corresponding to each power consumption data point train and key vector K train The number of bits, for each plaintext P train and key k train The label corresponding to position i is set to label. i :
[0083] in, N is the side channel information collected. train Power consumption data, This is the power consumption data after cropping; and These are the plaintext and key corresponding to position i, respectively.
[0084] In this specific implementation, the key for the training dataset needs to be set to include all possible scenarios for attacking the dataset; therefore, a plaintext vector P is used. train and key vector K train The second sampling scheme is set to collect N samples in a fully random manner. train Side channel information as training data T train ;
[0085] N is the side channel information collected. train Power consumption data;
[0086] Based on the first n features of the feature vector t* obtained after feature selection t Each feature point is paired with the collected training data T train= Perform cropping to obtain training data T train The first n of the eigenvectors t* t The data corresponding to each feature point is used as the training dataset. This is the power consumption data after cropping;
[0087] To label the training dataset, existing methods label it based on leaks in the encryption algorithm. This invention directly uses plaintext key information to label the training dataset. Considering existing device limitations and time complexity, the attack unit for each attack is set to n. attack Bits, the plaintext vector P corresponding to each power consumption data point in the training dataset. train and key vector K train For n bit Bit. Therefore, based on the plaintext p at the corresponding position. train and key k train There are n labels to set. bit / n attack Each plaintext p train and key k train The label corresponding to position i is set to label. i : and These are the plaintext and key corresponding to position i, respectively.
[0088] By labeling the training dataset, this method eliminates the need to examine the encryption algorithm's implementation code before the attack, unlike previous deep learning-based side-channel attacks. This solves the problem of attackers spending significant time and effort searching for leaked operations. In processing power consumption data, other methods require finding leaked operations first and then extracting the corresponding power consumption data, inevitably requiring the search for these operations before the attack. To achieve black-box attacks, this invention employs a specific feature selection algorithm to process power consumption data. It introduces a specific feature selection technique to extract more valuable feature points from the power consumption data, effectively reducing the data volume, improving attack efficiency, and making power consumption data more suitable for black-box attacks.
[0089] In another embodiment provided by the present invention, step S3 specifically includes:
[0090] The Conformer training model is built based on deep learning, and an additional one-dimensional convolutional layer is constructed as the encoding layer of the model.
[0091] The labeled training dataset is input into the constructed Conformer training model for training, and the model generated after training is used as the attack model.
[0092] In this specific implementation, a Conformer training model is built based on deep learning, and an additional encoding layer is built.
[0093] After setting up the Conformer training model, the labeled training dataset is input into the constructed model for training, and the model generated after training is used as the attack model.
[0094] Introducing a deep learning model with stronger learning capabilities to learn the power consumption data after feature selection can better learn the dependency relationship between power consumption data and sensitive information.
[0095] In another embodiment provided by the present invention, step S4 specifically includes:
[0096] Using preset data collection quantity and plaintext P attack The third sampling scheme is set to collect N samples using a fully random method. attack Power consumption data;
[0097] Based on the first n of the feature vectors t N feature points attack The power consumption data is truncated, and the truncated N data is obtained. attack Power consumption data as attack dataset The attack dataset is input into the attack model, and the probability vector of the key corresponding to the attack dataset is output to determine each key. i Score S(key) i );
[0098] Use the key with the highest score as the attack key to complete the side-channel black-box attack;
[0099] in, It is the trimmed power consumption data for each individual key. i Score It is a key i The probability vector.
[0100] In this specific implementation, a data collection scheme for the attack dataset is determined. To obtain more information during the attack phase, the plaintext P_attack in the attack data collection scheme is set to completely random. A preset collection quantity and plaintext P_attack are used. attack The third sampling scheme is set to collect N samples using a fully random method. attack Power consumption data;
[0101] Based on the first n of the feature vectors t N feature points attack The power consumption data is truncated, and the truncated N data is obtained. attack Power consumption data as attack dataset
[0102] The power consumption data after cropping are as follows:
[0103] attack dataset The input is fed into the attack model, which outputs a probability vector (Prob) for each possible key of the attacking unit, and determines the key for each key. i Score S(key) i );
[0104] It is a key i The probability vector.
[0105] The key with the highest score is selected as the attack key to complete the side-channel black-box attack.
[0106] In yet another embodiment provided by the present invention, see Figure 2 This is a flowchart illustrating a side-channel black-box attack method according to another embodiment of the present invention, the method comprising steps one to ten.
[0107] Step 1: Encrypt plaintext P1, P2, ..., Pn (cross-encrypt) k times, and collect the corresponding power consumption trajectory as side channel data;
[0108] The collected side channel data includes k power consumption trajectories, each with n sampling points, i.e., n features;
[0109] Step 2: Calculate the power consumption data using feature selection techniques;
[0110] Step 3: Select the top n with the largest weights t The feature vector of the leakage point is determined by considering n features. t One leak point;
[0111] Step 4: Set up a second data acquisition scheme for the power consumption data required for training, and collect the corresponding power consumption trajectory as training data;
[0112] Each power consumption data point in the training data contains n sampling points;
[0113] Step 5: Crop the power consumption trajectories in the training data according to the feature vectors to obtain the training dataset. Each power consumption data point in the training dataset contains n... t One sampling point;
[0114] Step Six: Label the training book collection;
[0115] Step 7: Build a deep learning model, learn from the training dataset, and use the trained model as the attack model.
[0116] Step 8: Set up a third data collection scheme for the power consumption data required for the attack, and collect the corresponding power consumption trajectory as attack data;
[0117] Each power consumption data point in the attack data contains n sampling points;
[0118] Step 9: Prune the power consumption trajectories in the attack data according to the feature vectors to obtain the attack dataset. Each power consumption data point in the attack dataset contains n... t One sampling point;
[0119] Step 10: Input the attack dataset into the attack model, which outputs the probability vector Prob of the attack key; calculate the key based on the probability vector. i Score S(key) i ), determine the attack key, and complete the side-channel black-box attack.
[0120] This invention proposes a novel method for labeling training datasets for deep learning-based side-channel attacks. Compared to previous deep learning-based side-channel attacks, it eliminates the need to examine the implementation code of the encryption algorithm before the attack, solving the problem of attackers spending significant time and effort searching for leaked operations. In processing power consumption data, other methods require finding leaked operations first and then extracting the corresponding power consumption data, inevitably requiring the search for leaked operations before the attack. To achieve black-box attacks, this invention employs a specific feature selection algorithm to process power consumption data, introducing a specific feature selection technique to extract more valuable feature points from the power consumption data, effectively reducing the data volume, improving attack efficiency, and making power consumption data more suitable for black-box attacks. This invention introduces a more powerful deep learning model to learn the power consumption data after feature selection, enabling better learning of the dependencies between power consumption data and sensitive information. This invention can achieve side-channel attacks without examining the implementation code of the encryption algorithm or knowing the leaked operations of the unknown encryption algorithm. This significantly improves the attacker's attack efficiency. Compared to existing side-channel attacks, it is more versatile and has greater advantages in terms of overall attack difficulty and time complexity.
[0121] See Figure 3 This is a schematic diagram of a side-channel black-box attack device provided in an embodiment of the present invention. The device includes: a data acquisition module, a data annotation module, a data training module, and an attack module.
[0122] The data acquisition module is used to acquire side channel information according to a preset first acquisition scheme, determine the feature points where side channel leakage occurs using a preset feature selection model, and generate feature vectors based on the determined feature points.
[0123] The data labeling module is used to collect training data according to a preset second collection scheme, trim the training data according to the feature vector to obtain a training dataset, and label the training dataset with labels.
[0124] The data training module is used to train the deep learning model based on the labeled training dataset to generate the attack model;
[0125] The attack module is used to collect data according to a preset third acquisition scheme, and generate an attack dataset by cropping the feature vector. The attack dataset is then input into the attack model to generate a probability vector for the key. The key with the highest score is used as the attack key to complete the side-channel black-box attack.
[0126] In specific implementation, the side-channel black box attack device described above can perform the specific functions of the side-channel black box attack method provided in any of the above embodiments. The specific implementation process has been specifically described in any embodiment of the side-channel black box attack method, and will not be repeated in this embodiment.
[0127] See Figure 4 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present invention, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a side-channel black-box attack method as described in any of the above embodiments.
[0128] The side-channel black-box attack device can be a computing device such as a desktop computer, laptop, handheld computer, or cloud server. The side-channel black-box attack device / terminal device may include, but is not limited to, a processor and memory.
[0129] The processor referred to can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. This processor is the control center of the side-channel black-box attack device, connecting various parts of the device via various interfaces and lines.
[0130] The memory can be used to store the computer program or module. The processor implements various functions of the side-channel black-box attack device / terminal device by running or executing the computer program or module stored in the memory and calling the data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating device and the application program required for at least one function (such as sound playback function, image playback function, etc.). The data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory may include high-speed random access memory and non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital card (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0131] This invention also provides a computer-readable storage medium, which includes a stored computer program. When the computer program is executed, it controls the device containing the computer-readable storage medium to perform a side-channel black-box attack method as described in any of the above embodiments. If the module integrated into the side-channel black-box attack device is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the embodiments of the above-described side-channel black-box attack method can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0132] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without creative effort. The above descriptions are preferred embodiments of the present invention. It should be pointed out that those skilled in the art can make several improvements and modifications without departing from the principle of the present invention, and these changes and modifications are also considered to be within the scope of protection of the present invention.
[0133] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these changes and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A side-channel black-box attack method, characterized in that, The method comprises: According to the preset first acquisition scheme, the side channel information is collected, the feature selection model is used to determine the feature points of the side channel leakage, and the feature vector is generated according to the determined feature points; According to the preset second acquisition scheme, the training data is collected, the training data set is obtained by cutting the training data according to the feature vector, and the label is labeled for the training data set; According to the labeled training data set, the deep learning model is trained to generate an attack model; According to the preset third acquisition scheme, the data is collected, and the attack data set is generated by cutting the feature vector, the attack data set is input into the attack model, the probability vector of the key is generated, and the highest score key is taken as the attack key to complete the side channel black box attack; According to the preset first acquisition scheme, the side channel information is collected, the feature selection model is used to determine the feature points of the side channel leakage, and the feature vector is generated according to the determined feature points, specifically comprising: According to the preset first acquisition scheme, the side channel information of the cryptographic algorithm running is collected, the side channel information includes power consumption, electromagnetic information, and the preset plaintext key cross sequence, plaintext key group number and plaintext key data setting; The collected side channel information is divided into n groups: T1, T2, …Tn n (n≥2), wherein T1~Tn n are the side channel information collected when encrypting fixed plaintexts F1~Fn n Each group of side channel information contains K pieces of power consumption data, including power consumption traces or electromagnetic traces, denoted as Each trace has Q sampling points, i.e. Q original features, wherein The mRMR value of Q sampling points in each power consumption data of the collected side channel information is calculated by using the maximum correlation minimum redundancy algorithm, the sampling points with mRMR value not less than the first threshold value in the power consumption data are determined, and the power consumption data of the determined m sampling points in K power consumption data in n groups of side channel information are taken as the power consumption data set T; The calculated power consumption data set T is trained by support vector machine to obtain the weight of m sampling points, the m sampling points are sorted according to the weight, a feature vector t* is generated, and m>0.
2. The side-channel black-box attack method of claim 1, wherein, The training data is collected according to the preset second acquisition scheme, the training data set is obtained by cutting the training data according to the feature vector, and the label is labeled for the training data set, specifically comprising: Adopting side channel information of plaintext vector P train And key vector K train The second acquisition scheme is set to full random N train Collect side channel information as training data T train ; select the first n t feature points of the feature vector t* train cutting, to obtain a training data set Set the number of attacks per unit as n attack Bit, each plaintext p train and key k train The label set in the corresponding position has n bit / n attack , n bit is the training data set Each plaintext vector P train and key vector K train corresponding to each power consumption data of the training data set train and key k train The label corresponding to the corresponding position i is set as label i : wherein, is the N train th side-channel information collected, 1≤i≤N train , is the trimmed power consumption data; 1≤i≤N train ; and are the plaintext and key corresponding to position i, respectively.
3. The side-channel black-box attack method of claim 1, wherein, According to the labeled training data set, the deep learning model is trained to generate an attack model, specifically comprising: A Conformer training model is built based on deep learning, and a one-dimensional convolution layer is additionally constructed as an encoding layer of the model; The labeled training data set is input into the constructed Conformer training model for training, and the generated model after training is taken as the attack model.
4. The side-channel black-box attack method of claim 1, wherein, The training data is collected according to the preset third acquisition scheme, and the attack data set is generated by cutting the feature vector, the attack data set is input into the attack model, the probability vector of the key is generated, and the highest score key is taken as the attack key to complete the side channel black box attack, specifically comprising: The preset collection quantity and the plaintext P attack The third collection scheme set as full random collects N attack Power consumption data Based on the first n of the feature vectors t N feature points attack The power consumption data is truncated, and the truncated N data is obtained. attack Power consumption data as attack dataset The attack dataset is input into the attack model, and the probability vector of the key corresponding to the attack dataset is output to determine each key. i Score S(key) i ); The highest score key is taken as the attack key to complete the side channel black box attack; wherein, 1≤j≤N attack , is each power consumption data after clipping, each key key i score of is the probability vector of key key i .
5. A side-channel black-box attack apparatus characterized by, The device comprises: A data acquisition module is used for collecting side channel information according to a preset first acquisition scheme, using a preset feature selection model to determine feature points of side channel leakage, and generating a feature vector according to the determined feature points; The data labeling module is configured to collect training data according to a preset second collection scheme, crop the training data according to the feature vector, obtain a training data set, and label the training data set; The data training module is configured to train a deep learning model according to the training data set with the labeled labels, and generate an attack model; The attack module is configured to collect data according to a preset third collection scheme, generate an attack data set through the feature vector cutting, input the attack data set into the attack model, generate a probability vector of the key, and complete the side channel black box attack by taking the key with the highest score as an attack key. The data collection module is specifically configured to: collect side channel information of a cryptographic algorithm in operation according to a first collection scheme set by a preset plaintext key crossing order, a plaintext key group number, and plaintext key data, wherein the side channel information includes power consumption and electromagnetic information; A fixed plaintext and a random plaintext are generated, the plaintext is encrypted, and the collected side-channel information is divided into n groups: T1, T2, ... T based on the encrypted plaintext. n (n≥2), where T1~T n It is an encrypted fixed plaintext F1~F n The side-channel information collected in real time, each group of side-channel information contains K power consumption data points, which include power consumption trajectories or electromagnetic trajectories, denoted as... Each trajectory has Q sampling points, which are Q original features, among which calculate mRMR values of Q sampling points of each power consumption data in the collected side channel information using a maximum correlation minimum redundancy algorithm, determine sampling points with mRMR values not less than a first threshold value in the power consumption data, and take power consumption data of the determined m sampling points in K pieces of power consumption data in n groups of side channel information as a power consumption data set T; perform support vector machine training on the calculated power consumption data set T to obtain weights calculated for the m sampling points, sort the m sampling points according to the weights, generate a feature vector t*, and m>0.
6. The side-channel black-box attack apparatus of claim 5, wherein, The data labeling module is specifically configured to: The plaintext vector P using side channel information train and the key vector K train The second acquisition scheme is set to full random acquisition N train pieces of side channel information as training data T train ; Select the first n features of feature vector t* t Each feature point is paired with training data T train The training dataset is obtained by cropping. Set the attack unit to n per attack. attack Each plaintext p train and key k train The corresponding label set at each position has n. bit / n attack n bit For training dataset The plaintext vector P corresponding to each power consumption data point train and key vector K train The number of bits per plaintext p train and key k train The label corresponding to position i is set to label. i : wherein, is the N train th side-channel information collected, 1≤i≤N train , is the trimmed power consumption data; 1≤i≤N train ; and are the plaintext and key corresponding to position i, respectively.
7. A terminal device, characterized by comprising: include a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and the processor implements the side channel black box attack method of any one of claims 1-4 when executing the computer program.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium includes a stored computer program, wherein the computer readable storage medium controls the device where the computer readable storage medium is located to execute the side channel black box attack method of any one of claims 1-4 when the computer program runs.