Key injection method and system

By generating target keys on the POS terminal and establishing a secure channel, local key injection is realized, solving the high cost and maintenance problems of enterprises when implementing key injection independently, and reducing operation and maintenance complexity.

CN119652516APending Publication Date: 2025-03-18FUJIAN WISBO DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411869394.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

When enterprises independently implement POS terminal key injection, they need to build complex remote key systems, resulting in high costs and maintenance burden.

Method used

By generating a target key in the first terminal and establishing a secure channel using security parameters and certificate chains, the key is injected into the second terminal to realize local key injection.

Benefits of technology

It reduces the cost of key injection, avoids the need to build complex remote key systems, simplifies operation and maintenance processes, and improves the convenience of key download and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119652516A_ABST
    Figure CN119652516A_ABST
Patent Text Reader

Abstract

The invention discloses a key injection method and system. The method is used for a system formed by connecting a first terminal and a second terminal, and comprises the following steps: the first terminal generates a target key; the second terminal sends a security parameter to the first terminal; the first terminal sends a preset certificate chain to the second terminal according to the security parameter; the second terminal generates a session key according to the certificate chain; creating a secure channel between the first terminal and the second terminal based on the session key; and the first terminal injects the target key into the second terminal through the secure channel. According to the invention, key injection can be realized based on local equipment, so that enterprise cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of key management, and in particular to a key injection method and system. Background Art

[0002] With the improvement of mass consumption level, POS (Point Of Sale) machines are widely used. Among them, the security of data transmission needs to be ensured in the process of using POS (Point Of Sale) for financial transactions. At present, POS machines generally use terminal keys to ensure the security of data transmission. Some companies rely on the manufacturer's key system to download terminal keys, while some companies build a key download system to download terminal keys. These key download methods all belong to the remote key injection system, that is, the key is injected into the terminal after establishing a secure channel with the terminal through the remote system. However, some companies do not want to rely on the manufacturer's key system and want to realize terminal key injection independently, but the cost of building a remote key download system independently is high, and there will be a lot of maintenance costs in the later stage. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a key injection method and a terminal, which can realize key injection based on local equipment, thereby reducing enterprise costs.

[0004] In order to solve the above technical problems, a technical solution adopted by the present invention is: A key injection method is used in a system formed by connecting a first terminal and a second terminal, the method comprising: The first terminal generates a target key; The second terminal sends the security parameter to the first terminal; The first terminal sends the preset certificate chain to the second terminal according to the security parameter; The second terminal generates a session key according to the certificate chain; Creating a secure channel between the first terminal and the second terminal based on the session key; The first terminal injects the target key into the second terminal through the secure channel.

[0005] In order to solve the above technical problems, another technical solution adopted by the present invention is: A key injection system comprises a first terminal and a second terminal, wherein the first terminal is connected to the second terminal, the first terminal comprises a first memory, a first processor, and a first computer program stored in the first memory and running on the first processor; the second terminal comprises a second memory, a second processor, and a second computer program stored in the second memory and running on the second processor; The first processor implements the steps performed by the first terminal of the above-mentioned key injection method when executing the first computer program; When the second processor executes the second computer program, the steps performed by the second terminal of the above-mentioned key injection method are implemented.

[0006] The beneficial effects of the present invention are: a target key is generated on the first terminal, so that the first terminal acts as a key host to perform key injection on the second terminal. The second terminal sends security parameters to the first terminal, so that the second terminal safely receives the certificate chain sent by the first terminal. The second terminal generates a session key based on the received certificate chain, so that a secure transmission channel is established between the key host and the terminal that needs to be injected with the key. Finally, the target key stored on the key host is injected into the terminal through a secure channel. The process of implementing key injection in the present invention only relies on the local key host, and there is no need to build a complex remote key system. The key host is implemented based on the local terminal, and no additional equipment research and development costs are required. The infrastructure investment is relatively small, which effectively reduces the key injection cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] Figure 1 A flowchart of a key injection method provided by an embodiment of the present invention; Figure 2 Another flow chart of a key injection method provided by an embodiment of the present invention; Figure 3 A schematic diagram of the structure of a key injection system provided by an embodiment of the present invention; Description of labels: 100. A key injection system; 101. A first terminal; 102. A second terminal; 1011. A first memory; 1012. A first processor; 1021. A second memory; 1022. A second processor. DETAILED DESCRIPTION

[0008] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

[0009] A key injection method provided by an embodiment of the present invention is used in a system formed by connecting a first terminal and a second terminal, and the method includes: The first terminal generates a target key; The second terminal sends the security parameter to the first terminal; The first terminal sends the preset certificate chain to the second terminal according to the security parameter; The second terminal generates a session key according to the certificate chain; Creating a secure channel between the first terminal and the second terminal based on the session key; The first terminal injects the target key into the second terminal through the secure channel.

[0010] From the above description, it can be seen that the beneficial effects of the present invention are: generating a target key on the first terminal, so that the first terminal acts as a key host to inject a key into the second terminal. The second terminal sends security parameters to the first terminal, so that the second terminal safely receives the certificate chain sent by the first terminal. The second terminal generates a session key based on the received certificate chain, so that a secure transmission channel is established between the key host and the terminal that needs to be injected with the key. Finally, the target key stored on the key host is injected into the terminal through a secure channel. The process of implementing key injection in the present invention only relies on the local key host, and there is no need to build a complex remote key system. The key host is implemented based on the local terminal, and no additional equipment research and development costs are required. The infrastructure investment is relatively small, which effectively reduces the key injection cost.

[0011] Furthermore, before the first terminal sends the preset certificate chain to the second terminal according to the security parameter, the method further includes: The second terminal sends the currently used message protocol type to the first terminal; The first terminal detects whether the message protocol type is supported; If yes, the first terminal receives the security parameters and sends the preset certificate chain to the second terminal according to the security parameters; Otherwise, the first terminal does not receive the security parameter and outputs key injection failure information.

[0012] It can be seen from the above description that the first terminal and the second terminal negotiate the message protocol type to ensure that the first terminal and the second terminal can perform data transmission and avoid data parsing or transmission errors.

[0013] Further, the second terminal sending the security parameter to the first terminal includes: The second terminal generates a second random number, generates a request message according to a security parameter and the second random number, and sends the request message to the first terminal.

[0014] It can be seen from the above description that since a secure channel needs to be established between the first terminal and the second terminal, a random number is generated to ensure the randomness and security of each secure channel establishment.

[0015] Further, the first terminal sending the preset certificate chain to the second terminal according to the security parameter includes: The first terminal parses the request message to obtain the second random number and the security parameter; The first terminal determines, from the security parameters, a target security parameter supported by the first terminal, and generates a first random number; The first terminal generates a response message according to the first random number and the certificate chain; The first terminal generates signature information of the response message by using the target security parameter; The first terminal sends the response message and the signature information to the second terminal.

[0016] As can be seen from the above description, the first terminal and the second terminal generate random numbers respectively to achieve two-way verification, further enhancing the unpredictability of the security channel. The parameters used by each terminal to ensure data security may be different. In order to avoid data verification failure due to parameter mismatch between the first terminal and the second terminal, after the security parameters of the second terminal are sent to the first terminal, the first terminal selects the supported target security parameters from them to ensure that the parameters of the two are consistent.

[0017] Furthermore, the second terminal generating a session key according to the certificate chain includes: The second terminal parses the response message to obtain the first random number and the certificate chain; The second terminal verifies the legitimacy of the certificate chain. If the certificate chain passes the verification, the second terminal verifies the signature information according to the certificate chain; If the signature information is verified successfully, the second terminal extracts the certificate public key from the certificate chain; The second terminal generates a temporary key, and encrypts the temporary key according to the certificate public key to obtain a session key.

[0018] From the above description, it can be seen that the signature information is verified through the certificate chain to ensure the integrity and accuracy of the message information during the transmission process, thereby improving the security of data transmission. The second terminal generates a temporary key and encrypts the temporary key based on the certificate public key, which ensures the security of the temporary key transmission while enabling the first terminal to verify the reliability of the session key based on the certificate private key.

[0019] Further, the establishing of a secure channel between the first terminal and the second terminal based on the session key includes: The second terminal sends the first random number and the session key to the first terminal; The first terminal verifies the first random number, and if the verification passes, obtains the certificate private key of the certificate chain, and decrypts the session key according to the certificate private key to obtain the temporary key; The first terminal calculates a key check value of the temporary key, and sends the second random number and the key check value to the second terminal; The second terminal verifies the second random number and the key check value respectively. If the verification passes, the secure channel between the first terminal and the second terminal is successfully established.

[0020] From the above description, it can be seen that the first terminal first verifies the random number to ensure the uniqueness of the data transmission object; then decrypts the session key through the certificate private key to verify the reliability of the session key; finally, calculates the key check value and sends it to the first terminal to verify the correctness of the transmission of the session key.

[0021] Further, the first terminal injecting the target key into the second terminal through the secure channel includes: The first terminal encrypts the target key according to the session key to obtain a transmission key, and sends the transmission key to the second terminal; The second terminal decrypts the transmission key according to the session key to obtain the target key, and stores the target key in a target location.

[0022] It can be seen from the above description that the first terminal and the second terminal encrypt and transmit the target key based on the session key to prevent the target key from being illegally obtained during the transmission process, thereby ensuring the security of the key injection process.

[0023] Furthermore, it also includes: The first terminal saves the injection result of the target key.

[0024] As can be seen from the above description, the first terminal saves the key injection result so that subsequent developers can refer to it during maintenance or troubleshooting.

[0025] Another embodiment of the present invention provides a key injection system, comprising a first terminal and a second terminal, wherein the first terminal is connected to the second terminal, the first terminal comprises a first memory, a first processor, and a first computer program stored in the first memory and running on the first processor; the second terminal comprises a second memory, a second processor, and a second computer program stored in the second memory and running on the second processor; The first processor implements the steps performed by the first terminal of the above-mentioned key injection method when executing the first computer program; When the second processor executes the second computer program, the steps performed by the second terminal of the above-mentioned key injection method are implemented.

[0026] From the above description, it can be seen that the beneficial effects of the present invention are: generating a target key on the first terminal, so that the first terminal acts as a key host to inject a key into the second terminal. The second terminal sends security parameters to the first terminal, so that the second terminal safely receives the certificate chain sent by the first terminal. The second terminal generates a session key based on the received certificate chain, so that a secure transmission channel is established between the key host and the terminal that needs to be injected with the key. Finally, the target key stored on the key host is injected into the terminal through a secure channel. The process of implementing key injection in the present invention only relies on the local key host, and there is no need to build a complex remote key system. The key host is implemented based on the local terminal, and no additional equipment research and development costs are required. The infrastructure investment is relatively small, which effectively reduces the key injection cost.

[0027] Furthermore, the first terminal is connected to the second terminal via a communication cable.

[0028] It can be seen from the above description that the first terminal and the second terminal are physically connected via a communication cable, so that the data transmission between the first terminal and the second terminal is not vulnerable to remote attacks, thereby effectively ensuring the security of transmission.

[0029] The key injection method and system of the present invention are applicable to POS machines and other security devices to implement local key injection, which is described below through specific implementation methods: Please refer to Figure 1 , Embodiment 1 of the present invention is: A key injection method is used in a system formed by connecting a first terminal and a second terminal, wherein the first terminal and the second terminal are connected via a communication cable. In some embodiments, the first terminal and the second terminal are connected via an OTG cable, which is a USB On-The-Go cable that allows direct connection and data transmission between USB devices, so that data transmission is achieved between the first terminal and the second terminal through a serial port service.

[0030] In some embodiments, a first application is developed on the first terminal, and the first application is used to set the key and key parameters (such as the key system, key algorithm, key purpose, and key component, etc.), so that the first terminal can inject the key into other terminals as a local key host. A second application is developed on the second terminal, and the second application communicates with the underlying module through the interface provided by the terminal underlying service, thereby receiving the key injected by the local key host.

[0031] On this system, the key injection methods specifically include: S1. The first terminal generates a target key.

[0032] S2. The second terminal sends security parameters to the first terminal.

[0033] Specifically, the step S2 includes: S21. The second terminal generates a second random number, generates a request message according to a security parameter and the second random number, and sends the request message to the first terminal.

[0034] In some embodiments, the security parameters include a list of algorithms supported by the terminal for protecting data security. The algorithm list includes an authentication algorithm list, a signature algorithm list, and a MAC (Message Authentication Code) algorithm list, etc. The second random number is used to verify the transmission data of the first terminal when a secure channel is subsequently created. For example, the second terminal encrypts the second random number, and sends the encrypted second random number and the unencrypted second random number to the first terminal at the same time. When the first terminal receives the data carrying the second random number, it decrypts the encrypted second random number. If the decryption result is consistent with the unencrypted second random number, the data verification is confirmed to have passed.

[0035] S3. The first terminal sends a preset certificate chain to the second terminal according to the security parameter.

[0036] Specifically, step S3 includes: S31, the first terminal parses the request message to obtain the second random number and the security parameter. After the first terminal parses the request message to obtain the second random number, the second random number is saved.

[0037] S32: The first terminal determines a target security parameter supported by the first terminal from the security parameters, and generates a first random number.

[0038] In some embodiments, an algorithm supported by the first terminal is selected from the list of algorithms supported by the second terminal to ensure that when data authenticated or encrypted based on the algorithm of the first terminal is transmitted to the second terminal, the second terminal can also correctly authenticate or decrypt the data based on the same algorithm.

[0039] S33. The first terminal generates a response message according to the first random number and the certificate chain, and generates signature information of the response message through the target security parameter.

[0040] In some embodiments, the certificate chain includes a signature certificate chain and an encryption certificate chain. The signature certificate chain is used to verify the signature information to ensure that the message is correctly transmitted to the second terminal, and the encryption certificate chain is used to ensure that the certificate public key is securely transmitted to the second terminal.

[0041] In some embodiments, the certificate chain is imported from the USB flash drive by the first application of the first terminal, so that the first terminal can directly use it when performing key injection. If the certificate chain is changed, the USB flash drive needs to be used again to import a new certificate chain.

[0042] In some embodiments, the signature information of the response message is generated by the target security parameters as follows: a hash value of the response message is calculated, and a signature certificate chain corresponding to the target security parameters is determined, and then the response message is signed by the private key in the signature certificate chain in combination with the hash value.

[0043] S34. The first terminal sends the response message and the signature information to the second terminal.

[0044] Specifically, before step S3, the method further includes: S301: The second terminal sends a currently used message protocol type to the first terminal.

[0045] In some embodiments, when the first terminal receives the key injection instruction, the first terminal sends an inquiry frame to the second terminal to obtain the message protocol type currently used by the second terminal. After receiving the inquiry frame, the second terminal sends the message protocol type to the first terminal.

[0046] S302: The first terminal detects whether it supports the message protocol type.

[0047] S303: If yes, the first terminal receives the security parameter and executes step S3.

[0048] In some embodiments, when the first terminal supports the message protocol type sent by the second terminal, the first terminal waits for the second terminal to send a request message containing security parameters.

[0049] S304: Otherwise, the first terminal does not receive the security parameter and outputs key injection failure information.

[0050] S4. The second terminal generates a session key according to the certificate chain.

[0051] Specifically, step S4 includes: S41. The second terminal parses the response message to obtain the first random number and the certificate chain.

[0052] S42: The second terminal verifies the legitimacy of the certificate chain. If the certificate chain passes the verification, the second terminal verifies the signature information according to the certificate chain.

[0053] In some embodiments, the second terminal decrypts the signature information using a public key in the signature certificate chain to verify the signature information.

[0054] S43: If the signature information is verified, the second terminal extracts the certificate public key from the certificate chain. In some embodiments, the certificate public key is extracted from an encrypted certificate chain.

[0055] S44: The second terminal generates a temporary key, and encrypts the temporary key according to the certificate public key to obtain a session key.

[0056] S5. Create a secure channel between the first terminal and the second terminal based on the session key.

[0057] Specifically, step S5 includes: S51. The second terminal sends the first random number and the session key to the first terminal.

[0058] S52: The first terminal verifies the first random number. If the verification passes, the first terminal obtains the certificate private key of the certificate chain, and decrypts the session key according to the certificate private key to obtain the temporary key.

[0059] In some embodiments, in step S51, the second terminal encrypts the first random number based on the certificate public key, and then sends the encrypted first random number and the session key to the first terminal at the same time. In step S52, the first terminal decrypts the first random number based on the certificate private key, and compares the decryption result with the previously generated first random number. If the comparison is consistent, the verification is passed.

[0060] S53: The first terminal calculates a key check value of the temporary key, and sends the second random number and the key check value to the second terminal.

[0061] S54: The second terminal verifies the second random number and the key check value respectively. If both pass the verification, the secure channel between the first terminal and the second terminal is successfully established.

[0062] In the present invention, the first terminal saves the second random number after receiving the request message, and the second terminal saves the first random number after receiving the response message. In the process of establishing a secure channel between the first terminal and the second terminal, the first terminal verifies the reliability of the second terminal by judging whether the first random number sent by the second terminal is correct, and the second terminal verifies the reliability of the first terminal by judging whether the second random number sent by the first terminal is correct, thereby enhancing the unpredictability of the data encryption operation and improving the security of data transmission.

[0063] S6. The first terminal injects the target key into the second terminal through the secure channel.

[0064] Specifically, step S6 includes: S61. The first terminal encrypts the target key according to the session key to obtain a transmission key, and sends the transmission key to the second terminal.

[0065] S62: The second terminal decrypts the transmission key according to the session key to obtain the target key, and stores the target key to a target location.

[0066] The method further includes: S7. The first terminal saves the injection result of the target key.

[0067] Please refer to Figure 2 , Embodiment 2 of the present invention is: A key injection method of the first embodiment is applied to an actual scenario, where a terminal acts as a key host to inject keys into other terminals.

[0068] Step 1: The developer sets the key and key parameters in the first application of the key host.

[0069] Step 2. Connect the key host and other terminals via OTG cable to transmit data through serial port service.

[0070] Step 3: Click the key injection instruction in the first application of the key host, and click the start receiving key instruction in the second application of other terminals.

[0071] Step 4: The first application of the key host sends an inquiry frame to the second application of the other terminal to determine the message protocol type currently used by the other terminal.

[0072] Step 5: The second application of the other terminal receives the inquiry frame and sends the currently supported message protocol type to the first application of the key host.

[0073] Step 6: The first application of the key host receives the message protocol type and determines whether it supports the message protocol type. If so, the key injection process continues and waits for other terminals to send request messages; otherwise, the key injection process ends and key injection failure information is output.

[0074] Step 7: The other terminal encapsulates the algorithm list supported by the terminal (such as the authentication algorithm list, the signature algorithm list, and the MAC algorithm list, etc.) and the generated random number random_local into a request message, and sends the request message to the key host.

[0075] Step 8: The key host receives the request message, selects a supported algorithm from the request message, and obtains the preset signature certificate chain and encryption certificate chain; encapsulates the signature certificate chain, encryption certificate chain, and the generated random number random_remote into a response message; calculates the hash value of the response message, and performs RSA signature on the response message using the private key of the signature certificate chain and the hash value; the RSA signature is a signature generated based on the RSA encryption algorithm. The key host sends the response message and the RSA signature to other terminals.

[0076] Step 9. Other terminals receive the response message, parse the response message to obtain the signature certificate chain, encryption certificate chain and random number random_remote; after verifying the legitimacy of the signature certificate chain and encryption certificate chain, verify the signature through the signature certificate chain. If the verification passes, obtain the certificate public key from the encryption certificate chain, save the certificate public key and random number random_remote.

[0077] Step 10: The other terminal generates a temporary key, encrypts the temporary key with the certificate public key to obtain a session key, and sends the session key carrying the random number random_remote to the key host.

[0078] Step 11: The key host verifies the random number random_remote. If the verification is correct, the session key is retrieved and the temporary key is obtained by decrypting the session key using the certificate private key of the encryption certificate chain. The KCV (key check value) of the temporary key is calculated and the KCV carrying the random number random_local is sent to other terminals.

[0079] Step 12: Other terminals verify the random number random_local. If the verification is correct, KCV is taken out and verified whether KCV is correct. If correct, the verification is successful.

[0080] At this point, the secure channel between the key host and other terminals is successfully established.

[0081] Step 13: The key host encrypts the generated key using the temporary key and the AES algorithm to obtain a transmission key, and sends the transmission key to other terminals.

[0082] Step 14: Other terminals use the temporary key and the AES algorithm to decrypt the transmission key to obtain the key, and save the key to the financial transaction program to complete the key injection process.

[0083] Step 15: The key host records the key injection result.

[0084] Please refer to Figure 3 , Embodiment 3 of the present invention is: A key injection system 100 includes a first terminal 101 and a second terminal 102, wherein the first terminal 101 is connected to the second terminal 102, the first terminal 101 includes a first memory 1011, a first processor 1012, and a first computer program stored in the first memory 1011 and running on the first processor 1012; the second terminal 102 includes a second memory 1021, a second processor 1022, and a second computer program stored in the second memory 1021 and running on the second processor 1022; When the first processor 1012 executes the first computer program, steps performed by the first terminal of a key injection method in embodiment 1 are implemented; When the second processor 1022 executes the second computer program, the steps performed by the second terminal of a key injection method in embodiment 1 are implemented.

[0085] In summary, the present invention provides a key injection method and system, which generates a target key on a first terminal, so that the first terminal acts as a key host to inject a key into a second terminal. The key injection process only relies on the local key host, and there is no need to build a complex remote key system. The key host is implemented based on the local terminal, and there is no need to invest additional equipment research and development costs. The infrastructure investment is relatively small, which effectively reduces the key injection cost. In addition, compared to the remote key system, the present invention can implement key settings in the local key host, and it is very convenient for operation and maintenance personnel to download keys whether inside or outside the factory. Moreover, when the operation and maintenance personnel repair the terminal, they only need to carry the local key host, without knowing the server address and networking requirements, etc., which improves the convenience of key downloading and maintenance.

[0086] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A key injection method, characterized in that: A system for connecting a first terminal and a second terminal, the method comprising: The first terminal generates a target key; The second terminal sends the security parameter to the first terminal; The first terminal sends the preset certificate chain to the second terminal according to the security parameter; The second terminal generates a session key according to the certificate chain; Creating a secure channel between the first terminal and the second terminal based on the session key; The first terminal injects the target key into the second terminal through the secure channel.

2. A key injection method according to claim 1, characterized in that: Before the first terminal sends the preset certificate chain to the second terminal according to the security parameter, the method further includes: The second terminal sends the currently used message protocol type to the first terminal; The first terminal detects whether the message protocol type is supported; If yes, the first terminal receives the security parameters and sends the preset certificate chain to the second terminal according to the security parameters; Otherwise, the first terminal does not receive the security parameter and outputs key injection failure information.

3. A key injection method according to claim 1, characterized in that: The second terminal sending the security parameter to the first terminal includes: The second terminal generates a second random number, generates a request message according to a security parameter and the second random number, and sends the request message to the first terminal.

4. A key injection method according to claim 3, characterized in that: The first terminal sending the preset certificate chain to the second terminal according to the security parameter includes: The first terminal parses the request message to obtain the second random number and the security parameter; The first terminal determines, from the security parameters, a target security parameter supported by the first terminal, and generates a first random number; The first terminal generates a response message according to the first random number and the certificate chain, and generates signature information of the response message according to the target security parameter; The first terminal sends the response message and the signature information to the second terminal.

5. A key injection method according to claim 4, characterized in that: The second terminal generating a session key according to the certificate chain includes: The second terminal parses the response message to obtain the first random number and the certificate chain; The second terminal verifies the legitimacy of the certificate chain. If the certificate chain passes the verification, the second terminal verifies the signature information according to the certificate chain; If the signature information is verified successfully, the second terminal extracts the certificate public key from the certificate chain; The second terminal generates a temporary key, and encrypts the temporary key according to the certificate public key to obtain a session key.

6. A key injection method according to claim 5, characterized in that: The establishing of a secure channel between the first terminal and the second terminal based on the session key includes: The second terminal sends the first random number and the session key to the first terminal; The first terminal verifies the first random number, and if the verification passes, obtains the certificate private key of the certificate chain, and decrypts the session key according to the certificate private key to obtain the temporary key; The first terminal calculates a key check value of the temporary key, and sends the second random number and the key check value to the second terminal; The second terminal verifies the second random number and the key check value respectively. If both pass the verification, the secure channel between the first terminal and the second terminal is successfully established.

7. A key injection method according to claim 1, characterized in that: The first terminal injecting the target key into the second terminal through the secure channel includes: The first terminal encrypts the target key according to the session key to obtain a transmission key, and sends the transmission key to the second terminal; The second terminal decrypts the transmission key according to the session key to obtain the target key, and stores the target key in a target location.

8. A key injection method according to claim 1, characterized in that: Also includes: The first terminal saves the injection result of the target key.

9. A key injection system, comprising a first terminal and a second terminal, wherein the first terminal is connected to the second terminal, the first terminal comprises a first memory, a first processor, and a first computer program stored in the first memory and running on the first processor; the second terminal comprises a second memory, a second processor, and a second computer program stored in the second memory and running on the second processor; characterized in that: The first processor implements the steps performed by the first terminal of the key injection method according to any one of claims 1 to 8 when executing the first computer program; When the second processor executes the second computer program, the steps performed by the second terminal of the key injection method described in any one of claims 1-8 are implemented.

10. A key injection system according to claim 9, characterized in that: The first terminal is connected to the second terminal via a communication cable.