CN111209605A - Encryption system and method for single chip microcomputer program - Google Patents
Encryption system and method for single chip microcomputer program Download PDFInfo
- Publication number
- CN111209605A CN111209605A CN201911309012.1A CN201911309012A CN111209605A CN 111209605 A CN111209605 A CN 111209605A CN 201911309012 A CN201911309012 A CN 201911309012A CN 111209605 A CN111209605 A CN 111209605A
- Authority
- CN
- China
- Prior art keywords
- encryption
- board
- chip microcomputer
- data
- user
- 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.)
- Withdrawn
Links
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/72—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 in cryptographic circuits
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 discloses an encryption system of a single chip microcomputer program, wherein a single chip microcomputer user board is provided with an encryption unit and a program unit, the encryption unit is used for sending an ID reading of a user board single chip microcomputer to a single chip microcomputer encryption board through a UART interface, and then receiving data calculated by the single chip microcomputer encryption board and storing the data to an OTP designated address; the program unit is used for reading the ID and then reading the data of the OTP designated address during running, running the same algorithm as the encryption board, and running the code normally used by the user if the data are equal; the invention utilizes the single chip to have the unique chip ID number and the internal OTP memory, and stores the data in the one-time OTP by using the self-defining algorithm of the encryption board, and the ID and the chip are bound, and the programs of each product after encryption are different, so that the programs can only run in the chip of the product, the programs are difficult to steal and cannot be used after being stolen, the defect of low safety coefficient of the single chip in the prior art is overcome, and the safety effect of using the single chip can be improved.
Description
Technical Field
The invention relates to the technical field of single-chip microcomputers, in particular to an encryption system and method for a single-chip microcomputer program.
Background
Many products developed by single chip microcomputers in the market have no encryption or adopt the original encryption method of chips, and when the products are sold in the market, some illegal persons can easily steal programs in the development tools or other strong tools with the same model to quickly imitate the products, so that the safety is not high.
The invention adopts the original global unique ID of the single chip microcomputer chip to carry out the self-defining algorithm and then stores the algorithm into the address appointed by the single chip microcomputer OTP, when the user program is used, the content of the appointed OTP address is read, the same self-defining algorithm is operated, the program encryption is achieved, and the ID number is globally unique and can only be used in the chip and the algorithm is self-defined by a separate encryption board, so that the problem of difficult decomposition is solved, and the higher product safety protection is achieved.
Disclosure of Invention
The invention aims to provide an encryption system and method for a single chip microcomputer program.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows: an encryption system of a single chip microcomputer program comprises the following components:
the singlechip user board is used for receiving the data sent by the singlechip encryption board;
the single-chip microcomputer encryption board is used for reading the ID of the single-chip microcomputer user board and sending data to the single-chip microcomputer user board;
the single chip microcomputer user board is provided with an encryption unit and a program unit, wherein the encryption unit is used for sending the ID reading of the user board single chip microcomputer to the single chip microcomputer encryption board through a UART interface, and then receiving data calculated by the single chip microcomputer encryption board and storing the data to an OTP (one time programmable) designated address; the program unit is used for reading the ID and then reading the data of the OTP designated address during running, running the same algorithm as the encryption board, and running the code normally used by the user if the data are equal;
the single-chip microcomputer encryption board is provided with a calculation unit and is used for receiving ID data sent by the single-chip microcomputer user board through a UART interface and then calculating, and the single-chip microcomputer encryption board sends the calculated data to the single-chip microcomputer user board.
Preferably, the single chip microcomputer user board comprises the following components:
the data transceiving module is used for transceiving data between the singlechip user board and the singlechip encryption board;
and the comparison module is used for comparing the encrypted data with the data of the encryption board, if the encrypted data are the same as the data of the encryption board, the code normally used by the user is operated, and otherwise, the encrypted data are not operated.
Preferably, the single chip microcomputer encryption board comprises the following components:
the random code module is used for receiving the ID sent by the singlechip user board and generating a random code with an ID identification according to the ID:
the encryption module encrypts a random code with an ID (identity) by adopting an encryption algorithm to generate an encrypted code;
and the output module is used for sending the encryption code to the singlechip user board.
Preferably, the singlechip user board is a GD32E103C8T6 chip.
An encryption method for a single chip microcomputer program comprises the following steps:
when in burning, the singlechip encryption board is inserted firstly and then powered on, the singlechip user board detects the encryption board, and the encryption program is operated to read and send the ID to the singlechip encryption board;
the singlechip encryption board receives the ID data, calculates a result value through a custom algorithm and then sends the result value back to the singlechip user board;
and the singlechip user board stores the result value data to the OTP designated address, namely encryption is completed, the encryption board is pulled out, the OTP designated address data is read and compared with the result value, and if the result value is equal, the code normally used by the user is operated, and if the result value is not equal, the operation is not performed.
Compared with the prior art, the invention has the advantages that:
the invention utilizes the single chip to have the unique chip ID number and the internal OTP memory, and stores the data in the one-time OTP by using the self-defining algorithm of the encryption board, and the ID and the chip are bound, and the programs of each product after encryption are different, so that the programs can only run in the chip of the product, the programs are difficult to steal and cannot be used after being stolen, the defect of low safety coefficient of the single chip in the prior art is overcome, and the safety effect of using the single chip can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a block diagram of an encryption system for a single-chip microcomputer program according to the present invention;
fig. 2 is a flow chart of an encryption method of a single chip microcomputer program.
Detailed Description
The preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings so that the advantages and features of the present invention can be more easily understood by those skilled in the art, and the scope of the present invention will be more clearly and clearly defined.
Referring to fig. 1, the invention provides an encryption system for a single chip microcomputer program, which comprises a single chip microcomputer user board and a encryption module, wherein the single chip microcomputer user board is used for receiving data sent by the single chip microcomputer encryption board; the single-chip microcomputer encryption board is used for reading the ID of the single-chip microcomputer user board and sending data to the single-chip microcomputer user board;
the single chip microcomputer user board is provided with an encryption unit and a program unit, wherein the encryption unit is used for sending the ID reading of the user board single chip microcomputer to the single chip microcomputer encryption board through a UART interface, and then receiving data calculated by the single chip microcomputer encryption board and storing the data into an OTP (one time programmable) designated address; the program unit is used for reading the ID and then reading the data of the OTP designated address during running, running the same algorithm as the encryption board, and running the code normally used by the user if the data are equal;
the single-chip microcomputer encryption board is provided with a calculation unit and is used for receiving ID data sent by the single-chip microcomputer user board through a UART interface and then calculating, and the single-chip microcomputer encryption board sends the calculated data to the single-chip microcomputer user board.
In this embodiment, the single chip microcomputer user board includes the following components:
the data transceiving module is used for transceiving data between the singlechip user board and the singlechip encryption board;
and the comparison module is used for comparing the encrypted data with the data of the encryption board, if the encrypted data are the same as the data of the encryption board, the code normally used by the user is operated, and otherwise, the encrypted data are not operated.
In this embodiment, the single chip microcomputer encryption board comprises the following components:
the random code module is used for receiving the ID sent by the singlechip user board and generating a random code with an ID identification according to the ID:
the encryption module encrypts a random code with an ID (identity) by adopting an encryption algorithm to generate an encrypted code;
and the output module is used for sending the encryption code to the singlechip user board.
In this embodiment, the single chip microcomputer user board is a GD32E103C8T6 chip, and the GD32E103C8T6 chip has a globally unique chip ID number and an internal OTP memory.
Referring to fig. 2, an encryption method for a single chip microcomputer program includes the following steps:
when in burning, the singlechip encryption board is inserted firstly and then powered on, the singlechip user board detects the encryption board, and the encryption program is operated to read and send the ID to the singlechip encryption board;
the encryption board of the single chip microcomputer receives the ID data, and the ID data is sent to a user board of the single chip microcomputer after a result value is obtained through a custom algorithm, for example, the custom algorithm calculates ID/2-8, and illegal personnel cannot know the algorithm in the encryption board;
and the singlechip user board stores the result value data to an OTP designated address, such as a designated address of 0x1fff7068, namely encryption is completed, the encryption board is pulled out, the OTP designated address data is read and compared with the result value, and if the OTP designated address data is equal to the result value, the code normally used by the user is operated, and the operation is not performed.
Although the embodiments of the present invention have been described with reference to the accompanying drawings, various changes or modifications may be made by the patentees within the scope of the appended claims, and within the scope of the invention, as long as they do not exceed the scope of the invention described in the claims.
Claims (5)
1. An encryption system of a single chip microcomputer program is characterized by comprising the following components:
the singlechip user board is used for receiving the data sent by the singlechip encryption board;
the single-chip microcomputer encryption board is used for reading the ID of the single-chip microcomputer user board and sending data to the single-chip microcomputer user board;
the single chip microcomputer user board is provided with an encryption unit and a program unit, wherein the encryption unit is used for sending the ID reading of the user board single chip microcomputer to the single chip microcomputer encryption board through a UART interface, and then receiving data calculated by the single chip microcomputer encryption board and storing the data to an OTP (one time programmable) designated address; the program unit is used for reading the ID and then reading the data of the OTP designated address during running, running the same algorithm as the encryption board, and running the code normally used by the user if the data are equal;
the single-chip microcomputer encryption board is provided with a calculation unit and is used for receiving ID data sent by the single-chip microcomputer user board through a UART interface and then calculating, and the single-chip microcomputer encryption board sends the calculated data to the single-chip microcomputer user board.
2. The encryption system of the single chip microcomputer program according to claim 1, characterized in that: the singlechip user board comprises the following components:
the data transceiving module is used for transceiving data between the singlechip user board and the singlechip encryption board;
and the comparison module is used for comparing the encrypted data with the data of the encryption board, if the encrypted data are the same as the data of the encryption board, the code normally used by the user is operated, and otherwise, the encrypted data are not operated.
3. The encryption system of the single chip microcomputer program according to claim 1, characterized in that: the single-chip microcomputer encryption board comprises the following components:
the random code module is used for receiving the ID sent by the singlechip user board and generating a random code with an ID identification according to the ID:
the encryption module encrypts a random code with an ID (identity) by adopting an encryption algorithm to generate an encrypted code;
and the output module is used for sending the encryption code to the singlechip user board.
4. The encryption system of the single chip microcomputer program according to claim 1, characterized in that: the singlechip user board is a GD32E103C8T6 chip.
5. A method for encrypting a single chip microcomputer program is characterized by comprising the following steps:
when in burning, the singlechip encryption board is inserted firstly and then powered on, the singlechip user board detects the encryption board, and the encryption program is operated to read and send the ID to the singlechip encryption board;
the singlechip encryption board receives the ID data, calculates a result value through a custom algorithm and then sends the result value back to the singlechip user board;
and the singlechip user board stores the result value data to the OTP designated address, namely encryption is completed, the encryption board is pulled out, the OTP designated address data is read and compared with the result value, and if the result value is equal, the code normally used by the user is operated, and if the result value is not equal, the operation is not performed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911309012.1A CN111209605A (en) | 2019-12-18 | 2019-12-18 | Encryption system and method for single chip microcomputer program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911309012.1A CN111209605A (en) | 2019-12-18 | 2019-12-18 | Encryption system and method for single chip microcomputer program |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111209605A true CN111209605A (en) | 2020-05-29 |
Family
ID=70788216
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911309012.1A Withdrawn CN111209605A (en) | 2019-12-18 | 2019-12-18 | Encryption system and method for single chip microcomputer program |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111209605A (en) |
-
2019
- 2019-12-18 CN CN201911309012.1A patent/CN111209605A/en not_active Withdrawn
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108880797B (en) | Authentication method of Internet of things equipment and Internet of things equipment | |
CN106529969B (en) | Method and system for checking fake source by NFC | |
CN107659632A (en) | A kind of file encryption-decryption method, device and computer-readable recording medium | |
GB2387937B (en) | Secure cpu and memory management unit with cryptographic extensions | |
CN109522328B (en) | Data processing method and device, medium and terminal thereof | |
US20040019796A1 (en) | System and method for firmware authentication | |
JP2005525662A5 (en) | ||
CN101373440B (en) | Method and device for processing firmware upgrading data | |
CN102855574A (en) | Method and system for identifying commodity information based on NFC (Near Field Communication) | |
CN101102192A (en) | Authentication device, method and system | |
CN107133807A (en) | A kind of digital anti-fake system do not networked, method and device | |
CN201185082Y (en) | Mobile memory with high safety | |
KR101425456B1 (en) | Information generation system and method therefor | |
CN107958141A (en) | A kind of method for protecting software based on chip ID number | |
CN104268483A (en) | Data protecting system, device and method | |
CN108171018B (en) | Software encryption and decryption method for vehicle-mounted decoder | |
CN109150813B (en) | Equipment verification method and device | |
CN111209605A (en) | Encryption system and method for single chip microcomputer program | |
CN102867260A (en) | Bluetooth-based commodity information identification method and system | |
CN100426178C (en) | A method for identification of driver identity | |
CN116644485A (en) | Anti-counterfeiting authentication method and device for server memory, electronic equipment and storage medium | |
CN110880965A (en) | Outgoing electronic document encryption method, system, terminal and storage medium | |
CN106156548A (en) | Authentication method and device for program encryption | |
CN107330318A (en) | A kind of binding encryption method of digital signal panel card and its debugging system | |
CN202870899U (en) | Bluetooth-based commodity information identification system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20200529 |
|
WW01 | Invention patent application withdrawn after publication |