Hardware Trojan horse detection method and device based on gated recurrent neural network
Through the hardware Trojan detection method based on the gated recurrent neural network, the SCOAP algorithm is used to screen suspicious circuit nodes and generate circuit sequence features, combined with the GRU layer and fully connected layer models, to solve the problem of low hardware Trojan detection accuracy and resource consumption in the existing technology. High-efficiency and accurate hardware Trojan detection is achieved.
Patent Information
- Application Number
- CN202410787637.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-18
- Publication Date
- 2024-09-06
AI Technical Summary
Existing hardware Trojan detection methods have low detection accuracy in third-party IP cores, especially for new hardware Trojans. The complex gate-level netlist design results in high computing resource consumption and frequent false positives and false negatives.
A detection method based on gated recurrent neural networks is used to screen suspicious circuit nodes through the SCOAP algorithm, generate circuit sequence features and input them into the gated recurrent neural network model for training and detection, using the combination of node sequences in suspicious circuits as training data, combined with GRU layer and fully connected layer to implement hardware Trojan detection.
It improves the accuracy of hardware Trojan detection, reduces detection time costs, enhances detection efficiency, can better capture the characteristics of circuit node sequences, and is suitable for different types of hardware Trojan detection.
Smart Images

Figure CN118607018A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of hardware Trojan detection, and in particular to a hardware Trojan detection method and device based on a gated recurrent neural network. Background Art
[0002] In the chip design process, if the development speed is not accelerated or the cost is not reduced, it will be necessary to use hardware IP (Intellectual Property) cores provided by a third party. In the design of such hardware IP, malicious attackers may modify it to embed Trojan circuits or codes in it, including adding additional logic to the design to make it perform malicious actions under specific conditions, such as leaking sensitive information, interfering with normal functions, or providing unauthorized access to the system. Therefore, in order to ensure security and reliability, it is necessary to detect hardware Trojans in the hardware IP core.
[0003] In the prior art, hardware Trojan detection usually uses machine learning and deep learning technologies to analyze and learn hardware design data, build a neural network-based model, and train the model with a data set covering various hardware Trojans (such as the Trusthub library) to form a detection model, which is used to identify potential hardware Trojan designs. When the above traditional hardware Trojan detection method is applied to third-party IP core detection, the following problems will occur:
[0004] 1. The accuracy of detection depends on the coverage of the training data set. Data sets such as the Trust hub library cover a limited number of hardware Trojan circuit types and often cannot fully cover all possible hardware Trojan variants. The lack of sufficiently diverse training data will limit the model's ability to detect hardware Trojans, especially when facing new and unknown types of hardware Trojans. The detection effect is poor, and the detection accuracy also depends on the characteristics of specific types of hardware Trojans. It lacks the ability to generalize to other types of Trojans. Hardware Trojan designs usually tend to be highly concealed, and their characteristics may not be easily captured by traditional feature extraction methods, resulting in difficulty in accurately and effectively identifying hardware Trojan characteristics using traditional machine learning algorithms, further affecting detection accuracy.
[0005] 2. The hardware design of large-scale third-party IP core gate-level netlists is usually more complex. If the entire gate-level netlist is parsed and tested, the analysis and testing will consume a lot of computing resources and time, including processors and memory. The parsing and testing process may take a long time to complete, and traditional machine learning methods have low detection efficiency and accuracy when processing complex data. Therefore, due to the scale and complexity of the netlist, a large number of false positives and missed positives will actually be generated. Summary of the invention
[0006] The technical problem to be solved by the present invention is as follows: In view of the above-mentioned problems in the prior art, a method and device for hardware Trojan detection based on a gated recurrent neural network is provided, which has a simple implementation method, low cost, high detection efficiency and accuracy.
[0007] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0008] A hardware Trojan detection method based on a gated recurrent neural network, comprising the following steps:
[0009] Step S01. Obtaining the gate-level netlist circuit of the hardware IP core under test;
[0010] Step S02. Using the SCOAP (Sandia Controllability / Observability Analysis Program) algorithm from the obtained gate-level netlist circuit, select nodes exceeding the controllability threshold as suspicious circuit nodes;
[0011] Step S03. Taking the suspicious circuit node as the root node, multiple nodes connected to the suspicious circuit node constitute a suspicious circuit, and dividing the suspicious circuit into multiple node paths with the suspicious circuit node as the root node, encoding each node in each node path according to the logic gate type as a feature, and modeling to obtain circuit sequence features;
[0012] Step S04. Input the circuit sequence features into the gated recurrent neural network model, and use the gated recurrent neural network model to perform hardware Trojan detection on the hardware IP core under test and output the detection results. The gated recurrent neural network model is pre-trained using a combination of node sequence data in different node paths in the suspicious circuit as training data.
[0013] Further, step S02 includes:
[0014] Step S201. Node relationship conversion: converting the gate-level node connection relationship in the gate-level netlist into a non-Euclidean structure;
[0015] Step S202. Calculation of node controllability value: using the SCOAP algorithm to calculate the controllability value of each circuit node and mapping it to the non-Euclidean structure, wherein the controllability value is used to represent the minimum number of signal assignments required to set the circuit node to a logical value of 0 or 1;
[0016] Step S203. Suspicious node screening: screening out circuit nodes whose controllability values are greater than a preset threshold as suspicious circuit nodes.
[0017] Furthermore, in step S03, the type of logic gates in the gate-level netlist is used as the feature of each node, and the type of logic gates in the suspicious circuit is encoded using one-hot encoding to obtain the circuit sequence feature.
[0018] Furthermore, in step S03, multiple node paths from the root node to the tail node are divided by taking the suspicious node as the root node, and multiple node sequence combinations are obtained from each node path.
[0019] Furthermore, during the training process, the gated recurrent neural network model uses a combination of node sequence data in different paths in the suspicious circuit and labels corresponding to the sequences as training data, and the training data includes a Trojan-free data set and a Trojan-containing data set. When there is a pre-marked Trojan node in the node sequence, the sequence label is set to 1, otherwise it is set to 0. After training, a gated recurrent neural network model capable of realizing hardware Trojan detection is obtained.
[0020] Furthermore, the gated recurrent neural network model includes an input layer, a GRU layer and a fully connected layer arranged in sequence, the input layer inputs a node sequence, the GRU layer processes the node sequence input by the input layer, and determines the output of the current time step based on the gating mechanism according to the vector representation of the current node and the hidden state of the previous time step. The fully connected layer is arranged after the last time step or the entire sequence, and the fully connected layer uses the softmax function to output the final binary classification result of predicting whether a hardware Trojan exists.
[0021] A hardware Trojan detection device based on a gated recurrent neural network, comprising:
[0022] A netlist circuit acquisition module is used to obtain the gate-level netlist circuit of the hardware IP core under test;
[0023] A suspicious circuit screening module is used to screen out nodes exceeding a controllability threshold from the acquired gate-level netlist circuit as suspicious circuit nodes;
[0024] A sequence modeling module is used to take the suspicious circuit node as a root node, form a suspicious circuit with a specified number of nodes having a connection relationship with the suspicious node, and divide the suspicious circuit into a plurality of different node sequences, encode each node in each node sequence according to a logic gate type, implement circuit sequence feature modeling, and obtain circuit sequence features;
[0025] The Trojan detection module is used to input the circuit sequence features into the gated recurrent neural network model, and the gated recurrent neural network model performs hardware Trojan detection on the hardware IP core under test and outputs the detection results. The gated recurrent neural network model is pre-trained using a combination of node sequence data in different paths in the suspicious circuit as training data.
[0026] An electronic device comprises a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to execute the computer program to perform the above method.
[0027] A computer-readable storage medium storing a computer program, wherein the computer program implements the above method when executed by a processor.
[0028] Compared with the prior art, the advantages of the present invention are:
[0029] The present invention adopts the SCOAP algorithm to preliminarily screen out circuit nodes with strong concealment as suspicious circuit nodes, then generates suspicious circuits with suspicious circuit nodes as root nodes, divides the suspicious circuits into multiple node sequences, encodes each node in the node sequence according to the logic gate type as a feature, realizes circuit sequence feature modeling, and finally inputs the obtained circuit sequence features into a gated recurrent neural network model, uses the gated recurrent neural network model to learn the controllability measurement method to screen the features of the circuit node sequence, detects the hardware Trojans therein, can fully mine the features of the circuit node sequence, greatly improves the accuracy of hardware Trojan detection, and effectively reduces the detection time cost and improves the detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a schematic diagram of the implementation flow of the hardware Trojan detection method based on the gated recurrent neural network in this embodiment.
[0031] Figure 2 It is a schematic diagram of the effect of screening suspicious circuit nodes in a specific application embodiment of the present invention.
[0032] Figure 3 It is a schematic diagram of the principle of calculating the controllability value based on the SCOAP algorithm in this embodiment.
[0033] Figure 4 4 is a schematic diagram of the implementation flow of calculating the controllability value based on the SCOAP algorithm in this embodiment.
[0034] Figure 5 It is a schematic diagram of the effect of forming a suspicious circuit in a specific application embodiment of the present invention.
[0035] Figure 6 Schematic diagram of the structural principle of the gated recurrent neural network model of this embodiment. DETAILED DESCRIPTION
[0036] Considering that hardware Trojans are essentially hidden, usually difficult to trigger, and extremely small in size relative to third-party IP cores, and do not require additional input and output ports to activate internal signals, the hardware Trojan detection method based on the SCOAP algorithm can screen out nodes in the circuit that exceed the controllability threshold. However, the proportion of Trojan nodes in the screened nodes is small, and a large number of normal nodes are included, resulting in a high false alarm rate, requiring a large amount of manual intervention inspection. At the same time, considering the problem that traditional detection methods have a single feature and cannot effectively capture the characteristics of hardware Trojan circuits, the present invention preliminarily screens out hidden Trojan nodes based on the controllability measurement method by using the SCOAP algorithm. The strong circuit nodes are taken as suspicious circuit nodes. The detection range of the circuit is first narrowed down to reduce the detection time. Then, the suspicious circuit is generated with the suspicious circuit node as the root node. The suspicious circuit is divided into multiple node sequences. Each node in the node sequence is encoded as a feature according to the logic gate type to realize circuit sequence feature modeling. Finally, the obtained circuit sequence features are input into the gated recurrent neural network model. The gated recurrent neural network model is used to fully learn the features of the circuit node sequence after screening by the controllability measurement method, and the hardware Trojans are detected. This can greatly improve the accuracy of hardware Trojan detection, while effectively reducing the detection time cost and improving the detection efficiency.
[0037] like Figure 1 As shown, the steps of the hardware Trojan detection method based on the gated recurrent neural network in this embodiment include:
[0038] Step S01: Obtain the gate-level netlist circuit of the hardware IP core under test.
[0039] For the third-party IP core under test, first obtain its gate-level netlist circuit, which contains a variety of logic gates. The connection relationship between the logic gates is described by the netlist, and the gate-level netlist node connection structure can be obtained. The gate-level netlist is used to describe the logical function of the circuit and the connection relationship between its internal components and the input and output information of each component. In the gate-level netlist, basic logic gates (such as AND gates, OR gates, NOT gates, etc.) are used to represent the logical operations in the circuit, and the connecting lines represent the transmission path of the signal.
[0040] Step S02: Using the SCOAP algorithm, select nodes exceeding a controllability threshold from the obtained gate-level netlist circuit as suspicious circuit nodes.
[0041] The SCOAP (Sandia Controllability / Observability Analysis Program) algorithm measures the testability of circuits and quantifies the controllability of related signals of gate-level netlist circuit nodes. It measures how many signals a hardware Trojan circuit needs to manipulate to change the original input control signal of the circuit. It can quantify the concealment of hardware Trojans and detect hardware Trojans without relying on the golden model without hardware Trojans.
[0042] This embodiment first quantifies the controllability of gate-level netlist circuit signals using a controllability measurement method based on the SCOAP algorithm, screens out suspicious circuit nodes in the circuit, narrows the scope of hardware Trojan detection, and reduces the hardware Trojan detection time. Subsequently, the previous-stage structure logic function structure data related to the suspicious nodes is used as an important feature for identifying hardware Trojans, so that circuit sequence feature modeling can be effectively performed.
[0043] In this embodiment, the steps of using the SCOAP algorithm to screen out suspicious circuits in the circuit include:
[0044] Step S201. Node relationship conversion: converting the gate-level node connection relationship in the gate-level netlist into a non-Euclidean structure;
[0045] Step S202. Calculation of node controllability value: Calculate the controllability value of each circuit node using the SCOAP algorithm and map it into a non-Euclidean structure. The controllability value is used to represent the minimum number of signal assignments required to set the circuit node to a logical value of 0 or 1.
[0046] Step S203. Suspicious node screening: Screen out circuit nodes whose controllability values are greater than a preset threshold as suspicious circuit nodes.
[0047] Specifically, the screening process based on the SCOAP algorithm includes three steps: node relationship conversion, node controllability value calculation, and suspicious node screening. First, the gate-level node connection relationship in the gate-level netlist is converted into a non-Euclidean structure, that is, the gate-level netlist is converted into a non-Euclidean structure between nodes, and then the controllability value of the circuit node calculated by the SCOAP algorithm is mapped to the circuit structure, and finally the controllability value is used to screen the nodes whose controllability is greater than the threshold as suspicious nodes. In a specific application embodiment, the SCOAP algorithm is used to screen out suspicious nodes from the node connection structure of the gate-level netlist. Figure 2 shown.
[0048] like Figure 3As shown in the figure, CC0(N) / CC1(N) represents the combined 0 / 1 controllability value of node N, that is, when the value of node N is set to the combinational logic value 0 / 1, the relevant nodes need to be assigned the minimum number of assignments to determine the combinational logic value. In the SCOAP algorithm, there are two quantitative indicators for the controllability of signal s: the 0 controllability of signal s (CC0(s)) and the 1 controllability of signal s (CC1(s)). The value range of CC1 and CC0 is [1, +∞]. For each type of gate, the controllability value is stored in the database. The specific values of CC1 and CC0 for each type of gate are:
[0049] If it is an AND gate, the value is: CC0(y)=min{CC0(a),CC0(b)}+1, CC1(y)=CC1(a)+CC1(b)+1; if it is an OR gate, the value is: CC0(y)=CC0(a)+CC0(b)+1, CC1(y)=min{CC1(a),CC1(b)}+1; if it is an XOR gate, the value is: CC0(y)=min{CC0(a)+CC0(b), CC1(a)+CC1(b)}+1, CC1(y)=min{CC1(a)+CC0(b), CC0(a)+CC1(b)}+1; if it is an NAND gate, the value is: CC0(y)=CC1(a)+CC1(b)+1, CC1(y)=min{CC0(a),CC0(b)}+1; if it is an NOR gate, the value is CC0(y)=min{CC1(a),CC1(b)}+1CC1(y)=CC0(a)+CC0(b)+1; if it is an XNOR gate, the value is: CC0(y)=min{CC1(a),CC1(b)}+1, CC1(y)=CC0(a)+CC0(b)+1.
[0050] like Figure 4 As shown, in this embodiment, when the SCOAP algorithm performs suspicious node screening, a first-in-first-out successor queue table is specifically used. In each calculation, an element is taken out from the successor table in sequence, and the controllability value database of the standard element is called to calculate the controllability values of all output nodes of the element. The cycle is executed until the successor table is empty.
[0051] Step S03. Taking the suspicious circuit node as the root node, multiple nodes connected to the suspicious circuit node constitute a suspicious circuit, and divide the suspicious circuit into multiple node paths with the suspicious circuit node as the root node, encode each node in each node path according to the logic gate type as a feature, and model the circuit sequence feature.
[0052] After screening out suspicious circuit nodes, this embodiment uses the suspicious circuit nodes screened out by the controllability metric as the root node, generates a suspicious circuit with a fixed number of nodes from multiple gate-level nodes that have a connection relationship with the suspicious circuit node, and then divides the suspicious circuit into multiple node sequences, and models the circuit sequence. The sequence modeling can effectively capture the timing information in the gate-level circuit, and then can be used as input data for the subsequent gated recurrent neural network. Since the timing relationship of signals is often involved in circuit design, the subsequent use of the gated recurrent neural network can better understand and process the changing laws of signals in the circuit, thereby improving the accuracy of detection.
[0053] In this embodiment, 25 types of gates in the gate-level netlist, including NONE, AND, NAND, OR, NOR, NO, XNOR, XOR, ON, ZER, BU, MUX, MUXI, NETINPUT, FD, FJK, FJK12S, FJK34S, LD, AND_NO, OR_NO, AND4, NAND4, OR4, and NOR4, are specifically regarded as features of nodes in the circuit, and the logic gate types in the suspicious circuit are encoded using one-hot encoding to divide the circuit sequence on this basis.
[0054] In this embodiment, the type of logic gate in the gate-level netlist is used as the feature of each node, and the logic gate type in the suspicious circuit is encoded using one-hot encoding to obtain circuit sequence features. That is, multiple node paths from the root node to the tail node are divided by taking the suspicious node as the root node, and the path from the strongly hidden root node to the tail node in the suspicious circuit is divided, and multiple node sequence combinations are obtained from each node path. When performing the one-hot encoding, each node is specifically encoded as an N-dimensional vector according to the logic gate type, where N represents the number of logic gate type categories, where only one dimension in the vector has a value of 1, and the values of the remaining dimensions are 0, and the dimension set to 1 corresponds to the index of the original category. For example, the node codes of NONE and AND are 0 and 1 respectively, corresponding to the 25-dimensional vector with index bits 0 and 1 being 1 and the rest being 0, that is, [1, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].
[0055] As Figure 5As shown in the figure, for example, 32 gate-level nodes connected to the suspicious circuit node MUX are used to generate a suspicious circuit. Then, the suspicious circuit node MUX is used as the root node, and multiple node paths from the start node to the suspicious circuit node MUX are divided according to the connection relationship. For example, the first path is NOT-AND-AND-MUX, which corresponds to the leftmost path in the suspicious circuit. Finally, multiple node paths can be formed. The nodes in each node path are represented as N-dimensional vectors according to the node type, so as to realize the modeling of suspicious circuit sequence.
[0056] Step S04. Input the circuit sequence features into the gated recurrent neural network model, and use the gated recurrent neural network model to perform hardware Trojan detection on the hardware IP core under test and output the detection results. The gated recurrent neural network model is pre-trained using a combination of node sequence data in different node paths in the suspicious circuit as training data.
[0057] Gated recurrent neural network is a variant of recurrent neural network (RNN), which can be used to process sequence data, such as text or time series. It can control the flow of information through a gating mechanism, effectively solving the problems of gradient vanishing and gradient explosion in traditional RNN. This embodiment pre-uses the combination of node sequence data in different paths in the suspicious circuit and the labels corresponding to the sequence as gated recurrent neural network training data. When there is a pre-marked Trojan node in the sequence, the sequence label is set to 1, otherwise it is set to 0. Convert each node in the node sequence into a vector representation, map each node to a vector space by a unique hot encoding method, and train these node vectors and sequence labels as the input sequence of the neural network. After training, a gated recurrent neural network model that can realize hardware Trojan detection can be obtained. Specifically, the model detects that the prediction value of the hardware Trojan sequence is 1, and the prediction value of the non-hardware Trojan sequence is 0. Through large-scale data set training, it is possible to learn universal feature representations from the sequence data of the training data set, and adapt to logic circuits of different scales and complexities, so that it can be applied to hardware Trojan detection of various types of circuits.
[0058] In this embodiment, in the gated recurrent neural network model, a deep learning framework such as TensorFlow is used to build the model. Figure 6As shown in the figure, the model includes an input layer: the input should be a sequence, and the input of each time step is a feature vector; GRU layer: add one or more GRU layers in the model to process sequence data, and set the number of hidden units, activation function and other parameters in each GRU layer; fully connected layer: add a fully connected layer after the last time step or the entire sequence to convert the sequence data output by the GRU layer into a vector, and finally output the final binary classification result. Based on the gating mechanism, the output of the current time step is determined according to the vector representation of the current node and the hidden state of the previous time step. The flow of gate-controlled information in the gated recurrent neural network unit is used to capture important features in the sequence structure, thereby fully mining the features in the circuit sequence. At the last time step, the output of the last time step is connected to a fully connected layer, and the softma× function is used to predict the presence of hardware Trojans.
[0059] Gate-level netlist circuits often have complex logical relationships. Traditional machine learning methods require manual feature design or use of relatively complex feature engineering techniques to effectively capture these relationships. This embodiment makes full use of the strong automation, complex relationship processing, generalization and adaptability of the gated recurrent neural network model in learning logical circuit features. It can represent and learn complex logical relationships in gate-level netlist circuits through multi-level nonlinear transformations. By learning the characteristic structural relationship of the same node in different sequences, it can also effectively capture the global and local features of suspicious circuits, thereby quickly and accurately detecting hardware Trojans therein. And because the suspicious circuits formed in this embodiment are only a small part of the circuits containing suspicious nodes, the number of nodes is small and the feature sequence is short. Combined with the simple structure of the gated recurrent neural network, the small number of parameters, and the more lightweight model, it can make training and reasoning efficient, easy to implement and modify, and the training and detection process more efficient.
[0060] This embodiment can achieve end-to-end learning by utilizing sequence modeling and gated recurrent neural networks, can directly learn features and patterns from raw data without manual feature extraction, can reduce the workload of feature engineering, and can better adapt to the complexity and variability in circuit design. At the same time, since neural networks have strong adaptability, the use of sequence modeling and gated recurrent neural networks can also be applied to various types of logic circuits, and can be well applied to logic circuits of various sizes or different complexities, and can also continuously improve detection performance as the data scale increases.
[0061] This embodiment further expands the hardware Trojan data set based on the Trusthub hardware Trojan library and open source IP core, realizes circuit sequence feature modeling, uses gated recurrent neural network to detect hardware Trojans in circuits, and realizes multiple types of Trojan circuits based on the Trusthub library and Trojan-free circuits. The types and quantities of open source hardware Trojan circuit samples in the traditional Trusthub library are limited. This limitation will lead to a lack of data support for the training and cross-validation of IP core security detection methods. In order to ensure the comprehensiveness of the experimental results, this embodiment constructs two types of data sets: the first type of data set is the IP core data set, which is used as the original data set and does not contain hardware Trojan circuits, including Ca_prng, cf_codir, fast_antilog, pid, signed_integer_divider, simon_core, fast_log_highacc and simple_spi; the second type of data set implants different hardware Trojan circuits in the Trusthub library into the IP data set circuit, that is, the training data set includes a Trojan-free data set and a Trojan-containing data set. Use the 10-fold cross-validation method to build a detection model in the training phase to prevent overfitting, which can improve the detection capability of new hardware Trojans. To verify the effectiveness of the present invention, the performance of the model in detecting hardware Trojans was evaluated on different Trusthub benchmark tests. A GRU neural network was built in the Tensorflow environment using the Python language and the Keras machine learning library. The pre-trained detection model was used to identify potential hardware Trojans. The test results show that the method of the present invention can accurately identify hardware Trojans, and its efficiency is significantly higher than that of traditional deep learning methods.
[0062] The present invention first uses a controllability measurement method based on the SCOAP algorithm to screen suspicious nodes in a hardware Trojan circuit and narrow the circuit detection range. On the basis of using the SCOAP method to screen suspicious nodes in a netlist circuit to narrow the circuit detection range, the Trojan circuit features are further effectively captured through sequence feature modeling, the gate-level netlist is converted into a non-Euclidean structure connected by gate nodes, a suspicious circuit with a fixed number of nodes is generated with suspicious nodes as root nodes, and then the suspicious circuit is divided into multiple node sequences to implement circuit sequence feature modeling, and a gated recurrent neural network is used to learn the circuit node sequence features after being screened by the controllability measurement method to detect the existence of hardware Trojans in the circuit. Compared with traditional machine learning methods that require manual feature design or use of relatively complex feature engineering methods, the gated recurrent neural network method can have stronger automation capabilities, the ability to handle complex relationships, generalization capabilities and adaptability, thereby being able to obtain higher detection accuracy and effectively shorten the detection time.
[0063] The hardware Trojan detection device based on the gated recurrent neural network of this embodiment includes:
[0064] A netlist circuit acquisition module is used to obtain the gate-level netlist circuit of the hardware IP core under test;
[0065] A suspicious circuit screening module is used to screen out nodes exceeding a controllability threshold from the acquired gate-level netlist circuit as suspicious circuit nodes;
[0066] A sequence modeling module is used to take a suspicious circuit node as a root node, form a suspicious circuit with a specified number of nodes that have a connection relationship with the suspicious node, and divide the suspicious circuit into multiple different node sequences, encode each node in each node sequence according to the logic gate type, realize circuit sequence feature modeling, and obtain circuit sequence features;
[0067] The Trojan detection module is used to input the circuit sequence features into the gated recurrent neural network model, and the gated recurrent neural network model performs hardware Trojan detection on the hardware IP core under test and outputs the detection results. The gated recurrent neural network model is pre-trained using a combination of node sequence data in different paths in the suspicious circuit as training data.
[0068] The hardware Trojan detection device based on a gated recurrent neural network in this embodiment corresponds one to one with the above-mentioned hardware Trojan detection method based on a gated recurrent neural network, and will not be described one by one here.
[0069] This embodiment further provides an electronic device, including a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to execute the computer program to perform the above method.
[0070] It is understandable that the above method of this embodiment can be executed by a single device, such as a computer or server, etc., and can also be applied to a distributed scenario and completed by multiple devices in cooperation with each other. In the case of a distributed scenario, one of the multiple devices can only execute one or more steps in the above method of this embodiment, and multiple devices interact to complete the above method. The processor can be implemented in the form of a general-purpose CPU, a microprocessor, an application-specific integrated circuit, or one or more integrated circuits, etc., for executing related programs to implement the above method of this embodiment. The memory can be implemented in the form of a read-only memory ROM, a random access memory RAM, a static storage device, and a dynamic storage device. The memory can store an operating system and other applications. When the above method of this embodiment is implemented by software or firmware, the relevant program code is stored in the memory and called and executed by the processor.
[0071] This embodiment further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the above method is implemented.
[0072] Those skilled in the art will appreciate that the above-mentioned embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, may be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the functions in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0073] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A hardware Trojan detection method based on gated recurrent neural network, characterized in that the steps include: Step S01. Obtaining the gate-level netlist circuit of the hardware IP core under test; Step S02. Using the SCOAP algorithm, select nodes exceeding the controllability threshold from the obtained gate-level netlist circuit as suspicious circuit nodes; Step S03. Taking the suspicious circuit node as the root node, multiple nodes connected to the suspicious circuit node constitute a suspicious circuit, and dividing the suspicious circuit into multiple node paths with the suspicious circuit node as the root node, encoding each node in each node path according to the logic gate type as a feature, and modeling to obtain circuit sequence features; Step S04. Input the circuit sequence features into the gated recurrent neural network model, and use the gated recurrent neural network model to perform hardware Trojan detection on the hardware IP core under test and output the detection results. The gated recurrent neural network model is pre-trained using a combination of node sequence data in different node paths in the suspicious circuit as training data.
2. The method for detecting hardware Trojans based on a gated recurrent neural network according to claim 1, characterized in that: Step S02 includes: Step S201. Node relationship conversion: converting the gate-level node connection relationship in the gate-level netlist into a non-Euclidean structure; Step S202. Calculation of node controllability value: using the SCOAP algorithm to calculate the controllability value of each circuit node and mapping it to the non-Euclidean structure, wherein the controllability value is used to represent the minimum number of signal assignments required to set the circuit node to a logical value of 0 or 1; Step S203. Suspicious node screening: screening out circuit nodes whose controllability values are greater than a preset threshold as suspicious circuit nodes.
3. The hardware Trojan detection method based on gated recurrent neural network according to claim 1 is characterized in that: In step S03, the type of logic gates in the gate-level netlist is used as the feature of each node, and the type of logic gates in the suspicious circuit is encoded using one-hot encoding to obtain the circuit sequence feature.
4. The method for detecting hardware Trojans based on a gated recurrent neural network according to claim 1, characterized in that: In step S03, multiple node paths from the root node to the tail node are divided by taking the suspicious node as the root node, and multiple node sequence combinations are obtained from each node path.
5. The method for detecting hardware Trojans based on a gated recurrent neural network according to any one of claims 1 to 4, characterized in that: During the training process, the gated recurrent neural network model uses a combination of node sequence data in different paths in a suspicious circuit and labels corresponding to the sequences as training data, and the training data includes a Trojan-free data set and a Trojan-containing data set. When a pre-marked Trojan node exists in the node sequence, the sequence label is set to 1, otherwise it is set to 0. After training, a gated recurrent neural network model capable of realizing hardware Trojan detection is obtained.
6. The method for detecting hardware Trojans based on a gated recurrent neural network according to claim 5, characterized in that: The gated recurrent neural network model includes an input layer, a GRU layer and a fully connected layer, which are arranged in sequence. The input layer inputs a node sequence, and the GRU layer processes the node sequence input by the input layer. The output of the current time step is determined based on the gating mechanism according to the vector representation of the current node and the hidden state of the previous time step. The fully connected layer is arranged after the last time step or the entire sequence, and the fully connected layer uses the softma× function to output the final binary classification result of predicting whether a hardware Trojan exists.
7. A hardware Trojan detection device based on a gated recurrent neural network, characterized in that: include: A netlist circuit acquisition module is used to obtain the gate-level netlist circuit of the hardware IP core under test; A suspicious circuit screening module is used to screen out nodes exceeding a controllability threshold from the acquired gate-level netlist circuit as suspicious circuit nodes; A sequence modeling module is used to take the suspicious circuit node as a root node, form a suspicious circuit with a specified number of nodes having a connection relationship with the suspicious node, and divide the suspicious circuit into a plurality of different node sequences, encode each node in each node sequence according to a logic gate type, implement circuit sequence feature modeling, and obtain circuit sequence features; The Trojan detection module is used to input the circuit sequence features into the gated recurrent neural network model, and the gated recurrent neural network model performs hardware Trojan detection on the hardware IP core under test and outputs the detection results. The gated recurrent neural network model is pre-trained using a combination of node sequence data in different paths in the suspicious circuit as training data.
8. An electronic device comprising a processor and a memory, wherein the memory is used to store a computer program, wherein: The processor is configured to execute the computer program to perform the method according to any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Information-missing-oriented super-large-scale integrated circuit security design detection method
CN120087302A
