CN106407810B - A kind of rtl hdl Trojan detecting method based on Recursive descent parsing - Google Patents
A kind of rtl hdl Trojan detecting method based on Recursive descent parsing Download PDFInfo
- Publication number
- CN106407810B CN106407810B CN201610854016.8A CN201610854016A CN106407810B CN 106407810 B CN106407810 B CN 106407810B CN 201610854016 A CN201610854016 A CN 201610854016A CN 106407810 B CN106407810 B CN 106407810B
- Authority
- CN
- China
- Prior art keywords
- word
- module
- statement
- rtl
- reading
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/55—Detecting local intrusion or implementing counter-measures
- G06F21/56—Computer malware detection or handling, e.g. anti-virus arrangements
- G06F21/561—Virus type analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/55—Detecting local intrusion or implementing counter-measures
- G06F21/56—Computer malware detection or handling, e.g. anti-virus arrangements
- G06F21/562—Static detection
- G06F21/563—Static detection by source code analysis
Abstract
The present invention relates to a kind of rtl hdl Trojan detecting method based on Recursive descent parsing, the detection method is according to wooden horse modelling RTL code rule, specified type of word, terminate to state word, signal statement word, logic function block statement word, medium term and termination word including module statement word, module, RTL file is analyzed using Recursive descent parsing, finds legal wooden horse module.Detection method of the invention is the RTL code grade hardware Trojan horse for specified type, relative to traditional method for detecting hardware Trojan horse on chip, substantially reduce test period, it can quickly and effectively detect RTL code grade hardware Trojan horse, and wooden horse position is accurately positioned, it improves work efficiency.
Description
Technical field
The present invention relates to rtl code safety analysis technical field, especially a kind of RTL based on Recursive descent parsing
Grade hardware Trojan horse detection method.
Background technique
Events such as " the Snowdon prism doors " and " Iran's shake net " that occurs in recent years show the hardware Trojan horse in integrated circuit
A kind of weapon be can be used as to carry out information war, the network warfare or even physical destruction military equipment and key facility, seriously threatened
National security.With the increasingly complexity of IC design, manufacturing cost is increasingly high, and IC industry is just towards globalization
The trend development of cooperation, within the following quite a long time, integrated circuit will be numerous and uncontrollable in face of source
The threat of third party IP, external eda software and the manufacture of uncontrollable wafer.In these links, integrated circuit is likely to
Back door loophole is formed by the modification of artificial malice.Therefore, it need to take effective measure to carry out the hardware Trojan horse in integrated circuit
Effectively identification, guarantees the secure and trusted of integrated circuit.
Mainly there is destruction at present both for the Trojan detecting method of pure hardware to the research of hardware Trojan horse detection both at home and abroad
Property detection, system operation detection, logic testing and four kinds of bypass analysis.Wherein most study is namely based on the hard of bypass analysis
Part Trojan detecting method.Bypass message (such as electromagnetic radiation, electric current or circuit delay when bypass analysis is using chip operation
Etc. information) wooden horse detected.Its principle is because the hardware Trojan horse being implanted into circuit can believe some bypasses of chip
Number, such as electric current, frequency or path delay are had an impact, therefore pass through the by-passing signal of observation chip and the bypass with original chip
Information is made comparisons, and then detects the presence for whether having hardware Trojan horse in chip.Hardware based on bypass analysis is carried out to circuit
The great advantage of trojan horse detection is hardware Trojan horse can be made to be detected in the case of not being triggered, but it also has significantly
The shortcomings that, i.e. being on a grand scale when circuit under test, small, some bypasses letters for the hardware Trojan horse being implanted inside circuit
Breath, such as electric current and path delay, amplitude of variation are minimum, it is contemplated that the noise introduced in measurement process and chip manufacturing
In the process due to process drift bring noise, this minimum by-passing signal variation will be unable to be actually measured out or i.e.
Make to be measured that be also difficult to determination be due to caused by hardware Trojan horse, or since measurement noise, process drift noise cause
's.
Chip due to design carelessness or is not good at, it is possible to form can be by people's malicious exploitation when carrying out RTL design
Loophole, such as the test port of direct access circuit internal confidential information that can be utilized, inside circuit from safety zone to
The signal of insecure area directly transmits.But it is substantially at blank for the code security Journal of Sex Research of RTL level or gate leve, because
This carries out secure path verification technique for above-mentioned this kind of design defect, and whether there is in detection RTL code can be by external non-
Method access, and does not meet the path that safety regulation defines, and ensureing in RTL code hiding can reveal circuit without containing this
The path of internal confidential information has certain feasibility and realistic meaning.In order to ensure chip in main industrial chain link
On can defend back door loophole, reduce the security threat that chip is subject to, it is necessary to develop the analysis of chip code level security with
Detection method.
Summary of the invention
The technical problem to be solved by the present invention is to overcome the existing defects, provides a kind of RTL based on Recursive descent parsing
Grade hardware Trojan horse detection method, this method is the RTL code grade hardware Trojan horse for specified type, relative to traditional in chip
The method of upper detection hardware Trojan horse, substantially reduces test period, can quickly and effectively detect RTL code grade hardware wood
Horse, and wooden horse position is accurately positioned, it improves work efficiency.
In order to solve the above-mentioned technical problems, the present invention provides the following technical solutions:
A kind of rtl hdl Trojan detecting method based on Recursive descent parsing of the present invention, which is according to wood
Horse modelling RTL code rule specifies type of word, including module statement word, module terminate statement word, signal states word,
Logic function block states word, medium term and termination word, is analyzed using Recursive descent parsing RTL file, finds and meet rule
Wooden horse module then.
Further, specific step is as follows for the detection method:
(1) by row reading of content since RTL file the first row, word is taken to analyze the content of reading, analysis is completed
Afterwards, it returns to line position to set, then reads next line statement, take word to analyze the content of reading, until running through RTL file;Wherein
It takes word to carry out analysis to refer to and judge type of word, when word is that module states word, into module analysis;
(2) when module analysis, a line statement is read, takes word to analyze the content of reading, after having analyzed, return to line position
It sets, then reads next line statement, take word to analyze the content of reading, repetitive operation is that module terminates to state word until word,
Terminate current block analysis circulation;It wherein takes word to carry out analysis to refer to word according to part of speech type progress different disposal, if word is
Signal states word, then enters building signal set method, if word is that logic function block states word, enters logic function and analyzes,
If word is that module terminates to state word, terminate current block analysis circulation;
(3) when logic function is analyzed, a line statement is read, takes word to analyze the content of reading, when word is medium term,
Continue down by row reading statement, take word, until acquisition word be termination word;When the word of acquisition is termination word, into termination word point
Module is analysed, if meeting is wooden horse condition, RTL code module where termination word is wooden horse module, and otherwise terminate RTL code where word
Module is not wooden horse module.
Further, step (1), (2), (3) middle a line content read do not include comment statement, every reading a line language
Sentence, a line, the primary analysis every row of RTL file are necessary and read-only primary backward for line position tagging.
Further, step (1), (2), take word to refer to the content to reading the content of reading in (3), obtain a word
Language or symbol;When taking word to sentence for the first time, first word is obtained, word is taken to the sentence every time later, acquisition last time takes word
Next word.
Further, building signal set method is that the signal of signal statement word statement is added to one in step (2)
In set, the signal set of module where composition.
Further, the termination word analysis module in step (3), which refers to, analyzes sentence according to wooden horse rule, judgement
Whether wooden horse rule is met.
The invention adopts the above technical scheme, compared with prior art, has following technical effect that
The present invention finds the hardware Trojan horse of specified type, examines on chip relative to traditional by formulating code regulation
The method for surveying hardware Trojan horse, substantially reduces test period, can quickly and effectively detect RTL code grade hardware Trojan horse, and
Wooden horse position is accurately positioned, improves work efficiency.
Detailed description of the invention
Fig. 1 is the flow chart of detection method.
Specific embodiment
Embodiment cited by the present invention, is merely used to help understand the present invention, should not be construed as protecting model to the present invention
The restriction enclosed for those skilled in the art without departing from the inventive concept of the premise, can also be right
The present invention makes improvements and modifications, these improvement and modification are also fallen into the range of the claims in the present invention protection.
The present invention will be further explained below with reference to the attached drawings.
The present invention provides a kind of rtl hdl Trojan detecting method based on Recursive descent parsing, according to wooden horse model
RTL code rule is designed, type of word, including module statement word, module is specified to terminate to state word, signal statement word, logic function
Energy block statement word, medium term and termination word, analyze RTL file, find legal wooden horse module.
The process of detection method is as shown in Figure 1, include the following steps:
Step 1: by row reading of content since RTL file the first row, obtained content is that the row removes comment statement
Content, one line statement of every reading, line position tagging to next line.
It takes word to analyze the content of reading, i.e., type of word is judged, when word is that module states word, entered
Module analysis after the completion of analysis, returns to line position and sets;Without processing when for other part of speech types.Continue to read next line statement, it is right
The content of reading takes word to be analyzed, until running through the RTL file;The every row of RTL file is necessary and read-only in analytic process
Once.
Step 2: when module analysis, reading a line statement, take word to analyze the content of reading, after having analyzed, return to row
Position, then next line statement is read, it takes word to analyze the content of reading, repeats above operation until word is that module terminates sound
Bright word terminates current block analysis circulation.
It takes word to carry out analysis to refer to according to part of speech type progress different disposal, if word is that signal states word, enters building and believe
Number collection approach, the i.e. signal by signal statement word statement are added in a set, the signal set of module where composition;If
Word is stated for logic function block, is analyzed into logic function, if word is that module terminates to state word, is terminated current block analysis and is followed
Ring.
Step 3: when logic function is analyzed, reading a line statement and take word to analyze the content of reading, when word is centre
When word, continue down by row reading statement, take word, until acquisition word be termination word.
When the word of acquisition is termination word, into termination word analysis module, if meeting is wooden horse module condition, the termination word institute
It is wooden horse module in RTL code module;Otherwise RTL code module where the termination word is not wooden horse module.
Wherein termination word analysis module, which refers to, analyzes sentence according to wooden horse rule, judges whether to meet wooden horse rule
Then.
Word is taken to the content of reading in above-mentioned steps 1,2,3, refers to the content to reading, obtains a word or symbol;
When taking word to sentence for the first time, first word is obtained, word is taken to the sentence every time later, acquisition last time takes next word of word.
A accessible RTL file of the embodiment of the present invention selection carries out hardware Trojan horse detection, the RTL file it is interior
Hold as follows:
To the detection method of above-mentioned RTL file are as follows: the hardware Trojan horse type to be searched of determination first will such as search accumulator
When the time bomb that module is realized, the module to be searched is accumulator, then it should be understood that accumulator code regulation;Then it defines
Set of words of all categories, definition module state word ' module ', and module terminates to state word ' endmodule ', and signal statement word is
' input ', ' output ' and ' reg ', the logic function block into module state word ' always ' and ' assign ', ' if ',
' else ' and ' begin ' is medium term, and the signal being defined in module is termination word.
Above-mentioned file is analyzed from the beginning, the first row content is annotation, and reading of content is sky, is read in next line
Hold also for sky, read code down until the 16th row, read the content non-empty that the line code obtains, obtain content are as follows:
Module top (clk, rst, din, dout1, dout2, dout3);
Word is taken to this line statement, takes word ' module ' for the first time, takes word ' top ' for the second time, takes word ' (' for the third time, is obtained
‘(’。
Taking word to obtain ' module ' is that module states word, ' top ' module is defined, into module analysis.
When module analysis, a line statement is read, content is obtained are as follows:
input clk;
Word is taken to this line statement, obtaining ' input ' is that signal states word, defines signal ' clk ', signal ' clk ' is added
It is added to the signal set of a module ' top '.RTL code is read by row down, the 19 to 28th non blank line is all addition signal
To the signal set of module.
31st line statement takes word, and obtaining ' always ' is that logic function block states word, analyzes into logic function.Read a line
It is ' if ' that sentence, which takes word, is medium term, and reading statement takes word down, and obtaining ' count1 ' is signal defined in module, and meeting is
The condition of termination word, analyzes this line statement, and assertive signal does not include termination word signal, does not meet wooden horse condition.Continue
Reading statement down, taking word ' else ' is medium term, reads next line statement, takes word to reading of content, and obtaining ' count1 ' is module
Defined in signal, meet be terminate word condition, this line statement is analyzed, assertive signal include termination word signal and plus
Operation meets wooden horse condition, then the logic function block of the 31 to 35th row description may have wooden horse circuit.When to this journey, the logic
Functional module reading terminates, return module analysis.When analyzing 56 row, it is that module terminates sound that taking word, which is ' endmodule ',
Bright word terminates current block analysis circulation, file analysis in 1 is entered step, until RTL file terminates.
Claims (5)
1. a kind of rtl hdl Trojan detecting method based on Recursive descent parsing, which is characterized in that the detection method is root
According to wooden horse modelling RTL code rule, type of word, including module statement word, module is specified to terminate to state word, signal statement
Word, logic function block statement word, medium term and termination word, RTL file is analyzed using Recursive descent parsing, finds and meets
The wooden horse module of rule;
Specific step is as follows for the detection method:
(1) it by row reading of content since RTL file the first row, takes word to analyze the content of reading, after the completion of analysis, returns
Reversion position, then next line statement is read, take word to analyze the content of reading, until running through RTL file;Wherein take word into
Row analysis, which refers to, judges type of word, when word is that module states word, into module analysis;
(2) when module analysis, a line statement is read, takes word to analyze the content of reading, after having analyzed, returned to line position and set, then
Next line statement is read, takes word to analyze the content of reading, repetitive operation is that module terminates to state word until word, terminates to work as
Front module analysis circulation;It wherein takes word to carry out analysis to refer to word according to part of speech type progress different disposal, if word is signal sound
Bright word then enters building signal set method, if word is that logic function block states word, enters logic function and analyzes, if word is
Module terminates to state word, then terminates current block analysis circulation;
(3) when logic function is analyzed, a line statement is read, takes word to analyze the content of reading, when word is medium term, continued
Down by row reading statement, take word, until acquisition word be termination word;When the word of acquisition is termination word, mould is analyzed into termination word
Block, if meeting is wooden horse condition, RTL code module where termination word is wooden horse module, and otherwise terminate RTL code module where word
It is not wooden horse module.
2. the rtl hdl Trojan detecting method according to claim 1 based on Recursive descent parsing, which is characterized in that
The step (1), (2), a line content read in (3) do not include comment statement, one line statement of every reading, and line position tagging is past
A line afterwards, the primary analysis every row of RTL file are necessary and read-only primary.
3. the rtl hdl Trojan detecting method according to claim 1 based on Recursive descent parsing, which is characterized in that
The step (1), takes word to refer to the content to reading the content of reading in (3) at (2), obtains a word or symbol;First
It is secondary to obtain first word when taking word to sentence, word is taken to the sentence every time later, obtains next word that last time takes word.
4. the rtl hdl Trojan detecting method according to claim 1 based on Recursive descent parsing, which is characterized in that
Building signal set method is that the signal of signal statement word statement is added in a set in the step (2), forms institute
In the signal set of module.
5. the rtl hdl Trojan detecting method according to claim 1 based on Recursive descent parsing, which is characterized in that
Termination word analysis module in the step (3), which refers to, analyzes sentence according to wooden horse rule, judges whether to meet wooden horse
Rule.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610854016.8A CN106407810B (en) | 2016-09-27 | 2016-09-27 | A kind of rtl hdl Trojan detecting method based on Recursive descent parsing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610854016.8A CN106407810B (en) | 2016-09-27 | 2016-09-27 | A kind of rtl hdl Trojan detecting method based on Recursive descent parsing |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106407810A CN106407810A (en) | 2017-02-15 |
CN106407810B true CN106407810B (en) | 2019-05-10 |
Family
ID=57997038
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610854016.8A Active CN106407810B (en) | 2016-09-27 | 2016-09-27 | A kind of rtl hdl Trojan detecting method based on Recursive descent parsing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106407810B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107545194B (en) * | 2017-08-01 | 2019-07-16 | 华南理工大学 | Detection and the defence method of hardware Trojan horse are coped in network-on-chip |
CN108363878A (en) * | 2018-02-27 | 2018-08-03 | 中国电子科技集团公司第五十八研究所 | Circuit safety verification method and computer readable storage medium |
CN109711159B (en) * | 2018-11-26 | 2020-11-10 | 北京计算机技术及应用研究所 | IP (Internet protocol) core RTL (real time language) level code security vulnerability detection method based on information flow |
CN109492337B (en) * | 2018-12-17 | 2023-02-03 | 北京计算机技术及应用研究所 | Information flow tracking model generation method of programmable logic device |
CN112257369B (en) * | 2020-12-21 | 2021-03-16 | 上海国微思尔芯技术股份有限公司 | Logic design segmentation method and system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102034042A (en) * | 2010-12-13 | 2011-04-27 | 四川大学 | Novel unwanted code detecting method based on characteristics of function call relationship graph |
CN104239616A (en) * | 2014-09-02 | 2014-12-24 | 工业和信息化部电子第五研究所 | Design method of integrated circuit and hardware trojan detection method |
EP3038006A1 (en) * | 2014-12-24 | 2016-06-29 | Kaspersky Lab, ZAO | System and method for distributed detection of malware |
CN105807204A (en) * | 2016-03-08 | 2016-07-27 | 天津大学 | Spectrum refinement-based hardware Trojan detection method |
-
2016
- 2016-09-27 CN CN201610854016.8A patent/CN106407810B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102034042A (en) * | 2010-12-13 | 2011-04-27 | 四川大学 | Novel unwanted code detecting method based on characteristics of function call relationship graph |
CN104239616A (en) * | 2014-09-02 | 2014-12-24 | 工业和信息化部电子第五研究所 | Design method of integrated circuit and hardware trojan detection method |
EP3038006A1 (en) * | 2014-12-24 | 2016-06-29 | Kaspersky Lab, ZAO | System and method for distributed detection of malware |
CN105807204A (en) * | 2016-03-08 | 2016-07-27 | 天津大学 | Spectrum refinement-based hardware Trojan detection method |
Non-Patent Citations (1)
Title |
---|
基于系统函数序列的恶意代码同源分析;官强;《中国优秀硕士学位论文全文数据库信息科技辑》;20150115(第01期);I138-110 |
Also Published As
Publication number | Publication date |
---|---|
CN106407810A (en) | 2017-02-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106407810B (en) | A kind of rtl hdl Trojan detecting method based on Recursive descent parsing | |
CN101266550B (en) | Malicious code detection method | |
CN102339252B (en) | Static state detecting system based on XML (Extensive Makeup Language) middle model and defect mode matching | |
CN104239616B (en) | The method for designing of integrated circuit and hardware Trojan horse detection method | |
CN103544436B (en) | System and method for distinguishing phishing websites | |
CN107659570A (en) | Webshell detection methods and system based on machine learning and static and dynamic analysis | |
CN109190372A (en) | A kind of JavaScript Malicious Code Detection model based on bytecode | |
CN110414277B (en) | Gate-level hardware Trojan horse detection method based on multi-feature parameters | |
CN106934275B (en) | Password strength evaluation method based on personal information | |
CN105205396A (en) | Detecting system for Android malicious code based on deep learning and method thereof | |
CN107656839A (en) | Research on Integrated Circuit Security is assessed and detection method | |
CN106126235A (en) | A kind of multiplexing code library construction method, the quick source tracing method of multiplexing code and system | |
CN110348214A (en) | To the method and system of Malicious Code Detection | |
CN103793652A (en) | Application system code safety scanning device based on static analysis | |
CN103177215A (en) | Computer malicious software detection novel method based on software control flow features | |
CN110427755A (en) | A kind of method and device identifying script file | |
CN107480561A (en) | Hardware Trojan horse detection method based on few state node traverses | |
CN109657461B (en) | RTL hardware Trojan horse detection method based on gradient lifting algorithm | |
CN110287735A (en) | Wooden horse based on chip netlist feature infects circuit identification method | |
CN104850804B (en) | Hardware Trojan horse detection method based on circuit feature analysis | |
CN103577323A (en) | Dynamic key command sequence birthmark-based software plagiarism detecting method | |
CN107958154A (en) | A kind of malware detection device and method | |
CN105718795A (en) | Malicious code evidence obtaining method and system on the basis of feature code under Linux | |
CN107239694A (en) | A kind of Android application permissions inference method and device based on user comment | |
CN109815705A (en) | A kind of hardware Trojan horse detection method based on scan chain signature analysis |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |