Security optimization method, device and system for terminal chip key initialization, chip and storage medium

By employing a hybrid encryption architecture based on asymmetric key negotiation, the security, efficiency, and cost issues of key collaborative initialization between SoC and OEM in the manufacturing of smart terminal devices are resolved, achieving a win-win situation of SoC leakage prevention, OEM confidentiality protection, reduced management complexity, and improved production line efficiency.

CN121966840APending Publication Date: 2026-05-01深圳开鸿数字产业发展有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511977402.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-25
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In the manufacturing of smart terminal devices, existing key collaboration initialization schemes are unable to balance the security and cost control of SoC manufacturers with the confidentiality and efficiency improvement of OEM manufacturers, resulting in an improper trade-off between security, efficiency and cost, and a lack of a collaborative mechanism that can simultaneously meet the core requirements of both parties.

Method used

It adopts a hybrid encryption architecture based on asymmetric key negotiation. Through the SoC manufacturer's obfuscation protection tools and the OEM manufacturer's localized operations, it uses the elliptic curve Diffie-Hellman key exchange algorithm to independently derive session keys on their respective sides to achieve key encryption and decryption, ensuring security and high efficiency.

Benefits of technology

It achieves SoC leakage prevention, reduces management complexity and cost, protects OEM confidentiality, improves production line efficiency, forms a security closed loop, and realizes security win-win and efficient collaboration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121966840A_ABST
    Figure CN121966840A_ABST
Patent Text Reader

Abstract

The invention discloses a security optimization method, device and system for terminal chip key initialization, a chip and a storage medium, and belongs to the technical field of embedded system security. The method is applied to an equipment manufacturing end and comprises the steps that a target equipment key is created, and the target equipment key is used for being injected into a chip security area of an equipment end to serve as a core key of the equipment end; obtaining a first key pair, the first key pair being a key pair of an equipment manufacturing end and comprising a first root private key and a first root public key; receiving a target chip root public key, wherein the target chip root public key is a chip root public key sent by a manufacturing end of a chip of the equipment end; constructing a target key encryption key based on the first root private key and the target chip root public key; encrypting the target device key based on the target key encryption key to generate a target ciphertext; and writing the target ciphertext into the device end. According to the invention, the security of key initialization of the terminal chip is improved, and the complexity is reduced at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of embedded system security technology, and in particular to a security optimization method, apparatus, system, chip, and storage medium for terminal chip key initialization. Background Technology

[0002] In the manufacturing of smart terminal devices, the establishment of a root of trust is crucial, with SoC chip manufacturers providing hardware security capabilities and OEMs injecting device keys. However, existing key collaboration and initialization schemes struggle to address the core needs of both parties: SoC manufacturers must rigorously prevent root key leakage and reduce management costs, while OEMs need to ensure the confidentiality of their own device keys and improve production line autonomy. This often results in an unbalanced trade-off between security, efficiency, and cost, failing to achieve a win-win situation for security and efficient collaboration, thus hindering the overall improvement of industry security.

[0003] Therefore, there is an urgent need for an innovative architecture that can establish a new trust and cooperation model between the two parties without exchanging sensitive keys, without frequent online interactions, and with shared responsibility and collaborative management.

[0004] Therefore, existing technologies still need to be improved and enhanced. Summary of the Invention

[0005] The main objective of this invention is to provide a security optimization method, apparatus, system, chip, and storage medium for terminal chip key initialization. This aims to address the problem in the existing technology of smart terminal device manufacturing that there is a lack of a key collaborative initialization scheme that can simultaneously and equally meet the core requirements of both chip manufacturers (SoCs) and device manufacturers (OEMs) in terms of security, cost, and efficiency.

[0006] To achieve the aforementioned objective, a first aspect of the present invention provides a security optimization method for terminal chip key initialization, applied in the device manufacturing process, the security optimization method for terminal chip key initialization comprising: Create a target device key, which is used to inject into the chip security area of ​​the device as the core key of the device; Obtain the first key pair, which is a key pair from the device manufacturing end, including a first private key and a first public key; Receive the target chip root public key, which is the chip root public key sent by the chip manufacturing end of the device. Construct a target key encryption key based on the first private key and the target chip root public key; The target device key is encrypted using the target key encryption key to generate target ciphertext; The target ciphertext is written to the device.

[0007] In one implementation, the security optimization method for initializing the terminal chip key further includes: Obtain the target tool sent by the chip manufacturing end, wherein the target tool contains an obfuscated target chip root private key, and the target chip root private key is the root private key of the chip manufacturing end; Write the target tool into the target security partition on the device.

[0008] In one implementation, constructing the target key encryption key based on the first root private key and the target chip root public key includes: The elliptic curve Diffie-Hellman key exchange algorithm is used to calculate the target key encryption key corresponding to the first root private key and the root public key of the target chip.

[0009] In one implementation, the step of constructing the target key encryption key based on the first root private key and the target chip root public key further includes: Construct a first version number for the first key pair, and use the first version number as one of the inputs to the derived function of the target key encryption key to obtain the target key encryption key corresponding to the first version number.

[0010] In one implementation, after constructing the target key encryption key based on the first root private key and the target chip root public key, the method further includes: When the first key pair is updated to the second key pair, a second version number is generated. The second key pair includes a second private key and a second public key. A second key encryption key is constructed based on the chip root private key, the target chip root public key, and the second version number. The second key encryption key is written into the device to replace the target key encryption key.

[0011] In one implementation, the target key encryption key is a symmetric key used for encryption.

[0012] In one implementation, the target device key is used on the device side as at least one of unique authentication, secure boot, or data encryption.

[0013] A second aspect of the present invention provides a security optimization method for terminal chip key initialization, applied to the device side, the security optimization method for terminal chip key initialization comprising: Obtain the target ciphertext and the first public key written by the device manufacturing end, wherein the first public key is the root public key of the device manufacturing end; Obtain the target tool written by the device manufacturing end, run the target tool, and combine it with the first public key to obtain the target key encryption key; The target ciphertext is decrypted based on the target key encryption key to obtain the target device key; The target device key is loaded into the chip's secure storage area.

[0014] In one implementation, the target tool includes an obfuscation-protected target chip root private key, which is the root private key from the chip manufacturing end.

[0015] In one implementation, before running the target tool, the method further includes: Obtain the target digital signature built into the chip, and verify the validity of the target digital signature based on the target tool; If verification fails, the target tool is prohibited from performing the operation of obtaining the target key encryption key.

[0016] A third aspect of the present invention provides a security optimization device for terminal chip key initialization, comprising: A key creation module is used to create a target device key, which is used to inject the chip security area of ​​the device as the core key of the device. A key pair acquisition module is used to acquire a first key pair, which is a key pair from the device manufacturing end, including a first private key and a first public key; A receiving module is used to receive the root public key of the target chip, wherein the root public key of the target chip is the chip root public key sent by the chip manufacturing end of the device. The KEK building module is used to construct a target key encryption key based on the first root private key and the target chip root public key. The ciphertext generation module is used to encrypt the target device key based on the target key encryption key to generate target ciphertext; The first writing module is used to write the target ciphertext into the device.

[0017] In one implementation, the apparatus further includes: The first tool acquisition module is used to acquire the target tool sent by the chip manufacturing end. The target tool contains an obfuscated target chip root private key, which is the root private key of the chip manufacturing end. The second writing module is used to write the target tool into the target security partition on the device.

[0018] In one implementation, the KEK building module includes: The first version number generation unit is used to construct a first version number of the first key pair, and use the first version number as one of the inputs to the derived function of the target key encryption key to obtain the target key encryption key corresponding to the first version number.

[0019] A fourth aspect of the present invention provides a security optimization apparatus for terminal chip key initialization, comprising: The data acquisition module is used to acquire the target ciphertext and the first public key written by the device manufacturing end, wherein the first public key is the root public key of the device manufacturing end; The second tool acquisition module is used to acquire the target tool written by the device manufacturing end, run the target tool, and combine it with the first public key to obtain the target key encryption key; The decryption module is used to decrypt the target ciphertext based on the target key encryption key to obtain the target device key; The loading module is used to load the target device key into the chip's secure storage area.

[0020] In one implementation, the second tool acquisition module includes: A verification unit is used to obtain the target digital signature built into the chip and verify the validity of the target digital signature based on the target tool. An execution prohibition unit is used to prevent the target tool from performing the operation of obtaining the target key encryption key if the verification fails.

[0021] In a fifth aspect, the present invention provides a security optimization system for terminal chip key initialization, the security optimization system for terminal chip key initialization comprising a device manufacturing end and a device end; the device manufacturing end is used to implement the steps of any of the above-described security optimization methods for terminal chip key initialization applied to the device manufacturing end; the device end is used to implement the steps of any of the above-described security optimization methods for terminal chip key initialization applied to the device end.

[0022] In a sixth aspect, the present invention provides a chip comprising: a memory, a processor, and a security optimization program for terminal chip key initialization stored in the memory and executable on the processor, wherein the security optimization program for terminal chip key initialization, when executed by the processor, implements the steps of the security optimization method for terminal chip key initialization as described above.

[0023] A seventh aspect of the present invention provides a computer-readable storage medium, wherein the computer storage medium stores one or more programs that can be executed by one or more processors to implement the steps of the security optimization method for terminal chip key initialization as described in any of the preceding claims.

[0024] Beneficial Effects: Compared with existing technologies, this invention provides a security optimization method, apparatus, system, chip, and storage medium for terminal chip key initialization. In the security optimization method for terminal chip key initialization provided by this invention, when applied to the device manufacturing end, firstly, the device manufacturing end creates a target device key, which is used to inject into the chip security area of ​​the device as the core key of the device. Then, a first key pair is obtained, which is a key pair from the device manufacturing end, including a first private key and a first public key. Next, a target chip root public key is received, which is the chip root public key sent by the chip manufacturing end of the device. A target key encryption key is constructed based on the first private key and the target chip root public key. Then, the target device key is encrypted based on the target key encryption key to generate target ciphertext. Finally, the target ciphertext is written to the device. This invention provides users with a security optimization method for terminal chip key initialization, solving the problem in existing technologies where there is a lack of a collaborative key initialization scheme that can simultaneously and equally meet the core requirements of both chip manufacturers (SoCs) and device manufacturers (OEMs) in terms of security, cost, and efficiency in the manufacturing of smart terminal devices. This allows the entire key preparation and injection process to be completed locally by the OEM, without interaction with the SoC server, resulting in high production line efficiency and strong autonomy. Attached Figure Description

[0025] Figure 1 This is a flowchart of an embodiment of the security optimization method for terminal chip key initialization in Embodiment 1 of the present invention; Figure 2 The prior art flow of the security optimization method for terminal chip key initialization in Embodiment 1 of the present invention Figure 1 ; Figure 3 The prior art flow of the security optimization method for terminal chip key initialization in Embodiment 1 of the present invention Figure 2 ; Figure 4 The prior art flow of the security optimization method for terminal chip key initialization in Embodiment 1 of the present invention Figure 3 ; Figure 5 The prior art flow of the security optimization method for terminal chip key initialization in Embodiment 1 of the present invention Figure 4 ; Figure 6 This is a flowchart illustrating the key preparation process of an embodiment of the security optimization method for terminal chip key initialization provided in Embodiment 1 of the present invention. Figure 7This is a flowchart of the key construction process for the security optimization method for terminal chip key initialization in Embodiment 1 of the present invention. Figure 8 This is a flowchart of an embodiment of the security optimization method for terminal chip key initialization in Embodiment 2 of the present invention; Figure 9 This is a flowchart illustrating the key writing process of an embodiment of the security optimization method for terminal chip key initialization in Embodiment 2 of the present invention. Figure 10 This is a flowchart illustrating the tool verification process for an embodiment of the security optimization method for terminal chip key initialization in Embodiment 2 of the present invention. Figure 11 This is a schematic diagram of the structural principle of an embodiment of the security optimization device for terminal chip key initialization in Embodiment 3 of the present invention; Figure 12 This is a schematic diagram of the structural principle of an embodiment of the security optimization device for terminal chip key initialization in Embodiment 4 of the present invention; Figure 13 This is a schematic diagram of the structural principle of the security optimization system for terminal chip key initialization in Embodiment 5 of the present invention. Figure 14 This is a schematic diagram of the operating environment of the chip in Embodiment Six of the present invention. Detailed Implementation

[0026] To make the objectives, technical solutions, and effects of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0027] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.

[0028] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.

[0029] The present invention provides a security optimization method for terminal chip key initialization, which can be applied to terminals with computing capabilities. The terminal can execute the security optimization method for terminal chip key initialization provided by the present invention to manage and control edge sub-devices.

[0030] First, the terms used in the embodiments of this invention will be introduced: OEM, terminal equipment manufacturers, such as existing mobile phone platform terminal manufacturers; Device, such as a computer running the HarmonyOS system or a mobile phone running the Android system; SoC, chip manufacturer; OEMKey, the terminal chip key to be securely written, is set by the OEM; RTLKey, or Register Transfer Level Key, is set by the SoC and is used to assist the OEM in securely writing the OEM Key to the terminal. Key Manage Server, a server used to manage terminal chip keys, is developed by the SoC; RTL Key Tool is a tool used to assist OEMs in securely writing OEM keys to the terminal, and is developed by the SoC. OEM-RTLPrivKey, an OEM-customized RTLPrivKey, is set by the OEM and is used to assist the OEM in securely writing the OEM Key to the terminal; OEM-RTLPubKey, an OEM-customized RTLPubKey, can be exported from OEM-RTLPrivKey; SoC-RTLPrivKey, a SoC-customized RTLPrivKey, is set by the SoC and is used to assist OEMs in securely writing OEM Keys to the terminal; SoC-RTLPubKey is a custom RTLPubKey for SoCs, which can be exported from SoC-RTLPrivKey.

[0031] This invention belongs to the field of embedded system security technology and is applicable to computing devices that require secure boot mechanisms, such as mobile terminals and IoT devices.

[0032] Specifically, in the smart terminal device manufacturing industry, the core security of the device relies on cryptographic keys stored in the secure area of ​​the chip hardware. These keys constitute the foundation of trust for device authentication, secure boot, and data encryption. To achieve this goal, a typical division of labor has emerged in the industry: SoC chip manufacturers are responsible for designing and producing hardware chips with security capabilities and reserving interfaces for key initialization; OEM terminal manufacturers need to generate unique keys representing their own brand and device identity and securely inject them into the chip.

[0033] In this key collaborative injection process, SoC manufacturers and OEMs face closely related yet inherently conflicting core demands. For SoC manufacturers, it is crucial to strictly protect their chip's underlying root key, the source of their intellectual property and trust chain; its leakage would jeopardize the security foundation of the entire chip series. Simultaneously, facing a vast and diverse range of OEM customers, SoC manufacturers urgently need to reduce the operational complexity of customized key management and tool distribution, pursuing standardized and scalable solutions. For OEMs, ensuring the absolute confidentiality of their device keys is paramount, concerning product security and brand assets. Furthermore, OEMs also hope to simplify production line processes, reduce reliance on SoC manufacturer servers, improve production efficiency, reduce communication costs, and strengthen control over their core manufacturing processes.

[0034] Existing key initialization schemes often face a dilemma: prioritizing the security and cost control of SoC manufacturers often comes at the cost of increasing the interaction burden on OEMs or introducing potential leakage risks; conversely, favoring the autonomy and efficiency of OEMs may weaken the SoC manufacturer's control capabilities and subject them to joint security responsibilities. This unbalanced situation reflects the current lack of a collaborative mechanism that can simultaneously and equally meet the core demands of both parties in terms of security, efficiency, and cost. Therefore, the industry urgently needs an innovative architecture to establish a new trusted cooperation model between SoCs and OEMs that eliminates the need for exchanging sensitive keys, frequent online interactions, and enables shared responsibility and collaborative management, fundamentally resolving the security bottlenecks and efficiency contradictions in the current key injection process.

[0035] To address the aforementioned issues, this invention reconstructs the key injection process between the SoC and the OEM through a hybrid encryption architecture based on asymmetric key negotiation, thereby systematically resolving the core contradictions between the two parties regarding security, cost, and efficiency.

[0036] For SoC manufacturers, this invention obfuscates and protects their core private key, embedding it in a single, universal tool. This tool is compatible with all chips of the same model and different OEM customers, achieving a paradigm shift from "one key per customer" to "one key per chip," significantly reducing the complexity and cost of key management and software distribution. Furthermore, the private key is distributed entirely offline, completely eliminating the risk of leakage during network transmission.

[0037] For OEMs, this invention ensures that their core device private keys are always stored on their own secure servers, with only the corresponding public keys written to the devices. This fundamentally eliminates the possibility of private key leakage on the production line or at the device end. The entire key preparation and encryption process is completed locally on the OEM, without any encrypted interaction with the SoC server, significantly improving production line efficiency and autonomy.

[0038] In terms of technical implementation, both parties use a static public-private key pair and a standard key negotiation algorithm (such as ECDH) to independently derive the same session key on their respective sides. This key is then used to efficiently encrypt and decrypt the final device key. This design not only leverages the security advantages of asymmetric cryptography but also ensures high performance at the production line level through subsequent symmetric encryption. At the same time, it naturally constructs a collaborative control mechanism at the cryptographic level, with both parties participating and mutually checking each other.

[0039] In summary, this invention logically forms a security closed loop: the SoC provides basic trust through general tools, the OEM maintains autonomy through localized operations, and both parties achieve seamless collaboration through cryptographic protocols, thereby simultaneously achieving the dual goals of SoC leakage prevention and cost reduction, and OEM confidentiality protection and efficiency improvement, realizing a secure win-win situation in industry collaboration.

[0040] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0041] Example 1 In this embodiment, a security optimization method for terminal chip key initialization is provided. The security optimization method for terminal chip key initialization provided in this embodiment is applied to the device manufacturing end. In this embodiment, the manufacturer's terminal of a mobile device is used as an example for illustration.

[0042] Specifically, Figure 1 This is a flowchart illustrating a security optimization method for terminal chip key initialization provided in this embodiment.

[0043] like Figure 1As shown, the security optimization method for terminal chip key initialization provided in this embodiment is applied to the device manufacturing end. The security optimization method for terminal chip key initialization includes the following steps: S110. Create a target device key, which is used to inject into the chip security area of ​​the device as the core key of the device.

[0044] In existing technical practices, in order to meet the needs of SoC manufacturers and OEM manufacturers in key collaborative initialization, the industry has gradually formed two representative solutions, Solution A and Solution B.

[0045] Scheme A primarily employs a two-level symmetric encryption to construct a "key onion." It utilizes a "double-encapsulation" structure based on symmetric keys.

[0046] Reference Figure 2 , Figure 2 In the key preparation phase of Scheme A, the OEM generates a temporary symmetric encryption key EK locally and uses this key to encrypt its actual device key OEMKey, forming the first-level ciphertext OEMKey_Cipher, where OEMKey_Cipher = Symmetric_Encrypt(key=EK, data=OEMKey). The OEM then transmits this intermediate ciphertext OEMKey_Cipher to the SoC manufacturer. The SoC manufacturer then uses its own tightly protected root symmetric key RTLKey to encrypt the received intermediate ciphertext OEMKey_Cipher a second time, forming the final injectable ciphertext OEMKey_Cipher2, where OEMKey_Cipher2 = Symmetric_Encrypt(key=TLKey, data=OEMKey_Cipher), and returns it to the OEM along with the RTL Key Tool containing the obfuscated RTLKey.

[0047] Reference Figure 3 , Figure 3For the key writing and initialization phase of Scheme A, the OEM integrates the RTL KeyTool into the terminal device and writes OEMKey_Cipher2 and EK. On the production line, the device needs to sequentially use the RTLKey in the RTL Key Tool to decrypt the outer layer, and then use the pre-set EK to decrypt the inner layer, in order to finally restore the OEMKey and load it into the corresponding chip's secure storage area. Specifically, OEMKey_Cipher = RTLKey_Tool(data = OEMKey_Cipher2); OEMKey = Symmetric_Decrypt(key = EK, data = OEMKey_Cipher). The core idea of ​​this design is to achieve responsibility isolation and security hardening through two independent symmetric keys. However, its inherent defects are quite prominent: each key injection forces the OEM and SoC's server to exchange encrypted data, which introduces significant communication latency and coordination costs in large-scale production; at the same time, in order to ensure key isolation between different OEM customers, the SoC manufacturer has to maintain an independent RTLKey for each customer and customize corresponding tool programs, resulting in a linear increase in key management complexity and operating costs with the number of customers, and poor scalability.

[0048] To overcome the interaction bottlenecks and management burdens of Solution A, Solution B was developed, referring to... Figure 4 , Figure 2 This is the key preparation phase for Scheme B. Specifically, Scheme B employs the "digital envelope" model in public-key cryptography. In this scheme, the OEM generates a pair of asymmetric keys, OEM-RTLPrivKey and OEM-RTLPubKey, and directly uses the public key to encrypt the device key OEMKey, generating the ciphertext OEMKey_Cipher, where OEMKey_Cipher = Digital_Envelope(key = OEM-RTLPubKey, data = OEMKey). Subsequently, the SoC manufacturer only needs to provide a standard, general-purpose utility program, RTL Key Tool, which contains the digital envelope decryption logic.

[0049] Reference Figure 5 , Figure 5This refers to the key writing and initialization phase of Scheme A. Specifically, on the production line, the OEM writes the encrypted OEMKey_Cipher along with the corresponding private key OEM-RTLPrivKey into the device. The device then runs the general-purpose tool RTL KeyTool, which uses the private key to decrypt the encrypted text to obtain the key OEMKey, where OEMKey = RTLKey_Tool_Digital_Developer(key=OEM-RTLPrivKey, data=OEMKey_Cipher). The brilliance of this scheme lies in completely eliminating online data interaction between the OEM and the SoC server, greatly simplifying the process, and allowing the SoC manufacturer to provide a completely unified tool with extremely low management costs. However, this comes at a new cost: First, using private keys for asymmetric decryption on the device side is slow, failing to meet the stringent speed requirements of high-efficiency production lines and becoming a bottleneck for production efficiency; second, writing highly sensitive private keys directly in plaintext into each terminal device greatly increases the risk of private keys being extracted and leaked in the production line environment or from the devices, violating best security practices for key management; finally, this model completely removes SoC manufacturers from the actual control of key injection, making it difficult to conduct necessary supervision and coordination of the security status of the devices.

[0050] As can be seen, Scheme A and Scheme B represent two different trade-offs: Scheme A sacrifices high interaction costs and management complexity for strong protection of both parties' keys and deep control of the SoC; Scheme B sacrifices production line performance and increases the security risk of OEM keys for simplified processes and lightweight SoC management. Neither of them finds a balance that simultaneously considers security, efficiency, cost, and control. In this embodiment, a security optimization method for terminal chip key initialization is presented, which perfectly solves the problems arising from the above two schemes. It proposes a method in which the SoC provides basic trust through general tools, the OEM maintains autonomy through localized operations, and both parties achieve seamless collaboration through cryptographic protocols. This simultaneously achieves the dual goals of preventing SoC leakage and reducing costs, and ensuring OEM confidentiality and improving efficiency, realizing a secure win-win situation in industry collaboration.

[0051] Specifically, in this embodiment, it is applied to the equipment manufacturing OEM.

[0052] Specifically, refer to Figure 6 First, the OEM creates the target device key OEMKey, which is used to inject into the chip security area of ​​the device as the core key of the device.

[0053] Specifically, the device manufacturer (OEM) generates a cryptographically strong, random, and unique target device key, OEMKey, within its protected security environment. The generation of this target device key strictly adheres to relevant security standards (such as using a certified true random number generator) to ensure its unpredictability and uniqueness. OEMKey is a device-specific, highest-level cryptographic trust anchor applied to the device itself. Its core mission is to serve as the core key of the device, securely injected and permanently residing in the hardware security area (such as a security element, trusted execution environment, or one-time programmable fuse memory) of the device chip. The device refers to a series of products manufactured by the device manufacturer; each individual device can be considered part of the device. Once successfully injected, OEMKey serves as the unique cryptographic credential for the device's identity and the foundation for all subsequent security functions. It can be directly used or used to derive other operational keys to achieve key security functions including, but not limited to: secure boot verification (ensuring firmware integrity), unique device authentication (establishing a trusted connection with a server or other devices), hardware-level data encryption / decryption (protecting sensitive data in storage and transmission), and providing proof of a trusted platform. Therefore, the creation of the target device key OEMKey is the first and most critical step in building the initial root of trust throughout the entire device security lifecycle.

[0054] Refer again Figure 1 After obtaining the target device key, the process further includes the following steps: S120. Obtain the first key pair, which is a key pair from the device manufacturing end, including a first private key and a first public key.

[0055] In this step, the OEM generates the first key pair, which includes a first private key OEM-RTLPrivKey and a first public key OEM-RTLPubKey.

[0056] Specifically, during the key preparation phase, the equipment manufacturer (OEM) uses a specified asymmetric cryptographic algorithm—in this embodiment, the asymmetric cryptographic algorithm may be Elliptic Curve Cryptography (ECC)—in its secure and controllable Key Management System (KMS) or Hardware Security Module (HSM) to generate the first key pair required for the key injection process on the device side, which is specific to a particular batch of devices. The first key pair consists of two related but cryptographically opposite parts: a highly sensitive first private key, denoted as OEM-RTLPrivKey, which must be kept absolutely secret; and a publicly distributed first public key, denoted as OEM-RTLPubKey, used for encryption or key negotiation.

[0057] The generation and management of the first private key, OEM-RTLPrivKey, adheres to the highest security standards. Throughout its lifecycle, it is strictly confined within the OEM's security boundaries, never leaving the OEM's trusted secure environment (HSM) in plaintext, and is never directly transmitted or written to the terminal device. Its core cryptographic purpose is to negotiate key with the fixed public key provided by the SoC manufacturer, thereby securely deriving the symmetric key required for subsequent encryption.

[0058] The corresponding first public key, OEM-RTLPubKey, does not have confidentiality requirements. As the cryptographic companion of the first private key, OEM-RTLPrivKey, it will be securely transmitted and ultimately written into the non-volatile memory of the device. During the key initialization process on the device side, the first public key, OEM-RTLPubKey, will cooperate with the private key in a protected tool provided by the SoC manufacturer to complete the same key negotiation operation. This allows the device to reconstruct the same session key as the OEM server without exchanging any secret information.

[0059] Specifically, this embodiment also includes the following steps: S130. Receive the target chip root public key, wherein the target chip root public key is the chip root public key sent by the chip manufacturing end of the device.

[0060] Specifically, the system-on-chip (SoC) manufacturer on the chip manufacturing side, that is, the company that designs and manufactures the chips on the device side (such as mobile phone processors, IoT module main chips), will create a pair of asymmetric cryptographic keys, which in this embodiment is called the target chip key pair, including the target chip root private key SoC-RTLPrivKey and the target chip root public key SoC-RTLPubKey.

[0061] Specifically, upstream in the equipment manufacturing industry chain, System-on-Chip (SoC) manufacturers, as providers of core hardware security capabilities, are responsible for designing and manufacturing the main control chips used in terminal devices, such as mobile platform processors in smartphones and communication and computing modules in IoT devices. During the chip's security architecture design phase or factory pre-configuration stage, SoC manufacturers create and solidify a crucial pair of asymmetric cryptographic keys—the target chip key pair—for their specific chip series, constituting the hardware trust anchor for that chip model. The target chip key pair includes: a highly confidential target chip root private key, protected by multiple physical and logical safeguards, denoted as SoC-RTLPrivKey, and a paired, publicly or selectively distributed target chip root public key, denoted as SoC-RTLPubKey.

[0062] The target chip's root private key, SoC-RTLPrivKey, is a core security asset of the SoC manufacturer, representing the original trust at the chip level. It is typically injected into the chip's security hardware during the production testing phase in a highly secure manner (e.g., through derivation using the chip's Physically Unclonable Function (PUF) or by incorporating it into a secure facility), ensuring it cannot be directly read or exported externally. This private key will be a fixed participant on the SoC side in all subsequent cross-vendor key negotiation processes, and its security is directly related to the security foundation of the entire chip family and all devices based on that chip.

[0063] Correspondingly, the target chip root public key, SoC-RTLPubKey, serves as the publicly disclosed identity credential and collaboration interface for the corresponding chip model. The SoC manufacturer provides this to its downstream OEM partners through secure channels, such as digital certificates and product security manuals. In this embodiment, the OEM manufacturer receives the target chip root public key and uses it on the server side. It performs cryptographic operations with its own OEM-RTLPrivKey to securely derive the session key used for encryption.

[0064] Therefore, this key pair (SoC-RTLPrivKey, SoC-RTLPubKey) created and managed by the SoC manufacturer essentially establishes a standardized, chip-level trust starting point for the entire multi-vendor collaborative key injection system. It enables the SoC to provide security endorsement and collaborative capabilities for the OEM's key injection through cryptographic protocols without needing to know the OEM's specific keys, achieving a clear division and seamless connection of security responsibilities across the industry chain.

[0065] Specifically, S140, construct a target key encryption key based on the first root private key and the target chip root public key.

[0066] Specifically, after receiving the target chip root public key from the SoC (System-on-Chips) at the chip manufacturing end, the OEM constructs the target key encryption key KEK (Key Encryption Key) based on the first root private key OEM-RTLPrivKey and the target chip root public key SoC-RTLPubKey. Here, KEK is a symmetric key used to encrypt other keys; in this embodiment, it is used to encrypt the target device key OEMKey. It is not the final key used, but rather an intermediate key protecting the final key.

[0067] Specifically, after securely receiving the target chip root public key SoC-RTLPubKey provided by the SoC manufacturer, the original equipment manufacturer (OEM) then initiates the core cryptographic operation process in its protected security environment, such as a hardware security module (HSM) or a high-security key management system.

[0068] Specifically, the OEM uses a specified key negotiation protocol, in this embodiment, the Elliptic-Curve Diffie-Hellman (ECDH) key exchange algorithm, to calculate the target key encryption key corresponding to the first private key and the target chip root public key. Specifically, the OEM uses its tightly guarded first private key, OEM-RTLPrivKey, and the target chip root public key, SoC-RTLPubKey, provided by the SoC, as input to the algorithm. By performing this asymmetric cryptographic operation, both parties can independently calculate the same, high-entropy shared secret value without ever directly exchanging any secret information. This process perfectly embodies the essence of public-key cryptography: even if the communication channel is intercepted, an attacker cannot deduce the shared secret generated in this negotiation from the publicly transmitted public key.

[0069] Subsequently, the OEM immediately performs cryptographic strengthening on this original shared secret. Typically, this is input into a key derivation function; in this embodiment, it could be an HMAC-based Key Derivation Function (HKDF), possibly combined with other pre-defined contextual information, such as fixed string labels and key usage identifiers. After this derivation process, a symmetric key with sufficient strength is generated, namely the target key encryption key KEK. This key will be used exclusively to encrypt the core secret that will be injected into the device next—the target device key OEMKey.

[0070] Therefore, this step of combining the OEM-RTLPrivKey and SoC-RTLPubKey is not a simple concatenation, but a cryptographic handshake that generates a shared secret. It successfully constructs a temporary, strong session key on the OEM's server side that simultaneously integrates the OEM's own secrets and the SoC chip's public identity, laying a crucial foundation for the subsequent secure and efficient protection of the OEMKey. At the same time, this design ensures the dynamism and exclusivity of the encryption key; even if the encryption of a single device is cracked, it will not affect other devices or leak the root key.

[0071] Reference Figure 7 In this embodiment, the step of constructing the target key encryption key based on the first root private key and the target chip root public key further includes: S141. Construct a first version number of the first key pair, and use the first version number as one of the inputs to the derived function of the target key encryption key to obtain the target key encryption key corresponding to the first version number.

[0072] After constructing the target key encryption key based on the first root private key and the target chip root public key, the method further includes: S142. After updating the first key pair to the second key pair, a second version number is generated. The second key pair includes the chip root private key and the second root public key. S143. Construct a second key encryption key based on the chip root private key, the target chip root public key, and the second version number. S144. Write the second key encryption key into the device to replace the target key encryption key.

[0073] Furthermore, in more embodiments, the process of constructing the target key encryption key KEK based on the first root private key OEM-RTLPrivKey and the target chip root public key SoC-RTLPubKey may also include a key mechanism that supports key versioning and secure rotation.

[0074] Specifically, during the initial construction phase, an initial first version number (v1) is assigned to the first key pair (OEM-RTLPrivKey, OEM-RTLPubKey). This first version number, along with the shared secret, serves as input to the key derivation function. Specifically, after calculating the original shared secret using the Elliptic Curve Diffie-Hellman (ECDH) algorithm, the first version number, along with optional fixed context information, is input into the key derivation function (such as HKDF). This design ensures that the derived KEK_v1 not only depends on the public / private key pair but is also strongly bound to a specific version number. Its formal representation is: KEK_v1 = KDF(ECDH(OEM-RTLPrivKey_v1, SoC-RTLPubKey)||Version_v1). Thus, KEKs derived from the same key pair with different version numbers will be completely different, achieving cryptographic isolation.

[0075] Furthermore, when the first key pair needs to be updated for security purposes (such as periodic rotation) or in response to a security incident, the OEM generates a new second key pair in its secure environment. This key pair contains a new second private key (denoted as OEM-RTLPrivKey_v2) and its corresponding second public key (denoted as OEM-RTLPubKey_v2). Simultaneously, the system generates an incrementing second version number (e.g., v2) to uniquely identify this update.

[0076] Then, based on the newly generated second private key (OEM-RTLPrivKey_v2), the unchanged target chip root public key on the SoC side (SoC-RTLPubKey), and the new second version number, the same versioned key derivation process as in step S141 is performed. This process will calculate a completely new second key encryption key (denoted as KEK_v2). Its derivation relationship is: KEK_v2 = KDF(ECDH(OEM-RTLPrivKey_v2, SoC-RTLPubKey)||Version_v2). Since both the private key and the version number have changed, KEK_v2 is cryptographically independent of KEK_v1.

[0077] Finally, the target device key OEMKey is encrypted using the newly derived second key encryption key KEK_v2 to generate a new ciphertext of the corresponding version. Subsequently, a data packet containing the second version number, the second public key OEM-RTLPubKey_v2, and the new ciphertext encrypted with the second key encryption key KEK_v2 is securely written to the device's storage area. During subsequent startup initialization, the device will prioritize recognizing and using the new version number and public key for key derivation and decryption, thereby completing a seamless replacement and upgrade of the key material. This allows for secure rotation of the key encryption key KEK without replacing the underlying SoC key pair.

[0078] S150. Encrypt the target device key based on the target key encryption key to generate target ciphertext.

[0079] Specifically, after obtaining the target key encryption key KEK, the target device key OEMKey is encrypted based on the target key encryption key KEK to generate the target ciphertext OEMKey_Cipher, where OEMKey_Cipher=Symmetric_Encrypt(key=KEK, data=OEMKey).

[0080] In this embodiment, a symmetric encryption algorithm, such as the Advanced Encryption Standard (AES), that has undergone rigorous cryptographic evaluation is used. The operating mode typically employs an authentication encryption mode with associated data, such as AES-GCM. The OEM inputs the newly derived, clean, and high-entropy target key encryption key KEK as the encryption key and the target device key OEMKey, which needs to be protected, as plaintext data into the encryption algorithm. After execution, the output of the encryption algorithm includes not only the converted target ciphertext OEMKey_Cipher, but also, in modes such as GCM, a crucial message authentication code is simultaneously generated.

[0081] The security of the generated target ciphertext OEMKey_Cipher relies entirely on the KEK. Since the KEK itself is derived from a shared secret negotiated via ECDH (Elliptic-Curve Diffie-Hellman Key Exchange), and this negotiation process cannot be cracked by a third party, the target ciphertext OEMKey_Cipher is effectively resistant to eavesdropping. Simultaneously, the use of an authenticated encryption mode ensures the integrity of the ciphertext; any tampering with the target ciphertext OEMKey_Cipher will be immediately detected and rejected during the subsequent decryption verification stage, thus preventing malicious replacement or destruction of the ciphertext during transmission or storage.

[0082] At this point, all key materials required for leaving the factory and ultimately being injected into the device are ready: the dynamically derived KEK does not need to be stored or transmitted, and its lifespan is limited to this encryption process; the highly sensitive target device key OEMKey has been securely encrypted with a KEK, transforming it into the securely distributable target ciphertext OEMKey_Cipher; and the OEM's private key never leaves the secure environment. This process constitutes a perfect cryptographic closed loop, ensuring that the OEM's core secrets are fully and verifiably protected before leaving its controlled environment.

[0083] S160. Write the target ciphertext into the device.

[0084] Specifically, during the production line manufacturing phase of the device, the target encrypted text OEMKey_Cipher is burned into the non-volatile memory of the device using secure production tools or a programming interface. This writing process is typically completed during the final assembly or testing phase of the device, ensuring that the encrypted text is persistently stored in a designated secure storage partition of the device chip before the device is first powered on.

[0085] Furthermore, in this embodiment, the security optimization method for initializing the terminal chip key further includes: S170. Obtain the target tool sent by the chip manufacturing end, wherein the target tool contains an obfuscation-protected target chip root private key, and the target chip root private key is the root private key of the chip manufacturing end. S180. Write the target tool into the target security partition on the device.

[0086] In this embodiment, the SoC (System-on-Chips) at the chip manufacturing end generates a dedicated, highly secure and hardened execution module, namely the target tool RTL Key Tool. The key innovation of this target tool lies in the fact that it is not merely a cryptographic function library, but also a controlled carrier of secure secrets: through advanced code obfuscation techniques and white-box cryptography, it deeply integrates and hides the cryptographic functions of the SoC manufacturer's core secret—the target chip's root private key SoC-RTLPrivKey—within the target tool RTL Key Tool. This means that the target chip's root private key SoC-RTLPrivKey itself does not exist in plaintext, but is transformed into a series of interdependent lookup tables and randomized algorithmic steps, making it extremely difficult to directly extract the original private key value even when the tool is reverse-engineered or dynamically debugged. Therefore, the target tool RTL Key Tool essentially encapsulates the right to use the target chip's root private key SoC-RTLPrivKey, rather than its static data itself. The primary function of the target tool, RTL Key Tool, is designed to, during device runtime, utilize this protected private key to perform ECDH key negotiation with an externally provided OEM-RTLPubKey, thereby deriving the correct KEK. This design enables SoC manufacturers to empower OEM customers at scale while ensuring their own key security.

[0087] Subsequently, SoC manufacturers deliver this RTL Key Tool to their OEM partners through secure channels (such as signed firmware update packages or access-controlled developer platforms). This tool features a unified version and customer-wide compatibility: all OEM customers of the same chip model will receive the exact same tool binary, as it embeds the unified SoC-RTLPrivKey for that chip model. OEM manufacturers integrate it as a core security component into the device's production firmware or secure boot chain. This delivery essentially completes a secure transfer of trust and capability. For SoC manufacturers: this enables a low-cost management model of "develop once, distribute infinitely," while retaining the ultimate cryptographic influence on the chip's security state (whether the key can be successfully derived) through the private key embedded in the tool. For OEM manufacturers: this provides the ability to securely execute key negotiation on local devices, backed by SoC trust, laying the foundation for a fully offline, autonomous key injection process.

[0088] Specifically, the OEM receives the target tool RTL Key Tool sent by the chip manufacturer. The core asset of the target tool RTL Key Tool lies in its integration of the SoC manufacturer's core secrets, namely the target chip root private key SoC-RTLPrivKey. The target chip root private key SoC-RTLPrivKey is the SoC-RTLPrivKey generated by the chip manufacturer during the chip design or pre-configuration stage, representing the hardware root of trust for that chip model.

[0089] After obtaining the target tool, during the manufacturing process of the terminal device, the OEM manufacturer needs to write the tool into a target secure partition on the device. This target secure partition is a protected executable environment guaranteed by the chip hardware characteristics. Deploying the target tool here ensures code integrity: this secure partition typically requires digital signature verification of the executable code within it (e.g., signed with the SoC manufacturer's private key). The device verifies this signature before starting or calling the tool, ensuring that the tool has not been tampered with during transmission and storage, thus maintaining the continuity of the trust chain. Furthermore, runtime isolation is provided: the tool runs within this partition, and its execution process is isolated from the device's main operating system (rich execution environment) at the hardware level. This effectively resists malware attacks, memory snooping, or code injection from the ordinary operating system level, providing a clean "safe" environment for sensitive operations such as key negotiation. Even further, controlled access is achieved: calls to functions within the secure partition typically have strict access control mechanisms, ensuring that only authorized and legitimate system firmware or bootloaders can activate and use this tool, preventing its functionality from being illegally abused.

[0090] As can be seen, the security optimization method for terminal chip key initialization provided in this embodiment, compared with scheme A, eliminates the necessary bidirectional encrypted transmission link between the OEM and the SoC, realizes a completely offline key injection process, and greatly reduces communication and collaboration costs. At the same time, SoC manufacturers no longer need to maintain independent keys and customized tools for different OEM customers. They can support all customers with just one set of general key pairs and uniformly compiled security tools, which greatly simplifies the complexity of key management and operational burden.

[0091] Compared to Solution B, the security optimization method for terminal chip key initialization provided in this embodiment replaces time-consuming asymmetric decryption on the production line with efficient symmetric decryption, and further improves encryption and decryption speed through a key reuse mechanism, significantly improving the efficiency of large-scale production. At the same time, the public key that is publicly available is written to the terminal instead of a highly sensitive private key, fundamentally reducing the key security risks and management costs for OEMs on the production line. In addition, the solution enables SoC manufacturers to achieve collaborative management without knowing the specific keys of OEMs through cryptographic design, effectively preventing key mismatch and enhancing the security and reliability of the overall process.

[0092] In terms of technology selection, the security optimization method for terminal chip key initialization provided in this embodiment supports internationally recognized standardized algorithms (such as AES, ECIES, ECDH), has good algorithm agility and compliance adaptability, and provides flexibility and interoperability assurance for deployment under different security requirements and regulatory environments.

[0093] In summary, this embodiment provides a security optimization method for terminal chip key initialization, applied to the device manufacturing end. First, the device manufacturing end creates a target device key, which is injected into the chip security area of ​​the device as its core key. Then, a first key pair is obtained, which is a key pair from the device manufacturing end, including a first private key and a first public key. Next, a target chip root public key is received, which is the chip root public key sent by the chip manufacturing end of the device. A target key encryption key is constructed based on the first private key and the target chip root public key. The target device key is then encrypted using the target key encryption key to generate target ciphertext. Finally, the target ciphertext is written to the device. This embodiment provides a security optimization method for terminal chip key initialization, solving the problem in existing technologies where there is a lack of a key collaborative initialization scheme that can simultaneously and equally meet the core requirements of both chip manufacturers (SoCs) and device manufacturers (OEMs) in terms of security, cost, and efficiency in smart terminal device manufacturing. This allows OEMs to complete the entire key preparation and injection process locally, without interacting with the SoC server, resulting in high production line efficiency and strong autonomy.

[0094] Example 2 In this embodiment, a security optimization method for terminal chip key initialization is provided. The security optimization method for terminal chip key initialization provided in this embodiment is applied to the device side. In this embodiment, a mobile device is used as an example for explanation.

[0095] Specifically, Figure 8 This is a flowchart illustrating a security optimization method for terminal chip key initialization provided in this embodiment.

[0096] like Figure 8 As shown, the security optimization method for terminal chip key initialization provided in this embodiment is applied to the device side. The security optimization method for terminal chip key initialization includes the following steps: S210. Obtain the target ciphertext and the first public key written by the device manufacturing end, wherein the first public key is the root public key of the device manufacturing end.

[0097] Specifically, refer to Figure 9 On the device side, when initializing the terminal chip key, the device first reads the key data pre-written by the device manufacturer OEM during the production stage from its non-volatile storage, including the target ciphertext OEMKey_Cipher and the first public key OEM-RTLPubKey.

[0098] S220. Obtain the target tool written by the device manufacturing end, run the target tool, and combine it with the first public key to obtain the target key encryption key.

[0099] Specifically, the target tool RTL Key Tool written by the device manufacturing end is obtained. The target tool RTL Key Tool contains an obfuscation-protected target chip root private key SoC-RTLPrivKey, which is the root private key of the chip manufacturing end.

[0100] Reference Figure 10 In many other applications, before running the target tool, the following steps are also included: S221. Obtain the target digital signature built into the chip, and verify the validity of the target digital signature based on the target tool; S222. If the verification fails, the target tool is prohibited from performing the operation of obtaining the target key encryption key.

[0101] Specifically, in more application examples, before running the target tool RTL Key Tool to perform core cryptographic operations, the device also includes a crucial secure boot verification step: the device retrieves a target digital signature pre-installed by the chip's SoC from the chip's built-in secure storage. This signature corresponds to a legitimate version of the target tool. The device verifies the integrity and authenticity of the target tool based on this signature. If verification fails, indicating that the target tool RTL Key Tool may have been tampered with or is an unauthorized version, the device will immediately terminate the process and prohibit the target tool RTL Key Tool from performing any subsequent sensitive operations involving key generation, thereby preventing supply chain attacks and malicious code injection.

[0102] The device can only securely run the target tool RTL Key Tool after it has passed integrity verification. The target tool RTL Key Tool internally includes a function implementation of the target chip root private key SoC-RTLPrivKey, protected by advanced obfuscation and white-box cryptography. After the target tool RTL Key Tool runs, it invokes this protected private key function and, in conjunction with the first public key OEM-RTLPubKey read from the device, calculates the target key encryption key KEK on the device side using a predetermined key negotiation algorithm, identical to the one on the OEM server side.

[0103] S230. Decrypt the target ciphertext based on the target key encryption key to obtain the target device key.

[0104] S240. Load the target device key into the chip's secure storage area.

[0105] After obtaining the correct target key encryption key KEK, the device will use the target key encryption key KEK to decrypt the acquired target ciphertext OEMKey_Cipher. Successful decryption restores the plaintext target device key OEMKey, where OEMKey = RTLKey_Tool_Derive_KEK (data = OEM - RTLLPubKey).

[0106] Finally, the device securely loads and locks the target device key OEMKey into the secure storage area in the chip's hardware, i.e., OEMKey=Symmetric_Decrypt(key=KEK, data=OEMKey_Cipher). This secure storage area can be a secure element, eFuse, or a protected OTP area, thus completing the secure initialization of the entire key. From this point onward, the target device key OEMKey will serve as the device's unique hardware root of trust, providing fundamental cryptographic support for advanced security functions such as device authentication and secure boot.

[0107] In summary, this embodiment provides a security optimization method for terminal chip key initialization, applied to the device side. It obtains the target ciphertext and a first public key written by the device manufacturer (the first public key is the root public key of the device manufacturer), then obtains the target tool written by the device manufacturer, runs the target tool, and combines it with the first public key to obtain the target key encryption key. Next, based on the target key encryption key, the target ciphertext is decrypted to obtain the target device key. Finally, the target device key is loaded into the chip's secure storage area. This embodiment provides users with a security optimization method for terminal chip key initialization, solving the problem in existing technologies where there is a lack of a key collaborative initialization scheme that can simultaneously and equally meet the core requirements of both chip manufacturers (SoCs) and device manufacturers (OEMs) in terms of security, cost, and efficiency in smart terminal device manufacturing. The entire key negotiation and decryption process is completed offline autonomously on the device side, without real-time interaction with any external server. This not only eliminates communication latency and dependency but also greatly improves production line efficiency and deployment flexibility. Moreover, the decrypted core device key is directly loaded into a secure storage area protected by hardware isolation, ensuring the physical security of the key during storage and use, and establishing an unbreakable hardware root of trust for all subsequent advanced security functions.

[0108] It should be understood that although the steps in the flowcharts shown in the accompanying drawings are displayed sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of the steps in this invention, and these steps can be executed in other orders. Moreover, at least a portion of the steps in this invention may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.

[0109] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program using signal-related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM). ROM Programmable ROM ( PROM ), electrically programmable ROM( EPROM Electrically erasable programmable ROM ( EEPROM ) or flash memory. Volatile memory may include random access memory (RAM) RAM Alternatively, an external cache memory. This is for illustrative purposes only and not as a limitation. RAM It can be obtained in various forms, such as static RAM ( SRAM ),dynamic RAM ( DRAM ),synchronous DRAM ( SDRAM ), double data rate SDRAM ( DDR SDRAM ), Enhanced SDRAM ( ESDRAM ), Synchronization Link ( Synchlink ), DRAM ( SLDRAM ), memory bus ( Rambus )direct RAM ( RDRAM ), Direct Memory Bus Dynamics RAM ( DRDRAM ), and memory bus dynamics RAM ( RDRAM )wait.

[0110] Example 3 Based on the above embodiments, the present invention also provides a security optimization device for terminal chip key initialization, the functional module of which is shown in the figure below. Figure 11 As shown, the security optimization device for initializing the terminal chip key includes: The key creation module is used to create a target device key, which is used to inject the chip security area of ​​the device as the core key of the device, as described in Embodiment 1. The key pair acquisition module is used to acquire a first key pair, which is a key pair from the device manufacturing end, including a first private key and a first public key, as described in Embodiment 1. The receiving module is used to receive the root public key of the target chip, which is the chip root public key sent by the chip manufacturing end of the device, as specifically described in Embodiment 1; The KEK construction module is used to construct a target key encryption key based on the first private key and the target chip root public key, as described in Embodiment 1. The ciphertext generation module is used to encrypt the target device key based on the target key encryption key to generate target ciphertext, as described in Embodiment 1. The first writing module is used to write the target ciphertext into the device, as described in Embodiment 1.

[0111] Example 4 Based on the above embodiments, the present invention also provides a security optimization device for terminal chip key initialization, the functional module of which is shown in the figure below. Figure 12 As shown, the security optimization device for initializing the terminal chip key includes: The data acquisition module is used to acquire the target ciphertext and the first public key written by the device manufacturing end. The first public key is the root public key of the device manufacturing end, as specifically described in Embodiment 2. The second tool acquisition module is used to acquire the target tool written by the device manufacturing end, run the target tool, and combine it with the first public key to obtain the target key encryption key, as described in Embodiment 2. The decryption module is used to decrypt the target ciphertext based on the target key encryption key to obtain the target device key, as specifically described in Embodiment 2; The loading module is used to load the target device key into the chip's secure storage area, as described in Embodiment 2.

[0112] Example 5 To achieve the above objectives, refer to Figure 13 The present invention also provides a security optimization system for terminal chip key initialization, wherein the security optimization system for terminal chip key initialization includes a device manufacturing end and a device end; The device manufacturing end is used to implement the steps of the security optimization method for terminal chip key initialization as described in any of the above embodiments; The device is used to implement the steps of the security optimization method for initializing the terminal chip key as described in any of the above embodiments.

[0113] Example 6 Figure 14 A schematic diagram of the structure of a chip provided in an embodiment of this application. The chip may include: The memory 501, the processor 502, and the computer program stored on the memory 501 and capable of running on the processor 502.

[0114] When the processor 502 executes the program, it implements the security optimization method for initializing the terminal chip key provided in the above embodiments.

[0115] Furthermore, the chip also includes: Communication interface 503 is used for communication between memory 501 and processor 502.

[0116] The memory 501 is used to store computer programs that can run on the processor 502.

[0117] Memory 501 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0118] If the memory 501, processor 502, and communication interface 503 are implemented independently, then the communication interface 503, memory 501, and processor 502 can be interconnected via a bus to complete communication between them. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EIS) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 14 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0119] Optionally, in a specific implementation, if the memory 501, processor 502, and communication interface 503 are integrated on a single chip, then the memory 501, processor 502, and communication interface 503 can communicate with each other through an internal interface.

[0120] Processor 502 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of this application.

[0121] Example 7 The present invention also provides a computer-readable storage medium having stored thereon one or more programs that can be executed by one or more processors to implement the steps of the security optimization method for terminal chip key initialization described in the above embodiments.

[0122] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A security optimization method for terminal chip key initialization, characterized in that, The security optimization method for initializing the terminal chip key, applied in equipment manufacturing, includes: Create a target device key, which is used to inject into the chip security area of ​​the device as the core key of the device; Obtain the first key pair, which is a key pair from the device manufacturing end, including a first private key and a first public key; Receive the target chip root public key, which is the chip root public key sent by the chip manufacturing end of the device. Construct a target key encryption key based on the first private key and the target chip root public key; The target device key is encrypted using the target key encryption key to generate target ciphertext; The target ciphertext is written to the device.

2. The security optimization method for terminal chip key initialization according to claim 1, characterized in that, The security optimization method for initializing the terminal chip key further includes: Obtain the target tool sent by the chip manufacturing end, wherein the target tool contains an obfuscated target chip root private key, and the target chip root private key is the root private key of the chip manufacturing end; Write the target tool into the target security partition on the device.

3. The security optimization method for terminal chip key initialization according to claim 1, characterized in that, The construction of the target key encryption key based on the first root private key and the target chip root public key includes: The elliptic curve Diffie-Hellman key exchange algorithm is used to calculate the target key encryption key corresponding to the first root private key and the root public key of the target chip.

4. The security optimization method for terminal chip key initialization according to claim 1, characterized in that, The step of constructing the target key encryption key based on the first root private key and the target chip root public key also includes: Construct a first version number for the first key pair, and use the first version number as one of the inputs to the derived function of the target key encryption key to obtain the target key encryption key corresponding to the first version number.

5. The security optimization method for terminal chip key initialization according to claim 4, characterized in that, After constructing the target key encryption key based on the first root private key and the target chip root public key, the method further includes: When the first key pair is updated to the second key pair, a second version number is generated. The second key pair includes a second private key and a second public key. A second key encryption key is constructed based on the chip root private key, the target chip root public key, and the second version number. The second key encryption key is written into the device to replace the target key encryption key.

6. The security optimization method for terminal chip key initialization according to claim 1, characterized in that, The target key encryption key is a symmetric key, used for encryption.

7. The security optimization method for terminal chip key initialization according to claim 1, characterized in that, The target device key is used on the device as at least one of unique authentication, secure boot, or data encryption.

8. A security optimization method for terminal chip key initialization, characterized in that, Applied to the device side, the security optimization method for initializing the terminal chip key includes: Obtain the target ciphertext and the first public key written by the device manufacturing end, wherein the first public key is the root public key of the device manufacturing end; Obtain the target tool written by the device manufacturing end, run the target tool, and combine it with the first public key to obtain the target key encryption key; The target ciphertext is decrypted based on the target key encryption key to obtain the target device key; The target device key is loaded into the chip's secure storage area.

9. The security optimization method for terminal chip key initialization according to claim 8, characterized in that, The target tool contains an obfuscated root private key for the target chip, which is the root private key from the chip manufacturing end.

10. The security optimization method for terminal chip key initialization according to claim 8, characterized in that, Before running the target tool, the process also includes: Obtain the target digital signature built into the chip, and verify the validity of the target digital signature based on the target tool; If verification fails, the target tool is prohibited from performing the operation of obtaining the target key encryption key.

11. A security optimization device for terminal chip key initialization, characterized in that, The device includes: A key creation module is used to create a target device key, which is used to inject the chip security area of ​​the device as the core key of the device. A key pair acquisition module is used to acquire a first key pair, which is a key pair from the device manufacturing end, including a first private key and a first public key; A receiving module is used to receive the root public key of the target chip, wherein the root public key of the target chip is the chip root public key sent by the chip manufacturing end of the device. The KEK building module is used to construct a target key encryption key based on the first root private key and the target chip root public key. The ciphertext generation module is used to encrypt the target device key based on the target key encryption key to generate target ciphertext; The first writing module is used to write the target ciphertext into the device.

12. The security optimization device for terminal chip key initialization according to claim 11, characterized in that, The device further includes: The first tool acquisition module is used to acquire the target tool sent by the chip manufacturing end. The target tool contains an obfuscated target chip root private key, which is the root private key of the chip manufacturing end. The second writing module is used to write the target tool into the target security partition on the device.

13. The security optimization device for terminal chip key initialization according to claim 11, characterized in that, The KEK building module includes: The first version number generation unit is used to construct a first version number of the first key pair, and use the first version number as one of the inputs to the derived function of the target key encryption key to obtain the target key encryption key corresponding to the first version number.

14. A security optimization device for terminal chip key initialization, characterized in that, The device includes: The data acquisition module is used to acquire the target ciphertext and the first public key written by the device manufacturing end, wherein the first public key is the root public key of the device manufacturing end; The second tool acquisition module is used to acquire the target tool written by the device manufacturing end, run the target tool, and combine it with the first public key to obtain the target key encryption key; The decryption module is used to decrypt the target ciphertext based on the target key encryption key to obtain the target device key; The loading module is used to load the target device key into the chip's secure storage area.

15. The security optimization device for terminal chip key initialization according to claim 14, characterized in that, The second tool acquisition module includes: A verification unit is used to obtain the target digital signature built into the chip and verify the validity of the target digital signature based on the target tool. An execution prohibition unit is used to prevent the target tool from performing the operation of obtaining the target key encryption key if the verification fails.

16. A security optimization system for terminal chip key initialization, characterized in that, The security optimization system for terminal chip key initialization includes the device manufacturing end and the device end; The device manufacturing end is used to implement the steps of the security optimization method for initializing the terminal chip key as described in any one of claims 1-7; The device is used to implement the steps of the security optimization method for initializing the terminal chip key as described in any one of claims 8-10.

17. A chip, characterized in that, The chip includes: a memory, a processor, and a security optimization program for terminal chip key initialization stored in the memory and executable on the processor. When the security optimization program for terminal chip key initialization is executed by the processor, it implements the steps of the security optimization method for terminal chip key initialization as described in any one of claims 1-7, or implements the steps of the security optimization method for terminal chip key initialization as described in any one of claims 8-10.

18. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a security optimization program for terminal chip key initialization. When the security optimization program for terminal chip key initialization is executed by a processor, it implements the steps of the security optimization method for terminal chip key initialization as described in any one of claims 1-7, or implements the steps of the security optimization method for terminal chip key initialization as described in any one of claims 8-10.