Chip encryption method and encryption chip
By synthesizing a user-customized password and real-time clock information into the chip to generate a combined password and expanding the protection area, the complexity and high cost of existing chip encryption methods are solved, achieving efficient chip anti-theft protection.
Patent Information
- Application Number
- CN202210563445.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-20
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2042-05-20
AI Technical Summary
Existing chip encryption methods are complex, increasing system costs and hardware overhead, while failing to effectively prevent chip theft, especially in situations of chip shortages, leading to economic losses for enterprises.
By combining user-defined passwords with real-time clock information to generate combined passwords, and using different combined passwords at different power-on times, the difficulty of decryption is increased by extending the protection area and modifying the bus mapping address.
This effectively increases the difficulty of decrypting the chip, reduces hardware overhead, shortens startup time, and enhances chip security and anti-theft protection.
Smart Images

Figure CN117131549B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of semiconductor technology, and in particular to a chip encryption method and an encryption chip. Background Technology
[0002] The programs and data of microcontroller units (MCUs) integrated circuit chips are typically stored in non-volatile memory. MCU chip manufacturers generally design encryption mechanisms for their customers to protect their program code from piracy. The first method of chip piracy is software encryption, which involves encrypting the program code using software methods. These methods include: using different disassemblers to scramble the disassembled code of a normal program, obfuscating parts of the program code and data code, or using encryption software to encrypt the program to be executed. The second method is to use external encryption chips or built-in encryption modules to synchronously encrypt and decrypt the data stream through hardware circuitry. The addition of an algorithm encryption module increases the difficulty of cracking. The third method utilizes the chip's built-in encryption function, using a built-in encryption lock or encrypted bytes to protect the on-chip program. The fourth anti-hacking method distinguishes non-volatile memory cells into erasable memory and read-only memory cells. Erasable memory stores important program data, while read-only memory stores the bootloader. Once the bootloader is entered, it immediately erases the data in the erasable memory to ensure the security of the chip's commercial program. Another hacking method records the number of times the non-volatile memory's read protection bits are erased. For read protection bit erasure operations exceeding a given threshold, the principle of ignoring them is applied to protect the circuit's read protection bits, achieving the effect of thwarting hacking.
[0003] However, the above encryption methods have the following limitations. First, software encryption forces software developers to incorporate highly concealed, reliable encryption algorithms with few design flaws into commercial programs during the initial design phase, causing inconvenience and significantly impacting development efficiency. Second, anti-cracking methods either add an encryption module or a separate encryption chip within the chip, resulting in complex algorithms, increased area overhead, and higher costs. Third, anti-cracking methods require a separate read-only memory (ROM) unit for the BOOTLOAD program, increasing chip area and making them unsuitable for systems without ROM memory, further increasing costs. Fourth, methods achieve anti-cracking by limiting the number of times the erase protection bit can be erased, but the read protection method is highly uniform across different customers, lacking customer-specificity.
[0004] Furthermore, all the anti-hacking methods mentioned above are only to prevent customers' business programs from being stolen. However, in the event of a chip shortage, some companies do not need to steal the business programs of their competitors, but instead want to steal the chips of their competitors. In this case, they do not need to crack the chips, but only need to erase the chips to blank and burn their own business programs to obtain illegal profits, while causing economic losses to the original chip holders. Summary of the Invention
[0005] In view of the shortcomings of the prior art described above, the purpose of this invention is to provide a chip encryption method and encryption chip to solve the problem that chip encryption in the prior art requires complex encryption algorithms, additional encryption modules, and additional storage units, which leads to increased system complexity and cost.
[0006] To achieve the above and other related objectives, the present invention provides a chip encryption method, characterized in that the chip encryption method includes at least:
[0007] 1) Power on or reset, start the configuration word and capture the real-time clock;
[0008] 2) Record the user-customized password and the current clock information, combine the user-customized password and the current clock information, and generate a first combined password;
[0009] 3) Compare the pre-stored password with the first combined password. When the first combined password matches the pre-stored password, perform the decryption operation. After the decryption operation is completed, end all operations. When the first combined password does not match the pre-stored password, maintain the encrypted state and execute step 4).
[0010] 4) Chip reset and release, read the second combination of passwords;
[0011] 5) Compare the first set of passwords with the second set of passwords. When the first set of passwords matches the second set of passwords, perform the decryption operation. After the decryption operation is completed, end all operations.
[0012] If the first set of passwords does not match the second set of passwords, then the first set of passwords is reset.
[0013] Optionally, the user-defined password includes: a hierarchical field, a combination method field, and a user-defined field.
[0014] Optionally, the hierarchical field is defined as program-level encryption or chip-level encryption. When the hierarchical field is defined as program-level encryption, the chip encryption method only provides read protection, write protection, and page erase protection for the chip. When the hierarchical field is defined as chip-level protection, the chip encryption method provides read protection, write protection, page erase protection, and chip erase protection for the chip.
[0015] Optionally, the combination method field includes: most significant bit XOR operation, least significant bit XOR operation, and real-time clock information removal operation.
[0016] Optionally, the user-customized password and the real-time clock information are synthesized using a bitwise XOR method.
[0017] Optionally, one way to generate the second combined password is for the intruder to perform custom encryption processing on their exhaustive user-defined passwords to generate the second combined password.
[0018] Alternatively, another way to generate the second combined password is for the intruder to combine the user-customized secrets they exhaustively enumerate with the external clock information obtained in real time to generate the second combined password.
[0019] Optionally, the matching method between the first combined password and the second combined password includes: the first combined password and the second combined password are matched on the first comparison; and the first combined password and the second combined password do not match on the first comparison, and the comparison operation continues until the number of comparison operations is less than or equal to the maximum number of matching operations, at which point the first combined password and the second combined password are matched.
[0020] Optionally, the method in which the first combination password and the second combination password do not match includes: the first combination password and the second combination password do not match in the first comparison, and the comparison operation continues until the maximum number of matches is exceeded, wherein the first combination password and the second combination password do not match during the comparison operation.
[0021] Optionally, one way to reset the first combined password is to capture a real-time clock, record the current clock information, combine the current clock information with the user-customized password, and then reset the first combined password.
[0022] Optionally, another way to reset the first combined password is to capture a real-time clock, record the current clock information, change the user-customized password, combine the changed user-customized password with the current clock information, and reset the first combined password.
[0023] This invention provides an encryption chip, the architecture of which is a microprocessor or a digital signal processor, including a mapping module and an encryption module, for implementing the chip encryption method, wherein the mapping module and the encryption module merge the programming channel, debugging channel and central processing unit access channel of the encryption chip.
[0024] Optionally, the encryption module includes: a configuration word reading module, a real-time clock module, a user-defined password register, hierarchical combination password generation logic, a real-time clock capture register, a matching password register, a matching counter, encryption / decryption generation logic, and an OR gate, wherein: the input terminals of the configuration word module and the real-time clock module receive clock signals provided by a crystal oscillator; the input terminal of the user-defined password register is connected to the output terminal of the configuration word reading module; the input terminal of the real-time clock capture register is connected to the output terminal of the real-time clock module; the input terminal of the hierarchical combination password generation logic is connected to the output terminals of the user-defined password register and the real-time clock capture register; The input terminal of the matching password register receives the external input password transmitted via the peripheral bus; the input terminal of the encryption / decryption generation logic is connected to the output terminal of the hierarchical combination password generation logic and the matching password register, and outputs the encryption or decryption status based on the result of the comparison operation between the synthesized password and the external input password; the matching counter is connected to the control terminal of the matching password register and is used to count the comparison operation; the first input terminal of the OR gate is connected to the output terminal of the configuration word reading module, the second input terminal is connected to the output terminal of the matching counter, and the output terminal is connected to the control terminal of the user-customized password register and the real-time clock capture register.
[0025] Optionally, the frequency of the crystal oscillator is 32.768 kHz.
[0026] Optionally, the mapping module changes the bus mapping address of the encryption chip based on a trigger instruction, changing the startup mode of the encryption chip from flash memory startup to memory startup.
[0027] Optionally, the encryption module encrypts and protects the bus address of the encryption chip based on the trigger quality, expanding the protection area from the flash memory area to a combination of the flash memory area and the memory area.
[0028] As described above, the chip encryption method and encryption chip of the present invention have the following beneficial effects:
[0029] 1) This invention combines user passwords with real-time clock information, so that the encryption chip has different passwords at different power-on times, greatly increasing the difficulty of decryption with minimal hardware overhead.
[0030] 2) This invention changes the startup method of the encryption chip from flash memory to memory by modifying the bus mapping address, thereby reducing startup time and increasing the difficulty of cracking the chip.
[0031] 3) This invention expands the protection area from the flash memory area to a combination of the flash memory area and the memory area, effectively filling the loopholes and further increasing the difficulty of cracking the chip. Attached Figure Description
[0032] Figure 1 The diagram shown is an exemplary encryption chip architecture of the present invention.
[0033] Figure 2 The diagram shown is a functional flow diagram of the chip encryption method of the present invention.
[0034] Figure 3 The diagram shown is a schematic diagram of a logic function module structure that uses a chip encryption method according to the present invention.
[0035] Figure 4 The diagram shown is a schematic of the encryption chip architecture of the present invention.
[0036] Component designation explanation
[0037] 41 Mapping Module
[0038] 42 Encryption Module
[0039] Steps S1 to S5 Detailed Implementation
[0040] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention.
[0041] Please see Figures 1 to 4 It should be noted that the illustrations provided in this embodiment are only schematic representations of the basic concept of the present invention. The illustrations only show components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0042] Figure 1This paper demonstrates an encrypted chip architecture with two channels for reading and writing to the flash memory module. One channel allows the user to access the flash memory module via the microprocessor chip's bus (typically the AHB bus, or Advanced High Performance Bus, used for connecting high-performance modules such as CPUs, direct memory access modules, and digital signal processors, serving as the on-chip system bus for the system-on-a-chip. Features include: single-clock-edge operation; non-tri-state implementation; support for burst transfers; support for segmented transfers; support for multiple master controllers; configurable bus width from 32 bits to 128 bits; and support for byte, half-word, and word transfers). The other channel allows for read and write access to the flash memory module via a test-mode programming interface. Figure 1 The demonstrated encryption chip architecture shows that:
[0043] 1) The protection mechanism primarily protects commercial user programs inside the flash memory module.
[0044] 2) If the programming module and the microprocessor chip bus are not unified, it may lead to additional protection for commercial user programs inside the flash memory module, which will make the chip design more complicated, increase the chip area, and also make it easier for vulnerabilities to appear.
[0045] 3) Intruders can access the chip's memory module and write stolen programs through test mode programming interfaces (such as serial wire debug interfaces, i.e., SWD interfaces). They can then set the program counter pointer (PC pointer) to point to the program entry point in the memory module, read the contents of the flash memory module, and output the read contents through general-purpose input / output interfaces (i.e., GPIO), thereby cracking the chip.
[0046] 4) To expand the applications of their chips, chip manufacturers typically only restrict read / write and page erase permissions for flash memory modules, leaving the complete erasure of the entire flash memory module unrestricted. Intruders exploit this limitation, allowing them to steal chips for other purposes simply by performing a complete erase, thus harming the interests of users.
[0047] Therefore, this invention proposes a chip encryption method and an encryption chip, as detailed below:
[0048] Example 1
[0049] like Figure 2 As shown, this embodiment provides a chip encryption method, which includes at least:
[0050] S1: As Figure 2As shown, power on or reset, start the configuration word and capture the real-time clock.
[0051] Specifically, as an example, such as Figure 2 As shown, the configuration word (DCW), also known as the device configuration word, is a special program storage unit inside a chip (referring to a microprocessor or digital signal processor) that uses a Complex Instruction Set Computer (CISC) or Reduced Instruction Set Computer (RISC) architecture. It is freely configurable by the user to define performance options for some functional circuit units of the chip; in this case, it is mainly used to read user-defined passwords. A real-time clock (RTC) is an electronic device that outputs actual time like a clock. It is generally an integrated circuit, hence also called a clock chip. Its low power consumption (especially important when using an auxiliary power supply) allows the main system to handle more time-sensitive tasks, sometimes providing more accurate output than other methods. Real-time clocks are typically provided by crystal oscillators. For example, the frequency of a crystal oscillator is 32.768 kHz, which can provide accurate real-time clock information. It should be noted that the methods for obtaining real-time clock information include, but are not limited to, crystal oscillators. The specific frequency includes, but is not limited to, 32.768 kHz. Any method that can obtain accurate real-time clock information is applicable and is not limited to this embodiment.
[0052] S2: As Figure 2 As shown, the user-customized password and the current clock information are recorded, and the user-customized password and the current clock information are combined to generate a first combined password.
[0053] Specifically, as an example, such as Figure 2 and Figure 3 As shown, the user-defined password is stored in the chip's user-defined password register, facilitating its retrieval and matching during chip encryption. It should be noted that the storage method for the user-defined password includes, but is not limited to, the user-defined password register; any storage method capable of ensuring chip encryption is applicable and not limited to this embodiment.
[0054] Specifically, as an example, such as Figure 2 As shown, the user-customized password and the real-time clock information are synthesized using a bitwise XOR method. The user-customized password includes: a hierarchical field, a combination method field, and a user-defined field. The data structure of the user-customized password is shown in the following table:
[0055]
[0056] More specifically, the hierarchical field is defined as program-level encryption or chip-level encryption. When the hierarchical field is defined as program-level encryption, the chip encryption method only provides read protection, write protection, and page erase protection for the chip. When the hierarchical field is defined as chip-level protection, the chip encryption method provides read protection, write protection, page erase protection, and chip erase protection for the chip. It should be noted that program-level encryption means that the user's password only protects the commercial program stored in non-volatile memory. This level of protection only protects read, write, and page erase operations on non-volatile memory, but does not protect against chip erase. This provides convenience for intruders to steal the chip; they only need to perform chip erase to erase the commercial program and user secrets, rendering the chip blank, thereby enabling illegal operations and causing incalculable losses to the user. Therefore, chip-level protection is particularly important. By protecting against chip erase, a physical barrier is added to the chip, maximizing the protection of the user's interests. The user-defined field sets the password based on user needs. The operational scope of chip-level encryption and program-level encryption is shown in the following table:
[0057]
[0058]
[0059] More specifically, the combination method field includes, but is not limited to, most significant bit XOR operation, least significant bit XOR operation, and real-time time information removal operation. It should be noted that if the most significant bit XOR operation is selected, the user-defined field in the user-customized password is XORed with the most significant bit of the real-time clock information; if the least significant bit XOR operation is selected, the user-defined field in the user-customized password is XORed with the least significant bit of the real-time clock information; if the real-time clock information removal operation is selected, no operation is performed between the user-customized password and the real-time clock information. It should be further noted that the combination method of the user-customized password and the real-time clock information includes, but is not limited to, bitwise XOR. Any method capable of combining the user-customized password and real-time clock information is applicable and can be set based on the usage scenario, and is not limited to this embodiment. For example, a bitwise XOR operation can also be used, in which case the combination method field corresponds to: most significant bit XOR operation, least significant bit XOR operation, and real-time clock information removal operation.
[0060] S3: As Figure 2As shown, the pre-stored password is compared with the first combined password. When the first combined password matches the pre-stored password, a decryption operation is performed. After the decryption operation is completed, all operations are terminated. When the first combined password does not match the pre-stored password, the encryption state is maintained, and step S4 is executed.
[0061] S4: As Figure 2 As shown, the chip resets and releases, then reads the second combination of passwords. Specifically, as an example, such as... Figure 2 As shown, one method for generating the second combined password is: the intruder performs custom encryption processing on its exhaustively enumerated user-customized password to generate the second combined password; another method for generating the second combined password is: the intruder combines its exhaustively enumerated user-customized secret with real-time acquired external clock information to generate the second combined password. It should be noted that the second combined password is used by the intruder when cracking the chip, and the two methods for generating the second combined password are methods used by the intruder when performing illegal operations. For the strategy to deal with the intruder in this embodiment, please refer to step S5.
[0062] S5: As Figure 2 As shown, the first set of passwords is compared with the second set of passwords. When the first set of passwords matches the second set of passwords, a decryption operation is performed. After the decryption operation is completed, all operations are terminated.
[0063] If the first set of passwords does not match the second set of passwords, then the first set of passwords is reset.
[0064] Specifically, as an example, such as Figure 2 As shown, the matching methods for the first and second password combinations include: a match is achieved on the first comparison; and if the first and second password combinations do not match on the first comparison, the comparison operation continues until the number of comparison operations is less than or equal to the maximum number of matches, at which point the first and second password combinations are considered a match. The non-matching methods for the first and second password combinations include: a non-match is achieved on the first comparison, the comparison operation continues until the maximum number of matches is exceeded, wherein during the comparison operation, the first and second password combinations do not match. It should be noted that the maximum number of matches is usually set by the user.
[0065] Specifically, as an example, such as Figure 2As shown, one way to reset the first combined password is to capture a real-time clock, record the current clock information, combine the current clock information with the user-customized password, and reset the first combined password. Another way to reset the first combined password is to capture a real-time clock, record the current clock information, change the user-customized password, combine the changed user-customized password with the current clock information, and reset the first combined password. It should be noted that the method for resetting the first combined password is set by the user. If the user-customized password is changed, it will take effect after a power-on or reset operation. Resetting the first combined password can maximize the difficulty for intruders to crack the chip and protect the user's intellectual property rights.
[0066] Example 2
[0067] like Figure 3 and 4 As shown, this embodiment provides an encryption chip. The architecture of the encryption chip is a microprocessor or digital signal processor, including a mapping module 41 and an encryption module 42, for implementing the chip encryption method as described in Embodiment 1. The mapping module 41 and the encryption module 42 merge the programming channel, debugging channel and central processing unit access channel of the encryption chip.
[0068] Specifically, as an example, such as Figure 3As shown, the encryption module includes: a configuration word reading module, a real-time clock module, a user-customized password register, a hierarchical combination password generation logic, a real-time clock capture register, a matching password register, a matching counter, encryption / decryption generation logic, and an OR gate. The input terminals of the configuration word module and the real-time clock module receive a clock signal provided by a crystal oscillator. More specifically, the frequency of the crystal oscillator is 32.768 kHz. It should be noted that the real-time clock can be provided by, but is not limited to, a crystal oscillator, and the specific frequency is not limited to 32.768 kHz. Any method that can obtain accurate real-time clock information is applicable and is not limited to this embodiment. The input terminal of the user-customized password register is connected to the output terminal of the configuration word reading module. The input terminal of the real-time clock capture register is connected to the output terminal of the real-time clock module. The input terminal of the hierarchical combination password generation logic is connected to the user-customized password register. The password register is connected to the output of the real-time clock capture register; the input of the matching password register receives the external input password transmitted via the peripheral bus; the input of the encryption / decryption generation logic is connected to the output of the hierarchical combination password generation logic and the matching password register, and outputs an encryption or decryption status based on the result of comparing the synthesized password with the external input password; the matching counter is connected to the control terminal of the matching password register and is used to count the comparison operation; the first input of the OR gate is connected to the output of the configuration word reading module, the second input is connected to the output of the matching counter, and the output is connected to the control terminal of the user-customized password register and the real-time clock capture register. The data structure of the external input password stored in the matching password register (referring to the external input password that matches the synthesized password) is shown in the following table:
[0069]
[0070] Specifically, as an example, such as Figure 3As shown, upon power-on or reset, a crystal oscillator (32.768kHz) provides a clock signal to the configuration word reading module and the real-time clock module. The configuration word reading module controls the user-customized password register, and the real-time clock module controls the real-time clock capture register. The user-customized password is read from the user-customized password register, and the real-time clock information is read from the real-time clock capture register. The read user-customized password and the real-time clock information are combined using hierarchical combination password generation logic to generate the first combination password. The first combination password is compared with the pre-stored password read from the matching password register. If they match, decryption is performed, and all operations end after decryption. If they do not match, the encrypted state is maintained, and a chip reset and release operation is performed. After reset and release, the second combination password is read. One method for generating the second combination password is that the intruder performs custom encryption processing on their exhaustive user-customized password to generate the second combination password. Another method is that the intruder combines their exhaustive user-customized password with the real-time acquired external clock information to generate the second combination password. The second combination password is stored through the peripheral bus. In the matching password register, the second combination password is compared with the first combination password. If the maximum number of matching attempts is set to 8, when the second combination password and the first combination password do not match for the first time, and the number of comparison operations performed so far is less than or equal to 8, the second combination password is input again. As long as the second combination password and the first combination password can match within 8 attempts, the decryption status is output, and the chip is decrypted. If the second combination password and the first combination password do not match for the first time, and the number of comparison operations performed so far is greater than 8, the encryption status is output. The matching password register controls the matching counter, and the matching counter outputs a jump signal used to trigger the real-time clock to capture and change the user-customized password. The jump signal is ORed. The next selectable operation is to capture the real-time clock, record the current clock information, combine the current clock information with the user-customized password, and reset the first combination password; or the other selectable operation is to capture the real-time clock, record the current clock information, change the user-customized password, combine the changed user-customized password with the current clock information, and reset the first combination password. The two states are selected based on user needs. It should be further explained that the change of the user-defined password here refers to the change of the user-defined field in step S2 of embodiment one. The changed user-defined field can only be read by the user and takes effect only after power-on or reset.
[0071] Specifically, as an example, such as Figure 4As shown, the mapping module changes the bus mapping address of the encryption chip based on a trigger instruction, changing the chip's boot mode from flash memory boot to memory boot. It should be noted that memory write operations typically take nanoseconds, while flash memory write operations typically take microseconds. Furthermore, flash memory requires an erase operation before a write operation, which typically takes milliseconds. Since intruders usually attempt to crack the chip during the boot phase, shortening the boot time maximizes chip protection.
[0072] Specifically, as an example, such as Figure 4 As shown, the encryption module encrypts and protects the bus address of the encryption chip based on trigger commands, expanding the protection area from the flash memory area to a combination of flash memory and RAM area. It should be noted that intruders typically implant Trojan programs in memory, outputting content read from flash memory through the chip's general-purpose input / output (GPIO) interface. The encryption chip's protection of the RAM area significantly increases the difficulty of cracking the code, effectively protecting intellectual property rights.
[0073] Specifically, as an example, such as Figure 4 As shown, the mapping module 41 and the encryption module 42 actually... Figure 1 The test mode programming interface shown has been removed. The programming channel, debugging channel, and central processing unit access channel have been merged through bus management. At the same time, the protection area has been expanded from the flash memory area to the flash memory area plus the memory area. This reduces the chip area and thus reduces costs, while increasing the difficulty of cracking and protecting the interests of users.
[0074] In summary, the chip encryption method of the present invention, namely an encryption chip, includes: powering on or resetting, starting a configuration word and capturing a real-time clock; recording a user-customized password and current clock information, combining the user-customized password and the current clock information to generate a first combined password, comparing a pre-stored password with the first combined password, and performing a decryption operation when the first combined password matches the pre-stored password, and ending all operations after the decryption operation is completed; maintaining the encryption state when the first combined password does not match the pre-stored password; resetting and releasing the chip, reading a second combined password; comparing the first combined password with the second combined password, and performing a decryption operation when the first combined password matches the second combined password, and ending all operations after the decryption operation is completed; resetting the first combined password when the first combined password does not match the second combined password. The present invention, by combining the user password and real-time clock information, enables the encryption chip to have different passwords at different power-on times, significantly increasing the difficulty of decryption with minimal hardware overhead. The present invention, by modifying the bus mapping address, changes the startup method of the encryption chip from flash memory startup to memory startup, reducing startup time and increasing the difficulty of cracking the chip. This invention expands the protection area from the flash memory region to a combination of flash memory and RAM region, effectively mitigating vulnerabilities and further increasing the difficulty of cracking the chip. Therefore, this invention effectively overcomes the various shortcomings of existing technologies and has high industrial application value.
[0075] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A chip encryption method, characterized in that, The chip encryption method includes at least the following: 1) Power on or reset, start the configuration word and capture the real-time clock; wherein, the configuration word is used to read the user-defined password; 2) Record the user-customized password and the current clock information, combine the user-customized password and the current clock information, and generate a first combined password; the user-customized password includes: a hierarchical field, a combination method field, and a user-defined field; wherein, the hierarchical field is defined as program-level encryption or chip-level encryption. When the hierarchical field is defined as program-level encryption, the chip encryption method only performs read protection, write protection, and page erase protection on the chip; when the hierarchical field is defined as chip-level encryption, the chip encryption method performs read protection, write protection, page erase protection, and chip erase protection on the chip. 3) Compare the pre-stored password in the matching password register with the first combined password. When the first combined password matches the pre-stored password, perform a decryption operation. After the decryption operation is completed, end all operations. When the first combined password does not match the pre-stored password, maintain the encrypted state and execute step 4). 4) Chip reset and release, read the second combination password; the second combination password is generated by the intruder combining the user-customized password he exhaustively enumerates with the external clock information obtained in real time. 5) Compare the first combination password with the second combination password. When the first combination password matches the second combination password, perform the decryption operation. After the decryption operation is completed, end all operations. If the first combination password does not match the second combination password, then the first combination password is reset.
2. The chip encryption method according to claim 1, characterized in that: The combination method field includes: most significant bit XOR operation, least significant bit XOR operation, and removal of real-time clock information operation.
3. The chip encryption method according to claim 1, characterized in that: The matching method between the first combined password and the second combined password includes: the first combined password and the second combined password are matched on the first comparison; and the first combined password and the second combined password do not match on the first comparison, and the comparison operation continues until the first combined password and the second combined password match and the number of comparison operations is less than or equal to the maximum number of matching operations, at which point the first combined password and the second combined password are matched.
4. The chip encryption method according to claim 1, characterized in that: The method in which the first combination password and the second combination password do not match includes: the first combination password and the second combination password do not match in the first comparison, and the comparison operation continues until the maximum number of matches is exceeded, wherein the first combination password and the second combination password do not match during the comparison operation.
5. The chip encryption method according to claim 1, characterized in that: One way to reset the first combined password is to capture a real-time clock, record the current clock information, combine the current clock information with the user-customized password, and then reset the first combined password.
6. The chip encryption method according to claim 1, characterized in that: Another way to reset the first combination password is to capture a real-time clock, record the current clock information, change the user-customized password, combine the changed user-customized password with the current clock information, and reset the first combination password.
7. An encryption chip, characterized in that: The encryption chip is an architecture of a microprocessor or a digital signal processor, including a mapping module and an encryption module, used to implement the chip encryption method as described in any one of claims 1-6, wherein the mapping module and the encryption module merge the programming channel, debugging channel and central processing unit access channel of the encryption chip.
8. The encryption chip according to claim 7, characterized in that: The encryption module includes: a configuration word reading module, a real-time clock module, a user-defined password register, hierarchical combination password generation logic, a real-time clock capture register, a matching password register, a matching counter, encryption / decryption generation logic, and an OR gate, wherein: the input terminals of the configuration word reading module and the real-time clock module receive clock signals provided by a crystal oscillator; the input terminal of the user-defined password register is connected to the output terminal of the configuration word reading module; the input terminal of the real-time clock capture register is connected to the output terminal of the real-time clock module; the input terminal of the hierarchical combination password generation logic is connected to the output terminals of the user-defined password register and the real-time clock capture register; the matching password register... The input terminal receives an external input password transmitted via the peripheral bus; the input terminal of the encryption / decryption generation logic is connected to the output terminal of the hierarchical combination password generation logic and the matching password register, and the result of the comparison operation between the first combination password output by the hierarchical combination password generation logic and the external input password outputs an encryption status or a decryption status; the matching counter is connected to the control terminal of the matching password register and is used to count the comparison operation; the first input terminal of the OR gate is connected to the output terminal of the configuration word reading module, the second input terminal is connected to the output terminal of the matching counter, and the output terminal of the OR gate is connected to the control terminal of the user-customized password register and the real-time clock capture register.
9. The encryption chip according to claim 7, characterized in that: The mapping module changes the bus mapping address of the encryption chip based on the trigger instruction, changing the startup mode of the encryption chip from flash memory startup to memory startup.
10. The encryption chip according to claim 7, characterized in that: The encryption module encrypts and protects the bus address of the encryption chip based on the trigger command, expanding the protection area from the flash memory area to the flash memory area plus the memory area.
Citation Information
Patent Citations
Chip, data protection device and method of chip
CN106919858A
Firmware upgrade management method and device and computer-readable storage medium
CN108958779A
