CN109214217B - Anti-cracking method for microcontroller chip - Google Patents
- ️Fri Nov 26 2021
CN109214217B - Anti-cracking method for microcontroller chip - Google Patents
Anti-cracking method for microcontroller chip Download PDFInfo
-
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
- 2018-09-07 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
- 238000000034 method Methods 0.000 title claims abstract description 14
- 238000005336 cracking Methods 0.000 title claims description 8
- 230000009545 invasion Effects 0.000 abstract description 3
- 238000010586 diagram Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
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/70—Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
- G06F21/71—Protecting 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/75—Protecting 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
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Theoretical Computer Science (AREA)
- Mathematical Physics (AREA)
- Computer Security & Cryptography (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Storage Device Security (AREA)
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
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.
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 partyPublication 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 partyPublication 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 |
EP1281123A1 (en) * | 2000-05-04 | 2003-02-05 | Koninklijke Philips Electronics N.V. | Method, system and computer program for data management on a 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 |
-
2018
- 2018-09-07 CN CN201811046315.4A patent/CN109214217B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN109214217A (en) | 2019-01-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9836392B2 (en) | 2017-12-05 | Storage control apparatus to control pre-processing operations |
US7778078B2 (en) | 2010-08-17 | Memory system and control method thereof |
US8452913B2 (en) | 2013-05-28 | Semiconductor memory device and method of processing data for erase operation of semiconductor memory device |
KR100347450B1 (en) | 2003-01-15 | How to control software write protection of nonvolatile memory, memory card and information processing device and nonvolatile memory using it |
US7934053B2 (en) | 2011-04-26 | Flash memory storage device for adjusting efficiency in accessing flash memory |
TW200303543A (en) | 2003-09-01 | Nonvolatile semiconductor memory device programming second dynamic reference cell according to threshold value of first dynamic reference cell |
JP3812933B2 (en) | 2006-08-23 | File system and control method thereof |
KR101506336B1 (en) | 2015-03-27 | Nonvolatile memory device having oxide film recovery function and its block management method |
WO2010002666A2 (en) | 2010-01-07 | Nand memory |
JP2009217391A (en) | 2009-09-24 | Memory system |
JP2004310477A (en) | 2004-11-04 | Memory card |
JPH10134586A (en) | 1998-05-22 | Nonvolatile semiconductor memory device |
KR20080085574A (en) | 2008-09-24 | Apparatus and method for garbage collection of nonvolatile memory |
KR20140133427A (en) | 2014-11-19 | Method for managing data stored in flash memory and associated memory device and controller |
Hasan et al. | 2020 | Data recovery from {“Scrubbed”}{NAND} flash storage: Need for analog sanitization |
US10445008B2 (en) | 2019-10-15 | Data management method for memory and memory apparatus |
KR100643287B1 (en) | 2006-11-10 | Apparatus and method for processing data in flash memory |
CN109214217B (en) | 2021-11-26 | Anti-cracking method for microcontroller chip |
JP4988054B2 (en) | 2012-08-01 | Memory system |
US20200097215A1 (en) | 2020-03-26 | Adaptive solid state device management based on data expiration time |
US20090119782A1 (en) | 2009-05-07 | Method and device for digital rights protection |
TWI705372B (en) | 2020-09-21 | Flash memory device and controlling method thereof |
CN113885791B (en) | 2024-07-16 | Data writing method, data reading method and data writing device for Flash memory |
US8446768B2 (en) | 2013-05-21 | Control device for nonvolatile memory and method of operating control device |
TWI661300B (en) | 2019-06-01 | Data management method for memory and memory apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
2019-01-15 | PB01 | Publication | |
2019-01-15 | PB01 | Publication | |
2019-02-12 | SE01 | Entry into force of request for substantive examination | |
2019-02-12 | SE01 | Entry into force of request for substantive examination | |
2021-11-26 | GR01 | Patent grant | |
2021-11-26 | GR01 | Patent grant |