CN109214217B - Anti-cracking method for microcontroller chip - Google Patents

Anti-cracking method for microcontroller chip Download PDF

Info

Publication number
CN109214217B
CN109214217B CN201811046315.4A CN201811046315A CN109214217B CN 109214217 B CN109214217 B CN 109214217B CN 201811046315 A CN201811046315 A CN 201811046315A CN 109214217 B CN109214217 B CN 109214217B
Authority
CN
China
Prior art keywords
circuit
erasing
chip
value
read
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
Application number
CN201811046315.4A
Other languages
Chinese (zh)
Other versions
CN109214217A (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 Hangshun Chip Technology R&D Co Ltd
Original Assignee
Shenzhen Hangshun Chip Technology R&D 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 Hangshun Chip Technology R&D Co Ltd filed Critical Shenzhen Hangshun Chip Technology R&D Co Ltd
Priority to CN201811046315.4A priority Critical patent/CN109214217B/en
Publication of CN109214217A publication Critical patent/CN109214217A/en
Application granted granted Critical
Publication of CN109214217B publication Critical patent/CN109214217B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/71Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information
    • G06F21/75Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information by inhibiting the analysis of circuitry or operation

Abstract

The invention provides a method for preventing a microcontroller chip from being cracked, which relates to the fields of industrial control, Internet of things, intelligent home, intelligent wearing equipment and the like, and comprises the following steps: s1: structuring the protection bit erasure request by a circuit; s2: automatically loading the record value of the erasing times through a circuit; s3: and judging whether the recording times of the circuit reach a set threshold value or not through the circuit, neglecting the erasing and writing request of the read-write protection bit after the recording times reach the set threshold value, and simultaneously generating an internal interrupt request of the chip. The maximum number of times that the read protection bit of the non-volatile memory data is erased is limited by the microcontroller chip internal circuit. When the recorded erasing times reach the rated value, the chip internal circuit ignores all erasing requests of the read protection bits, and the erasing requests of the read protection bits of the times can trigger the internal interruption of the microcontroller chip so as to inform the application program in the chip of illegal invasion.

Description

Anti-cracking method for microcontroller chip
Technical Field
The invention relates to the fields of industrial control, Internet of things, intelligent home, intelligent wearing equipment and the like, in particular to a method for preventing cracking of a microcontroller chip.
Background
The applications and data of the microcontroller chip are typically stored in non-volatile memory internal to the chip. In order to prevent a pirate from directly reading out programs and data stored in the chip, the microcontroller chip generally defines one or several bytes of data in a nonvolatile memory in the chip as a read protection bit. Once the user program sets the read protection bit to valid data, the data stored inside the microcontroller chip cannot be accessed from the outside through the interface of the chip. If the user changes the protection bit from the active protection state to the inactive state, the microcontroller chip will erase all data stored in the entire nonvolatile memory inside the chip, and then change the read protection bit to the inactive state.
The current cracking method for protecting the internal data of the microcontroller chip aiming at the reading protection bit is as follows: the read protection bit is erased by the external device continuously requesting it, and the data written each time must be valid data capable of maintaining the read protection state. Therefore, when the continuous erasing times exceed the service life of the nonvolatile memory in the chip, the read protection bit of the microcontroller chip can be changed into an invalid value and the whole erasing action of the nonvolatile memory cannot be triggered. And then the pirate can read all the data in the chip through the interface of the chip to finish the pirate.
There is therefore a need for a mechanism to prevent brute force cracking of the read protection bits of non-volatile memory data in a microcontroller chip.
Disclosure of Invention
The invention aims to provide a method for preventing a microcontroller chip from being cracked, which has the characteristic of preventing a read protection bit of nonvolatile memory data in the microcontroller chip from being cracked.
The invention is realized by the following technical scheme:
a method for preventing cracking of a microcontroller chip comprises the following steps:
s1: recording the read protection bit erasing request through a circuit;
s2: automatically loading the record value of the erasing times through a circuit;
s3: judging whether the recording times of the circuit reach a set threshold value or not through the circuit, and ignoring the read protection bit erasing request after the recording times reach the set threshold value;
wherein, the set threshold is smaller than the erasing operation life of the nonvolatile memory of the chip, and the circuit allows the program to read the recorded value of the erasing times, but does not allow the program to rewrite the recorded value of the erasing times.
Preferably, the chip internal interrupt request is generated while the read protection bit erasure request is ignored in S3.
Preferably, in S3, when the number of times of recording does not reach the set threshold, the circuit increments the erasure recording value by 1, and writes the result back to the recording address.
Preferably, the read protection bit is erased by circuitry after the result is written back to the record address.
Compared with the prior art, the invention has the following advantages:
the maximum number of times that the read protection bit of the non-volatile memory data is erased is limited by the microcontroller chip internal circuit. And opening up a new number of times of erasing and writing the read protection data in the address recording chip in the nonvolatile memory, adding 1 to the value in the recording address by the read protection bit every time of erasing and writing, and simultaneously, the value of the address cannot be rewritten by a user program. When the recorded erasing times reach the rated value, the chip internal circuit ignores all erasing requests of the read protection bits, and the erasing requests of the read protection bits of the times can trigger the internal interruption of the microcontroller chip so as to inform the application program in the chip of illegal invasion.
Drawings
Fig. 1 is a flow chart diagram of a method for preventing a microcontroller chip from being cracked.
Detailed Description
The technical solutions in the embodiments of the present invention are clearly and completely described below, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
A method for preventing microcontroller chips from cracking, as shown in fig. 1, comprises the following steps:
s1: recording the read protection bit erasing request through a circuit;
s2: automatically loading the record value of the erasing times through a circuit;
s3: judging whether the recorded times of the circuit reach a set threshold value or not through the circuit, ignoring a read protection bit erasing request after the recorded times reach the set threshold value, and generating a chip internal interrupt request;
when the recording times do not reach the set threshold value, the circuit adds 1 to the erasing record value and writes the result back to the recording address
In this embodiment, the erase/write operation threshold of the read protection bit set in the circuit is smaller than the erase/write operation lifetime of the nonvolatile memory.
In the present embodiment, the circuit allows the program to read the recorded value of the number of times of erasing operation, but does not allow the program to rewrite the recorded value of the number of times.
Compared with the prior art, the invention has the following advantages:
the maximum number of times that the read protection bit of the non-volatile memory data is erased is limited by the microcontroller chip internal circuit. And opening up a new number of times of erasing and writing the read protection data in the address recording chip in the nonvolatile memory, adding 1 to the value in the recording address by the read protection bit every time of erasing and writing, and simultaneously, the value of the address cannot be rewritten by a user program. When the recorded erasing times reach the rated value, the chip internal circuit ignores all erasing requests of the read protection bits, and the erasing requests of the read protection bits of the times can trigger the internal interruption of the microcontroller chip so as to inform the application program in the chip of illegal invasion.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.
Furthermore, it should be understood that although the present description refers to embodiments, not every embodiment may contain only a single embodiment, and such description is for clarity only, and those skilled in the art should integrate the description, and the embodiments may be combined as appropriate to form other embodiments understood by those skilled in the art.

Claims (3)

1. A method for preventing cracking of a microcontroller chip is characterized by comprising the following steps: comprises the following steps:
s1: recording the read protection bit erasing request through a circuit;
s2: automatically loading the record value of the erasing times through a circuit;
s3: judging whether the recorded times of the circuit reach a set threshold value or not through the circuit, ignoring a read protection bit erasing request after the recorded times reach the set threshold value, and generating a chip internal interrupt request;
wherein, the set threshold is smaller than the erasing operation life of the nonvolatile memory of the chip, and the circuit allows the program to read the recorded value of the erasing times, but does not allow the program to rewrite the recorded value of the erasing times.
2. The method for preventing the microcontroller chip from being cracked according to claim 1, wherein the method comprises the following steps: in S3, when the number of times of recording does not reach the set threshold, the circuit increments the erasure recording value by 1, and writes the result back to the recording address.
3. The method for preventing the microcontroller chip from being cracked according to claim 2, wherein the method comprises the following steps: and after the result is written back to the record address, erasing and writing of the read protection bit are executed through the circuit.
CN201811046315.4A 2018-09-07 2018-09-07 Anti-cracking method for microcontroller chip Active CN109214217B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811046315.4A CN109214217B (en) 2018-09-07 2018-09-07 Anti-cracking method for microcontroller chip

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811046315.4A CN109214217B (en) 2018-09-07 2018-09-07 Anti-cracking method for microcontroller chip

Publications (2)

Publication Number Publication Date
CN109214217A CN109214217A (en) 2019-01-15
CN109214217B true CN109214217B (en) 2021-11-26

Family

ID=64986746

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811046315.4A Active CN109214217B (en) 2018-09-07 2018-09-07 Anti-cracking method for microcontroller chip

Country Status (1)

Country Link
CN (1) CN109214217B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112764691A (en) * 2021-02-05 2021-05-07 浙江威固信息技术有限责任公司 Solid state disk and safety management method thereof

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4322613A (en) * 1980-04-08 1982-03-30 Vendacopy, Inc. Method for tamper-proofing magnetic stripe card reader
CN1229253A (en) * 1998-01-25 1999-09-22 深圳市明华澳汉磁卡系列有限公司 Mass storage enciphered storage chip
KR100818035B1 (en) * 2000-05-04 2008-03-31 엔엑스피 비 브이 Method, system and computer program for data management on storage medium
US6691204B1 (en) * 2000-08-25 2004-02-10 Micron Technology, Inc. Burst write in a non-volatile memory device
US7391654B2 (en) * 2005-05-11 2008-06-24 Micron Technology, Inc. Memory block erasing in a flash memory device
US7631161B2 (en) * 2005-10-21 2009-12-08 International Business Machines Corporation Apparatus, system, and method for writing data to protected partitions of storage media
CN101661796B (en) * 2008-08-25 2012-02-29 北京兆易创新科技有限公司 Nonvolatile storage and data protection method thereof
CN101872327A (en) * 2009-04-23 2010-10-27 深圳富泰宏精密工业有限公司 Data erasing system of flash memory and method thereof
CN102237117A (en) * 2010-05-04 2011-11-09 国民技术股份有限公司 Method and device for calculating service life of mobile storage device
CN102929275B (en) * 2012-11-09 2016-06-15 重庆长安汽车股份有限公司 The safety monitoring method and system of automobile controller
TWI502400B (en) * 2014-07-30 2015-10-01 Elan Microelectronics Corp Microcontroller unit and protecting method for a data in the microcontroller unit
CN107797765B (en) * 2017-09-26 2020-09-25 昆明理工大学 Method for prolonging service life of electrically erasable storage element
CN108304700A (en) * 2017-12-19 2018-07-20 浙江泰米电子科技有限公司 The anti-decompiling encryption method of software based on MCU

Also Published As

Publication number Publication date
CN109214217A (en) 2019-01-15

Similar Documents

Publication Publication Date Title
US9836392B2 (en) Storage control apparatus to control pre-processing operations
US7778078B2 (en) Memory system and control method thereof
US8452913B2 (en) Semiconductor memory device and method of processing data for erase operation of semiconductor memory device
KR100347450B1 (en) How to control software write protection of nonvolatile memory, memory card and information processing device and nonvolatile memory using it
US7663933B2 (en) Memory controller
JP3812933B2 (en) File system and control method thereof
US20090204746A1 (en) Flash memory storage device for adjusting efficiency in accessing flash memory
KR101506336B1 (en) Nonvolatile memory device recoverying oxide layer and block management method thereof
WO2010002666A2 (en) Nand memory
KR20100096457A (en) Memory system and data processing method thereof
JP2009217391A (en) Memory system
JP2004310477A (en) Memory card
JPH10134586A (en) Nonvolatile semiconductor memory device
KR20140133427A (en) Method for managing data stored in flash memory and associated memory device and controller
US10445008B2 (en) Data management method for memory and memory apparatus
KR100643287B1 (en) Data processing device and method for flash memory
Hasan et al. Data recovery from {“Scrubbed”}{NAND} flash storage: Need for analog sanitization
CN109214217B (en) Anti-cracking method for microcontroller chip
JP4988054B2 (en) Memory system
US20090119782A1 (en) Method and device for digital rights protection
CN109522237B (en) Data management method of memory and memory device
US20200097215A1 (en) Adaptive solid state device management based on data expiration time
US8446768B2 (en) Control device for nonvolatile memory and method of operating control device
TWI705372B (en) Flash memory device and controlling method thereof
TWI661300B (en) Data management method for memory and memory apparatus

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