A secure chip firmware constrained update method and system

By using server-side and smart password keys to collaboratively generate authorization codes, the lack of authorization restrictions in existing firmware update methods is resolved. This enables restricted control over security chip firmware updates, ensuring that only authorized devices can perform updates, thus improving the security and controllability of the update process.

CN119918043BActive Publication Date: 2026-07-31GUANGZHOU WANXIETONG INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU WANXIETONG INFORMATION TECH CO LTD
Filing Date
2024-12-25
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing firmware update methods lack reasonable authorization restrictions and cannot flexibly limit the scope and number of firmware updates, resulting in unrestricted and uncontrollable update operations.

Method used

By working in tandem with the server and smart password key, authorization codes are generated using hardware encoding, a preset string mapping table, and encryption algorithms. This ensures that only authorized devices can perform security chip firmware updates, including the combination processing and security verification of authorization codes.

Benefits of technology

An authorization mechanism for security chip firmware updates has been implemented to prevent unauthorized devices from obtaining update files, ensuring that the scope and number of updates are limited, and improving the security and controllability of update operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119918043B_ABST
    Figure CN119918043B_ABST
Patent Text Reader

Abstract

This application discloses a method and system for restricted firmware updates of a security chip. The method includes: a server receiving a firmware update request from a terminal device, the firmware update request including the hardware code of the security chip; sending the hardware code to a smart key; the smart key determining whether to authorize the hardware code based on multiple pre-stored codes to be updated and the current number of successful authorizations; if authorization is granted, obtaining the security chip type associated with the hardware code; querying the string corresponding to the security chip type according to a preset table; encrypting the hardware code using a preset encryption algorithm to obtain a code to be combined; combining the string with the code to be combined to obtain an authorization code and sending it back to the server; and the server sending a preset firmware update file and the authorization code to the terminal device to perform the security chip firmware update and authorization operation. This solution can prevent unauthorized devices from obtaining the firmware update file, thus restricting firmware updates.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic digital data processing technology, and in particular to a method and system for restricted firmware updates of a security chip. Background Technology

[0002] Firmware is software running within a Microcontroller Unit (MCU). It controls the basic functions and operational logic of the hardware, serving as the foundational, low-level working software of the system. Firmware determines the functionality and performance of the hardware device. A security chip is a device capable of independently generating and decrypting keys. It has its own processor and storage unit, storing keys and feature data to provide encryption and security authentication services for computing devices. Security chip firmware is updated periodically to improve security, performance, and compatibility, or to add new features.

[0003] In most related technologies, the new firmware is transmitted as a file and written to a specific storage area of ​​the MCU to be upgraded. The new firmware replaces the old firmware, thus completing the firmware update operation. However, this firmware update method allows any third party that obtains the firmware update file to update the firmware on multiple existing legitimate hardware devices. It lacks reasonable authorization restrictions and cannot flexibly limit the scope and number of firmware updates, resulting in unrestricted and uncontrollable firmware update operations. Summary of the Invention

[0004] This application provides a method and system for restricted firmware updates of a security chip, which solves the problem that existing firmware update methods lack reasonable authorization restrictions, cannot flexibly limit the scope and quantity of firmware updates, and result in unrestricted and uncontrollable firmware update operations. It realizes an authorization mechanism for security chip firmware updates, which can prevent unauthorized terminal devices from obtaining firmware update files and restrict security chip firmware updates.

[0005] In a first aspect, embodiments of this application provide a method for restricted firmware updates of a security chip, including:

[0006] The server receives a firmware update request from a terminal device. The terminal device includes security chip firmware to be updated. The firmware update request includes the hardware code of the security chip. The server sends the hardware code to a smart key. The smart key determines whether to authorize the terminal device with the hardware code based on multiple pre-stored codes to be updated and the recorded number of successful authorizations.

[0007] When authorization is confirmed, the smart password key obtains the security chip type associated with the hardware code, queries the string corresponding to the security chip type according to the preset string mapping table, and encrypts the hardware code based on the preset encryption algorithm to obtain the authorization code to be combined. The string and the authorization code to be combined are combined to obtain the authorization code of the hardware code, and the authorization code is fed back to the server.

[0008] The server sends a preset firmware update file and the authorization code to the terminal device for the terminal device to perform firmware update and authorization operations on the security chip.

[0009] Optionally, the step of combining the string with the authorization code to be combined to obtain the hardware-encoded authorization code includes:

[0010] The number of bits in the authorization code to be combined is determined, and the insertion position of the authorization code to be combined is determined according to a preset percentage and the number of bits. The string is inserted into the insertion position of the authorization code to be combined to obtain the hardware-encoded authorization code.

[0011] Optionally, the step of combining the string with the authorization code to be combined to obtain the hardware-encoded authorization code includes:

[0012] The string is split into a header combination part and a tail combination part. The header combination part is added to the beginning of the authorization code to be combined, and the tail combination part is added to the end of the authorization code to be combined, so as to obtain the hardware-encoded authorization code.

[0013] Optionally, if the string corresponding to the security chip type does not exist in the preset string mapping table, the method for generating the authorization code further includes:

[0014] The corresponding encoding processing method is determined based on the hardware encoding format associated with the security chip type, and the hardware encoding is encrypted according to the encoding processing method to obtain a unique authorization code.

[0015] Optionally, the step of determining the corresponding encoding processing method based on the hardware encoding format associated with the security chip type includes:

[0016] Based on the preset code number, the sub-segment encoding formats in the hardware encoding format are determined from front to back. The pre-stored sub-segment encoding processing methods corresponding to each sub-segment encoding format are combined to obtain the corresponding encoding processing method. The sub-segment encoding formats include character format, number format, and character-number combination format.

[0017] Optionally, the terminal device performs firmware update and authorization operations for the security chip, including:

[0018] The terminal device performs digital signature verification on the preset firmware update file based on the security chip firmware. If the digital signature verification is successful, the security chip firmware is updated according to the preset firmware update file; otherwise, the security chip firmware update is refused.

[0019] The terminal device performs security verification on the authorization code. If the security verification is successful, the normal function of the security chip is enabled; otherwise, an error message is displayed and any operation other than authorized is prohibited.

[0020] Optionally, before the server receives the firmware update request sent by the terminal device, the method further includes:

[0021] The server performs login authentication for the smart password key based on the input key. If the smart password key login authentication is successful, the server imports multiple pre-stored codes to be updated into the smart password key for authorization restrictions.

[0022] Secondly, embodiments of this application also provide a security chip firmware restricted update device, comprising:

[0023] A receiving module is used to receive a firmware update request sent by a terminal device on the server side. The terminal device includes the firmware of a security chip to be updated, and the firmware update request includes the hardware code of the security chip.

[0024] The sending module is used by the server to send the hardware code to the smart password key;

[0025] The authorization determination module is used to determine whether the smart password key should authorize the terminal device with the hardware code based on multiple pre-stored codes to be updated and the recorded number of current successful authorizations.

[0026] The authorization code generation and feedback module is used to obtain the security chip type associated with the hardware code when the smart password key confirms authorization, query the string corresponding to the security chip type according to the preset string mapping table, encrypt the hardware code based on the preset encryption algorithm to obtain the authorization code to be combined, combine the string with the authorization code to be combined to obtain the final authorization code, and feed the authorization code back to the server.

[0027] The sending module is further configured to send a preset firmware update file and the authorization code from the server to the terminal device, so that the terminal device can perform firmware update and authorization operations for the security chip.

[0028] Thirdly, embodiments of this application also provide a security chip firmware restricted update device, the device comprising:

[0029] One or more processors;

[0030] Storage device for storing one or more programs.

[0031] When the one or more programs are executed by the one or more processors, the one or more processors implement the secure chip firmware restricted update method described in the embodiments of this application.

[0032] Fourthly, embodiments of this application also provide a storage medium for storing computer-executable instructions, which, when executed by a computer processor, are used to perform the security chip firmware restricted update method described in embodiments of this application.

[0033] In this embodiment, the server receives a firmware update request from a terminal device. The terminal device includes the security chip firmware to be updated, and the firmware update request includes the hardware code of the security chip. The server sends the hardware code to a smart key. The smart key determines whether to authorize the terminal device with the hardware code based on multiple pre-stored codes to be updated and the recorded number of successful authorizations. If authorization is granted, the smart key obtains the security chip type associated with the hardware code, queries the string corresponding to the security chip type according to a preset string mapping table, and encrypts the hardware code based on a preset encryption algorithm to obtain a code to be combined. The string and the code to be combined are combined to obtain the authorization code of the hardware code, and the authorization code is fed back to the server. The server sends a preset firmware update file and the authorization code to the terminal device for the terminal device to perform security chip firmware update and authorization operations. This solution, by introducing an authorization mechanism, solves the problem that existing firmware update methods lack reasonable authorization restrictions, cannot flexibly limit the scope and quantity of firmware updates, and result in unrestricted and uncontrollable firmware update operations. It implements an authorization mechanism for security chip firmware updates, which can prevent unauthorized terminal devices from obtaining firmware update files and restrict security chip firmware updates. Attached Figure Description

[0034] Figure 1 A flowchart illustrating a restricted firmware update method for a security chip provided in this application embodiment;

[0035] Figure 2 A flowchart illustrating a restricted update method for security chip firmware, including a combination processing method for strings and authorization codes to be combined, is provided in this application embodiment.

[0036] Figure 3A flowchart illustrating a restricted update method for security chip firmware that includes a combination processing method for another string and an authorization code to be combined, provided in this application embodiment;

[0037] Figure 4 A flowchart illustrating a restricted update method for security chip firmware, including an authorization code generation method, is provided for embodiments of this application.

[0038] Figure 5 A flowchart of a restricted update method for security chip firmware, including a smart password key configuration method, is provided for embodiments of this application.

[0039] Figure 6 A module structure block diagram of a security chip firmware restricted update device provided in this application embodiment;

[0040] Figure 7 This is a schematic diagram of a security chip firmware restricted update device provided in an embodiment of this application. Detailed Implementation

[0041] The embodiments of this application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of this application and are not intended to limit the scope of the embodiments. Furthermore, it should be noted that, for ease of description, only the parts relevant to the embodiments of this application are shown in the accompanying drawings, not the entire structure.

[0042] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and or or" indicates at least one of the connected objects, and the character "or" generally indicates that the preceding and following related objects have an "or" relationship.

[0043] This application provides a restricted update method for security chip firmware, which can be applied to security chip firmware update scenarios. For example, when the security chip firmware needs to be updated, it can be updated using the restricted update method provided in this application.

[0044] Figure 1 A flowchart illustrating a restricted firmware update method for a security chip provided in this application embodiment is shown below. Figure 1 As shown, it specifically includes:

[0045] Step S101: The server receives a firmware update request sent by the terminal device. The terminal device includes the firmware of the security chip to be updated. The firmware update request includes the hardware code of the security chip. The server sends the hardware code to the smart password key.

[0046] In this context, the server refers to the computer system within a computer network responsible for receiving and processing client requests and sending corresponding data to the client. The terminal device refers to the device used by the user to interact with the computer system or network. The server can receive firmware update requests from terminal devices and can also send the hardware code of the security chip in the firmware update request to the smart key. The firmware update request indicates that the terminal device needs to update the security chip firmware. The security chip firmware is the software program embedded in the security chip, responsible for managing its various functions. The hardware code can be the unique serial number of the security chip, used to distinguish the identity of each security chip. The smart key is a terminal cryptographic product that performs cryptographic functions and secure storage, typically using a USB interface. The smart key connects to the server via the USB interface. For example, the server receives a firmware update request from terminal device A, where the hardware code of the security chip to be updated in the firmware update request is A12-67gh. The server then sends "A12-67gh" to the connected smart key.

[0047] Step S102: The smart password key determines whether to authorize the terminal device with the hardware code based on multiple pre-stored codes to be updated and the recorded number of successful authorizations.

[0048] The pre-stored update code represents the hardware code of the security chip stored in the smart key, awaiting firmware update. The current authorization count can be the total number of successful authorizations performed by the smart key. This current successful authorization count can be recorded by an authorization counter built into the smart key; for example, the built-in authorization counter increments by 1 each time an authorization code is successfully generated.

[0049] In one embodiment, the total number of pre-stored codes to be updated is counted. If the recorded number of successful authorizations is less than this total number, the hardware code of the security chip of the terminal device is compared with each of the pre-stored codes to be updated. If a pre-stored code to be updated that matches the hardware code is found, the terminal device with that hardware code is authorized. If the recorded number of successful authorizations equals the total number or no pre-stored code to be updated that matches the hardware code is found, the terminal device with that hardware code is not authorized. An exemplary example could be that the hardware code of the security chip of terminal device a is A12-67gh, the total number of pre-stored codes to be updated is 10, and the recorded number of successful authorizations is 3, which is less than the total number. Therefore, the hardware code of the security chip of terminal device a is compared with each of the pre-stored codes to be updated. If a pre-stored code to be updated that matches the hardware code is found, then the terminal device a is authorized. By comparing the current number of successful authorizations with the total number of codes to be updated and matching the hardware codes, the scope and number of firmware updates for the security chip can be precisely controlled. At the same time, the use of a smart key as the sole authorization carrier enhances the security of the authorization process and enables secure, restricted firmware update functionality.

[0050] In another embodiment, the hardware code of the security chip of the terminal device is compared with each pre-stored code to be updated, and it is determined whether the number of currently successful authorizations is less than a preset number. If the hardware code is successfully compared and the number of currently successful authorizations is less than the preset number, the terminal device with the hardware code is authorized. The preset number can be set according to the actual situation.

[0051] Step S103: When authorization is confirmed, the smart password key obtains the security chip type associated with the hardware code, queries the string corresponding to the security chip type according to the preset string mapping table, and encrypts the hardware code based on the preset encryption algorithm to obtain the authorization code to be combined.

[0052] The security chip type is used to classify security chips, which can be based on brand, function, etc. The preset string mapping table is a pre-defined table mapping strings to security chip types. This table allows users to look up the string corresponding to a specific security chip type. The preset encryption algorithm represents a pre-defined algorithm used for hardware encryption, such as SM2 (asymmetric algorithm), SM3 (digest algorithm), SM4 (symmetric algorithm), and other Chinese cryptographic algorithms. The authorization code to be combined can be a password awaiting combination with other parts. An example of a preset string mapping table is shown below:

[0053] Type 1 A1a Type 2 B2b Type 3 C3c Type 4 D4d

[0054] The mapping table above describes the mapping relationship between security chip types and strings, as follows: when the security chip type is type 1, the corresponding string is A1a; when the security chip type is type 2, the corresponding string is B2b; when the security chip type is type 3, the corresponding string is C3c; and when the security chip type is type 4, the corresponding string is D4d.

[0055] The security chip type associated with the hardware code of the security chip of terminal device a is security type 1. The corresponding string A1a is obtained by querying the above-mentioned preset string mapping table. The hardware code of the security chip of terminal device a is encrypted based on the preset SM4 encryption algorithm to obtain the authorization code to be combined as 67rc5b. The relevant information in the material is only an example, and the actual length of the relevant data items may be different (such as chip hardware code, authorization code, etc.).

[0056] Step S104: Combine the string with the authorization code to be combined to obtain the hardware-encoded authorization code, and send the authorization code back to the server. The server sends the preset firmware update file and the authorization code to the terminal device for the terminal device to perform the security chip firmware update and authorization operation.

[0057] The authorization code is a special code used to verify the user's identity or the device's legitimacy. This authorization code can be used to authorize the security chip firmware. The preset firmware update file represents a pre-set update file used to replace the original firmware file in the security chip. This preset firmware update file can be used to update the security chip firmware. Optionally, one method for combining a string with the authorization code to be combined is to determine the number of bits in the authorization code to be combined, determine the insertion position of the authorization code to be combined based on a preset percentage and the number of bits, and insert the string into the insertion position of the authorization code to be combined to obtain the hardware-encoded authorization code. Determining the insertion position of the string in the authorization code to be combined by using a preset percentage can improve the security of the authorization code. In one embodiment, if there is no string corresponding to the security chip type associated with the hardware code in the preset string mapping table, one method for generating the authorization code is to determine the corresponding encoding processing method based on the hardware encoding format associated with the security chip type, and encrypt the hardware code according to the encoding processing method to obtain a unique authorization code.

[0058] In one embodiment, a method for updating and authorizing security chip firmware may involve the terminal device digitally verifying a preset firmware update file based on the security chip firmware. If the digital signature verification is successful, the security chip firmware is updated according to the preset firmware update file; otherwise, the update is refused. The terminal device also performs security verification on the authorization code. If the security verification is successful, the normal functions of the security chip are enabled; otherwise, an error message is displayed and any operation other than authorized is prohibited. Digital signature verification refers to the process of verifying the validity of a digital signature using public-key cryptography, thereby confirming the integrity and source identity of the data. This digital signature can be obtained by signing the preset firmware update file using the private key of the firmware update key pair. This digital signature verification determines whether to update the security chip firmware. Security verification refers to measures to verify the security of the authorization code. By verifying the digital signature of the update file and the security of the authorization code, a strict prohibition on firmware updates for unregistered devices is achieved, ensuring the scope of firmware updates.

[0059] In another embodiment, a method for updating and authorizing a security chip firmware may involve a terminal device performing digest value verification on a preset firmware update file based on the security chip firmware, and performing security verification on the authorization code. If the digital signature verification and security verification pass, the security chip firmware is updated based on the preset firmware update file. The digest value may be a value generated by combining the content of the preset firmware update file with a randomly generated number and then using a hash function.

[0060] As described above, the server receives a firmware update request from a terminal device. The terminal device includes the security chip firmware to be updated, and the firmware update request includes the hardware code of the security chip. The server sends the hardware code to the smart key. The smart key determines whether to authorize the terminal device with the hardware code based on multiple pre-stored codes to be updated and the recorded number of successful authorizations. If authorization is granted, the smart key obtains the security chip type associated with the hardware code, queries the string corresponding to the security chip type according to a preset string mapping table, and encrypts the hardware code using a preset encryption algorithm to obtain the authorization code to be combined. The string and the authorization code to be combined are combined to obtain the authorization code of the hardware code, and the authorization code is fed back to the server. The server sends the preset firmware update file and the authorization code to the terminal device for the terminal device to perform security chip firmware update and authorization operations. This solution, by introducing an authorization mechanism, solves the problem of existing firmware update methods lacking reasonable authorization restrictions, unable to flexibly limit the scope and quantity of firmware updates, resulting in unrestricted and uncontrollable firmware update operations. It implements an authorization mechanism for security chip firmware updates, which can prevent unauthorized terminal devices from obtaining firmware update files, thus restricting security chip firmware updates.

[0061] Figure 2 A flowchart illustrating a restricted update method for security chip firmware, including a combination processing method for strings and authorization codes to be combined, is provided in this application embodiment. Figure 2 As shown, it specifically includes:

[0062] Step S201: The server receives a firmware update request sent by the terminal device. The terminal device includes the firmware of the security chip to be updated. The firmware update request includes the hardware code of the security chip. The server sends the hardware code to the smart password key.

[0063] Step S202: The smart password key determines whether to authorize the terminal device with the hardware code based on multiple pre-stored codes to be updated and the recorded number of successful authorizations.

[0064] Step S203: When authorization is confirmed, the smart password key obtains the security chip type associated with the hardware code, queries the string corresponding to the security chip type according to the preset string mapping table, and encrypts the hardware code based on the preset encryption algorithm to obtain the authorization code to be combined.

[0065] Step S204: Determine the number of digits of the authorization code to be combined, determine the insertion position of the authorization code to be combined according to the preset percentage and the number of digits, insert the string into the insertion position of the authorization code to be combined to obtain the hardware-encoded authorization code, and feed the authorization code back to the server.

[0066] The preset percentage can be a percentage value set in advance based on actual conditions or randomly. This preset percentage can be used to determine the insertion position of the authorization code to be combined. The insertion position represents the position of the string to be inserted in the authorization code to be combined. Optionally, one way to determine the insertion position is to multiply the preset percentage by the number of digits in the authorization code to be combined to obtain a reference number of digits, determine the position of the reference number of digits in the authorization code to be combined, and determine the position after the reference number of digits as the insertion position. An exemplary example is that the authorization code to be combined is 3a6b47, with 6 digits, a preset percentage of 50%, and the string corresponding to the security chip type is A1a. Multiplying the preset percentage by the number of digits in the authorization code to be combined yields a reference number of digits of 3. The third digit in the authorization code to be combined is "6". Therefore, the position after "6" is determined as the insertion position, and this string is inserted into the insertion position of the authorization code to obtain the hardware-coded authorization code 3a6A1ab47. In another embodiment, one way to determine the insertion position is to multiply a preset percentage by the number of bits in the authorization code to be combined to obtain a reference number of bits, determine the position of the reference number of bits in the authorization code to be combined, and determine the position before the position of the reference number of bits as the insertion position.

[0067] Step S205: The server sends the preset firmware update file and the authorization code to the terminal device for the terminal device to perform the firmware update and authorization operation of the security chip.

[0068] As described above, the number of bits in the authorization code to be combined is determined, and the insertion position of the authorization code to be combined is determined based on the preset percentage and the number of bits. The string is then inserted into the insertion position of the authorization code to be combined to obtain the hardware-encoded authorization code. This scheme improves the security of the authorization code by combining the string with the authorization code to be combined.

[0069] Figure 3 A flowchart illustrating a restricted update method for security chip firmware, including a combination processing method for another string and an authorization code to be combined, is provided in this application embodiment. Figure 2 As shown, it specifically includes:

[0070] Step S301: The server receives a firmware update request sent by the terminal device. The terminal device includes the firmware of the security chip to be updated. The firmware update request includes the hardware code of the security chip. The server sends the hardware code to the smart password key.

[0071] Step S302: The smart password key determines whether to authorize the terminal device with the hardware code based on multiple pre-stored codes to be updated and the recorded number of successful authorizations.

[0072] Step S303: When authorization is confirmed, the smart password key obtains the security chip type associated with the hardware code, queries the string corresponding to the security chip type according to the preset string mapping table, and encrypts the hardware code based on the preset encryption algorithm to obtain the authorization code to be combined.

[0073] Step S304: Split the string into a beginning combination part and a end combination part. Add the beginning combination part to the beginning of the authorization code to be combined and add the end combination part to the end of the authorization code to be combined to obtain the hardware-encoded authorization code. Then, send the authorization code back to the server.

[0074] The header and tail portions can be the string parts to be combined located at the beginning of the string. The tail portion can be the string parts to be combined located at the end of the string. These header and tail portions can be combined with the authorization code to be combined to obtain the hardware-encoded authorization code. For example, if the string corresponding to the security chip type is a2b3 and the authorization code to be combined is 6a54, splitting this string into equal parts yields a header portion of a2 and a tail portion of b3. The header portion is added to the beginning of the authorization code to be combined, and the tail portion is added to the end of the authorization code to be combined, resulting in the hardware-encoded authorization code a26a54b3.

[0075] Step S305: The server sends the preset firmware update file and the authorization code to the terminal device for the terminal device to perform the firmware update and authorization operation of the security chip.

[0076] As described above, the string is split into a header and a footer portion. The header portion is added to the beginning of the authorization code to be combined, and the footer portion is added to the end of the authorization code to obtain the hardware-encoded authorization code. This scheme improves the security of the authorization code by combining the string with the authorization code to be combined.

[0077] Figure 4 A flowchart of a restricted update method for security chip firmware, including an authorization code generation method, is provided for embodiments of this application. Figure 4 As shown, it specifically includes:

[0078] Step S401: The server receives a firmware update request sent by the terminal device. The terminal device includes the firmware of the security chip to be updated. The firmware update request includes the hardware code of the security chip. The server sends the hardware code to the smart password key.

[0079] Step S402: The smart password key determines whether to authorize the terminal device with the hardware code based on multiple pre-stored codes to be updated and the recorded number of successful authorizations.

[0080] Step S403: When authorization is confirmed, the smart password key obtains the security chip type associated with the hardware code and queries the string corresponding to the security chip type according to the preset string mapping table.

[0081] Step S404: If there is no string corresponding to the security chip type in the preset string mapping table, determine the corresponding encoding processing method according to the hardware encoding format associated with the security chip type, encrypt the hardware encoding according to the encoding processing method to obtain a unique authorization code, and feed the authorization code back to the server.

[0082] The hardware encoding format can be a standard form of hardware encoding. For example, the hardware encoding format associated with security chip type 'a' is a nine-bit code, where the first three bits are numbers, the fourth and fifth bits are characters, and the last four bits are numbers. This hardware encoding format can be used to determine the hardware encoding processing method. The encoding processing method characterizes the method used to encrypt the hardware encoding. Optionally, one way to determine the encoding processing method is to determine the sub-segment encoding formats in the hardware encoding format associated with the security chip type from front to back according to a preset number of codes, and combine the pre-stored sub-segment encoding processing methods corresponding to each sub-segment encoding format to obtain the corresponding encoding processing method. The sub-segment encoding formats include character formats, number formats, and character-number combination formats. The sub-segment encoding format can be the encoding format of a sub-part of the hardware encoding format, and the pre-stored sub-segment encoding processing methods characterize the encoding processing methods corresponding to the pre-stored sub-segment encoding formats. An exemplary example could be that the preset code number is 3. The pre-stored sub-segment encoding processing method for numeric formats involves calculating the sum of each digit. The pre-stored sub-segment encoding processing method for character formats involves determining the ASCII code (American Standard Code for Information Interchange) of each character. The pre-stored sub-segment encoding processing method for character-digit combinations involves shifting the digits sequentially to the end. The hardware encoding format associated with the security chip is a nine-bit code, where the first three bits are digits, the fourth and fifth bits are characters, the sixth bit is a digit, and the last three bits are characters. Based on the preset code number, this hardware encoding format is sub-segmented to obtain three sub-segments: the first, second, and third bits, and the fourth, fifth, and sixth bits... The format of the first, second, and third sub-segments is numeric, the format of the fourth, fifth, and sixth sub-segments is a combination of alphanumeric characters, and the format of the first, second, and third sub-segments is character. The corresponding encoding processing method is to combine the pre-stored sub-segment encoding processing methods corresponding to each sub-segment encoding format to obtain the corresponding encoding processing method. This involves calculating the sum of the first, second, and third digits in the hardware encoding to obtain the first sub-password, determining the ASCII codes of the fourth, fifth, and sixth digits to obtain the second sub-password, shifting the digits in the seventh, eighth, and ninth digits to the end to obtain the third sub-password, and then combining the first, second, and third sub-passwords.

[0083] In another embodiment, an encoding processing method may be determined by matching the hardware encoding format associated with the security chip type with various preset encoding formats, and determining the preset processing method associated with the successfully matched preset encoding format as the hardware encoding processing method, wherein the preset encoding formats include character format, numeric format and character-numeric combination format.

[0084] Step S405: The server sends the preset firmware update file and the authorization code to the terminal device for the terminal device to perform the firmware update and authorization operation of the security chip.

[0085] As described above, when no string corresponding to the security chip type exists in the preset string mapping table, the corresponding encoding method is determined based on the hardware encoding format associated with the security chip type. The hardware encoding is then encrypted using this method to obtain a unique authorization code, which is then sent back to the server. This solution improves the security of the authorization code by determining the encryption method based on the hardware encoding format of the security chip type.

[0086] Figure 5 A flowchart illustrating a restricted update method for security chip firmware, including a smart password key configuration method, is provided for embodiments of this application. Figure 5 As shown, it specifically includes:

[0087] Step S501: The server performs login authentication of the smart password key based on the input key. If the smart password key login authentication is successful, the server imports multiple pre-stored codes to be updated into the smart password key for authorization restrictions.

[0088] The key is used to represent the content input to the smart key login key. This key is used for smart key login authentication. Multiple pre-stored codes to be updated can be obtained by aggregating the hardware codes of all security chips ready for authorization upgrades to the server. For example, the server may have multiple pre-stored codes to be updated, such as z33y79, c37u56, j78n53, h42m43, and k02d48. When the server detects the key input, it authenticates the key and displays a successful authentication message, indicating successful login to the smart key connected to the server. The server then imports these pre-stored codes into the connected smart key for authorization restrictions.

[0089] Step S502: The server receives a firmware update request sent by the terminal device. The terminal device includes the firmware of the security chip to be updated. The firmware update request includes the hardware code of the security chip. The server sends the hardware code to the smart password key.

[0090] Step S503: The smart password key determines whether to authorize the terminal device with the hardware code based on multiple pre-stored codes to be updated and the recorded number of successful authorizations.

[0091] Step S504: When authorization is confirmed, the smart password key obtains the security chip type associated with the hardware code, queries the string corresponding to the security chip type according to the preset string mapping table, and encrypts the hardware code based on the preset encryption algorithm to obtain the authorization code to be combined.

[0092] Step S505: Combine the string with the authorization code to be combined to obtain the hardware-encoded authorization code, and send the authorization code back to the server. The server sends the preset firmware update file and the authorization code to the terminal device for the terminal device to perform the security chip firmware update and authorization operation.

[0093] As described above, the server receives a firmware update request from the terminal device. The terminal device includes the firmware of the security chip to be updated, and the firmware update request includes the hardware code of the security chip. The server then sends the hardware code to the smart key. This solution uses a smart key as the unique authorization carrier, enhancing the security of the authorization process and enabling secure, restricted firmware update functionality.

[0094] Figure 6 This is a block diagram of a module structure for a restricted firmware update device for a security chip provided in an embodiment of this application. The system is used to execute a restricted firmware update method for a security chip provided in the above embodiment, and has corresponding functional modules and beneficial effects for executing the method. Figure 6 As shown, the system specifically includes:

[0095] The receiving module 101 is used to receive a firmware update request sent by a terminal device on the server side. The terminal device includes the firmware of the security chip to be updated, and the firmware update request includes the hardware code of the security chip.

[0096] Sending module 102 is used by the server to send the hardware code to the smart password key;

[0097] The authorization judgment module 103 is used to determine whether the smart password key should authorize the terminal device with the hardware code based on multiple pre-stored codes to be updated and the recorded number of current successful authorizations.

[0098] The authorization code generation and feedback module 104 is used to obtain the security chip type associated with the hardware code when the smart password key confirms authorization, query the string corresponding to the security chip type according to the preset string mapping table, encrypt the hardware code based on the preset encryption algorithm to obtain the authorization code to be combined, combine the string with the authorization code to be combined to obtain the final authorization code, and feed the authorization code back to the server.

[0099] The sending module is further configured to send a preset firmware update file and the authorization code from the server to the terminal device, so that the terminal device can perform firmware update and authorization operations for the security chip.

[0100] As described in the above scheme, the server receives a firmware update request from the terminal device. The terminal device includes the security chip firmware to be updated, and the firmware update request includes the hardware code of the security chip. The server sends the hardware code to the smart key. The smart key determines whether to authorize the terminal device with the hardware code based on multiple pre-stored codes to be updated and the recorded number of successful authorizations. If authorization is granted, the smart key obtains the security chip type associated with the hardware code, queries the string corresponding to the security chip type according to a preset string mapping table, and encrypts the hardware code based on a preset encryption algorithm to obtain the authorization code to be combined. The string and the authorization code to be combined are combined to obtain the authorization code of the hardware code, and the authorization code is fed back to the server. The server sends the preset firmware update file and the authorization code to the terminal device for the terminal device to perform security chip firmware update and authorization operations. This scheme, by introducing an authorization mechanism, solves the problem that existing firmware update methods lack reasonable authorization restrictions, cannot flexibly limit the scope and quantity of firmware updates, and result in unrestricted and uncontrollable firmware update operations. It implements an authorization mechanism for security chip firmware updates, which can prevent unauthorized terminal devices from obtaining firmware update files and restrict security chip firmware updates.

[0101] In one possible embodiment, the authorization code generation and feedback module 104 is specifically used for:

[0102] The number of bits in the authorization code to be combined is determined, and the insertion position of the authorization code to be combined is determined according to a preset percentage and the number of bits. The string is inserted into the insertion position of the authorization code to be combined to obtain the hardware-encoded authorization code.

[0103] In one possible embodiment, the authorization code generation and feedback module 104 is further configured to:

[0104] The string is split into a header combination part and a tail combination part. The header combination part is added to the beginning of the authorization code to be combined, and the tail combination part is added to the end of the authorization code to be combined, so as to obtain the hardware-encoded authorization code.

[0105] In one possible embodiment, the authorization code generation and feedback module 104 is further configured to:

[0106] The corresponding encoding processing method is determined based on the hardware encoding format associated with the security chip type, and the hardware encoding is encrypted according to the encoding processing method to obtain a unique authorization code.

[0107] In one possible embodiment, the authorization code generation and feedback module 104 is further configured to:

[0108] Based on the preset code number, the sub-segment encoding formats in the hardware encoding format are determined from front to back. The pre-stored sub-segment encoding processing methods corresponding to each sub-segment encoding format are combined to obtain the corresponding encoding processing method. The sub-segment encoding formats include character format, number format, and character-number combination format.

[0109] In one possible embodiment, an update and authorization module is further included, specifically for:

[0110] The terminal device performs digital signature verification on the preset firmware update file based on the security chip firmware. If the digital signature verification is successful, the security chip firmware is updated according to the preset firmware update file; otherwise, the security chip firmware update is refused.

[0111] The terminal device performs security verification on the authorization code. If the security verification is successful, the normal function of the security chip is enabled; otherwise, an error message is displayed and any operation other than authorized is prohibited.

[0112] In one possible embodiment, a data import module is also included, specifically for:

[0113] The server performs login authentication for the smart password key based on the input key. If the smart password key login authentication is successful, the server imports multiple pre-stored codes to be updated into the smart password key for authorization restrictions.

[0114] Figure 7 This is a schematic diagram of the structure of a security chip firmware restricted update device provided in an embodiment of this application, as shown below. Figure 7 As shown, the device includes a processor 201, a memory 202, an input device 203, and an output device 204; the number of processors 201 in the device can be one or more. Figure 7 Taking a processor 201 as an example; the processor 201, memory 202, input device 203, and output device 204 in the device can be connected via a bus or other means. Figure 7Taking a bus connection as an example, the memory 202, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions or modules corresponding to a secure chip firmware restricted update method in this embodiment. The processor 201 executes various functional applications and data processing of the device by running the software programs, instructions, and modules stored in the memory 202, thereby implementing the aforementioned secure chip firmware restricted update method. The input device 203 can be used to receive input digital or character information and generate key signal inputs related to user settings and function control of the device. The output device 204 may include a display screen or other display device.

[0115] This application also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a restricted update method for a security chip firmware, the method comprising:

[0116] The server receives a firmware update request from a terminal device. The terminal device includes security chip firmware to be updated. The firmware update request includes the hardware code of the security chip. The server sends the hardware code to a smart key. The smart key determines whether to authorize the terminal device with the hardware code based on multiple pre-stored codes to be updated and the recorded number of successful authorizations.

[0117] When authorization is confirmed, the smart password key obtains the security chip type associated with the hardware code, queries the string corresponding to the security chip type according to the preset string mapping table, and encrypts the hardware code based on the preset encryption algorithm to obtain the authorization code to be combined. The string and the authorization code to be combined are combined to obtain the authorization code of the hardware code, and the authorization code is fed back to the server.

[0118] The server sends a preset firmware update file and the authorization code to the terminal device for the terminal device to perform firmware update and authorization operations on the security chip.

[0119] It is worth noting that in the embodiments of the above-mentioned secure chip firmware restricted update method system, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this application.

[0120] Note that the above are merely preferred embodiments and the technical principles applied in this application. Those skilled in the art will understand that the embodiments of this application are not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of the embodiments of this application. Therefore, although the embodiments of this application have been described in detail through the above embodiments, the embodiments of this application are not limited to the above embodiments. More other equivalent embodiments may be included without departing from the concept of the embodiments of this application, and the scope of the embodiments of this application is determined by the scope of the appended claims.

Claims

1. A secure chip firmware constrained update method, characterized in that, The method includes: The server performs login authentication for the smart password key based on the input key. If the smart password key login authentication is successful, the server imports multiple pre-stored codes to be updated into the smart password key for authorization restrictions. The server receives a firmware update request from a terminal device. The terminal device includes security chip firmware to be updated. The firmware update request includes the hardware code of the security chip. The server sends the hardware code to a smart key. The smart key determines whether to authorize the terminal device with the hardware code based on multiple pre-stored codes to be updated and the recorded number of successful authorizations. When authorization is confirmed, the smart password key obtains the security chip type associated with the hardware code, queries the string corresponding to the security chip type according to a preset string mapping table, encrypts the hardware code based on a preset encryption algorithm to obtain the authorization code to be combined, combines the string with the authorization code to obtain the authorization code of the hardware code, and feeds the authorization code back to the server. The process of combining the string with the authorization code to obtain the authorization code of the hardware code includes: determining the number of digits of the authorization code to be combined, determining the insertion position of the authorization code to be combined according to a preset percentage and the number of digits, and inserting the string into the insertion position of the authorization code to obtain the authorization code of the hardware code. The server sends a preset firmware update file and the authorization code to the terminal device for the terminal device to perform firmware update and authorization operations on the security chip.

2. The secure chip firmware constrained update method of claim 1, wherein, The step of combining the string with the authorization code to be combined to obtain the hardware-encoded authorization code includes: The string is split into a header combination part and a tail combination part. The header combination part is added to the beginning of the authorization code to be combined, and the tail combination part is added to the end of the authorization code to be combined, so as to obtain the hardware-encoded authorization code.

3. The secure chip firmware constrained update method of claim 1, wherein, If the string corresponding to the security chip type does not exist in the preset string mapping table, the method for generating the authorization code further includes: The corresponding encoding processing method is determined based on the hardware encoding format associated with the security chip type, and the hardware encoding is encrypted according to the encoding processing method to obtain a unique authorization code.

4. The method for restricted firmware update of a security chip according to claim 3, characterized in that, The step of determining the corresponding encoding processing method based on the hardware encoding format associated with the security chip type includes: Based on the preset code number, the sub-segment encoding formats in the hardware encoding format are determined from front to back. The pre-stored sub-segment encoding processing methods corresponding to each sub-segment encoding format are combined to obtain the corresponding encoding processing method. The sub-segment encoding formats include character format, number format, and character-number combination format.

5. The method for restricted firmware update of a security chip according to any one of claims 1-2, characterized in that, The terminal device performs firmware update and authorization operations for the security chip, including: The terminal device performs digital signature verification on the preset firmware update file based on the security chip firmware. If the digital signature verification is successful, the security chip firmware is updated according to the preset firmware update file; otherwise, the security chip firmware update is refused. The terminal device performs security verification on the authorization code. If the security verification is successful, the normal function of the security chip is enabled; otherwise, an error message is displayed and any operation other than authorized is prohibited.

6. A security chip firmware restricted update device, characterized in that, include: The data import module is used by the server to perform login authentication of the smart password key based on the input key. If the login authentication of the smart password key is successful, the server imports multiple pre-stored codes to be updated into the smart password key for authorization restrictions. A receiving module is used to receive a firmware update request sent by a terminal device on the server side. The terminal device includes the firmware of a security chip to be updated, and the firmware update request includes the hardware code of the security chip. The sending module is used by the server to send the hardware code to the smart password key; The authorization determination module is used to determine whether the smart password key should authorize the terminal device with the hardware code based on multiple pre-stored codes to be updated and the recorded number of successful authorizations. The authorization code generation and feedback module is used to obtain the security chip type associated with the hardware code when the smart password key confirms authorization, query the string corresponding to the security chip type according to the preset string mapping table, encrypt the hardware code according to the preset encryption algorithm to obtain the authorization code to be combined, combine the string with the authorization code to obtain the final authorization code, and feed the authorization code back to the server. Specifically, the authorization code generation and feedback module is used to determine the number of digits of the authorization code to be combined, determine the insertion position of the authorization code to be combined according to the preset percentage and the number of digits, and insert the string into the insertion position of the authorization code to be combined to obtain the authorization code of the hardware code. The sending module is further configured to send a preset firmware update file and the authorization code from the server to the terminal device, so that the terminal device can perform firmware update and authorization operations for the security chip.

7. A security chip firmware restricted update device, the device comprising: One or more processors; A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to implement the secure chip firmware restricted update method as described in any one of claims 1-5.

8. A storage medium storing computer-executable instructions, which, when executed by a computer processor, are used to perform the secure chip firmware restricted update method as described in any one of claims 1-5.