CN106874775A - A kind of Implementation of Embedded System method of anti-copying - Google Patents

A kind of Implementation of Embedded System method of anti-copying Download PDF

Info

Publication number
CN106874775A
CN106874775A CN201611216267.XA CN201611216267A CN106874775A CN 106874775 A CN106874775 A CN 106874775A CN 201611216267 A CN201611216267 A CN 201611216267A CN 106874775 A CN106874775 A CN 106874775A
Authority
CN
China
Prior art keywords
yards
data
flag bit
embedded
copying
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.)
Granted
Application number
CN201611216267.XA
Other languages
Chinese (zh)
Other versions
CN106874775B (en
Inventor
杨雄
詹晋川
杨清
张晓进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Forward Industrial Co Ltd
Original Assignee
Shenzhen Forward Industrial Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Forward Industrial Co Ltd filed Critical Shenzhen Forward Industrial Co Ltd
Priority to CN201611216267.XA priority Critical patent/CN106874775B/en
Publication of CN106874775A publication Critical patent/CN106874775A/en
Application granted granted Critical
Publication of CN106874775B publication Critical patent/CN106874775B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/604Tools and structures for managing or administering access control systems

Abstract

The invention discloses a kind of Embedded Design Method of anti-copying; the embedded system of anti-copying is used based on ID yards and once read; the mode for judging repeatedly; key data is read during system initialization; certification protection mechanism is run in systems always, only makes a decision treatment, and most ID yards of comparative result is assigned to flag bit at last; the value that system relies on this flag bit judges whether system needs normal operation, so as to play the purpose of protection system.Implementation method of the invention has the advantages that flexible design, ensures Product Safety based on embedded-type electric subsystem.

Description

A kind of Implementation of Embedded System method of anti-copying
Technical field
The present invention relates to a kind of controlled skill of safety for protecting embedded electronic product chip program not cracked clone illegally Art, the Implementation of Embedded System method of more particularly to a kind of anti-copying.
Background technology
The core of embedded electronic product is main by two parts of hardware and software.After many companies issue new product, The company of same industry competition all can carry out certain competition analysis according to its product, contrast the excellent of itself Products whereby It is bad.Also it is no lack of some companies to save R&D costs or quickly releasing product, has just used illegal means to be copied, this The new product for planting novelty just appears on the market just by flight or clone, will cause the massive losses of original company, while influenceing innovation Enthusiasm, causes electronic product to enter the vicious circle of homogeneous low-price competition.
Embedded electronic product is similar to computer industry, and the hardware solution of product has turned into disclosed data, produces The core technology of product designer is in fact concentrated in embedded application software.So, hardware technology is gradually ripe and disclosure Today, how to protect the design of product, the copyright of product to be actually converted into the protection to embedded application software.With The development of hacking technique and chip anatomy, the attack that electronic product embedded system faces is also more and more, with debugging Software reads the binary system BIN files of inside embedded system chip (ROM/FLASH/EEPROM), it is possible to in chip Code is copied, and then to whole PCB or even the illegal clone of product.In order to prevent unauthorized access chip program, greatly Multi-embedding formula chip all carrys out screening glass internal program with encryption lock positioning or encrypted byte.But such safeguard measure is very crisp Weak, attacker is by special equipment, the leak or software defect designed using chip, by multiple technologies means, it is possible to Key message is extracted from chip, embedded chip internal processes are obtained.Chip factory embedded in only to the every chip piece for dispatching from the factory ID yards of one so that per chip piece Existence and uniquenss, R&D personnel can be encrypted protection using ID, even if core Even if piece program is cloned into other chips but because ID yards different causes the program cannot normally to run.Mostly using encryption Process is as follows:
1) unique ID number of chip is read;
2) using this No. ID as original value, the value PW after certain AES is encrypted;
3) in PW values being stored into EEPROM or the flash of itself;
4) PW values are read in the application, and the ID of chip is obtained by decipherment algorithm;
5) whether application program reads the ID values of chip, is compared with the ID values after decryption and consistent sees.
Obviously the way more than obtains security not enough, because the process (address of ID Code memories such as occur) for reading ID may Just divulge a secret, attacker can be analyzed and processed by reading the program file of chip, and contrast points are skipped by debugging method Mode crack, just can make normal program operation.
The content of the invention
The technical problems to be solved by the invention are to provide one kind and are difficult to crack, design simple chip copy prevention method, The method of chip anti-copying is unique ID yards based on chip and realizes.
The technical scheme that the present invention solves above-mentioned technical problem is as follows:
A kind of Implementation of Embedded System method of anti-copying, the embedded system of anti-copying is used based on ID yards once to be read Take, the mode for judging repeatedly reads key data during system initialization, data are no longer read afterwards, certification protection mechanism is always Operation in systems, only makes a decision treatment, is finally presented as a flag bit, and system relies on the normal operation of this mark, so as to rise To the purpose of protection system, its concrete methods of realizing is comprised the following steps:
(1) ID yards is read:ID yards is read in initialization, ID yards of data are stored in ID code tables;
(2) ID yards is encrypted:Black list of the length more than ID code tables is defined, by the way of data lookup table, by ID yards Table is encrypted, and obtains encryption data;System produces a random number as deviant, and combining encryption data are put into black list In;
(3) encryption data is accessed:Chip is most preceding or rearmost end reserves certain F lash address spaces to preserve black list Data, read this data in access list in initialization;
(4) concealed encrypted data:Contrast table of the length more than black list is defined, system produces a random number conduct Deviant, combining encryption table data are put into contrast table;
(5) authentication mechanism contrasts ID yards:According to byte length by the way of repeatedly comparing, to access list and contrast table Data are compared, and most ID yards of comparative result is assigned to flag bit at last;
(6) protection mechanism judges whether system needs normal operation according to flag bit:Mark is added in the operation of system The judgement of will position, when flag bit is effective, then system performs effectively operation, otherwise directly skips or logs off, and is protected with this Demonstrate,prove the normal operation of systemic-function.
The beneficial effects of the invention are as follows:Implementation method of the invention has flexible design, protects based on embedded-type electric subsystem Demonstrate,prove the advantage of Product Safety.
On the basis of above-mentioned technical proposal, the present invention can also do following improvement.
Further, described ID yards is that other have uniqueness in ID yards of embedded system control chip or embedded system ID yards of external chip.
Further, the reading address for reading ID yards obtains by the indirect computing of variable.
Brief description of the drawings
Fig. 1 is anti-copying encrypted protection system flow chart of the invention;
Fig. 2 is that ID yards of single treatment of authentication mechanism contrast of the present invention realizes flow chart.
Specific embodiment
Principle of the invention and feature are described below in conjunction with accompanying drawing, example is served only for explaining the present invention, and It is non-for limiting the scope of the present invention.
As shown in figure 1, the present invention is a kind of protection provided on the basis of the security for ensureing embedded electronic product Method.Copy preventing system is used and once read, the mode for judging repeatedly.Key data is read during system initialization, afterwards no longer Data are read, certification protection mechanism is run in systems always, only makes a decision treatment, is finally presented as a flag bit, system The normal operation of this mark is relied on, so as to play the purpose of protection system, its concrete methods of realizing is comprised the following steps:
(1) ID yards is read:ID yards is read in initialization, ID yards of data are stored in ID code tables, wherein, ID yards is insertion Other have ID yards of the external chip of uniqueness in ID yards of formula system control chip or embedded system, read address by becoming Indirect computing is measured to obtain;
(2) ID yards is encrypted:Black list of the length more than ID code tables is defined, by the way of data lookup table, by ID yards Table is encrypted, and obtains encryption data;System produces a random number as deviant, and combining encryption data are put into black list In;
(3) encryption data is accessed:Chip is most preceding or rearmost end reserves certain F lash address spaces to preserve black list Data, read this data in access list in initialization;If the data for reading are full 0 xff or full 0 x00, that is, represent encryption number According to designated area is not stored in also, then the data in black list are stored in Flash designated address spaces, again reading off Flash can obtain To access list valid data;
(4) concealed encrypted data:Contrast table of the length more than black list is defined, system produces a random number conduct Deviant, combining encryption table data are put into contrast table;
(5) authentication mechanism contrasts ID yards:According to byte length by the way of repeatedly comparing, to access list and contrast table Data are compared, and most ID yards of comparative result is assigned to flag bit at last;Detailed process is that it is repeatedly right to count realization according to contrast Than;System operation mark exception is set before contrast every time;When correction data is consistent, then mark is set normally, while increasing contrast Count, the next byte data of contrast next time;Data are inconsistent, then skip treatment (flag bit is abnormal, and contrast counts constant, Contrast next time is still this secondary data), i.e., only when data are consistent, flag bit can be just set to normally, under just allowing to contrast The data of one byte;Data Comparison counts the byte number more than or equal to effective correction data, then reset contrast and count, and circulates according to this Contrast;
(6) protection mechanism judges whether system needs normal operation according to flag bit:Mark is added in the operation of system The judgement of will position, when flag bit is effective, then system performs effectively operation, otherwise directly skips or logs off, and is protected with this Demonstrate,prove the normal operation of systemic-function.
Embodiment 1
By taking unique ID of STM32F103 chips as an example, the reference number pair that the product unique identity of 96 is provided Any one STM32 microcontroller, be all under any circumstance it is unique, can be with byte (8), half-word (16) or complete Word (32) is read out for unit.
Encipherment protection step is as follows:
Read ID yards:With byte (8) as unit in initialization, read 12 times, 12 bytes are stored in by ID yards In ID code tables UID_rd_tab [12], read address obtain by the indirect computing of variable (assuming that ID yard of address is ID_ADDR, Split into the individual part ID_ADDR=ID_ADDR_1 of 2 (some)<<16 | ID_ADDR_2, reads data mode in the way of variable It is var_id_addr=ID_ADDR_1<<16|ID_ADDR_2;Var_id_data=* (_ _ IOu32*) (var_id_addr); This address of Compiler Optimization can not be allowed, it is to avoid this address is directly found after dis-assembling).
ID yards of encryption:Black list UID_en_tab [24] of the length more than ID code tables is defined, using data lookup table Mode, ID code tables are carried out into data encryption (can be encrypted, the 12 bytes encryption number for obtaining using CRC32 tables to ID code tables According to), system produces random number offset_en ((random%12+1) scope<1,12>) it is skew, combining encryption data It is put into black list UID_en_tab [24] that (preceding 24 byte that the value in black list can be taken in CRC32 tables is kept away as initial value Exempt to be entered as full 0 x00 or 0xff), UID_en_tab [0] preserves the value of offset address, and such as skew is offset_en=3, then UID_ is preserved in UID_en_tab [0]=3, UID_en_tab [offset_en+0]~UID_en_tab [offset_en+11] Rd_tab passes through 12 byte encryption datas of encryption.
Access encryption data:Chip is most preceding or rearmost end reserves certain address space to preserve encryption data UID_en_ Content in tab, remaining space can also be used for user other special parameters and (consider here based on simple mini system;If possessing The system of abundant external resource, it is also possible to preserved by external devices);In initialization, the address according to storage data is read Take and be stored in the encryption data kept in System on Chip/SoC and be put into access list UID_save_tab [24];If the data for reading are Full 0 xff or full 0 x00, that is, represent that encryption data is not stored in designated area also, then the data in black list are stored in into flash refers to Determine address space, again read off flash and can obtain access list valid data (UID_save_tab [24]==UID_ in theory en_tab[24])。
Concealed encrypted data:Contrast table UID_cmp_tab [48] of the length more than black list is defined, system produces one Individual random number offset_cmp (<0,24>, random%25) and used as skew, combining encryption table data (are similar in being put into contrast table In the mode of ID code tables to black list, the initial value in UID_cmp_tab try not use full 0 x00 or full 0 xff, with Machine number is skew, due to using random number, so after system is restarted every time, the data in UID_cmp_tab [48] can not Equally), UID_cmp_tab [0]=offset_cmp, the data in UID_en_tab [24] can be sequentially stored into UID_cmp_ After tab [offset_cmp+0].
Authentication mechanism contrasts ID yards:Using 12 contrasts, a byte data is contrasted every time.If contrast counting is less than 12, then contrast access list UID_save_tab [24] (right with effective 12 byte data in contrast table UID_cmp_tab [48] It is 24 byte datas after UID_save_tab [0] and UID_cmp_tab [UID_cmp_tab [0]] than data, or After UID_save_tab [UID_save_tab [0]] and UID_cmp_tab [UID_cmp_tab [UID_cmp_tab [0]]] 12 byte datas), contrast is preceding every time sets system operation mark exception, only when correction data is consistent, then sets mark normally, together Shi Zengjia contrasts are counted, it is allowed to contrast next byte data;If contrast is counted is more than or equal to 12, resets contrast and count, according to this Circulation contrast.ID yards of matching final result is presented as the state of flag bit sys_match_flag.
As shown in Fig. 2 authentication mechanism contrasts ID yards of single treatment realizes flow, can be with different programming modes come real It is existing, it is recommended here that the circulation form of while or for should not to be used, it is proposed that programmed with switch or if else sentences, be In order to prevent attacker from easily finding the assignment operation position of flag bit, therefore assignment is carried out using many places, final system ID is No matching is embodied in above a flag bit.
Protection mechanism judges whether system needs normal operation according to flag bit:This is added to mark in crucial handling function The judgement of will position sys_match_flag, i.e., when judgement symbol is effective, then (such as one embedded system is by showing to perform effectively operation Show that module, memory module, button detection module, communication module etc. are constituted, then can choose addition in one or more module The judgement of this mark, only when flag bit is effective, just the normal flow for performing modules, otherwise directly skips or exits mould Block) ensure the normal operation of systemic-function.
It is only to obtain data in power-up initializing, without making a decision treatment, can judges always in system operation Treatment, it is proposed that system all adds this to judge position in important functional module program, and can final system function normally be run, with This flag bit strong correlation, rather than single endless loop is done, with extremely strong flexibility and security.
In this example, system initialization reads chip id code, by certain ciphering process, the ID numbers of final 12 byte According to being embodied in the data more than 12 bytes (the access data of 24 bytes and the correction data of 48 bytes).Differed due to ID yards Sample, and correction data is to be based on generating random number, irregularities, using traditional code cracked out in embedded type CPU simultaneously Cannot be cracked by the way of debugging method skips contrast points, in can be applied to all of embedded electronic product, for medium and small Or even large scale system can play defencive function.
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all it is of the invention spirit and Within principle, any modification, equivalent substitution and improvements made etc. should be included within the scope of the present invention.

Claims (3)

1. a kind of Implementation of Embedded System method of anti-copying, it is characterised in that the embedded system of anti-copying is adopted based on ID yards With once reading, the mode for judging repeatedly reads key data during system initialization, certification protection mechanism operates in system always In, treatment is only made a decision, most ID yards of comparative result is assigned to flag bit at last, and the value that system relies on this flag bit judges that system is No to need normal operation, so as to play the purpose of protection system, its concrete methods of realizing is comprised the following steps:
(1) ID yards is read:ID yards is read in initialization, ID yards of data are stored in ID code tables;
(2) ID yards is encrypted:Black list of the length more than ID code tables is defined, by the way of data lookup table, ID code tables is entered Row encryption, obtains encryption data;System produces a random number as deviant, and combining encryption data are put into black list;
(3) encryption data is accessed:Chip is most preceding or rearmost end reserves certain F lash address spaces to preserve the number of black list According to reading this data in initialization in access list;
(4) concealed encrypted data:Contrast table of the length more than black list is defined, system produces a random number as skew Value, combining encryption table data are put into contrast table;
(5) authentication mechanism contrasts ID yards:According to byte length by the way of repeatedly comparing, to access list and the data of contrast table It is compared, most ID yards of comparative result is assigned to flag bit at last;
(6) protection mechanism judges whether system needs normal operation according to flag bit:Flag bit is added in the operation of system Judgement, when flag bit is effective, then system perform effectively operation, otherwise directly skip or log off, ensured with this be The normal operation of function of uniting.
2. the Implementation of Embedded System method of anti-copying as claimed in claim 1, its characteristic is that described ID yards is embedded Other have ID yards of the external chip of uniqueness in system control chip ID yards or embedded system.
3. the Implementation of Embedded System method of anti-copying as claimed in claim 1, its characteristic is to read ID yard of reading Location obtains by the indirect computing of variable.
CN201611216267.XA 2016-12-26 2016-12-26 Method for realizing anti-copy embedded system Active CN106874775B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611216267.XA CN106874775B (en) 2016-12-26 2016-12-26 Method for realizing anti-copy embedded system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611216267.XA CN106874775B (en) 2016-12-26 2016-12-26 Method for realizing anti-copy embedded system

Publications (2)

Publication Number Publication Date
CN106874775A true CN106874775A (en) 2017-06-20
CN106874775B CN106874775B (en) 2020-07-07

Family

ID=59164253

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611216267.XA Active CN106874775B (en) 2016-12-26 2016-12-26 Method for realizing anti-copy embedded system

Country Status (1)

Country Link
CN (1) CN106874775B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108304700A (en) * 2017-12-19 2018-07-20 浙江泰米电子科技有限公司 The anti-decompiling encryption method of software based on MCU
CN110807177A (en) * 2019-11-06 2020-02-18 南京法艾博光电科技有限公司 Reverse engineering defense device and method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102495990A (en) * 2011-12-07 2012-06-13 惠州市德赛西威汽车电子有限公司 Software protection method based on microchip
CN105260627A (en) * 2015-09-18 2016-01-20 许继集团有限公司 Anti-copy method for embedded device program
CN106156550A (en) * 2016-07-04 2016-11-23 广州市鸿远电子科技有限公司 A kind of chip prevents the method cracked

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102495990A (en) * 2011-12-07 2012-06-13 惠州市德赛西威汽车电子有限公司 Software protection method based on microchip
CN105260627A (en) * 2015-09-18 2016-01-20 许继集团有限公司 Anti-copy method for embedded device program
CN106156550A (en) * 2016-07-04 2016-11-23 广州市鸿远电子科技有限公司 A kind of chip prevents the method cracked

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108304700A (en) * 2017-12-19 2018-07-20 浙江泰米电子科技有限公司 The anti-decompiling encryption method of software based on MCU
CN110807177A (en) * 2019-11-06 2020-02-18 南京法艾博光电科技有限公司 Reverse engineering defense device and method

Also Published As

Publication number Publication date
CN106874775B (en) 2020-07-07

Similar Documents

Publication Publication Date Title
Kayaalp et al. A high-resolution side-channel attack on last-level cache
TWI334130B (en) Embedded system insuring security and integrity, and method of increasing security thereof
US9514305B2 (en) Code pointer authentication for hardware flow control
KR101863143B1 (en) Memory integrity
US8065532B2 (en) Cryptographic architecture with random instruction masking to thwart differential power analysis
Hwang et al. Securing embedded systems
RU2541196C2 (en) Method of providing software integrity
CN110008745B (en) Encryption method, computer equipment and computer storage medium
US20030120605A1 (en) System and method for preventing unauthorized use of protected software utilizing a portable security device
CN110659458A (en) Central processor design method supporting software code data secret credible execution
KR20060135467A (en) System and method of using a protected non-volatile memory
CN103903043B (en) A kind of smart card Trinity preventing side-channel attack means of defence and system
US7877615B2 (en) Semiconductor devices and scrambled data transmission methods thereof
CN109274661A (en) A kind of bidirectional identity authentication prevents the key storage and extracting method of Replay Attack
CN106874775A (en) A kind of Implementation of Embedded System method of anti-copying
CN114662135A (en) Data access method, computer device and readable storage medium
CN108334754A (en) The encrypting and decrypting method and system of embedded system program
CN105608775B (en) A kind of method of authentication, terminal, access card and SAM card
CN116302563A (en) Edge computing method and edge computing service system
KR20060067584A (en) Smart card having hacking prevention function
CN103336919A (en) System and method for achieving instrument encryption verification control function
EP3046095B1 (en) A method of protecting diverse applications stored on an integrated circuit using PUFs
CN209103293U (en) Electronic equipment
CN101364249A (en) Safety algorithm protection method
Zaharis et al. Live forensics framework for wireless sensor nodes using sandboxing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant