A security chip and its operating mode switching method

By using customer identifiers for switching the operating mode of the security chip, the problems of vulnerability to attack and high cost in existing technologies for mode switching are solved, achieving higher security and lower chip cost.

CN114254401BActive Publication Date: 2026-01-06GUANGZHOU ANYKA MICROELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111515545.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-10
Publication Date
2026-01-06
Estimated Expiration
2041-12-10

AI Technical Summary

Technical Problem

Existing methods for switching operating modes of security chips are easily attacked and cracked, require additional storage space which increases chip costs, and also pose security risks.

Method used

The system uses a customer identifier as the operating mode identifier and controls the switching of the security chip's operating modes, including test mode and failure mode, by setting first and second rules. This avoids the use of one-time programmable memory and uses the status of the customer identifier to indicate the current mode.

Benefits of technology

This increases the difficulty of cracking the operating mode of the security chip, reduces the chip area and cost, enhances security, and prevents the chip from being attacked and forced into an incorrect mode.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114254401B_ABST
    Figure CN114254401B_ABST
Patent Text Reader

Abstract

This invention relates to the field of chip security, specifically disclosing a security chip and a method for switching its operating modes. The method includes identifying a client identifier of the security chip; determining whether the client identifier meets preset rules; if so, controlling the security chip to enter the corresponding operating mode; wherein the operating modes include a test mode and a failure mode; otherwise, controlling the security chip to enter a secure mode. This invention increases the difficulty of cracking the security chip and improves chip security by reusing the client identifier as the operating mode identifier; it can also effectively reduce chip area and lower chip cost; or increase the data length of the client identifier, further increasing the difficulty of brute-force cracking the client identifier.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of chip security, and more particularly to a security chip and a method for switching its operating modes. Background Technology

[0002] With the development of modern information technology, chips have become essential tools in production and daily life. People's lives and production are now inseparable from chip-based information interaction and digital control management. To ensure information security in production and daily life and protect important data from theft, security chips with security protection functions have become one of the keys to modern information security protection.

[0003] Current security chips typically have three operating modes: test mode, secure mode, and failure mode. Switching between these modes controls the chip's lifecycle. Test mode has a high privilege level and low security level, usually used for testing and development; secure mode has a low privilege level and high security level, used for normal chip operation; failure mode has a high privilege level and low security level, used for returning defective chips for analysis. The lifecycle of a security chip is a sequential, irreversible switch between test mode, secure mode, and failure mode. Because security chips have high security requirements, ensuring safe and irreversible switching between these three operating modes is crucial to prevent attacks and malicious tampering that could compromise the chip's security.

[0004] Existing security chips typically switch operating modes using operating mode identifiers stored in a one-time programmable memory. All zeros indicate test mode, random values ​​indicate secure mode, and all one-digit values ​​indicate fail mode. The boot program, embedded in the security chip's ROM, reads the operating mode identifiers to execute the corresponding mode. This method requires additional space to store the operating mode identifiers, increasing chip area and manufacturing costs. Furthermore, external attacks could cause the non-volatile memory to read back all one or all zero values, leading the chip to enter an incorrect operating mode and posing a security risk. Summary of the Invention

[0005] To overcome the problems that existing security chip operating mode identifiers are easily attacked and cracked, and that setting up non-volatile memory to store the operating mode identifier bits increases chip costs, this invention provides a security chip and a method for switching its operating modes.

[0006] The present invention discloses a method for switching the operating mode of a security chip, comprising:

[0007] Identify the customer's identity for the security chip;

[0008] Determine whether the customer identifier meets the preset rules;

[0009] If so, the security chip is controlled to enter the corresponding working mode; wherein, the working mode includes: test mode and failure mode;

[0010] Otherwise, control the security chip to enter a safe mode.

[0011] Preferably, the identification of the customer identifier of the security chip further includes:

[0012] When the customer identifier is identified as being in factory condition, one of the values ​​that conforms to the first rule is written to the customer identifier; wherein, all values ​​that conform to the first rule are not equal to the minimum or maximum value of the customer identifier.

[0013] Preferably, if so, the security chip is controlled to enter the corresponding operating mode; wherein, the operating mode includes: test mode and failure mode; otherwise, the security chip is controlled to enter the security mode; specifically:

[0014] When the customer identifier matches the first rule, the security chip is controlled to enter the test mode;

[0015] When the customer identifier meets the second rule, the security chip is controlled to enter the failure mode; wherein, all values ​​corresponding to the second rule are not equal to the minimum value, maximum value or any value corresponding to the first rule of the customer identifier, and all values ​​corresponding to the second rule are irreversibly rewritten from the values ​​corresponding to the first rule.

[0016] When the customer identifier is neither in the factory state nor conforms to the first rule or the second rule, the security chip is controlled to enter the security mode.

[0017] Preferably, when the customer identifier is identified as being in a factory-shipped state, writing one of the values ​​conforming to the first rule to the customer identifier further includes:

[0018] After writing a value that conforms to the first rule to the customer identifier, the customer identifier is read back;

[0019] The customer identifier of the security chip is identified again to determine whether the customer identifier conforms to the first rule;

[0020] If not, then stop the security chip from operating.

[0021] The technical solution adopted in this invention also discloses a security chip, including an identification module, a judgment module, a first execution module, and a second execution module;

[0022] The identification module is used to identify the customer identifier of the security chip;

[0023] The judgment module is used to determine whether the customer identifier meets the preset rules;

[0024] The first execution module is used to control the security chip to enter the corresponding working mode when the customer identifier meets the preset rules; wherein, the working mode includes: test mode and failure mode;

[0025] The second execution module is used to control the security chip to enter a security mode when the customer identifier does not meet the preset rules.

[0026] Preferably, an initialization module is also included;

[0027] The initialization module is used to write one of the values ​​that conform to the first rule to the customer identifier when the customer identifier is identified as being in the factory state; wherein, all values ​​that conform to the first rule are not equal to the minimum or maximum value of the customer identifier.

[0028] Preferably, the first execution module includes a first execution unit and a second execution unit, and the second execution module includes a third execution unit;

[0029] The first execution unit is used to control the security chip to enter the test mode when the customer identifier matches the first rule;

[0030] The second execution unit is used to control the security chip to enter the failure mode when the customer identifier meets the second rule; wherein, all values ​​corresponding to the second rule are not equal to the minimum value, maximum value or any value corresponding to the first rule of the customer identifier, and all values ​​corresponding to the second rule are irreversibly rewritten from the values ​​corresponding to the first rule.

[0031] The third execution unit is used to control the security chip to enter a security mode when the customer identifier is neither the factory default state nor conforms to the first rule or the second rule.

[0032] Preferably, the initialization module includes a readback unit, a secondary judgment unit, and a termination unit;

[0033] The readback unit is used to read back the customer identifier after writing a value that conforms to the first rule to the customer identifier;

[0034] The secondary judgment unit is used to identify the customer identifier of the security chip again and determine whether the customer identifier conforms to the first rule;

[0035] The termination unit is used to stop the operation of the security chip if not.

[0036] The beneficial effects of this invention are:

[0037] By reusing the customer identifier as the operating mode identifier, the difficulty of cracking the operating mode of the security chip is increased. At the same time, the one-time programmable memory occupied by the original operating mode identifier can be eliminated, effectively reducing the chip area and lowering the chip cost. Alternatively, the one-time programmable memory occupied by the original operating mode identifier can be merged into the customer identifier, increasing the data length of the customer identifier, thereby further increasing the difficulty of cracking the customer identifier and the chip operating mode.

[0038] Preferably, by writing the security chip's customer identifier from its factory state to the value corresponding to the first rule upon initial power-on, the security chip can be effectively prevented from being attacked and its one-time programmable memory storing the customer identifier from being forcibly cracked back to its factory state and directly entering the test mode.

[0039] Preferably, using whether the customer identifier conforms to the first rule or the second rule as the switching condition for the working mode can effectively prevent the chip from being attacked and forcibly causing the one-time programmable memory storing the customer identifier to be all 0s or all 1s, thus breaking the working mode of the security chip, increasing the difficulty of cracking and improving the security of the chip. Attached Figure Description

[0040] The present invention will be further described below with reference to the accompanying drawings, wherein:

[0041] Figure 1 This is a flowchart illustrating a method for switching the operating mode of a security chip according to one embodiment of the present invention.

[0042] Figure 2 This is a flowchart illustrating the lifecycle of a security chip based on a customer identifier, according to another embodiment of the present invention.

[0043] Figure 3 This is a flowchart illustrating the security chip operating mode determination based on customer identifier, according to another embodiment of the present invention. Detailed Implementation

[0044] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0045] The customer identifier and operating mode identifier in the security chip are usually stored in one-time programmable memory such as eFuse or OTP register. The initial value of eFuse is all 0, and it can only be written with 1 and is irreversible. The initial value of OTP register is all 1, and it can only be written with 0 and is irreversible. The embodiments of this solution all take eFuse as an example.

[0046] The customer identifier is a set of data randomly written to the eFuse by the customer. It is used to derive the customer key from the chip's root key, and then use the customer key to encrypt and decrypt programs and data. The customer identifier prevents different customer manufacturers from using the same customer key. The customer identifier can be 64 bits or 128 bits long, and it does not have a fixed data structure; it can be considered a random number.

[0047] See Figure 1 This is one embodiment of the present invention, which includes a method for switching the operating mode of a security chip, the implementation steps of which are as follows:

[0048] S1. Identify the customer identifier of the security chip;

[0049] S2. Determine whether the customer identifier meets the preset rules;

[0050] S3. If so, control the security chip to enter the corresponding working mode; wherein, the working mode includes: test mode and failure mode;

[0051] S4. Otherwise, control the security chip to enter the security mode.

[0052] Preferably, step S1 further includes the following sub-steps:

[0053] S11. When the customer identifier is identified as being in factory condition, write one of the values ​​that conforms to the first rule to the customer identifier.

[0054] Preferably, steps S3 to S4 specifically involve:

[0055] S31. When the customer identifier matches the first rule, control the security chip to enter the test mode;

[0056] S32. When the customer identifier meets the second rule, control the security chip to enter the failure mode;

[0057] S41. When the customer identifier is neither in the factory state nor conforms to the first rule or the second rule, control the security chip to enter the security mode.

[0058] Wherein, all values ​​corresponding to the first rule are not equal to the minimum or maximum value of the customer identifier; all values ​​corresponding to the second rule are not equal to the minimum or maximum value of the customer identifier or any value corresponding to the first rule; and all values ​​corresponding to the second rule are irreversibly rewritten from written values, including values ​​that conform to the first rule or values ​​that do not conform to the first and second rules; in particular, when the written values ​​cannot conform to the second rule by rewriting, the security chip can never enter the mode corresponding to the second rule, that is, the security chip can never enter the failure mode.

[0059] Both the first rule and the second rule can have only one specified value, or contain multiple values ​​that conform to their rule definitions. By using the first and second rules based on the customer identifier as the switching conditions for the operating mode, the problem of the chip being attacked and forced to have all 0s or all 1s (i.e., the maximum or minimum value) in the one-time programmable memory storing the customer identifier, which would lead to the breaking of the security chip's operating mode, can be effectively prevented. This increases the difficulty of cracking the security chip, improves the chip's security, and effectively protects the customer's data.

[0060] The value corresponding to the second rule can be irreversibly rewritten from one of the values ​​corresponding to the first rule, or it can be irreversibly rewritten from any one of the values ​​corresponding to the first rule. It should be noted that the above rewriting is not limited to rewriting only the value corresponding to the first rule to obtain any one of the values ​​corresponding to the second rule. Rather, a value rewritten based on the value corresponding to the first rule can also achieve the technical effect required in this embodiment by rewriting it according to the second rule. However, when the rewritten value cannot be rewritten into any one of the values ​​corresponding to the second rule, the security chip will never enter the failure mode corresponding to the second rule. As long as the settings of the first and second rules meet the above conditions, the same technical effect as in this embodiment can be achieved. When the operating mode of the security chip is not limited to the above modes, adding corresponding third, fourth, etc., is also an equivalent solution in this embodiment.

[0061] Preferably, step S1 further includes the following sub-steps:

[0062] S12. After writing a value that conforms to the first rule to the customer identifier, read back the customer identifier;

[0063] S13. Re-identify the customer identifier of the security chip and determine whether the customer identifier conforms to the first rule;

[0064] S14. If not, stop the operation of the security chip.

[0065] This embodiment also discloses a security chip, including an identification module, a judgment module, a first execution module, and a second execution module;

[0066] The identification module is used to identify the customer identifier of the security chip;

[0067] The judgment module is used to determine whether the customer identifier meets the preset rules;

[0068] The first execution module is used to control the security chip to enter the corresponding working mode when the customer identifier meets the preset rules; wherein, the working mode includes: test mode and failure mode;

[0069] The second execution module is used to control the security chip to enter a security mode when the customer identifier does not meet the preset rules.

[0070] Preferably, an initialization module is also included;

[0071] The initialization module is used to write one of the values ​​that conform to the first rule to the customer identifier when the customer identifier is identified as being in the factory state; wherein, all values ​​that conform to the first rule are not equal to the minimum or maximum value of the customer identifier.

[0072] Preferably, the first execution module includes a first execution unit and a second execution unit, and the second execution module includes a third execution unit;

[0073] The first execution unit is used to control the security chip to enter the test mode when the customer identifier matches the first rule;

[0074] The second execution unit is used to control the security chip to enter the failure mode when the customer identifier meets the second rule; wherein, all values ​​corresponding to the second rule are not equal to the minimum value, maximum value or any value corresponding to the first rule of the customer identifier, and all values ​​corresponding to the second rule are irreversibly rewritten from the values ​​corresponding to the first rule.

[0075] The third execution unit is used to control the security chip to enter a security mode when the customer identifier is neither the factory default state nor conforms to the first rule or the second rule.

[0076] Preferably, the initialization module includes a readback unit, a secondary judgment unit, and a termination unit;

[0077] The readback unit is used to read back the customer identifier after writing a value that conforms to the first rule to the customer identifier;

[0078] The secondary judgment unit is used to identify the customer identifier of the security chip again and determine whether the customer identifier conforms to the first rule;

[0079] The termination unit is used to stop the operation of the security chip if not.

[0080] This embodiment eliminates the need for a one-time programmable memory occupied by the working mode identifier in traditional security chips, effectively reducing chip area and cost. It also merges the one-time programmable memory previously occupied by the working mode identifier and the customer identifier, further increasing the data length of the customer identifier and thus making it more difficult to crack the customer identifier and the chip's working mode.

[0081] In another embodiment of the present invention, the customer identifier in the eFuse module of the security chip is reused as a working mode identifier, and the state of the customer identifier is used to indicate the current working mode of the chip. Specifically, the factory default state of the customer identifier is all bits are 0, i.e., the first special value; the value corresponding to the first rule is bit 0 is 1, and the remaining bits are 0, i.e., the second special value; the value corresponding to the second rule is any one bit is 0, and the remaining bits are 1, i.e., the third special value.

[0082] See Figure 3 This embodiment describes the security chip operating mode determination process based on customer identifiers. The specific steps of the process are as follows:

[0083] B1. When the security chip is powered on or reset, the startup program stored in the ROM is run first. The startup program reads the customer identifier in the eFuse module.

[0084] B2. When all the customer identifier bits are 0, i.e. the first special value, the program starts by writing 1 to bit 0 of the customer identifier.

[0085] B21. Read back the customer identifier;

[0086] B22. Determine if bit 0 is 1 and the other bits are 0;

[0087] B23. If so, then enter test mode;

[0088] B24. Otherwise, the chip will stop operating;

[0089] B3. When the customer identifier bit 0 is 1 and the other bits are 0, i.e. the second special value, the security chip enters the test mode.

[0090] B4. When any one bit of the customer identifier is 0 and the rest of the bits are 1, i.e., the third special value, the security chip enters the failure mode.

[0091] B5. When the customer identifier is not the first, second, or third special value, enter the security mode.

[0092] When the chip is in test mode, it can run plaintext programs without requiring user key encryption and decryption. After running the programming program to program the customer identifier to a random value (a value other than the first, second, or third special value), the chip will enter secure mode after powering on or resetting; after running the programming program to program the customer identifier to the third special value, the chip will enter failure mode after powering on or resetting.

[0093] When the chip is in secure mode, it can only run encrypted programs. The encrypted programs and the data in the chip need to be encrypted and decrypted using a customer key derived from the customer identifier and the chip's root key before they can be run or read.

[0094] In the lifecycle of the security chip in this embodiment, the test mode can enter the security mode or the failure mode; the security mode can enter the failure mode; the failure mode is the last mode and cannot return to the test mode or the security mode, and the security mode cannot return to the test mode.

[0095] See Figure 2 The lifecycle evolution of the security chip in this embodiment is as follows:

[0096] C1. When the chip is manufactured and shipped, the customer identifier bit is all 0;

[0097] C2. When the chip is powered on for the first time, the startup program writes bit 0 of the customer identifier to 1. At this time, the value of the customer identifier becomes bit 0 is 1 and the other bits are 0, which corresponds to the test mode.

[0098] C3. The user develops and debugs the chip program in test mode;

[0099] C4. When the development is completed, the security chip is used as a product. When the application firmware is burned, the customer identifier is written with the required customer identifier value. The customer identifier value cannot be the first special value, the second special value or the third special value.

[0100] C5. After the chip is powered on again or reset, the startup program is run first to read the value of the customer identifier and determine whether the value is the first special value, the second special value or the third special value.

[0101] C5.1 If not, the security chip enters security mode, the startup program derives a customer key using the customer identifier, and uses the customer key to encrypt or decrypt the firmware and run it.

[0102] C5.2 If it is the third special value, the security chip enters the failure mode;

[0103] C6. When the chip malfunctions, the customer identifier is reprogrammed to the third special value, which is equivalent to clearing the customer identifier and putting the chip into failure mode.

[0104] C7. Send the chip back to the chip manufacturer for analysis.

[0105] Using the above scheme, when a problem occurs with the security chip during application and it needs to be returned to the chip manufacturer for problem analysis, the user can run a programming program on the problematic chip. This program will leave one bit of the customer identifier as 0 and write all the remaining bits as 1. This operation is equivalent to clearing the customer identifier. At this point, the security chip cannot derive the customer key, and therefore cannot decrypt and run the program within the firmware, thus protecting the customer data within the security chip. After power-on or a reset, the chip will enter a failure mode, facilitating analysis by the chip manufacturer. However, if a hacker attacks the chip using external methods, causing the readback customer identifier to be all 1s, it will enter a secure mode, but will be unable to derive the correct customer key, effectively rendering the chip unusable and protecting the customer data within the security chip. Similarly, if the chip is attacked and the readback customer identifier is all 0s, since writing 1s is no longer possible, the startup program will fail to execute, rendering the security chip unusable.

[0106] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.

Claims

1. A method for switching the working mode of a secure chip, characterized in that, The method comprises the following steps: identifying the customer identification of the security chip; determining whether the customer identification meets preset rules; the preset rules comprise a first rule and a second rule; all values corresponding to the first rule are not equal to the minimum value or the maximum value of the customer identification; if yes, controlling the security chip to enter a corresponding working mode; the working mode comprises a test mode and an invalidation mode; otherwise, controlling the security chip to enter a security mode; specifically: when the customer identification meets the first rule, controlling the security chip to enter the test mode; when the customer identification meets the second rule, controlling the security chip to enter the invalidation mode; all values corresponding to the second rule are not equal to the minimum value, the maximum value of the customer identification or any value corresponding to the first rule, and all values corresponding to the second rule are obtained by irreversible rewriting of the values corresponding to the first rule; when the customer identification is neither a factory state nor meets the first rule or the second rule, controlling the security chip to enter the security mode.

2. The method of claim 1, wherein, The identification of the customer identification of the security chip further comprises the following steps: when it is identified that the customer identification is a factory state, writing a value meeting the first rule into the customer identification; all values meeting the first rule are not equal to the minimum value or the maximum value of the customer identification.

3. The method of claim 2, wherein the security chip is a secure microcontroller unit (MCU). When it is identified that the customer identification is a factory state, writing a value meeting the first rule into the customer identification further comprises the following steps: after writing the value meeting the first rule into the customer identification, reading the customer identification again; identifying the customer identification of the security chip again to determine whether the customer identification meets the first rule; if no, stopping the operation of the security chip.

4. A security chip, characterized by The method comprises an identification module, a determination module, a first execution module and a second execution module; the identification module is used for identifying the customer identification of the security chip; the determination module is used for determining whether the customer identification meets preset rules; the preset rules comprise a first rule and a second rule; all values corresponding to the first rule are not equal to the minimum value or the maximum value of the customer identification; the first execution module is used for, when the customer identification meets the preset rules, controlling the security chip to enter a corresponding working mode; the working mode comprises a test mode and an invalidation mode; the second execution module is used for, when the customer identification does not meet the preset rules, controlling the security chip to enter a security mode; specifically: when the customer identification meets the first rule, controlling the security chip to enter the test mode; when the customer identification meets the second rule, controlling the security chip to enter the invalidation mode; all values corresponding to the second rule are not equal to the minimum value, the maximum value of the customer identification or any value corresponding to the first rule, and all values corresponding to the second rule are obtained by irreversible rewriting of the values corresponding to the first rule; when the customer identification is neither a factory state nor meets the first rule or the second rule, controlling the security chip to enter the security mode.

5. A security chip according to claim 4, characterized in that The method further comprises an initialization module; The initialization module is configured to write one of values conforming to a first rule into the customer identification when it is identified that the customer identification is in a factory state; all values conforming to the first rule are not equal to a minimum value or a maximum value of the customer identification.

6. A security chip according to claim 5, characterized in that The first execution module comprises a first execution unit and a second execution unit, and the second execution module comprises a third execution unit; The first execution unit is configured to control the security chip to enter a test mode when the customer identification conforms to the first rule; The second execution unit is configured to control the security chip to enter an invalidation mode when the customer identification conforms to a second rule; all values corresponding to the second rule are not equal to the minimum value, the maximum value of the customer identification or any one of values corresponding to the first rule, and all values corresponding to the second rule are obtained by irreversible rewriting of values corresponding to the first rule; The third execution unit is configured to control the security chip to enter a security mode when the customer identification is neither in the factory state nor conforms to the first rule or the second rule.

7. A secure chip according to claim 5, characterized in that, The initialization module comprises a readback unit, a secondary judgment unit and a termination unit; The readback unit is configured to read back the customer identification after writing the value conforming to the first rule into the customer identification; The secondary judgment unit is configured to identify the customer identification of the security chip again to determine whether the customer identification conforms to the first rule; The termination unit is configured to stop the operation of the security chip if not.

Citation Information

Patent Citations

  • Media gateway / terminal implementation method supporting DRM (Digital Rights Management) and equipment thereof

    CN106851351A

  • Methods, computer programs and devices for configuring a vehicle's radio carrier to enable Car2x communication

    DE102020122330A1