Method for verifying key correctness in microprocessor and microprocessor

By providing an encryption and decryption operation unit and a one-time programmable read-only memory unit in the microprocessor, the hash value comparison verifies the correctness of the key, the problem of lack of real-time verification of key burning in the prior art is solved, and higher product yield and security are achieved.

CN120223289APending Publication Date: 2025-06-27NUVOTON
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410915032.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-12-27
Filing Date
2024-07-09
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

The lack of real-time verification of existing microprocessors in the security key burning process leads to the inability to ensure that the key is written correctly and effectively, posing a potential security risk.

Method used

An encryption and decryption computing unit is provided in the microprocessor, and the security key is stored through a one-time programmable read-only memory unit and its corresponding hash value is transferred to the microprocessor. The hash value is calculated using the encryption and decryption operation unit, and the input hash value is compared with the calculated hash value to determine whether the key is burned correctly.

Benefits of technology

Real-time verification of keys before microprocessor shipment is achieved, increasing product yield, reducing potential security risks, and improving production line efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120223289A_ABST
    Figure CN120223289A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to a method for verifying the correctness of a key in a microprocessor and the microprocessor using the same. The method for verifying the correctness of the secret key in the microprocessor comprises the following steps of: providing an encryption and decryption operation unit in the microprocessor; recording a security key to a one-time programmable read-only memory unit in the microprocessor; transmitting a first hash value corresponding to the security key to the microprocessor; calculating a second hash value of the data stored in the one-time programmable read-only memory unit through the encryption and decryption operation unit; and determining whether the response is successful or not according to the second hash value and the transmitted first hash value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a technology for microprocessor verification, and in particular, to a method for verifying the correctness of a key in a microprocessor and a microprocessor using the same. Background Art

[0002] In recent years, the key position of microprocessors in the digital age has become increasingly prominent, and the burning of security keys has become an essential part of ensuring the security of devices. However, there may be a key problem in the security key burning process adopted by some manufacturers before shipping microprocessors, that is, the lack of real-time verification of the burning process. This defect may cause manufacturers to be unable to confirm whether the security key has been successfully burned, and may thus trigger potential security risks.

[0003] During the production of microprocessors, the burning of security keys is usually completed through a specific area in the One Time Programming (OTP) in the microprocessor. These security keys are crucial for protecting the security of devices and data, as they are used to encrypt and decrypt sensitive information and ensure the authentication of devices. However, the problem is that these keys are not verified in real time during the burning process. During burning, it can only be confirmed whether the security key burning is successful from the burning flag. However, if there is an error during the transmission or the burning process is attacked, the correctness of the security key cannot be determined, making it impossible for manufacturers to ensure whether the key is correctly and effectively written into the microprocessor. Summary of the Invention

[0004] The present invention provides a method for verifying the correctness of a key in a microprocessor and a microprocessor using the same, for burning a security key into the microprocessor before shipping and performing self-verification of the security key by the microprocessor, thereby increasing the product yield.

[0005] An embodiment of the present invention provides a method for verifying the correctness of a key in a microprocessor. The method for verifying the correctness of a key in a microprocessor includes: providing an encryption / decryption operation unit in a microprocessor; burning a security key into a one-time programmable read-only memory unit inside the microprocessor; transmitting a first hash value corresponding to the security key to the microprocessor; calculating a second hash value of the data stored in the one-time programmable read-only memory unit by the encryption / decryption operation unit; and responding with success or failure according to the second hash value and the transmitted first hash value.

[0006] An embodiment of the present invention provides a microprocessor, which includes a main control processing unit, an encryption / decryption operation unit, and a one-time programmable read-only memory unit. The encryption / decryption operation unit is coupled to the main control processing unit. The one-time programmable read-only memory unit is coupled to the main control processing unit. When burning a security key into the one-time programmable read-only memory unit, a first hash value corresponding to the security key is transmitted to the microprocessor. Wherein, the main control processing unit controls the encryption / decryption operation unit to calculate a second hash value of the data stored in the one-time programmable read-only memory unit. According to the second hash value and the transmitted first hash value, the main control processing unit determines whether the burning device successfully burns the security key.

[0007] According to the method for verifying the correctness of a key in a microprocessor and the microprocessor using the same according to a preferred embodiment of the present invention, wherein calculating the second hash value of the data stored in the one-time programmable read-only memory unit by the encryption / decryption operation unit includes: performing a Secure Hash Algorithm (SHA) operation on the data of the one-time programmable read-only memory unit to obtain the second hash value. In another preferred embodiment, calculating the second hash value of the data stored in the one-time programmable read-only memory unit by the encryption / decryption operation unit includes: performing a Message-Digest Algorithm operation on the data of the one-time programmable read-only memory unit to obtain the second hash value. In another preferred embodiment, transmitting the first hash value corresponding to the security key to the microprocessor includes: burning the first hash value into the one-time programmable read-only memory unit.

[0008] In summary, when the embodiment of the present invention burns a security key into the one-time programmable read-only memory unit of the microprocessor, a hash value calculated by a specific algorithm is also programmed in. After the burning is completed, the encryption / decryption operation unit of the microprocessor immediately calculates the hash value of the burned security key using the above specific algorithm, and compares the input hash value with the calculated hash value. Thereby, it can be determined whether the burned security key is successfully burned correctly.

[0009] In order to further understand the technology, means, and effects of the present invention, reference may be made to the following detailed description and drawings, so as to thoroughly and specifically understand the purpose, features, and concepts of the present invention. However, the following detailed description and drawings are only used for reference and explanation of the implementation manner of the present invention, and are not used to limit the present invention. Description of the Drawings

[0010] The accompanying drawings provided are for enabling those of ordinary skill in the art to which the present invention pertains to further understand the present invention and are incorporated into and form a part of the specification of the present invention. The drawings illustrate exemplary embodiments of the present invention and are used together with the specification of the present invention to explain the principles of the present invention.

[0011] Figure 1 It is a flowchart showing a method for verifying the correctness of a burned key according to a preferred embodiment of the present invention.

[0012] Figure 2 It is a system block diagram of a microprocessor according to a preferred embodiment of the present invention.

[0013] Figure 3 It is a flowchart showing a method for verifying the correctness of a key in a microprocessor according to a preferred embodiment of the present invention.

[0014] Explanation of reference numerals in the drawings:

[0015] S101 - S106... Flow steps of a method for verifying the correctness of a burned key according to a preferred embodiment of the present invention; 201... Main control processing unit; 202... Encryption / decryption operation unit; 203... One-time programmable read-only memory unit; S301 - S308... Flow steps of a method for verifying the correctness of a key in a microprocessor according to a preferred embodiment of the present invention. Detailed implementation manners

[0016] Now, reference will be made in detail to the exemplary embodiments of the present invention, and the exemplary embodiments will be illustrated in the accompanying drawings. Wherever possible, the same component symbols are used in the drawings and the specification to refer to the same or similar components. Additionally, the implementation manners of the exemplary embodiments are only one of the implementation ways of the design concept of the present invention, and the following exemplifications are not used to limit the present invention.

[0017] Figure 1 It is a flowchart showing a method for verifying the correctness of a burned key according to a preferred embodiment of the present invention. Please refer to Figure 1 , and this method for verifying the correctness of a burned key includes:

[0018] Step S101: Start. Generally, it is after burning is completed.

[0019] Step S102: Enable the processor-readable function.

[0020] Step S103: Read the security key of the one-time programmable read-only memory unit.

[0021] Step S104: The microprocessor responds.

[0022] Generally speaking, there are two results for the microprocessor reply. One is to reply 0 (such as in step S106), and the other is to reply with the security key written in the one-time programmable read-only memory unit above (such as in step S105).

[0023] The above steps have two major drawbacks. First, it is very easy for general operators to overlook the above step S102, that is, to enable the processor's readable function. When step S102 is not executed, step S106 will occur, and the security key of the one-time programmable read-only memory unit cannot be read out. Another drawback is that even if, as in step S105, the security key of the one-time programmable read-only memory unit is read out, it is also necessary for the human eye or the operator to start a program to compare whether the security key of the one-time programmable read-only memory unit is correct.

[0024] To solve the above problems, in the following embodiments, the original architecture of the microprocessor is improved. Figure 2 The system block diagram of the microprocessor according to a preferred embodiment of the present invention is shown. Please refer to Figure 2 , this microprocessor includes a main control processing unit 201, an encryption / decryption operation unit 202, and a one-time programmable read-only memory unit 203. The encryption / decryption operation unit 202 and the one-time programmable read-only memory unit 203 are coupled to the main control processing unit 201.

[0025] Suppose the manufacturer starts the burning process according to the customer's requirements. The microprocessor is configured on the burner, and the burning program is started. When the burning program loads the security key to be burned, the burning program will perform operations such as the Secure Hash Algorithm (SHA), such as SHA256, to calculate the hash value (HASH) of the above security key. Then, the burning program burns the security key into the one-time programmable read-only memory unit 203 of the microprocessor through the burner. And, in this embodiment, the hash value of this security key will also be burned into the one-time programmable read-only memory unit 203. After that, after the burning is completed, the main control processing unit 201 of the microprocessor will command the encryption / decryption operation unit 202 to perform the above security hash algorithm SHA256 operation on the security key in the one-time programmable read-only memory unit 203 to calculate the hash value. Then, the main control processing unit 201 will compare the hash value existing in the one-time programmable read-only memory unit 203 with the calculated hash value. When the comparison is in line, the microprocessor will output a flag indicating successful burning to the burner, such as logic 1. If the comparison fails, the microprocessor will output a flag indicating failed burning, such as logic 0.

[0026] As can be seen from the above embodiments, due to the addition of the encryption and decryption operation unit 202 and the corresponding mechanism in the improved microprocessor, the hash value can be calculated after burning is completed. By automatically comparing the hash values, it can be determined whether the microprocessor is defective. Thereby, the yield of the microprocessors shipped to customers can be increased, and customer dissatisfaction can be reduced. Moreover, the burden on the production line employees can be reduced, and the efficiency of the production line employees can be increased.

[0027] In addition, in the above embodiments, although the secure hash algorithm operation such as SHA256 is used, those skilled in the art can also adopt operations such as the Message-Digest Algorithm, such as MD5, after referring to the above embodiments. Within the spirit of the present invention, the present invention is not limited to the above embodiments. Furthermore, in the above embodiments, although the hash value is burned into the one-time programmable read-only memory unit 203, those skilled in the art should know that this is a preferred implementation manner and there is no need to burn again. Those skilled in the art can also burn the hash value into the flash memory that can be rewritten repeatedly. Within the spirit of the present invention, the present invention is not limited to the above embodiments.

[0028] According to the above preferred embodiments, a method for verifying the correctness of a key in a microprocessor can be summarized. Figure 3 The flowchart of the method for verifying the correctness of a key in a microprocessor according to a preferred embodiment of the present invention is shown. Please refer to Figure 3 This method for verifying the correctness of a key in a microprocessor includes the following steps:

[0029] Step S301: Start.

[0030] Step S302: Provide an encryption and decryption operation unit in a microprocessor. As Figure 2 shown, the system block of the microprocessor includes the encryption and decryption operation unit 202.

[0031] Step S303: Burn a security key into the one-time programmable read-only memory unit inside the microprocessor.

[0032] Step S304: Transmit a first hash value (HASH1) corresponding to the security key to the microprocessor.

[0033] Step S305: Calculate a second hash value (HASH2) of the data stored in the one-time programmable read-only memory unit through the encryption and decryption operation unit.

[0034] Step S306: Compare the above first hash value (HASH1) with the above second hash value (HASH2). If they are equal, proceed to step S307. If they are not equal, proceed to step S308.

[0035] Step S307: Output flag 1.

[0036] Step S308: Output flag 0.

[0037] The burner can receive whether the security key is burned correctly through the above-mentioned flag 1 or flag 0, and the production line personnel can also use this to determine whether the microprocessor is defective.

[0038] In summary, when the embodiment of the present invention burns the security key into the one-time programmable read-only memory unit of the microprocessor, the hash value calculated by a specific algorithm is also programmed in. After the burning is completed, the encryption and decryption operation unit of the microprocessor immediately calculates the hash value of the burned security key using the above-mentioned specific algorithm, and compares the input hash value with the calculated hash value. Thereby, it can be determined whether the burned security key is burned successfully.

[0039] It should be understood that the examples and embodiments described herein are for illustrative purposes only, and various modifications or changes thereof will be suggested to those skilled in the art and will be included within the spirit and scope of this application and the scope of the appended claims.

Claims

1. A method for verifying the correctness of a key in a microprocessor, characterized in that: In a microprocessor, an encryption and decryption operation unit is provided; Burning a security key into a one-time programmable read-only memory unit inside the microprocessor; Transmitting a first hash value corresponding to the security key to the microprocessor; Calculating a second hash value of the data stored in the one-time programmable read-only memory unit through the encryption and decryption calculation unit; as well as The response is successful or not according to the second hash value and the transmitted first hash value.

2. The method for verifying the correctness of a key in a microprocessor according to claim 1, characterized in that: The method further comprises: calculating the second hash value of the data stored in the one-time programmable read-only memory unit by the encryption and decryption operation unit, comprising: A secure hash algorithm operation is performed on the data of the one-time programmable read-only memory unit to obtain the second hash value.

3. The method for verifying the correctness of a key in a microprocessor according to claim 1, characterized in that: The method further comprises: calculating the second hash value of the data stored in the one-time programmable read-only memory unit by the encryption and decryption operation unit, comprising: A message digest algorithm operation is performed on the data of the one-time programmable read-only memory unit to obtain the second hash value.

4. The method for verifying the correctness of a key in a microprocessor according to claim 1, characterized in that: Transmitting the first hash value corresponding to the security key to the microprocessor includes: The first hash value is recorded into the one-time programmable read-only memory unit.

5. A microprocessor, characterized in that: A main control processing unit; An encryption and decryption computing unit, coupled to the main control processing unit; A one-time programmable read-only memory unit coupled to the main control processing unit; When a security key is burned into the one-time programmable read-only memory unit, a first hash value corresponding to the security key is transmitted to the microprocessor. The main control processing unit controls the encryption and decryption operation unit to calculate a second hash value of the data stored in the one-time programmable read-only memory unit. According to the second hash value and the transmitted first hash value, the main control processing unit responds to whether a burning device is successfully burned.

6. The microprocessor according to claim 5, characterized in that: The encryption and decryption operation unit performs a secure hash algorithm operation on the data of the one-time programmable read-only memory unit to obtain the second hash value.

7. The microprocessor according to claim 5, characterized in that: The encryption and decryption operation unit performs a message digest algorithm operation on the data of the one-time programmable read-only memory unit to obtain the second hash value.

8. The microprocessor according to claim 5, characterized in that: When burning a security key into the one-time programmable read-only memory unit, the first hash value is burned into the one-time programmable read-only memory unit.