A method, device and computer for detecting hardware Trojans through a side channel

By collecting the energy trace data of the chip and calculating the difference results using the generator and discriminator, the hardware Trojan instructions are quickly identified, which solves the problem of difficult to quickly identify hardware Trojans in the prior art, and achieves higher detection accuracy and applicability.

CN114021126BActive Publication Date: 2025-06-06BEIJING MATHMAGIC TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111367036.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-18
Publication Date
2025-06-06
Estimated Expiration
2041-11-18

AI Technical Summary

Technical Problem

The prior art is difficult to quickly identify hardware Trojan instructions through the features of the side channel, making it difficult for hardware Trojans to be discovered.

Method used

By collecting the energy trace data of the chip to be tested, inputting the pre-trained generator to obtain the reconstructed energy trace data, and computing the difference between the reconstruction data and the original data. If the difference result exceeds the preset abnormal score threshold, it is determined that the chip contains a hardware Trojan.

Benefits of technology

This method can better adapt to situations where there are few effective instructions and the energy trace characteristics cannot be predicted, reduce the impact of wrong selection parameters, improve detection accuracy, and classify abnormalities to a certain extent to analyze the internal similarity of instructions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114021126B_ABST
    Figure CN114021126B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of network security side channel analysis, and specifically relates to a method, device and computer for detecting hardware Trojans through an artificial intelligence side channel, including: collecting energy trace data corresponding to a chip to be tested; inputting the energy trace data corresponding to the chip to be tested into a pre-trained generator to obtain reconstructed energy trace data; calculating the difference between the reconstructed energy trace data and the energy trace data corresponding to the chip to be tested, and if the difference exceeds a preset anomaly score threshold, it is determined that the chip to be tested contains a hardware Trojan. The present application can better adapt to situations where there are fewer valid instructions and the characteristics of the energy trace cannot be predicted, and reduce the impact of incorrectly selected parameters; it can better avoid the misjudgment of adjacent energy traces by a single abnormal energy trace. The present application is easy to implement, and the present application performs anomaly determination based on anomaly scores, which can classify anomalies to a certain extent, and then analyze the inherent similarity of instructions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of network security side channel analysis, and specifically relates to a method, device and computer for detecting hardware Trojans through an artificial intelligence side channel. Background Art

[0002] The GM / T 0008-2012 Security Chip Password Detection Guidelines stipulate that the physical interfaces and logical interfaces supported by security chips must not contain implicit channels. The so-called implicit channel refers to a transmission channel that can be used to transmit keys and sensitive information in a way that violates security requirements. In a security chip, the instructions sent from outside the chip to the chip and the chip's response to the instructions constitute a typical transmission channel. Chip manufacturers are fully capable of using this transmission channel to transmit keys or sensitive information. If the implicit channel in the chip is used for malicious attacks, it can be called a hardware Trojan. This attack will bring huge security risks to chip users and even threaten national security.

[0003] In 2012, researchers at Cambridge University discovered that Actel's military FPGA chip ProASIC3 contained a hardware Trojan based on an implicit channel. The manufacturer could use this channel to send specific instructions to the chip, extract all FPGA configuration data downloaded from the chip, modify algorithm keys and authentication keys, or permanently destroy the chip. All signs indicate that hardware Trojans are inextricably linked to APT (Advanced Persistent Threat) attacks. At present, some detection agencies at home and abroad have begun to pay close attention to the relevant technologies for hardware Trojan detection, but due to the characteristics of hardware Trojans such as small area, short code, short execution time, low power consumption, and hidden design, hardware Trojans are difficult to detect in most cases.

[0004] The activation of hardware Trojans generally uses channels such as instruction activation and physical channel activation, and the activation method is very covert; common means of detecting hardware Trojans include side channel analysis, layout comparison, feature comparison and other methods.

[0005] The detection agency can use this tool to perform traversal detection on the instruction space of the cryptographic chip to obtain a list of valid instructions that control the chip. Among these valid instructions, some should be user instructions defined in the manual, and the other part is some hidden instructions reserved by the manufacturer when the chip leaves the factory. Some of these hidden instructions may be debugging instructions used by programmers to verify chip functions, while the rest may be backdoor instructions used to execute hardware Trojans.

[0006] After the testing agency removes the user instructions from the list of valid instructions detected, it can ask the chip manufacturer to reasonably explain the hidden instructions in its chip and give a functional description of the hidden instructions one by one; then, the testing agency can predict the energy waveform characteristics that will be generated by the function and compare it with its actual energy waveform to verify the authenticity of the function claimed by the manufacturer, so as to evaluate whether the instruction is a backdoor instruction containing a hardware Trojan. In the case of uncertainty about security, the testing agency can also directly ask the manufacturer to delete all hidden instructions including debugging instructions. In the above detection process, the most critical and difficult link is to quickly identify hardware Trojan instructions through the characteristics of the side channel. Summary of the invention

[0007] In order to solve the problem in the prior art that it is difficult to quickly identify hardware Trojan instructions through side channel features, the embodiment of the present invention provides the following technical solutions:

[0008] In a first aspect, the present application provides a method for side channel detection of hardware Trojans, comprising:

[0009] Collect energy trace data corresponding to the chip to be tested;

[0010] Inputting the energy trace data corresponding to the chip to be tested into a pre-trained generator to obtain reconstructed energy trace data;

[0011] The difference result between the reconstructed energy trace data and the energy trace data corresponding to the chip to be tested is calculated, and if the difference result exceeds a preset abnormal score threshold, it is determined that the chip to be tested contains a hardware Trojan.

[0012] Furthermore, the process of obtaining the pre-trained generator includes:

[0013] Acquire the instructions to be tested and the empty instructions with no obvious side channel features, and obtain the instruction set and the empty instruction set;

[0014] Sending the empty instruction set to the chip according to a preset sending method, collecting the energy trace of the chip, and obtaining a training set;

[0015] Input the noise that follows Gaussian distribution into the generator to obtain a pseudo energy trace data set;

[0016] Inputting the false energy trace data set and the training set into a discriminator to obtain a discrimination result;

[0017] If the discrimination result is equal to a preset threshold or the number of iterations reaches a preset maximum number of iterations, the pre-trained generator is obtained.

[0018] Further, calculating the difference between the reconstructed energy trace data and the energy trace data corresponding to the chip to be tested, and if the difference exceeds a preset abnormal score threshold, determining that the chip to be tested contains a hardware Trojan, including:

[0019] Calculate the loss function of the reconstructed energy trace data and the energy trace data corresponding to the chip to be tested;

[0020] The discriminator is used to calculate the loss function of the reconstructed energy trace data and the energy trace data corresponding to the chip to be tested at the feature level of the discriminator middle layer to obtain a difference result. If the difference result exceeds a preset abnormal score threshold, it is determined that the chip to be tested contains a hardware Trojan.

[0021] Furthermore, the process of obtaining the discriminator includes:

[0022] The loss function of the pseudo energy data set and the energy trace data corresponding to the chip to be tested is calculated to obtain the discriminator.

[0023] Furthermore, the instructions to be tested and the empty instructions with no obvious side channel characteristics are obtained to obtain the instruction set and the empty instruction set, including:

[0024] Instructions are traversed on the designated bytes based on single bytes, and energy traces corresponding to the designated bytes are analyzed to obtain the empty instruction set.

[0025] Further, the collecting of energy trace data corresponding to the chip to be tested includes:

[0026] Sending a preset instruction to the chip to be tested;

[0027] The energy trace data corresponding to the chip to be tested is collected according to the preset instruction.

[0028] Furthermore, the energy trace data corresponding to the chip to be tested is input into a pre-trained generator to obtain reconstructed energy trace data, and further includes:

[0029] The noise obeying the Gaussian distribution and the energy trace data corresponding to the chip to be tested are input into the pre-trained generator to obtain the reconstructed energy trace data.

[0030] In a second aspect, the present application provides a device for side channel detection of hardware Trojans, comprising:

[0031] An acquisition module, used to acquire energy trace data corresponding to the chip to be tested;

[0032] A module for generating reconstructed energy trace data is used to input the energy trace data corresponding to the chip to be tested into a pre-trained generator to obtain reconstructed energy trace data;

[0033] The calculation module calculates the difference between the reconstructed energy trace data and the energy trace data corresponding to the chip to be tested, and if the difference exceeds a preset abnormal score threshold, it is determined that the chip to be tested contains a hardware Trojan.

[0034] In a third aspect, the present application provides a computer, comprising:

[0035] a memory having an executable program stored therein;

[0036] A processor is used to execute the executable program in the memory to implement the steps of any one of the above methods.

[0037] The present invention has the following beneficial effects:

[0038] A method, device and computer for side channel detection of hardware Trojans provided by an embodiment of the present invention include: collecting energy trace data corresponding to a chip to be tested; inputting the energy trace data corresponding to the chip to be tested into a pre-trained generator to obtain reconstructed energy trace data; calculating the difference between the reconstructed energy trace data and the energy trace data corresponding to the chip to be tested, and if the difference exceeds a preset anomaly score threshold, it is determined that the chip to be tested contains a hardware Trojan. Compared with traditional anomaly detection and unsupervised learning methods, the present application can better adapt to situations where there are fewer valid instructions and the characteristics of energy traces cannot be predicted, and reduce the impact of incorrect parameter selection; compared with local-based anomaly judgment methods, the present application can better avoid the misjudgment of adjacent energy traces by a single abnormal energy trace. The present application is easy to implement, and the present application performs anomaly judgment based on anomaly scores, which can classify anomalies to a certain extent, and then analyze the inherent similarity of instructions. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0040] Figure 1 It is a flow chart of a method for detecting hardware Trojans through a side channel in one embodiment of the present invention.

[0041] Figure 2 It is a schematic diagram of the side channel detection principle for instruction-activated hardware Trojans in one embodiment of the present invention.

[0042] Figure 3This is a flowchart of the acquisition process of a pre-trained generator provided by an embodiment of the present application.

[0043] Figure 4 It is a classification diagram of chip external control instructions in another embodiment of the present invention.

[0044] Figure 5 It is an overlay diagram of energy traces of a null instruction set in one embodiment of the present invention.

[0045] Figure 6 It is an overlay diagram of the energy trace of the smart card traversal instruction in one embodiment of the present invention.

[0046] Figure 7 This is a normal true energy trace diagram in one embodiment of the present invention.

[0047] Figure 8 is a true energy trace diagram of an anomaly in one embodiment of the present invention.

[0048] Fig. 9 FIG. 4 is another abnormal true energy trace diagram in one embodiment of the present invention.

[0049] Fig.10 It is a pseudo energy trace diagram generated by a generator in one embodiment of the present invention.

[0050] Fig.11 The figure is a schematic diagram of anomaly score calculation results in one embodiment of the present invention.

[0051] Fig.12 It is a structural diagram of a device for detecting hardware Trojans through a side channel provided by an embodiment of the present invention.

[0052] Fig.13 It is a schematic diagram of a computer structure provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0053] To make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.

[0054] See also Figure 1 , Figure 1 A flow chart of a method for detecting hardware Trojans through a side channel provided by an embodiment of the present application is as follows: Figure 1 As shown, the method comprises the following steps:

[0055] Step 101, collecting energy trace data corresponding to the chip to be tested;

[0056] It should be noted that, specifically, Figure 2 As shown, Figure 2 This is a side channel detection schematic for instruction-activated hardware Trojans. According to the side channel analysis principle, an integrated circuit test platform is built to make the integrated circuit work normally under the same test environment (i.e., the temperature, humidity, test equipment and other conditions are the same). The test instructions are input to the chip under test through the computer, and the computer receives the reply from the chip under test. Then, an oscilloscope is used in the working state to collect the side channel energy trace data of the sending and reply time period.

[0057] Step 102: input the energy trace data corresponding to the chip to be tested into a pre-trained generator to obtain reconstructed energy trace data;

[0058] Step 103 : calculating a difference result between the reconstructed energy trace data and the energy trace data corresponding to the chip to be tested. If the difference result exceeds a preset abnormal score threshold, it is determined that the chip to be tested contains a hardware Trojan.

[0059] A method, device and computer for side channel detection of hardware Trojans provided by an embodiment of the present invention include: collecting energy trace data corresponding to a chip to be tested; inputting the energy trace data corresponding to the chip to be tested into a pre-trained generator to obtain reconstructed energy trace data; calculating the difference between the reconstructed energy trace data and the energy trace data corresponding to the chip to be tested, and if the difference exceeds a preset anomaly score threshold, it is determined that the chip to be tested contains a hardware Trojan. . Compared with traditional anomaly detection and unsupervised learning methods, the present application can better adapt to situations where there are fewer valid instructions and the characteristics of energy traces cannot be predicted, and reduce the impact of incorrect parameter selection; compared with local-based anomaly judgment methods, the present application can better avoid the misjudgment of adjacent energy traces by a single abnormal energy trace. The present application is easy to implement, and the present application performs anomaly judgment based on anomaly scores, which can classify anomalies to a certain extent, and then analyze the inherent similarity of instructions.

[0060] For some examples, see Figure 3 , Figure 3 This is a flowchart of a process of obtaining a pre-trained generator provided by an embodiment of the present application, including:

[0061] Step 301, obtaining the instruction to be tested and the empty instruction with no obvious side channel characteristics, and obtaining the instruction set and the empty instruction set;

[0062] It should be noted that a contact smart card that complies with the ISO7816 specification is used as an example to analyze the valid instructions in the smart card. The application protocol data unit of the communication protocol ISO7816 specification is defined as follows in Table 1:

[0063] Table 1 Definition of application protocol data unit in ISO7816 communication protocol

[0064]

[0065]

[0066] According to the above instruction definition, the first five bytes of the instruction are the effective bytes of the instruction. Figure 4 , Figure 4 This is a classification diagram of chip external control instructions.

[0067] Step 302: Send the empty instruction set to the chip according to a preset sending method, collect the energy trace of the chip, and obtain a training set;

[0068] See also Figure 5 , Figure 5 It is an overlay diagram of energy traces of an empty instruction set in an embodiment of the present invention.

[0069] Step 303: inputting the noise that obeys the Gaussian distribution into the generator to obtain a pseudo energy trace data set;

[0070] In one embodiment, the generator G forward propagates to generate pseudo energy traces.

[0071] Step 304: input the false energy trace data set and the training set into a discriminator to obtain a discrimination result;

[0072] Step 305: If the discrimination result is equal to the preset threshold or the number of iterations reaches the preset maximum number of iterations, the pre-trained generator is obtained.

[0073] In some embodiments, the discrimination result is a decimal between 0 and 1, and the preset threshold is generally set to 0.5. When the discrimination result is 0.5, it can be understood that the fake data generated by the generator can be mistaken for real data. Thus, the network training is completed and the generator is obtained.

[0074] In some embodiments, the pre-trained generator can generate a new data set based on the noise and the energy trace data corresponding to the chip to be tested. If the energy trace data corresponding to the chip to be tested is a normal energy trace, the new data set will be highly consistent with the energy trace data corresponding to the chip to be tested; otherwise, the energy trace data corresponding to the chip to be tested is an abnormal energy trace corresponding to a valid instruction, and the new data set is close to the normal energy trace. This difference will reflect the abnormality of the energy trace. Figure 7 As shown in the figure, it is the normal real energy trace diagram in this embodiment, and the abnormal real energy trace is as follows Figure 8 and Fig. 9 As shown, Fig.10 As shown, Fig.10This is a pseudo energy trace diagram generated by the generator. It can be seen that the generated pseudo energy trace is very close to the real energy trace.

[0075] In one embodiment, calculating the difference between the reconstructed energy trace data and the energy trace data corresponding to the chip to be tested to obtain an abnormal score result includes:

[0076] Calculate the loss function of the reconstructed energy trace data and the energy trace data corresponding to the chip to be tested;

[0077] The discriminator is used to calculate the loss function of the reconstructed energy trace data and the energy trace data corresponding to the chip to be tested at the feature level of the discriminator middle layer to obtain an abnormal score result. Fig.11 As shown, Fig.11 Schematic diagram of the calculation result of the abnormality score in the embodiment of the method of the present invention.

[0078] In one embodiment, the process of obtaining the discriminator includes:

[0079] The loss function of the pseudo energy data set and the energy trace data corresponding to the chip to be tested is calculated to obtain the discriminator.

[0080] Among them, the generator forward propagates to generate a false energy trace, and the generator's output and training set are passed into the discriminator. The generator and the discriminator form a game until the maximum number of iterations is reached or the false data generated by the generator can be mistaken for the real thing, thus completing the generator's network training.

[0081] The discriminator accepts the fake data generated by the generator and tries to distinguish it. The generator continuously generates fake data that is closer to the real energy trace to confuse the discriminator. The two continue to compete until the discriminator can hardly distinguish the data generated by the generator.

[0082] It can also be understood that the generator and the discriminator update each other, and finally obtain a trained generator and a trained discriminator.

[0083] This method enables the generator to correct abnormal energy traces and determine abnormal scores through training, thereby achieving the purpose of anomaly detection. Before the training begins, the network structure and optimization method of the generator and the discriminator are first determined, and the network parameters and the maximum number of iterations are initialized. The generator forward propagates to generate false energy traces, and the output of the generator and the training set are passed to the discriminator. The generator and the discriminator form a game until the maximum number of iterations is reached or the false data generated by the generator can be mistaken for the real data, and the network training is completed.

[0084] Specifically, the following steps are also included:

[0085] Step 401: Train the discriminator with real normal energy traces, so that it has a certain ability to distinguish normal energy traces from abnormal energy traces.

[0086] Step 402: Train the generator, starting from a noise that follows a Gaussian distribution, and generate a set of fake data that is expected to deceive the discriminator through network forward propagation.

[0087] In some embodiments, the energy trace data corresponding to the chip to be tested is input into a pre-trained generator to obtain reconstructed energy trace data, further comprising:

[0088] The noise obeying the Gaussian distribution and the energy trace data corresponding to the chip to be tested are input into the pre-trained generator to obtain the reconstructed energy trace data.

[0089] Step 403: The discriminator accepts the false data generated by the generator and tries to distinguish it. The generator continuously generates false data that is closer to the real energy trace to confuse the discriminator. The two continue to compete until the discriminator has difficulty distinguishing the data generated by the generator.

[0090] In one embodiment, the instructions to be tested and the empty instructions with no obvious side channel characteristics are obtained to obtain the instruction set and the empty instruction set, including:

[0091] Instructions are traversed on the designated bytes based on single bytes, and energy traces corresponding to the designated bytes are analyzed to obtain the empty instruction set.

[0092] Taking a contact smart card that complies with ISO7816 standard as an example, the valid instructions in the smart card are analyzed.

[0093] According to the above instruction definition, the first five bytes of the instruction are the valid bytes of the instruction. The traditional solution needs to traverse them, and the corresponding time complexity is o(256 n ). This method performs valid instruction detection for a single byte. First, it scans the 256 cases corresponding to the first byte CLA and analyzes its energy trace to find the valid instruction of the byte, and then traverses the next byte, thus completing the time complexity of o(256 n )-oriented single-byte valid instruction detection method.

[0094] In one embodiment, collecting energy trace data corresponding to the chip to be tested includes:

[0095] Sending a preset instruction to the chip to be tested;

[0096] The energy trace data corresponding to the chip to be tested is collected according to the preset instruction.

[0097] Based on the method for detecting hardware Trojans through a side channel disclosed in the above embodiment of the present invention, Fig.11 It is a structural diagram of a device for detecting hardware Trojans through a side channel provided by an embodiment of the present invention.

[0098] like Fig.12 As shown, the device comprises:

[0099] The acquisition module 121 is used to acquire energy trace data corresponding to the chip to be tested;

[0100] A module 122 for generating reconstructed energy trace data is used to input the energy trace data corresponding to the chip to be tested into a pre-trained generator to obtain reconstructed energy trace data;

[0101] The calculation module 123 calculates the difference between the reconstructed energy trace data and the energy trace data corresponding to the chip to be tested. If the difference exceeds a preset abnormal score threshold, it is determined that the chip to be tested contains a hardware Trojan.

[0102] The specific working processes of the acquisition module 121, the module 122 for generating reconstructed energy trace data, the calculation module 123, the comparison module 124 and the determination module 125 in the device for detecting hardware Trojans through the side channel disclosed in the above-mentioned present invention can be referred to the corresponding contents in the method for detecting hardware Trojans through the side channel disclosed in the above-mentioned embodiment of the present invention, and will not be described in detail here.

[0103] In summary, the present application provides a device for detecting hardware Trojans through a side channel, wherein the energy trace data corresponding to the chip to be tested is collected through an acquisition module; the energy trace data corresponding to the chip to be tested is input into a pre-trained generator through a module for generating reconstructed energy trace data to obtain reconstructed energy trace data; the difference between the reconstructed energy trace data and the energy trace data corresponding to the chip to be tested is calculated through a calculation module to obtain an abnormal score result; the abnormal score result is compared with a preset abnormal score threshold through a comparison module to obtain a comparison result; if the comparison result is that the abnormal score result exceeds the preset abnormal score threshold through a determination module, it is determined that the chip to be tested contains a hardware Trojan. The present application is based on detecting hardware Trojans through a side channel, and can better adapt to situations where there are fewer valid instructions and the characteristics of the energy trace cannot be predicted, reducing the impact of incorrectly selected parameters; improving detection accuracy, and the present application can complete hardware Trojan detection without the need for a standard integrated circuit, greatly improving the scope of application of the detection method.

[0104] Based on a computer disclosed in the above embodiment of the present invention, Fig.12 It is a computer structure diagram provided by an embodiment of the present invention.

[0105] like Fig.13 As shown, it includes: a memory 131 on which an executable program is stored;

[0106] The processor 132 is used to execute the executable program in the memory 131 to implement the steps of any of the above methods.

[0107] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.

[0108] It should be noted that, in the description of this application, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, the meaning of "plurality" refers to at least two.

[0109] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0110] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0111] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0112] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0113] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0114] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0115] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A method for side-channel detection of hardware Trojans, It is characterized in that include: Collect energy trace data corresponding to the chip to be tested; Inputting the energy trace data corresponding to the chip to be tested into a pre-trained generator to obtain reconstructed energy trace data; Calculating the difference between the reconstructed energy trace data and the energy trace data corresponding to the chip to be tested, and if the difference exceeds a preset abnormal score threshold, determining that the chip to be tested contains a hardware Trojan, including: calculating a loss function between the reconstructed energy trace data and the energy trace data corresponding to the chip to be tested; The discriminator is used to calculate the loss function of the reconstructed energy trace data and the energy trace data corresponding to the chip to be tested at the feature level of the discriminator middle layer to obtain a difference result. If the difference result exceeds a preset abnormal score threshold, it is determined that the chip to be tested contains a hardware Trojan.

2. The method according to claim 1, It is characterized in that The process of obtaining the pre-trained generator includes: Get the instructions to be tested and the empty instructions with no obvious side channel features, and obtain the instruction set and the empty instruction set; Sending the empty instruction set to the chip according to a preset sending method, collecting the energy trace of the chip, and obtaining a training set; The noise that follows Gaussian distribution is input into the generator to obtain a pseudo energy trace data set; Inputting the false energy trace data set and the training set into a discriminator to obtain a discrimination result; If the discrimination result is equal to a preset threshold or the number of iterations reaches a preset maximum number of iterations, the pre-trained generator is obtained.

3. The method according to claim 1, It is characterized in that The process of obtaining the discriminator includes: The loss function of the pseudo energy data set and the energy trace data corresponding to the chip to be tested is calculated to obtain the discriminator.

4. The method according to claim 2, It is characterized in that Get the instructions to be tested and the empty instructions with no obvious side channel features, and get the instruction set and the empty instruction set, including: Instructions are traversed on the designated bytes based on single bytes, and energy traces corresponding to the designated bytes are analyzed to obtain the empty instruction set.

5. The method according to claim 1, It is characterized in that The collecting of energy trace data corresponding to the chip to be tested includes: Sending a preset instruction to the chip to be tested; The energy trace data corresponding to the chip to be tested is collected according to the preset instruction.

6. The method according to claim 1, It is characterized in that Inputting the energy trace data corresponding to the chip to be tested into a pre-trained generator to obtain reconstructed energy trace data, further comprising: The noise obeying the Gaussian distribution and the energy trace data corresponding to the chip to be tested are input into the pre-trained generator to obtain the reconstructed energy trace data.

7. A device for detecting hardware Trojans via a side channel. It is characterized in that include: An acquisition module, used to acquire energy trace data corresponding to the chip to be tested; A module for generating reconstructed energy trace data is used to input the energy trace data corresponding to the chip to be tested into a pre-trained generator to obtain reconstructed energy trace data; A calculation module is used to calculate the difference between the reconstructed energy trace data and the energy trace data corresponding to the chip to be tested. If the difference exceeds a preset abnormality score threshold, it is determined that the chip to be tested contains a hardware Trojan. The calculation module is specifically used to calculate the loss function of the reconstructed energy trace data and the energy trace data corresponding to the chip to be tested. The discriminator is used to calculate the loss function of the reconstructed energy trace data and the energy trace data corresponding to the chip to be tested at the feature level of the discriminator middle layer to obtain the difference. If the difference exceeds a preset abnormality score threshold, it is determined that the chip to be tested contains a hardware Trojan.

8. A computer, It is characterized in that include: a memory having an executable program stored therein; A processor, configured to execute the executable program in the memory to implement the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Hardware Trojan horse detection method and device, and storage medium

    CN112464297A