A hardware trojan side channel detection method based on an autoencoder
By automatically extracting key features of side-channel information through an autoencoder, the problem of insufficient automation and accuracy in hardware Trojan detection is solved, and efficient detection under unsupervised learning is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING INST OF TECH
- Filing Date
- 2022-05-29
- Publication Date
- 2026-07-03
AI Technical Summary
Existing hardware Trojan detection technologies suffer from high detection difficulty, low automation, and insufficient accuracy, especially in unsupervised learning scenarios where it is difficult to effectively extract key features of side-channel information.
A hardware Trojan side-channel detection method based on autoencoder is adopted. The key features of side-channel information are automatically extracted by autoencoder, and normal data is trained by encoder and decoder to achieve unsupervised learning. Anomalies are determined by loss function.
It improves the automation and accuracy of hardware Trojan side-channel detection, adapts to different data distributions, requires less computation, and produces intuitive and easy-to-implement results.
Smart Images

Figure CN115168843B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a hardware Trojan side-channel detection method based on an autoencoder, belonging to the field of network security side-channel analysis technology, specifically relating to an artificial intelligence hardware Trojan side-channel detection method based on an autoencoder. Background Technology
[0002] A hardware trojan horse is a special module intentionally implanted in a chip or electronic system, or a defective module unintentionally left by the designer. This module lies dormant within the original circuit, causing it to behave abnormally when the circuit operates under certain values or conditions. This malicious circuit can purposefully modify the original circuit, such as leaking information to attackers, altering circuit functionality, or even directly damaging the circuit.
[0003] The GM / T 0008-2012 standard for cryptographic testing of security chips stipulates that the physical and logical interfaces supported by security chips must not contain implicit channels. If such implicit channels are used for malicious attacks, such as transmitting keys or other sensitive information in violation of security requirements, they can be considered hardware Trojans. Hardware Trojans are diverse in type and function, and their implantation methods vary, involving multiple layers and posing extremely high detection challenges. The existence of hardware Trojans can bring significant security risks to chip users and even threaten national security.
[0004] Over the past few years, hardware Trojan detection technology has developed rapidly. Failure analysis-based methods compare reverse engineering results with the original design; however, this method is time-consuming and labor-intensive, and ineffective for highly integrated and complex chips. Logic testing-based methods require generating test stimuli to maximize the probability of activating potential hardware Trojans, but exhaustive testing is very time-consuming and test vector generation can be extremely complex. Side-channel information-based methods are currently widely used, analyzing circuit operation based on timing, energy, and electromagnetic side-channel information.
[0005] In general, determining whether a chip contains a hardware Trojan is very difficult. Hardware Trojan detection based on artificial intelligence algorithms is mainly divided into supervised learning and unsupervised learning. Supervised learning requires the detector to be able to determine whether a hardware Trojan exists in a part of the chip, which is quite difficult in real-world scenarios. Unsupervised learning commonly uses algorithms such as clustering, isolated forests, and local anomaly factors. These algorithms are adapted to different data distributions and may have parameters that need to be manually adjusted. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of existing technologies, solve the technical problems of hardware Trojan side-channel detection, and improve the automation and accuracy of hardware Trojan side-channel detection. This invention proposes an artificial intelligence side-channel analysis method for hardware Trojans based on an autoencoder. This method does not require manual screening of key information, can automatically extract key features from side-channel information in unsupervised scenarios, has relatively low computational cost, can perform nonlinear dimensionality reduction, and has good adaptability to different data distributions.
[0007] The present invention is achieved using the following technical solution.
[0008] A hardware Trojan side-channel detection method based on an autoencoder includes the following steps:
[0009] Step 1: Send a large number of invalid commands to the chip, and at the same time collect the corresponding side information (such as energy waveform) X. This side information can be regarded as normal data and used as a training set; a large number of invalid commands means that the number of invalid commands sent is not less than the set value.
[0010] Send a traversal command to the chip and simultaneously collect the corresponding side information Y, which can be regarded as a test set for detection;
[0011] Step 2: The autoencoder consists of two parts: an encoder and a decoder. Normal data X is used as the input to the encoder to train the encoder and decoder until the output X' of the decoder has a small error compared to the input X of the encoder; a small error means that the error is less than a set threshold.
[0012] Step 3: Use the test set Y as the input to the encoder to obtain the encoder output T and the decoder output Y';
[0013] Step 4: Determine abnormal situations. The encoder output T corresponds to the characteristics of the side information. When the chip performs similar operations, the side information has similar encoding results. Calculate the decoder output y. i 'Compared with the original data y i The larger the calculated loss function value, the more significant the anomaly in the corresponding side information, and the more effective the corresponding operation command.
[0014] Beneficial effects
[0015] Compared with existing hardware Trojan side-channel analysis methods, the method of this invention has the following advantages:
[0016] 1. Compared to traditional neural networks, this method does not require abnormal data for training, and unsupervised learning is more in line with reality;
[0017] 2. Compared with traditional anomaly detection methods, this method does not require manual parameter adjustment. It completes network training through network self-supervision, has a high degree of automation, and is well adaptable to different data distributions.
[0018] 3. This invention is easy to implement, the normal data used for training is easy to collect, and the autoencoder method has a relatively small computational load, making it suitable for application in real-world scenarios.
[0019] 4. This method uses side information as input to the autoencoder and performs anomaly detection based on the encoding results obtained by the encoder. The results are intuitive and accurate. Attached Figure Description
[0020] Figure 1 This is a flowchart of the method of the present invention;
[0021] Figure 2 This is a superimposed waveform diagram of the smart card empty instruction energy in an embodiment of the method of the present invention;
[0022] Figure 3 This is a superimposed diagram of the energy waveform of the smart card traversal instruction in the embodiment of the method of the present invention;
[0023] Figure 4 This is the side information data corresponding to the normal instructions in the method embodiments of the present invention;
[0024] Figure 5 This is the side information data corresponding to the abnormal instruction in the method embodiment of the present invention;
[0025] Figure 6 It is the low-dimensional code calculated in the method embodiment of the present invention;
[0026] Figure 7 This is the result of the loss function value in the embodiment of the method of the present invention. Detailed Implementation
[0027] The method of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0028] Example
[0029] like Figures 1-7 As shown, taking a contact smart card conforming to the ISO7816 standard as an example, we analyze the valid instructions within the smart card.
[0030] like Figure 1 As shown, an AI side-channel analysis method for hardware Trojans includes the following steps:
[0031] Step 1: Send a large number of invalid instructions to the chip, and at the same time collect the corresponding side information (such as energy waveform) X. This side information can be regarded as normal data and used as the training set.
[0032] A traversal command is sent to the chip, and the corresponding side information Y is collected at the same time. This side information can be regarded as a test set for detection.
[0033] The ISO 7816 standard specifies the communication standard for smart cards, and its application protocol data unit is defined as follows:
[0034] CLA INS P1 P2 Lc Data Le Instruction categories Instruction code Parameter 1 Parameter 2 Data length data Maximum length of response
[0035] According to the definition of the application protocol data unit, the first five bytes of communication data correspond to the instruction part. Traditional solutions require traversing these five bytes, resulting in a time complexity of O(2^56). n However, considering that this chip parses instructions byte by byte, first determining the valid CLA, and then traversing the INS bytes, thereby reducing the search space of the traversal, the time complexity of this method is O(256n).
[0036] Step 1.1: Following the instruction set published by the chip manufacturer, send several no-instruction commands to the chip and collect corresponding side information, such as energy waveforms and electromagnetic waveforms. According to general chip design principles, an n-bit instruction corresponds to 256... n The vast majority of the instructions are empty instructions, so collecting information from these empty instructions is easy. This embodiment sends a large number of empty instructions to the smart card chip and collects the corresponding energy waveforms as a training set for the autoencoder, such as... Figure 2 As shown.
[0037] Step 1.2: Send the instructions to be analyzed to the chip in a traversal manner, while simultaneously acquiring the chip's energy waveform as a test set for the autoencoder, such as... Figure 3 As shown.
[0038] Step 2: The autoencoder consists of two parts: an encoder and a decoder. Normal data X is used as the input to the encoder to train both the encoder and decoder until the decoder's output X' has a small error compared to the encoder's input X.
[0039] An autoencoder, based on backpropagation and optimization methods (such as gradient descent), uses the input data itself as supervision, learns the mapping relationship through a neural network, obtains a low-dimensional encoded representation, and can reconstruct an output that is close to the original input through this encoding.
[0040] Before training begins, the neural network is first initialized, and the network structure, number of neurons, optimization method, etc. of the autoencoder are determined.
[0041] Step 3: Using the test set Y as the input to the encoder, we can obtain the encoder output T and the decoder output Y'.
[0042] Specifically, it includes the following steps:
[0043] Step 3.1: Input the test set Y into the encoder module of the autoencoder. The encoder outputs a low-dimensional code T, which is also a feature representation of the original data.
[0044] Step 3.2: Input the encoding result T into the decoder module of the autoencoder, and the decoder outputs the reconstructed data Y′.
[0045] Step 4: Determine abnormal situations. The encoder output T corresponds to the characteristics of the side information. When the chip performs similar operations, the side information should have similar encoding results. Calculate the loss function value between the decoder output Y′ and the original data Y. The larger the loss value, the more significant the abnormal situation of the corresponding side information.
[0046] Specifically, it includes the following steps:
[0047] Step 4.1: The trained autoencoder can automatically extract features from the input data and represent these features in a low-dimensional encoded form. If the input is side information corresponding to an invalid instruction, the low-dimensional encoding result should be similar to the encoding result of the training set; if the input is side information corresponding to a valid instruction, the low-dimensional encoding result should be significantly different from the encoding result of the training set.
[0048] In this embodiment, the side information data corresponding to the normal command is as follows: Figure 4 The side information data corresponding to the abnormal command is as follows: Figure 5 The corresponding low-dimensional encoding is as follows: Figure 6 As can be seen in the figure, there are significant differences between normal and abnormal data in their low-dimensional coding representations.
[0049] Step 4.2: Calculate the loss function value between the decoder output Y′ and the original data Y. A higher loss function value corresponds to a higher degree of anomaly in the original data. The loss function value is normalized. The anomaly score calculation result is illustrated in this embodiment of the method. Figure 7 .
[0050] The above description is merely a preferred embodiment of the present invention, and the present invention should not be limited to the content disclosed in this embodiment and the accompanying drawings. Any equivalent or modified embodiments made without departing from the spirit of the present invention fall within the scope of protection of the present invention.
Claims
1. A hardware Trojan side-channel detection method based on an autoencoder, wherein the autoencoder used in this method consists of two parts: an encoder and a decoder, characterized in that... The method includes the following steps: Step 1: Send a large number of invalid commands to the chip, and simultaneously collect the corresponding side information X, which serves as the training set for training; send traversal commands to the chip, and simultaneously collect the corresponding side information Y, which serves as the test set Y for detection; specifically: Step 1.1: According to the instruction set published by the chip manufacturer, send several empty instructions to the chip and collect the corresponding side information X, including energy waveform and electromagnetic waveform; Step 1.2: Send the instructions to be analyzed to the chip in a traversal manner, and at the same time collect the chip's energy waveform as the test set Y of the autoencoder; Step 2: Use the side information X from Step 1 as the input to the encoder to train the encoder and decoder until the error between the decoder's output X' and the encoder's input X is less than a set threshold. Step 3: Use the side information Y from Step 1 as the input to the encoder trained in Step 2 to obtain the encoder output T and the decoder output Y'; specifically: Step 3.1: Input the test set Y into the encoder module of the autoencoder. The encoder outputs a low-dimensional code T, which is also a feature representation of the original data. Step 3.2: Input the encoded result T into the decoder module of the autoencoder, and the decoder outputs the reconstructed data Y'; Step 4: Classify the instruction type according to the encoder output T. If the encoding result t of the side information... i and t j If the correlation coefficient is higher than the threshold, then the instructions i and j executed by the chip are considered to have similar operations; t i t j For each element in the corresponding encoder output set T, i and j are the instructions executed by the chip at this time; The validity of the instruction is determined based on the decoder's output Y', and the decoder's output y is calculated. i 'Compared with the original data y i The larger the calculated loss function value, the more significant the anomaly in the corresponding side information, and the more effective the corresponding operation command. i '、y i Let Y be the output set Y of the corresponding decoder and the elements in the original data set Y, where i is the instruction executed by the chip at this time.
2. The hardware Trojan side-channel detection method based on an autoencoder according to claim 1, characterized in that: In step 1, "a large number of invalid instructions" means that the number of invalid instructions sent is not less than a set value.