Deep learning side-channel collision analysis method and device for protected block cipher

By fragmenting side-channel information and training machine learning models, the accuracy problem of key recovery in weak mask leakage scenarios is solved, and efficient key recovery is achieved under weak mask leakage conditions.

CN122247617APending Publication Date: 2026-06-19BEIJING INST OF TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING INST OF TECH
Filing Date
2026-04-29
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively establish the correlation between side-channel information and sensitive intermediate variables in scenarios with weak mask leakage, leading to decreased accuracy or failure in the analysis of protected block cipher key recovery.

Method used

By controlling the fixed byte input of plaintext, side channel information is collected and divided into multiple segments, corresponding to plaintext bytes. A machine learning model is used to train and splice the segment data to determine the candidate key difference. Key combination analysis is then performed by combining known plaintext-ciphertext pairs.

Benefits of technology

Even with weak mask leakage signals, maintain high analysis accuracy and success rate to recover the key of a protective block cipher.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122247617A_ABST
    Figure CN122247617A_ABST
Patent Text Reader

Abstract

This invention provides a deep learning-based side-channel collision analysis method and apparatus for protective block ciphers. The method includes: fixing the i-th byte of the plaintext input to the cryptographic device; collecting multiple side-channel information and dividing the regions where secret information-related operations are performed into multiple side-channel information segments; combining the side-channel information segments of the i-th and j-th bytes and using them to train a machine learning model; for each z-th byte, concatenating the side-channel information segments of the i-th and z-th bytes of the multiple side-channel information to form multiple input data; using the machine learning model to obtain the first predicted probability of each second candidate value corresponding to each input data; determining the target candidate key difference between the j-th and z-th bytes based on the second candidate value, the first predicted probability, and the plaintext value of the z-th byte; determining each candidate key combination and performing correct key combination analysis. This invention maintains high analysis accuracy and success rate even when the mask leakage signal is very weak.
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, specifically to a deep learning side-channel collision analysis method and apparatus for protective block ciphers. Background Technology

[0002] Block cipher algorithms, especially AES (Advanced Encryption Standard), are widely used in various information systems due to their good security performance and high computational efficiency. However, when these algorithms run on physical devices, their power consumption, electromagnetic radiation, and other side-channel information can be exploited by attackers to deduce sensitive information such as keys. This type of attack is called side-channel analysis. To defend against side-channel analysis, cryptographic implementations typically incorporate masking techniques, i.e., protective block ciphers. This technique splits sensitive intermediate computational variables into multiple randomized shares, disrupting the direct correlation between side-channel leakage and the original sensitive value, thus increasing the difficulty of the attack.

[0003] In some cases, such as when a user forgets their key or when the security of a protective block cipher needs to be tested, it is necessary to recover the key of the protective block cipher. Existing technologies utilize deep learning to fuse multi-share leaks (such as mask value leaks and leaks of masked intermediate variables) in mask implementations, effectively uncovering the relationship between side-channel information and sensitive intermediate variables, thereby enabling the recovery of the protective block cipher key.

[0004] However, the analytical effectiveness of existing technologies is highly dependent on the leakage strength of the mask itself and its related operations in the side channel. In many practical scenarios, such as when the leakage strength of the mask value in the side channel information is weak, or when the leakage of the mask value and the masked intermediate variable is difficult to observe simultaneously within the same time window, existing technologies struggle to effectively establish the correlation between the side channel information and the sensitive intermediate variable, ultimately leading to decreased analytical accuracy or even analytical failure. Summary of the Invention

[0005] In view of this, in order to solve the above-mentioned technical problems, the present invention provides a deep learning side-channel collision analysis method and apparatus for protective block ciphers.

[0006] The present invention adopts the following technical solution:

[0007] In a first aspect, the present invention provides a deep learning-based side-channel collision analysis method for protective block ciphers, comprising: The i-th byte of the plaintext input to the cryptographic device is fixed, and multiple pieces of side-channel information generated during the operation of the cryptographic device are collected; the cryptographic device uses a protective block cipher. For each piece of side channel information, the region in the side channel information where secret information-related operations are performed is divided into multiple side information segments. Each side information segment corresponds one-to-one with a byte of the plaintext, and each side information segment corresponds to the calculation process of its corresponding byte. The side information fragment corresponding to the i-th byte is combined with the side information fragment corresponding to the j-th byte of the plaintext to form training data. Then, using the plaintext value of the j-th byte as the label, a machine learning model is trained using the training data. For each z-th byte of the plaintext, the side information fragments corresponding to the i-th byte of the multiple side channel information are concatenated with the side information fragments corresponding to the z-th byte to form multiple input data. Using the machine learning model, the first predicted probability of each second candidate value of the j-th byte corresponding to each input data is obtained. Based on a preset cryptographic relationship, the target candidate key difference between the j-th byte and the z-th byte is determined according to the second candidate value, the first predicted probability, and the plaintext value of the z-th byte. The z-th byte is any byte of the plaintext other than the i-th byte and the j-th byte. Based on the first candidate values ​​of the i-th and j-th bytes and the difference between the target candidate key, each candidate key combination is determined, and correct key combination analysis is performed on the candidate key combinations using at least one set of known plaintext-ciphertext pairs.

[0008] Optionally, based on a preset cryptographic relationship, the target candidate key difference between the j-th byte and the z-th byte is determined according to the second candidate value, the first predicted probability, and the plaintext value of the z-th byte, specifically including: For each piece of input data, the second candidate value corresponding to the input data is XORed with the plaintext value of the z-th byte to obtain the candidate key difference corresponding to each second candidate value. The candidate key difference is the candidate key difference between the j-th byte and the z-th byte. The first prediction probability corresponding to the second candidate value is assigned to the candidate key difference corresponding to the second candidate value to obtain the second prediction probability of the candidate key difference. The second predicted probabilities of each candidate key difference corresponding to all the input data are accumulated and statistically analyzed, and the candidate key difference with the largest accumulated probability is determined as the target candidate key difference.

[0009] Optionally, the cryptographic device is a block cipher device with protection implementation.

[0010] Optionally, the machine learning model is a neural network model.

[0011] Optionally, the neural network model includes a feature extraction module, a first fully connected layer, a first activation layer, a bilinear vector layer, a second fully connected layer, a second activation layer, and a third fully connected layer connected in sequence. The feature extraction module includes a convolutional layer, a third activation layer, a batch normalization layer, an average pooling layer, and a flattening layer.

[0012] Optionally, the i-th byte of the plaintext input to the cryptographic device is fixed, and multiple pieces of side-channel information generated during the operation of the cryptographic device are collected, specifically including: The i-th byte of the plaintext input to the cryptographic device is fixed, while the other bytes of the plaintext, excluding the i-th byte, are randomized to generate a target number of plaintext data sets. The side-channel information generated by the cryptographic device when executing each group of plaintext data is collected.

[0013] Optionally, using at least one known set of plaintext-ciphertext pairs, correct key combination analysis is performed on the candidate key combinations, specifically including: From the at least one set of known plaintext-ciphertext pairs, select the first plaintext-ciphertext pair; Using the first plaintext-ciphertext pair, perform correct key combination analysis on the candidate key combinations to obtain the target key combination; The target key combination is verified using the remaining plaintext-ciphertext pair; If the verification passes, the target key combination is determined to be the correct key combination; If the verification fails, the preset alarm action will be executed.

[0014] Secondly, the present invention provides a deep learning side-channel collision analysis device for protective block ciphers, comprising: The acquisition module is used to control the i-th byte of the plaintext input to the cryptographic device to be fixed, and to acquire multiple pieces of side-channel information generated during the operation of the cryptographic device; the cryptographic device uses a protective block cipher. The partitioning module is used to divide the region in the side channel information where secret information-related operations are performed into multiple side information segments for each side channel information segment. Each side information segment corresponds one-to-one with a byte of the plaintext, and each side information segment corresponds to the calculation process of its corresponding byte. The training module is used to combine the side information fragment corresponding to the i-th byte with the side information fragment corresponding to the j-th byte of the plaintext to form training data, and to train a machine learning model using the plaintext value of the j-th byte as the label. The inference module is used to concatenate the side information fragments corresponding to the i-th byte of the multiple side channel information with the side information fragments corresponding to the z-th byte for each z-th byte of the plaintext to form multiple input data. Using the machine learning model, it obtains the first predicted probability of each second candidate value corresponding to the j-th byte for each input data. Based on a preset cryptographic relationship, and according to the second candidate value, the first predicted probability, and the plaintext value of the z-th byte, it determines the target candidate key difference between the j-th byte and the z-th byte; the z-th byte is any byte of the plaintext other than the i-th byte and the j-th byte. The recovery module is used to determine each candidate key combination based on the difference between the first candidate values ​​of the i-th byte and the j-th byte and the target candidate key, and to perform correct key combination analysis on the candidate key combinations using at least one set of known plaintext-ciphertext pairs.

[0015] This invention employs the above technical solution, fixing the i-th byte of the plaintext input to the cryptographic device, determining the target candidate key difference (i.e., the "relative relationship" between the leakage signals of different bytes) between the j-th byte and each z-th byte, and using the target candidate key difference for analysis. This invention cleverly bypasses the direct dependence on mask value leakage. Therefore, even in scenarios where the mask leakage signal is very weak, this invention can still maintain high analysis accuracy and success rate. Attached Figure Description

[0016] 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.

[0017] Figure 1 This is a flowchart illustrating a deep learning side-channel collision analysis method for a protective block cipher provided in an embodiment of the present invention. Figure 2 This is a schematic diagram of an energy waveform of the AES-128 cryptographic algorithm performing first-order mask protection according to an embodiment of the present invention; Figure 3 This is the embodiment of the invention corresponding to Figure 2 A schematic diagram showing the location of the area where secret information-related calculations are performed; Figure 4 This is a schematic diagram of dividing the part of the S-box replacement operation into 16 waveform segments according to an embodiment of the present invention; Figure 5This is a schematic diagram of the ranking of the cumulative probability of the target candidate key difference among all candidate key differences as a function of the number of waveforms, provided in an embodiment of the present invention. Figure 6 This is a schematic diagram of the structure of a deep learning side-channel collision analysis device for a protective block cipher provided in an embodiment of the present invention. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be described in detail below. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other implementation methods obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0019] Figure 1 This is a flowchart illustrating a deep learning-based side-channel collision analysis method for a protective block cipher provided in an embodiment of the present invention. Figure 1 As shown, this process includes: Step 101: Fix the i-th byte of the plaintext input to the cryptographic device, and collect multiple pieces of side-channel information generated during the operation of the cryptographic device; the cryptographic device uses a protective block cipher.

[0020] This embodiment uses a protected block cipher as the first-order mask protection for the AES-128 cryptographic algorithm, an STM32F407ZGT6 development board as the cryptographic device, and energy waveforms as the side-channel information for illustration. The cryptographic device can be a block cipher device with protection implementation.

[0021] The i-th byte of the plaintext input to the cryptographic device is fixed. Multiple pieces of side-channel information generated during the operation of the cryptographic device are collected, which may specifically include: The i-th byte of the plaintext input to the cryptographic device is fixed, while the other bytes of the plaintext are randomized to generate a target number of plaintext data sets.

[0022] Collect side-channel information generated by cryptographic devices when executing each set of plaintext data.

[0023] In a specific example, the i-th byte is the 0th byte. After setting up the hardware and software platform, the 0th byte of the plaintext input to the STM32F407ZGT6 development board is fixed, while the remaining 15 bytes of the plaintext are randomly generated in each encryption request, ultimately generating 50,000 sets of plaintext data. The energy waveforms (continuous voltage changes) generated by the STM32F407ZGT6 development board when executing each set of plaintext data are collected, resulting in 50,000 energy waveforms. That is, 50,000 side-channel messages. Among them, This represents the first energy waveform. The meaning of "equal" is the same. (Energy waveform reference) Figure 2 The horizontal axis represents time (in terms of sampling points), and the vertical axis represents the measured energy value (in millivolts).

[0024] Step 102: For each side channel information, the region in the side channel information where secret information-related operations are performed is divided into multiple side information segments. Each side information segment corresponds one-to-one with a byte of plaintext, and the side information segment corresponds to the calculation process of its corresponding byte.

[0025] In particular, the S-box substitution (i.e., the Sub-Bytes operation) in the first round of the AES-128 cryptographic algorithm is a common vulnerability in side-channel analysis, allowing attackers to easily recover the correct key. Therefore, this invention defines the portion of the energy waveform where the S-box substitution operation is performed as the region where operations related to secret information are executed. Figure 3 This is the embodiment of the invention corresponding to Figure 2 A schematic diagram showing the location of the area where operations related to secret information are performed. (Example) Figure 3 As shown, the part of the energy waveform where the S-box is replaced is set as the region for performing operations related to secret information.

[0026] In the process of dividing the region in the side-channel information where secret information-related operations are performed into multiple side-channel information segments, the principle of block cipher algorithms is combined to analyze the region in the side-channel information where secret information-related operations are performed and divide it into multiple side-channel information segments. Each side-channel information segment corresponds one-to-one with a byte of plaintext. Each side-channel information segment corresponds to the intermediate state calculation process of the AES-128 cryptographic algorithm on the byte corresponding to that side-channel information segment. The intermediate state is generated by the plaintext byte and the key byte.

[0027] Specifically, the S-box substitution in the AES-128 cryptographic algorithm is based on the S-box, which is a non-linear mapping table. The AES-128 cryptographic algorithm divides the 128-bit input into 16 bytes, each byte being 8 bits. During S-box substitution, the high 4 bits of the byte are used as the row value of the S-box table, and the low 4 bits are used as the column value. The corresponding row and column values ​​in the S-box are then retrieved. Therefore, each round of S-box transformation in the AES-128 cryptographic algorithm corresponds to each byte of the 16 bytes of plaintext and is performed non-linearly along with the corresponding key bytes.

[0028] Based on the above principles, refer to Figure 4 The portion of each energy waveform in which the S-box replacement operation is performed is divided into 16 waveform segments. This refers to the side information segment. Each side information segment corresponds to the calculation process of a plaintext byte and the corresponding key byte in the AES-128 cryptographic algorithm encryption process. Among them, This represents the side information segment in the first side channel information that corresponds to the 0th byte of the plaintext. .

[0029] Step 103: Combine the side information fragment corresponding to the i-th byte with the side information fragment corresponding to the j-th byte of the plaintext to form training data, and use the plaintext value of the j-th byte as the label to train a machine learning model.

[0030] Specifically, (1) in this embodiment, the j-th byte is set as the first byte. Regarding the j-th byte... Side channel information (i.e., energy waveform) will and By piecing them together, we obtain the training data. ,in, The training dataset is constructed using the plaintext value of the first byte (i.e., the j-th byte) as the label. .

[0031] (2) Construct a machine learning model, which can be a neural network model. The structure of the neural network model can be as shown in Table 1, including a feature extraction module, a first fully connected layer, a first activation layer, a bilinear vector layer, a second fully connected layer, a second activation layer, and a third fully connected layer connected in sequence; wherein, the feature extraction module includes a convolutional layer, a third activation layer, a batch normalization layer, an average pooling layer, and a flattening layer.

[0032] Table 1. Structure of Neural Network Models

[0033] After training data is input into the neural network model, it passes through a feature extraction module. The convolutional layers are one-dimensional (1 input channel, 4 output channels, kernel size 1) used to extract basic features from the original waveform. Following the convolutional layers are a SeLu activation function, a batch normalization layer, and an average pooling layer with a stride of 2 to enhance non-linearity and reduce dimensionality, outputting a feature map. The feature map is flattened by a flattening layer and then enters a first fully connected layer with 752 input features and 10 output features. The data then passes through a bilinear vector layer, which learns the second-order interactions between features and has an output dimension of 100. Afterward, the data passes through two more fully connected layers and a SeLu activation function. The final output layer contains 256 neurons and uses a Softmax activation function, outputting a 256-dimensional probability vector corresponding to the predicted probabilities of plaintext bytes 0 to 255.

[0034] (3) Using training data The neural network model is trained to obtain a fully trained neural network model. The training process uses the Adam optimizer, with a batch size of 50, and a total of 500 training cycles.

[0035] Step 104: For each z-th byte of the plaintext, concatenate the side information fragment corresponding to the i-th byte of the multiple side channel information with the side information fragment corresponding to the z-th byte to form multiple input data. Use a machine learning model to obtain the first predicted probability of each second candidate value corresponding to each input data. Based on the preset cryptographic relationship, determine the target candidate key difference between the j-th byte and the z-th byte according to the second candidate value, the first predicted probability and the plaintext value of the z-th byte; the z-th byte is the other bytes of the plaintext except for the i-th byte and the j-th byte.

[0036] Specifically, based on a preset cryptographic relationship, the target candidate key difference between the j-th byte and the z-th byte is determined according to the second candidate value, the first predicted probability, and the plaintext value of the z-th byte. This can include: (1) For each input data, XOR each second candidate value corresponding to the input data with the plaintext value of the z-th byte to obtain the candidate key difference corresponding to each second candidate value. The candidate key difference is the candidate key difference between the j-th byte and the z-th byte.

[0037] (2) Assign the first prediction probability corresponding to the second candidate value to the candidate key difference corresponding to the second candidate value to obtain the second prediction probability of the candidate key difference.

[0038] (3) The second prediction probability of each candidate key difference corresponding to all input data is accumulated and statistically analyzed, and the candidate key difference with the largest cumulative probability is determined as the target candidate key difference.

[0039] Specifically, in step 1041, for the first... Side channel information (i.e., energy waveform) will and ( By concatenating these parts, we obtain the input data. ,in, , Less than or equal to All the input data constitute the input dataset. .

[0040] Step 1042: For each piece of input data in the input dataset, input the input data into the trained neural network model. The neural network model outputs the first predicted probability vector corresponding to the input data. ,in, Indicates input data Regarding the second candidate value of the j-th byte The first predicted probability, .

[0041] Step 1043: Select the second candidate value XOR the plaintext value of the z-th byte to obtain the second candidate value. Corresponding candidate key difference The candidate key difference is the difference between the j-th byte and the corresponding z-th byte. The second candidate value... The first prediction probability is assigned to the candidate key difference corresponding to the second candidate value, thus obtaining the second prediction probability of the candidate key difference, as shown in the formula: . Indicates the first The second candidate value of the input data The second predicted probability of the corresponding candidate key difference, This indicates the second candidate value. With the The plaintext values ​​of the bytes are XORed.

[0042] Step 1044: Since the analysis results of a single input data point are easily affected by noise, in order to improve the analysis accuracy, it is necessary to analyze all input data. The results are accumulated, and the difference between the target candidate keys is determined based on the accumulation result. Specifically, this embodiment uses a logarithmic probability summation method for statistical analysis: for each... Each of the following bytes (i.e., each of the 3rd, 4th, ..., 15th bytes) is initialized into a score vector of length 256. Let each component be initialized to 0. For each candidate key difference... of By summing, we get:

[0043] in, Represents the difference between candidate keys The cumulative probability.

[0044] Will The largest candidate key difference is determined as the target candidate key difference, which is the key difference between the first byte and the second byte. Correct key difference between bytes of key (i.e., the difference between the target candidate keys) is:

[0045] Figure 5 This is a schematic diagram of the ranking of the cumulative probability of the target candidate key difference among all candidate key differences as a function of the number of waveforms, provided in an embodiment of the present invention.

[0046] like Figure 5 As shown, the horizontal axis represents the number of input data points involved in the analysis, and the vertical axis represents the ranking of the target candidate key difference among the corresponding 256 candidate key differences (i.e., all candidate key differences between the j-th byte and the z-th byte), with rank 0 being the best. Different curves in the figure correspond to the first byte and the z-th byte, respectively. The target candidate key difference between bytes ranks the cumulative probability among all candidate key differences. It can be seen that only a maximum of 250 input data points are needed (i.e., ... This ensures that the difference between the first byte and other target candidate key values ​​ranks highest in the cumulative probability, indicating that the score of the target candidate key difference is significantly higher than that of other candidate differences. Therefore, it is evident that by employing a deep learning side-channel collision analysis method for protective block ciphers, and through cumulative statistics of multiple input data, all target candidate key differences can be successfully recovered under a limited number of input data conditions. .

[0047] Step 105: Based on the first candidate values ​​of the i-th byte and the j-th byte and the difference between the target candidate key, determine each candidate key combination, and use at least one known plaintext-ciphertext pair to perform correct key combination analysis on the candidate key combination.

[0048] This involves using at least one known plaintext-ciphertext pair to perform correct key combination analysis among candidate key combinations, which may specifically include: (1) Select the first plaintext-ciphertext pair from at least one known plaintext-ciphertext pair.

[0049] (2) Using the first plaintext-ciphertext pair, perform correct key combination analysis in the candidate key combination to obtain the target key combination.

[0050] (3) Verify the target key combination using the remaining plaintext-ciphertext pair.

[0051] (4) If the verification passes, the target key combination is determined to be the correct key combination; if the verification fails, the preset alarm action is executed.

[0052] Specifically, let the first candidate value of the 0th byte be... The first candidate value of the first byte is For each possible Based on the difference between the target candidate keys Calculate the candidate keys for the other bytes in turn. This forms a complete 16-byte candidate key combination. Then, using the first plaintext-ciphertext pair, each candidate key combination is used to encrypt its plaintext, and the result is compared with its ciphertext. The candidate key combination corresponding to the matching result is determined as the target key combination. The remaining plaintext-ciphertext pairs are used to verify the target key combination. If the verification passes, the target key combination is determined to be the correct key combination; if the verification fails, a preset alarm action is executed.

[0053] It should be noted that the plaintext-ciphertext pair originates from the synchronous output of the cryptographic device during the side-channel information acquisition process.

[0054] Based on a general inventive concept, the present invention also provides a deep learning side-channel collision analysis device for protective block ciphers. Figure 6 This is a schematic diagram of a deep learning side-channel collision analysis device for a protective block cipher provided in an embodiment of the present invention. Figure 6 As shown, this device includes: The acquisition module 61 is used to control the i-th byte of the plaintext input to the cryptographic device to be fixed, and to acquire multiple pieces of side channel information generated during the operation of the cryptographic device; the cryptographic device uses a protective block cipher.

[0055] The partitioning module 62 is used to divide the region in the side channel information where secret information-related operations are performed into multiple side information segments for each side channel information. Each side information segment corresponds one-to-one with a byte of plaintext, and the side information segment corresponds to the calculation process of its corresponding byte.

[0056] Training module 63 is used to combine the side information fragment corresponding to the i-th byte with the side information fragment corresponding to the j-th byte of plaintext to form training data, and to train a machine learning model using the plaintext value of the j-th byte as the label.

[0057] The inference module 64 is used to concatenate the side information fragments corresponding to the i-th byte of multiple side channel information with the side information fragments corresponding to the z-th byte for each z-th byte of the plaintext to form multiple input data. Using a machine learning model, it obtains the first predicted probability of each second candidate value corresponding to each input data. Based on a preset cryptographic relationship, it determines the target candidate key difference between the j-th byte and the z-th byte according to the second candidate value, the first predicted probability and the plaintext value of the z-th byte. The z-th byte is the other bytes of the plaintext except for the i-th byte and the j-th byte.

[0058] Recovery module 65 is used to determine each candidate key combination based on the difference between each first candidate value of the i-th byte and the j-th byte and the target candidate key, and to perform correct key combination analysis on the candidate key combination using at least one set of known plaintext-ciphertext pairs.

[0059] Optional, inference module 64, which can be used for: For each piece of input data, each second candidate value corresponding to the input data is XORed with the plaintext value of the z-th byte to obtain the candidate key difference corresponding to each second candidate value. The candidate key difference is the candidate key difference between the j-th byte and the z-th byte. The first prediction probability corresponding to the second candidate value is assigned to the candidate key difference corresponding to the second candidate value to obtain the second prediction probability of the candidate key difference. The second prediction probability of each candidate key difference corresponding to all input data is accumulated and statistically analyzed, and the candidate key difference with the largest cumulative probability is determined as the target candidate key difference.

[0060] Optionally, the cryptographic device is a block cipher device with protection implementation.

[0061] Optionally, the machine learning model is a neural network model.

[0062] Optionally, the neural network model includes a feature extraction module, a first fully connected layer, a first activation layer, a bilinear vector layer, a second fully connected layer, a second activation layer, and a third fully connected layer connected in sequence. The feature extraction module includes a convolutional layer, a third activation layer, a batch normalization layer, an average pooling layer, and a flattening layer.

[0063] Optional, the acquisition module 61 can be used for: The i-th byte of the plaintext input to the cryptographic device is fixed, while the other bytes of the plaintext, excluding the i-th byte, are randomized to generate a target number of plaintext data sets. Collect side-channel information generated by cryptographic devices when executing each set of plaintext data.

[0064] Optional, recovery module 65, specifically can be used for: From at least one known plaintext-ciphertext pair, select the first plaintext-ciphertext pair; Using the first plaintext-ciphertext pair, perform correct key combination analysis on the candidate key combinations to obtain the target key combination; Verify the target key combination using the remaining plaintext-ciphertext pair; If the verification passes, the target key combination is determined to be the correct key combination; If the verification fails, the preset alarm action will be executed.

[0065] It is understood that the same or similar parts in the above embodiments can be referred to each other, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.

[0066] It should be noted that in the description of this invention, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this invention, unless otherwise stated, "a plurality of" means at least two.

[0067] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.

[0068] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0069] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0070] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0071] The storage media mentioned above can be read-only memory, disk, or optical disk, etc.

[0072] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0073] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A deep learning-based side-channel collision analysis method for a protective block cipher, characterized in that, include: The i-th byte of the plaintext input to the cryptographic device is fixed, and multiple pieces of side-channel information generated during the operation of the cryptographic device are collected. The cryptographic device uses a protective block cipher. For each piece of side channel information, the region in the side channel information where secret information-related operations are performed is divided into multiple side information segments. Each side information segment corresponds one-to-one with a byte of the plaintext, and each side information segment corresponds to the calculation process of its corresponding byte. The side information fragment corresponding to the i-th byte is combined with the side information fragment corresponding to the j-th byte of the plaintext to form training data. Then, using the plaintext value of the j-th byte as the label, a machine learning model is trained using the training data. For each z-th byte of the plaintext, the side information fragments corresponding to the i-th byte of the multiple side channel information are concatenated with the side information fragments corresponding to the z-th byte to form multiple input data. Using the machine learning model, the first predicted probability of each second candidate value corresponding to each input data is obtained. Based on a preset cryptographic relationship, according to the second candidate value, the first predicted probability, and the plaintext value of the z-th byte, the target candidate key difference between the j-th byte and the z-th byte is determined; the z-th byte is any byte of the plaintext other than the i-th byte and the j-th byte. Based on the first candidate values ​​of the i-th and j-th bytes and the difference between the target candidate key, each candidate key combination is determined, and correct key combination analysis is performed on the candidate key combinations using at least one set of known plaintext-ciphertext pairs.

2. The deep learning side-channel collision analysis method for protective block ciphers according to claim 1, characterized in that, Based on a preset cryptographic relationship, the target candidate key difference between the j-th byte and the z-th byte is determined according to the second candidate value, the first predicted probability, and the plaintext value of the z-th byte, specifically including: For each piece of input data, the second candidate value corresponding to the input data is XORed with the plaintext value of the z-th byte to obtain the candidate key difference corresponding to each second candidate value. The candidate key difference is the candidate key difference between the j-th byte and the z-th byte. The first prediction probability corresponding to the second candidate value is assigned to the candidate key difference corresponding to the second candidate value to obtain the second prediction probability of the candidate key difference. The second predicted probabilities of each candidate key difference corresponding to all the input data are accumulated and statistically analyzed, and the candidate key difference with the largest accumulated probability is determined as the target candidate key difference.

3. The deep learning side-channel collision analysis method for protective block ciphers according to claim 1, characterized in that, The cryptographic device is a block cipher device with protection implemented.

4. The deep learning side-channel collision analysis method for protective block ciphers according to claim 1, characterized in that, The machine learning model is a neural network model.

5. The deep learning side-channel collision analysis method for protective block ciphers according to claim 4, characterized in that, The neural network model includes a feature extraction module, a first fully connected layer, a first activation layer, a bilinear vector layer, a second fully connected layer, a second activation layer, and a third fully connected layer connected in sequence. The feature extraction module includes a convolutional layer, a third activation layer, a batch normalization layer, an average pooling layer, and a flattening layer.

6. The deep learning side-channel collision analysis method for protective block ciphers according to claim 1, characterized in that, The i-th byte of the plaintext input to the cryptographic device is fixed, and multiple pieces of side-channel information generated during the operation of the cryptographic device are collected, specifically including: The i-th byte of the plaintext input to the cryptographic device is fixed, while the other bytes of the plaintext, excluding the i-th byte, are randomized to generate a target number of plaintext data sets. The side-channel information generated by the cryptographic device when executing each group of plaintext data is collected.

7. The deep learning side-channel collision analysis method for protective block ciphers according to claim 1, characterized in that, Using at least one known plaintext-ciphertext pair, perform correct key combination analysis on the candidate key combinations, specifically including: From the at least one set of known plaintext-ciphertext pairs, select the first plaintext-ciphertext pair; Using the first plaintext-ciphertext pair, perform correct key combination analysis on the candidate key combinations to obtain the target key combination; The target key combination is verified using the remaining plaintext-ciphertext pair; If the verification passes, the target key combination is determined to be the correct key combination; If the verification fails, the preset alarm action will be executed.

8. A deep learning side-channel collision analysis device for a protective block cipher, characterized in that, include: The acquisition module is used to control the i-th byte of the plaintext input to the cryptographic device to be fixed, and to acquire multiple pieces of side channel information generated by the cryptographic device during operation; The cryptographic device uses a protective block cipher. The partitioning module is used to divide the region in the side channel information where secret information-related operations are performed into multiple side information segments for each side channel information segment. Each side information segment corresponds one-to-one with a byte of the plaintext, and each side information segment corresponds to the calculation process of its corresponding byte. The training module is used to combine the side information fragment corresponding to the i-th byte with the side information fragment corresponding to the j-th byte of the plaintext to form training data, and to train a machine learning model using the plaintext value of the j-th byte as the label. The inference module is used to concatenate the side information fragments corresponding to the i-th byte of the multiple side channel information with the side information fragments corresponding to the z-th byte for each z-th byte of the plaintext to form multiple input data. Using the machine learning model, it obtains the first predicted probability of each second candidate value corresponding to the j-th byte for each input data. Based on a preset cryptographic relationship, and according to the second candidate value, the first predicted probability, and the plaintext value of the z-th byte, it determines the target candidate key difference between the j-th byte and the z-th byte; the z-th byte is any byte of the plaintext other than the i-th byte and the j-th byte. The recovery module is used to determine each candidate key combination based on the difference between the first candidate values ​​of the i-th byte and the j-th byte and the target candidate key, and to perform correct key combination analysis on the candidate key combinations using at least one set of known plaintext-ciphertext pairs.