Private key protection method, server access method, system, device, and storage medium

By using the trusted execution environment and key management service to encrypt the private key in privacy computing, the problem of low private key security is solved, efficient encrypted storage and transmission of the private key is realized, the risk of leakage is reduced, and the security of the private key is improved. Data security.

WO2024198933A1PCT designated stage expired Publication Date: 2024-10-03CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PTE LTD

Patent Information

Application Number
PCT/CN2024/081369
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-29
Filing Date
2024-03-13
Publication Date
2024-10-03

AI Technical Summary

Technical Problem

In privacy computing, private keys have low security and are easily leaked, leading to increased data security risks.

Method used

Introduce Trusted Execution Environment (TEE) and Key Management Service (KMS), obtain the data key and the ciphertext of the data key in the TEE, and use the data key to encrypt the private key to generate the ciphertext of the private key. , stored on the client, while maintaining the plain text of the private key in the TEE to prevent access from external untrusted environments.

Benefits of technology

It effectively reduces the risk of private key leakage, improves the security of the private key, ensures that the private key remains confidential in the confidential computing environment, and the external environment cannot access the private key, thereby enhancing data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024081369_03102024_PF_FP_ABST
    Figure CN2024081369_03102024_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a private key protection method, a server access method, a system, a device, and a storage medium. In the embodiments of the present application, a TEE and a KMS are introduced to protect a private key in a security protocol. Specifically, a TEE calls a KMS to acquire a data key of a user of a client and a ciphertext of the data key, and the TEE encrypts a private key by using the data key to obtain a ciphertext of the private key; and then the ciphertext of the private key and the ciphertext of the data key are stored in the client, so that encrypted storage of the private key is realized, and the risk of leakage of the private key can be reduced. Additionally, the TEE encrypts the private key, so that a plaintext of the private key is kept in the TEE of confidential computing, and the private key cannot be accessed by an external untrusted environment, thereby further improving the security of the private key.
Need to check novelty before this filing date? Find Prior Art

Description

Private key protection and server access method, system, device and storage medium

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on March 29, 2023, with application number 202310333675.7 and application name “Private Key Protection and Server Access Method, System, Device and Storage Medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of communication technologies, and in particular to a method, system, device, and storage medium for protecting a private key and accessing a server. Background Art

[0003] With the rapid development of privacy computing, privacy computing technology has been widely applied across various industries. Cryptography is a key technology in privacy computing. The security of private keys determines the data security of all environments in the privacy computing process. Improving the security of private keys and reducing the risk of private key leakage have become urgent technical challenges in this field.

[0004] Summary of the Invention

[0005] Multiple aspects of the present application provide a private key protection and server access method, system, device and storage medium to reduce the risk of private key leakage and improve private key security.

[0006] In a first aspect, an embodiment of the present application provides a private key protection method, comprising:

[0007] Use the trusted execution environment (TEE) to obtain the target user's public and private key pairs to be protected;

[0008] Using the TEE, obtain the target user's data key and the ciphertext of the data key from the key management service KMS;

[0009] In the TEE, the private key in the public-private key pair is encrypted using the data key to obtain a ciphertext of the private key;

[0010] The TEE is used to return the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key to the user's client, so that the client can store the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key.

[0011] In a second aspect, an embodiment of the present application further provides a server access method, including:

[0012] A decryption request initiated by the client is obtained using a trusted execution environment (TEE); the decryption request includes a ciphertext of a random number, a ciphertext of the data key, and a ciphertext of the private key; the ciphertext of the random number is obtained by the server in response to the client's access request by encrypting the random number using the public key in the public-private key pair; the client stores the ciphertext of the data key and the ciphertext of the private key;

[0013] Using the TEE to call KMS to decrypt the ciphertext of the data key to obtain the data key;

[0014] Decrypting the ciphertext of the private key using the data key in the TEE to obtain the private key;

[0015] Decrypting the ciphertext of the random number using the private key in the TEE to obtain the plaintext of the random number;

[0016] The plain text of the random number is returned to the client, so that the client can access the server based on the plain text of the random number.

[0017] In a third aspect, an embodiment of the present application further provides a private key protection method, comprising:

[0018] Calling the Trusted Execution Environment (TEE) to encrypt the private key in the target user's public-private key pair, so that the TEE can call the KMS to obtain the target user's data key and the ciphertext of the data key, and then encrypt the private key with the data key to obtain the ciphertext of the private key;

[0019] Receive the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key returned by the TEE;

[0020] The ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key are stored.

[0021] In a fourth aspect, an embodiment of the present application further provides a server access method, including:

[0022] Initiate an access request to the server, so that the server responds to the access request and encrypts the random number using the public key of the public-private key pair of the target user corresponding to the client to obtain the ciphertext of the random number; the client stores the ciphertext of the private key of the public-private key pair and the ciphertext of the data key of the target user;

[0023] Receiving the ciphertext of the random number returned by the server;

[0024] Initiate a decryption request to the Trusted Execution Environment (TEE), where the decryption request includes the ciphertext of the random number, the ciphertext of the data key, and the ciphertext of the private key, so that the TEE can call the KMS to decrypt the ciphertext of the data key to obtain the data key, decrypt the ciphertext of the private key using the data key to obtain the private key, and decrypt the ciphertext of the random number using the private key to obtain the plaintext of the random number.

[0025] Receive the plaintext of the random number returned by the TEE;

[0026] Based on the plain text of the random number, access the server.

[0027] In a fifth aspect, an embodiment of the present application further provides a communication system, comprising: a client, a first service node, and a second service node; the first service node runs a trusted execution environment TEE; the second service node is used to provide key management services;

[0028] The first service node is configured to execute the steps of the method provided in the first aspect and / or the second aspect above;

[0029] The client is used to execute the steps in the method provided in the third aspect and / or fourth aspect of the claim.

[0030] In a sixth aspect, an embodiment of the present application further provides a computing device, comprising: a memory and a processor; wherein the memory is used to store a computer program;

[0031] The processor is coupled to the memory, and is configured to execute the computer program to perform the steps of the method performed by the first service node in the fifth aspect and / or the client in the fifth aspect.

[0032] In the seventh aspect, an embodiment of the present application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed by one or more processors, the one or more processors execute the steps in the method executed by the first service node in the fifth aspect and / or the client in the fifth aspect.

[0033] In an embodiment of the present application, a Trusted Execution Environment (TEE) and a Key Management Service (KMS) are introduced to protect the private key in the security protocol. Specifically, TEE calls KMS to obtain the client's user's data key and the ciphertext of the data key, and uses the data key to encrypt the private key in the TEE to obtain the ciphertext of the private key; then, the ciphertext of the private key and the ciphertext of the data key are stored on the client, thereby realizing the encrypted storage of the private key and reducing the risk of private key leakage. On the other hand, the private key is encrypted by TEE, so that the plaintext of the private key remains in the TEE for confidential computing, and the private key cannot be accessed by an external untrusted environment, which can further improve the security of the private key. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0035] FIG1 is a schematic diagram of a traditional solution for verifying login using a public and private key pair provided by the SSH protocol;

[0036] Figures 2 and 3 are schematic diagrams of a process for private key protection in a communication system according to an embodiment of the present application;

[0037] FIG4 is a schematic diagram of a process of performing trusted authentication on a TEE by a communication system according to an embodiment of the present application;

[0038] FIG5 is a schematic diagram of a process of accessing a server by a communication system according to an embodiment of the present application;

[0039] 6 and 7 are flowcharts of a private key protection method according to an embodiment of the present application;

[0040] 8 and 9 are schematic diagrams of a process for accessing a server provided in an embodiment of the present application;

[0041] FIG10 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0043] Figure 1 illustrates a traditional solution for authenticating logins using a public-private key pair provided by the Secure Shell (SSH) protocol. The SSH protocol is a protocol used for secure remote logins and other secure network services over insecure networks. As shown in Figure 1 , the communication system includes a client 10 and a server 20.

[0044] The client 10 refers to a computer device used by a user that has the required computing, Internet access, and communication functions, such as a smartphone, tablet computer, personal computer, or wearable device. Of course, the client 10 can also be implemented as a server device. For example, it can be a single server device, a cloud-based server array, or a virtual machine (VM) running on a cloud-based server array. Furthermore, it can also refer to other computing devices with corresponding service capabilities, such as computers and other terminal devices (running service programs).

[0045] The server 20 refers to a server device that responds to the request of the client 10 and provides services to the user, and generally has the ability to undertake and guarantee services. The server 20 can be a single server device, or a cloud-based server array, or a virtual machine (VM) running in a cloud-based server array. In addition, the server 20 can also refer to other computing devices with corresponding service capabilities, such as computers and other terminal devices (running service programs), etc. In the embodiment of the present application, the specific implementation form of the service provided by the server 20 is not limited. Optionally, the service provided by the server 20 may be a live broadcast service, an online shopping service, an instant messaging service, an email service, a video service, an audio service or other services, etc.

[0046] In this embodiment, when the client 10 accesses the server 20, the server 20 may verify the access rights of the target user of the client 10. The client 10 accessing the server 20 may be implemented as the client 10 logging into the server 20 or the client 10 accessing services provided by the server 20.

[0047] In some embodiments, the public-private key pair mechanism provided by the SSH protocol can be used to verify access rights. Specifically, as shown in FIG1 , the client 10 can generate a public-private key pair and store the public-private key pair in a designated directory (corresponding to step 1, "Generate and store a public-private key pair," in FIG1 ). This is typically the " / .ssh" directory. Furthermore, the client 10 can register the public key in the public-private key pair with the server 20 (corresponding to step 2, in FIG1 ).

[0048] When accessing server 20, client 10 may initiate an access request to server 20 (corresponding to step 3 in Figure 1 ). This access request is also known as an SSH connection request. In response to this access request, server 20 may generate a random number and encrypt the random number using the public key in the public-private key pair to obtain a ciphertext of the random number (corresponding to step 4, "Public key encryption of random number" in Figure 1 ). The ciphertext of the random number may then be returned to client 10 (corresponding to step 5 in Figure 1 ).

[0049] Client 10 receives the ciphertext of the random number and reads the private key from the public-private key pair in the " / .ssh" directory to decrypt the random number to obtain the plaintext of the random number (corresponding to step 6 "Private key decrypts the ciphertext of the random number" in Figure 1). Client 10 can then send the plaintext of the random number to server 20 (corresponding to step 7 in Figure 1). Server 20 can compare the received random number with its own stored random number to verify the access rights of client 10 (corresponding to step 8 in Figure 1) and obtain an access rights verification result. This access rights verification result indicates whether the client has access rights to the service or not. Further, server 20 can send the access rights verification result to client 10 (9 corresponding to step 9 in Figure 1). If the random number received by server 20 is the same as the random number stored by server 20, it is determined that client 10 has access rights. An SSH connection is then established with client 10, allowing client 10 to access server 20. If the random number received by server 20 is different from the random number stored by server 20, server 20 returns a message to client 10 indicating that client 10 does not have access rights.

[0050] As shown above, the private key in the public-private key pair is stored in plaintext in the client's " / .ssh" directory. Although the " / .ssh" directory is hidden, it's generally known to those skilled in the art that public-private key pairs are stored there. Therefore, there's a risk of leakage of the private key. If an attacker steals the SSH private key, they can remotely control access to the client or even the server, or carry out other attacks.

[0051] In order to solve the above technical problems, in some embodiments of the present application, a Trusted Execution Environment (TEE) and a Key Management Service (KMS) are introduced to protect the private key in the security protocol. Specifically, TEE calls KMS to obtain the client's user's data key and the ciphertext of the data key, and uses the data key to encrypt the private key in the TEE to obtain the ciphertext of the private key; then, the ciphertext of the private key and the ciphertext of the data key are stored on the client, thereby realizing the encrypted storage of the private key and reducing the risk of private key leakage. On the other hand, the private key is encrypted by TEE, so that the plaintext of the private key remains in the confidential computing TEE, and the external untrusted environment cannot access the private key, which can further improve the security of the private key.

[0052] The following describes in detail the technical solutions provided by various embodiments of the present application in conjunction with the accompanying drawings.

[0053] It should be noted that the same reference numerals denote the same objects in the following drawings and embodiments, and therefore, once an object is defined in one drawing or embodiment, it does not need to be further discussed in the subsequent drawings and embodiments.

[0054] 2 to 5 are schematic diagrams of the communication system provided in the embodiments of the present application. Referring to FIG. 2 to 5 , the communication system includes: a client 10 , a first service node 30 , and a second service node 40 .

[0055] For the implementation of client 10, please refer to the relevant content of Figure 1 and will not be repeated here. The first service node 30 runs a Trusted Execution Environment (TEE). In confidential computing, the computing entity running the TEE is called an enclave. The calculations and memory operations performed in the enclave are invisible to user applications and the operating system kernel.

[0056] Enclave can provide a trusted isolation space to encapsulate software into the Enclave, ensuring the confidentiality and integrity of software code and data and protecting them from malware attacks.

[0057] The first service node 30 can create an enclave based on Software Guard Extensions (SGX) technology as a trusted execution environment (TEE). It can also allocate a portion of the enclave page cache (EPC) in the memory of the first service node 30 to host the enclave. The central processing unit (CPU) of the first service node 30 can simultaneously create one or more enclaves. The code running in different enclaves can be the same or different, depending on the purpose of the enclave. The CPU can partition computing resources to create enclaves as trusted execution environments. Computing resources may include virtual CPUs (vCPUs) and memory. The vCPUs and memory allocated to the enclave are isolated from other CPUs and memory on the host computer of the first service node 30.

[0058] In this embodiment, the first service node 30 can be implemented as an independent physical machine to provide TEE services. Of course, the first service node 30 can also be deployed on the same physical machine as the client 10 and serve as a functional module for providing TEE on the client 10.

[0059] In this embodiment, the second service node 40 can provide a key management service (KMS). KMS provides a key management and data encryption service platform with simple, reliable, secure, and compliant data encryption protection capabilities. The key management service can be implemented as a Software as a Service (SaaS) product and deployed in the cloud.

[0060] In order to improve key security, KMS can provide a customer master key (CMK). Each user corresponds to a unique CMK. The user is generally the user of client 10. CMK is a key created by the user or cloud service through key management, which is mainly used to encrypt and protect the data key (DK). A customer master key can encrypt multiple data keys. A CMK can derive multiple DKs. Different applications of the user can use different DKs for data encryption, so that even if a DK is lost, it will not affect the use of other applications. If the same CMK is used to encrypt all the application data of the user, once the CMK is lost, the security of all application data will be affected.

[0061] Based on the scenario shown in FIG1 above in which the client 10 and the server 20 communicate based on a security protocol, the client 10 can access the server 20 based on the security protocol. The client 10 can be the client of the security protocol. The server 20 can be the server of the security protocol. Specifically, the client 10 can access the server 20 using the public-private key pair mechanism provided by the security protocol. A security protocol refers to a message exchange protocol based on cryptography, the purpose of which is to provide various security services in a network environment. The security protocol can be, but is not limited to, the SSH protocol, the remote terminal (Telnet) protocol, or the Secure Sockets Layer (SSL) protocol. Regarding the process of the client 10 accessing the server 20 using the public-private key pair mechanism provided by the security protocol, please refer to the relevant content of FIG1 above, which will not be repeated here.

[0062] In this embodiment, to improve private key security, TEE and KMS are introduced to protect the private key in the public-private key pair of the security protocol. Specifically, in conjunction with Figures 2 and 3, client 10 can call the TEE provided by the first service node 30 to encrypt the private key in the public-private key pair of the target user (corresponding to step 1 in Figure 2 and step 1 in Figure 3). The target user is the user of client 10.

[0063] It is worth noting that before the client 10 uses the TEE running on the first service node 30, it needs to ensure that the TEE is trustworthy. This requires trustworthy authentication of the TEE. Remote Attestation (RA) can be used for trustworthy authentication of the Enclave. Among them, RA refers to a technology in which a computing system (prover) proves its software and / or hardware configuration and status to a remote system (verifier). A remote attestation system usually consists of two parts: a prover and a verifier. The prover side has a system integrity measurement (Integrity Measurement) mechanism, which can report the measurement value of its own system to the verifier through the remote attestation protocol (RAP) based on the remote attestation protocol between the prover and the verifier, so that the verifier can verify the integrity of the prover system.

[0064] In this embodiment, the client 10 can act as a verifier, also known as a challenger. The TEE in the first service node 30 acts as a prover. The RA service node 50 refers to a device, module, or virtual instance that provides a remote attestation service. A virtual instance can be a virtual machine, a container group (such as a Pod), or a container. The remote attestation service provided by the RA service node 50 can be a SaaS product. The remote attestation process of the TEE is exemplified below with reference to FIG4 .

[0065] Before using the TEE provided by the first service node 30, the client 10 needs to verify the trustworthiness of the TEE. Under the condition that the TEE is verified to be a trusted executable environment, the TEE can be called to encrypt the private key in the public-private key pair of the target user.

[0066] As shown in Figure 4, the client 10 can use remote attestation technology to verify the credibility of the TEE. Specifically, the client 10 can initiate a remote attestation (RA) request to the TEE in the first service node 30 (corresponding to step 1 in Figure 4). The TEE in the first service node 30 receives the RA request and, in response to the RA request, generates the TEE's identity key and remote attestation report (Report) (corresponding to step 2 in Figure 4). The first service node 30 can provide the TEE's identity key and remote attestation report (Report) to the RA service node 50 (corresponding to step 3 in Figure 4).

[0067] The RA service node 50 can verify the legitimacy of the TEE's identity key based on the remote attestation report (Report); and if the verification result shows that the TEE is legal, it will issue an identity authentication certificate for the TEE. Furthermore, the RA service node 50 can obtain the TEE's quotation information (Quotes) and encrypt the TEE's quotation information using the local public key to obtain the encrypted quotation information (corresponding to step 4 of Figure 4). The quotation information may include: Enclave's identity authentication certificate, measurement log and signature value, etc. The measurement log may include: TEE's operating status, security version number (SVN), hardware signature information (such as PCK cert) and Trusted Computing Base (TCB) information, etc.

[0068] Furthermore, the RA service node 50 may send the encrypted reference information to the client 10 (corresponding to step 5 in FIG4 ). The client 10 may call the RA service node 50 to remotely authenticate the encrypted reference information (corresponding to step 6 in FIG4 ).

[0069] Specifically, the client 10 can provide the encrypted reference information to the RA service node 50. The RA service node 50 can use the local private key to decrypt the encrypted reference information to obtain the TEE's reference information. Furthermore, the TEE can be verified for credibility based on the TEE's reference information (corresponding to step 7 in Figure 4) and the verification result can be returned to the client 10 (corresponding to step 8 in Figure 4). The verification result is used to indicate whether the TEE is trustworthy, that is, the verification result is whether the TEE is trustworthy or not.

[0070] The above embodiment illustrates the TEE's credibility verification process, but does not constitute a limitation. As shown in Figure 2, after confirming that the TEE is credible, the client 10 can call the TEE to encrypt the private key in the target user's public-private key pair (corresponding to step 1 in Figure 2 and step 1 in Figure 3). The target user is the user of the client 10.

[0071] Accordingly, the first service node 30 can use TEE to obtain the target user's public-private key pair to be protected (corresponding to step 2 of Figure 2 and step 2 of Figure 3). The public-private key pair can be generated by the first service node 30 for the target user in the TEE, or it can be the public-private key pair imported into the TEE by the client 10.

[0072] In some embodiments, the client 10 may initiate a key application request to the TEE (corresponding to step 1 in Figure 3). The first service node 30 may use the TEE to receive the key application request, and use the TEE to generate a public-private key pair for the target user in response to the key application request as the public-private key pair to be protected (corresponding to step 2 in Figure 3). In the embodiment of the present application, the specific implementation method of the TEE generating the public-private key pair for the target user is not limited. Optionally, the TEE may use a key generator to generate a public-private key pair for the target user. Alternatively, the TEE may call the KMS provided by the second service node 40 to generate a public-private key pair for the target user.

[0073] In other embodiments, the public-private key pair to be protected may also be the public-private key pair provided by the client 10 to the TEE (corresponding to step 1 "Importing a public-private key pair" in FIG3 ). Accordingly, the TEE may receive the public-private key pair provided by the client 10 as the public-private key pair to be protected (corresponding to step 2 "Obtaining an imported public-private key pair" in FIG3 ).

[0074] After obtaining the target user's public and private key pair to be protected, the TEE can obtain the target user's data key and the ciphertext of the data key from the KMS (corresponding to step 3 in Figure 2 and steps 3-5 in Figure 3).

[0075] Specifically, TEE can initiate a key application request to KMS (corresponding to step 3 "Apply for DK" in Figure 3). The key application request may include the identifier of the target user. Accordingly, KMS receives the key application request and obtains the target user's master key, that is, the target user's DMK, based on the identifier of the target user carried in the key application request. Among them, the target user's DMK is created in advance by KMS for the target user, that is, the target user has applied for KMS. Further, KMS can generate the target user's data key based on the target user's DMK (corresponding to step 3 and step 4 "CMK derives DK" in Figure 2). Optionally, KMS can use a key derivation function to derive at least one data key (DK) based on the target user's DMK.

[0076] Furthermore, KMS can encrypt the data key to obtain the ciphertext of the data key (corresponding to step 4 "Generate ciphertext of DK" in Figure 3). In this embodiment, the key used to encrypt the data key is not limited. In some embodiments, the target user's DMK can be used as a key to encrypt the data key to obtain the ciphertext of the data key. In other embodiments, KMS can use a key derivation function based on the target user's DMK to derive multiple data keys (such as two data keys DK1 and DK2), and one of the multiple data keys (such as DK1) can be used as the target user's data key; the other (such as DK2) can be used as the data key to encrypt the target user's data key. Accordingly, the target user's data key DK1 can be encrypted using data key DK2 to obtain the ciphertext of the target user's data key DK1.

[0077] Furthermore, the KMS can return the target user's data key and the ciphertext of the data key to the TEE (corresponding to step 3 in Figure 2 and step 5 in Figure 3). The TEE can use the data key to encrypt the private key in the public-private key pair to obtain the ciphertext of the private key (corresponding to step 4 in Figure 2 and step 6 in Figure 3). Furthermore, the TEE can return the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key to the client 10 (corresponding to step 5 in Figure 2 and step 7 in Figure 3).

[0078] The client 10 can receive the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key; and store the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key (corresponding to step 6 of Figure 2 and step 8 of Figure 3). Optionally, for the SSH protocol, the client 10 can store the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key in the .ssh directory.

[0079] In this embodiment, TEE and KMS are introduced to protect the private key in the security protocol. Specifically, the TEE calls KMS to obtain the client's user's data key and the ciphertext of the data key. The private key is then encrypted in the TEE using the data key to obtain the ciphertext of the private key. The ciphertext of the private key and the ciphertext of the data key are then stored on the client, achieving encrypted storage of the private key and reducing the risk of private key leakage. Furthermore, the encryption of the private key by the TEE ensures that the plaintext of the private key remains in the confidential computing TEE, making it inaccessible to untrusted external environments, further improving the security of the private key.

[0080] Since the target user's data key is managed and controlled by the KMS, the lifecycle of the private key in the public-private key pair can be managed through KMS's data key lifecycle management, maintaining consistent key management methods with KMS. For example, the private key can be deregistered by revoking the data key through KMS. Since the private key's ciphertext is encrypted using the data key, once the data key is decrypted, the private key's ciphertext becomes invalid due to the lack of a decryption key. For another example, private key rotation can be achieved through KMS's data key rotation.

[0081] Key rotation refers to the requirement that, in scenarios with high security requirements, the encryption key for encrypted data must be periodically changed, preventing the use of the same key for extended periods of time. This encryption method of periodically changing keys is called key rotation. Specifically, data keys can be rotated and updated through the KMS. The updated data key pair is then sent to the TEE, which encrypts the private key in the public-private key pair to obtain the updated ciphertext of the private key, thus achieving private key rotation.

[0082] In this embodiment of the present application, the client 10 may also register the public key of the public-private key pair with the server 20 (corresponding to step 7 in FIG. 2 and step 9 in FIG. 3 ). Based on the private key protection method provided in the above embodiment, this embodiment of the present application also provides a corresponding server access method. The following is an exemplary description of the server access process provided in this embodiment of the present application.

[0083] As shown in Figure 5 , when client 10 accesses server 20, it may initiate an access request to server 20 (corresponding to step 1 in Figure 5 ). Server 20 receives the access request and, in response, generates a random number. It then encrypts the random number using the public key of the target user's public-private key pair, generating a ciphertext of the random number (corresponding to step 2, "Public Key Encryption of Random Number" in Figure 5 ). Server 20 then returns the ciphertext of the random number to client 10 (corresponding to step 3 in Figure 5 ).

[0084] Client 10 receives the ciphertext of the random number and initiates a decryption request to the TEE in first service node 30 (corresponding to step 4 in Figure 5 ). Specifically, client 10 generates a decryption request based on the ciphertext of the random number, the ciphertext of the data key, and the ciphertext of the private key in the target user's public-private key pair. The decryption request includes the ciphertext of the random number, the ciphertext of the data key, and the ciphertext of the private key in the target user's public-private key pair.

[0085] Optionally, the client 10 can call the TEE through the ecall method and request the TEE to decrypt the ciphertext of the random number. The ecall method is a method provided by the TEE (such as Enclave) that is called by an external program (i.e., an untrusted environment) of the TEE (such as Enclave). In other words, the ecall method is the only channel for the outside of the TEE to access the inside of the TEE, but its execution process is protected by a trusted environment. Alternatively, the client 10 can call the TEE through the Application Programming Interface (API) and request the TEE to decrypt the ciphertext of the random number, etc.

[0086] Correspondingly, TEE receives the decryption request and calls KMS to decrypt the ciphertext of the data key to obtain the data key of the target user (corresponding to steps 5-7 in Figure 5).

[0087] Specifically, TEE can call KMS and send the ciphertext of the data key and the identifier of the target user to KMS (corresponding to step 5 of Figure 5). KMS can decrypt the ciphertext of the data key to obtain the data key of the target user (corresponding to step 6 of Figure 5). Specifically, for the above-mentioned embodiment in which KMS uses the user master key (DMK) of the target user as the key to encrypt the data key of the target user, KMS can obtain the user master key (DMK) of the target user based on the identifier of the target user, and use the DMK to decrypt the ciphertext of the data key of the target user to obtain the data key of the target user. For the above-mentioned KMS, the ciphertext of the data key DK1 of the target user is decrypted using another data key DK2 derived based on the DMK of the target user to obtain the data key DK1 of the target user.

[0088] Furthermore, the KMS can return the target user's data key to the TEE (corresponding to step 7 in Figure 5). The TEE receives the data key and uses the target user's data key to decrypt the ciphertext of the private key to obtain the plaintext of the private key (corresponding to step 8 in Figure 5). Furthermore, the TEE can use the private key to decrypt the ciphertext of the random number to obtain the plaintext of the random number (corresponding to step 9 in Figure 5).

[0089] Furthermore, the TEE may return the plaintext of the random number to the client 10 (corresponding to step 10 in FIG5 ). The client 10 may access the server 20 based on the plaintext of the random number.

[0090] Specifically, the client 10 can send the plain text of the random number to the server 20 (corresponding to step 11 in Figure 5). The server 20 can verify the access rights of the client 10 based on the random number provided by the client and the random number generated by itself (corresponding to step 12 in Figure 5), and return the permission verification result to the client 10 (corresponding to step 13 in Figure 5). If the random number provided by the client received by the server 20 is consistent with the random number generated by itself, it means that the client 10 has the private key corresponding to the public key, that is, the client 10 has access rights, then it is determined that the client 10 has access rights to the server 20, and the client 10 is allowed to access the server 20. Correspondingly, if the random number provided by the client received by the server 20 is inconsistent with the random number generated by itself, it means that the client 10 does not have the private key corresponding to the public key, then it is determined that the client 10 does not have access rights to the server 20, and the client 10 is blocked from accessing the server 20. Of course, a prompt message indicating that there is no access rights can also be returned to the client 10.

[0091] In this embodiment, during the access authorization verification process for a client to access a server based on a public-private key pair mechanism, the private key in the public-private key pair of the security protocol is maintained in a trusted execution environment (TEE) for confidential computing, making it inaccessible to external, untrusted environments. Even if a user's client, such as a virtual machine, is compromised, the private key is protected from loss, reducing the risk of private key leakage. Furthermore, the private key is stored and transmitted in encrypted form, reducing the risk of plaintext exposure.

[0092] In addition, the above-mentioned interaction process between the client and the server is compatible with the original security protocol process (such as the SSH protocol process), and no changes are required to the server of the security protocol (such as SSH). The client of the security protocol (such as SSH) can add a calling interface for TEE, such as an application programming interface (API), to implement the call to TEE, thereby realizing the interaction process between the client and the server. This lightweight modification can maintain good compatibility and improve the universality and versatility of the solution provided by this embodiment.

[0093] In addition to the above system embodiments, the present application also provides a private key access method and a server access method. The following is an exemplary description of the private key access method and the server access method provided in the present application embodiment from the perspective of the client and the first service node running the TEE.

[0094] Figure 6 is a flow chart of a private key access method provided by an embodiment of the present application. This method is applicable to a service node running a TEE. As shown in Figure 6, the method mainly includes:

[0095] 601. Use TEE to obtain the target user's public and private key pair to be protected.

[0096] 602. Use TEE to obtain the target user's data key and the ciphertext of the data key from KMS.

[0097] 603. In the TEE, the private key in the public-private key pair is encrypted using the data key to obtain the ciphertext of the private key.

[0098] 604. Use TEE to return the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key to the user's client, so that the client can store the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key.

[0099] FIG7 is a flow chart of another private key access method provided by an embodiment of the present application. This method is applicable to a client of a security protocol. As shown in FIG7 , this method mainly includes:

[0100] 701. Call TEE to encrypt the private key in the public-private key pair of the target user, so that TEE can call KMS to obtain the target user's data key and the ciphertext of the data key, and use the data key to encrypt the private key to obtain the ciphertext of the private key.

[0101] 702. Receive the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key returned by the TEE.

[0102] 703. Store the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key.

[0103] In this embodiment, the client can access the server based on a security protocol. The client can be a client of the security protocol. The server can be a server of the security protocol. Specifically, the client can access the server using the public-private key pair mechanism provided by the security protocol.

[0104] In this embodiment, to improve private key security, TEE and KMS are introduced to protect the private key in the public-private key pair of the security protocol. Specifically, for the client, as shown in step 701 of Figure 7, the TEE can be called to encrypt the private key in the public-private key pair of the target user. The target user is the client user.

[0105] It is worth noting that before using the TEE, the client needs to ensure that the TEE is trustworthy. This requires trustworthy authentication of the TEE. For the specific implementation of trustworthy authentication of the TEE, please refer to the relevant content of Figure 4 above, which will not be repeated here.

[0106] When the client confirms that the TEE is trustworthy, in step 701 , the client can call the TEE to encrypt the private key in the public-private key pair of the target user, where the target user is the user of the client 10 .

[0107] Accordingly, for a service node running a TEE, the TEE can be used to obtain the target user's public and private key pair to be protected in step 601. The public and private key pair can be generated for the target user in the TEE, or imported into the TEE by the client.

[0108] In some embodiments, a client can initiate a key request to a TEE. A service node running a TEE can utilize the TEE to receive the key request and, in response to the key request, utilize the TEE to generate a public-private key pair for the target user as the public-private key pair to be protected.

[0109] In other embodiments, the public-private key pair to be protected may also be a public-private key pair provided by the client to the TEE. Accordingly, the TEE may be used to receive the public-private key pair provided by the client as the public-private key pair to be protected.

[0110] After obtaining the target user's public and private key pair to be protected, the TEE can use the TEE to obtain the target user's data key and the ciphertext of the data key from the KMS in step 602.

[0111] Specifically, the TEE can initiate a key application request to the KMS. The key application request may include the identifier of the target user. Accordingly, the KMS receives the key application request and, based on the identifier of the target user carried in the key application request, obtains the target user's master key, i.e., the target user's DMK. The target user's DMK is pre-created for the target user by the KMS, i.e., the target user has applied for KMS. Furthermore, the KMS can generate the target user's data key based on the target user's DMK. Optionally, the KMS can use a key derivation function to derive at least one data key based on the target user's DMK. Furthermore, the KMS can encrypt the data key to obtain the ciphertext of the data key.

[0112] Furthermore, the KMS can return the target user's data key and the ciphertext of the data key to the TEE. Correspondingly, the TEE can receive the target user's data key and the ciphertext of the data key. Furthermore, in step 602, the TEE can use the data key to encrypt the private key in the public-private key pair to obtain the ciphertext of the private key. Furthermore, in step 603, the TEE can return the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key to the client.

[0113] In step 702, the client may receive the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key; and in step 703, store the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key (corresponding to step 6 in Figure 2 and step 8 in Figure 3). Optionally, for the SSH protocol, the client may store the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key in the .ssh directory.

[0114] In this embodiment, TEE and KMS are introduced to protect the private key in the security protocol. Specifically, the TEE calls KMS to obtain the client's user's data key and the ciphertext of the data key. The private key is then encrypted in the TEE using the data key to obtain the ciphertext of the private key. The ciphertext of the private key and the ciphertext of the data key are then stored on the client, achieving encrypted storage of the private key and reducing the risk of private key leakage. Furthermore, the encryption of the private key by the TEE ensures that the plaintext of the private key remains in the confidential computing TEE, making it inaccessible to untrusted external environments, further improving the security of the private key.

[0115] Since the target user's data key is managed and controlled by the KMS, the lifecycle of the private key in the public-private key pair can be managed through KMS's data key lifecycle management, maintaining consistent key management methods with KMS. For example, the private key can be deregistered by revoking the data key through KMS. Since the private key's ciphertext is encrypted using the data key, once the data key is decrypted, the private key's ciphertext becomes invalid due to the lack of a decryption key. For another example, private key rotation can be achieved through KMS's data key rotation.

[0116] Specifically, the data key can be rotated and updated through KMS; and the updated data key pair is sent to TEE, which encrypts the private key in the public-private key pair to obtain the updated ciphertext of the private key, thereby realizing private key rotation.

[0117] In an embodiment of the present application, the client can also register the public key in the public-private key pair with the server. Based on the private key protection method provided in the above embodiment, the embodiment of the present application also provides a corresponding server access method. The following is an exemplary description of the server access process provided in the embodiment of the present application.

[0118] FIG8 is a flow chart of a method for accessing a server provided in an embodiment of the present application. The method is applicable to a client of a security protocol. As shown in FIG8 , the method mainly includes:

[0119] 801. Initiate an access request to the server, so that the server responds to the access request and uses the public key of the public-private key pair of the target user corresponding to the client to encrypt the random number to obtain the ciphertext of the random number; the client stores the ciphertext of the private key in the public-private key pair and the ciphertext of the data key of the target user.

[0120] 802. Receive the ciphertext of the random number returned by the server.

[0121] 803. Initiate a decryption request to TEE. The decryption request includes the ciphertext of the random number, the ciphertext of the data key, and the ciphertext of the private key, so that TEE can call KMS to decrypt the ciphertext of the data key to obtain the data key, and use the data key to decrypt the ciphertext of the private key to obtain the private key; and use the private key to decrypt the ciphertext of the random number to obtain the plaintext of the random number.

[0122] 804. Receive the plaintext of the random number returned by TEE.

[0123] 805. Access the server based on the plain text of the random number.

[0124] FIG9 is a flow chart of another server access method provided in an embodiment of the present application. This method is applicable to a service node running a TEE. As shown in FIG9 , the method mainly includes:

[0125] 901. Use TEE to obtain the decryption request initiated by the client; the decryption request includes the ciphertext of the random number, the ciphertext of the data key, and the ciphertext of the private key; the ciphertext of the random number is obtained by the server responding to the client's access request, using the public key in the public-private key pair to encrypt the random number; the client stores the ciphertext of the data key and the ciphertext of the private key.

[0126] 902. Use TEE to call KMS to decrypt the ciphertext of the data key to obtain the data key.

[0127] 903. Decrypt the ciphertext of the private key using the data key in the TEE to obtain the private key.

[0128] 904. Decrypt the ciphertext of the random number using the private key in the TEE to obtain the plaintext of the random number.

[0129] 905. Use TEE to return the plaintext of the random number to the client, so that the client can access the server based on the plaintext of the random number.

[0130] In this embodiment, when accessing the server, the client may initiate an access request to the server in step 801. The server receives the access request and, in response, generates a random number. It then encrypts the random number using the public key of the target user's public-private key pair to obtain a ciphertext of the random number. The server then returns the ciphertext of the random number to the client.

[0131] The client receives the ciphertext of the random number returned by the server in step 802 and initiates a decryption request to the TEE in step 803. Specifically, the decryption request is generated based on the ciphertext of the random number, the ciphertext of the data key, and the ciphertext of the private key in the target user's public-private key pair. This decryption request includes the ciphertext of the random number, the ciphertext of the data key, and the ciphertext of the private key in the target user's public-private key pair.

[0132] Alternatively, the client can call the TEE through the API and request the TEE to decrypt the ciphertext of the random number.

[0133] Correspondingly, for the service node running TEE, in step 901, the decryption request can be received; and in step 902, the TEE is used to call KMS to decrypt the ciphertext of the data key to obtain the data key of the target user.

[0134] Specifically, the TEE can call the KMS and send the ciphertext of the data key and the identifier of the target user to the KMS. The KMS can decrypt the ciphertext of the data key to obtain the data key of the target user. Specifically, for the embodiment in which the KMS uses the target user's user master key (DMK) as the key to encrypt the target user's data key, the KMS can obtain the target user's user master key (DMK) based on the target user's identifier, and use the DMK to decrypt the ciphertext of the target user's data key to obtain the target user's data key. For the above-mentioned KMS, the ciphertext of the target user's data key DK1 is decrypted using another data key DK2 derived from the target user's DMK to obtain the target user's data key DK1.

[0135] Furthermore, the KMS can return the target user's data key to the TEE. The service node running the TEE can receive the data key and, in step 903, decrypt the ciphertext of the private key using the target user's data key within the TEE to obtain the plaintext of the private key. Furthermore, in step 904, the ciphertext of the random number is decrypted within the TEE using the private key to obtain the plaintext of the random number.

[0136] Furthermore, in step 905, the plaintext of the random number is returned to the client using TEE. Accordingly, in step 804, the client can receive the plaintext of the random number returned by TEE; and in step 805, access the server 20 based on the plaintext of the random number.

[0137] Specifically, the plain text of the random number can be sent to the server. The server can verify the access rights of the client based on the random number provided by the client and the random number generated by itself, and return the result of the permission verification to the client. If the random number provided by the client received by the server is consistent with the random number generated by itself, it means that the client has the private key corresponding to the public key, that is, the client has access rights, then it is determined that the client has access rights to the server, and the client is allowed to access the server. The client can access the server. Correspondingly, if the random number provided by the client received by the server is inconsistent with the random number generated by itself, it means that the client does not have the private key corresponding to the public key, that is, the client does not have access rights to the server, then it is determined that the client does not have access rights to the server, and the client is blocked from accessing the server. Of course, a prompt message indicating that there is no access rights can also be returned to the client.

[0138] In this embodiment, during the access authorization verification process for a client to access a server based on a public-private key pair mechanism, the private key in the public-private key pair of the security protocol is maintained in a trusted execution environment (TEE) for confidential computing, making it inaccessible to external, untrusted environments. Even if a user's client, such as a virtual machine, is compromised, the private key is protected from loss, reducing the risk of private key leakage. Furthermore, the private key is stored and transmitted in encrypted form, reducing the risk of plaintext exposure.

[0139] In addition, the above-mentioned interaction process between the client and the server is compatible with the original security protocol process (such as the SSH protocol process), and no changes are required to the server of the security protocol (such as SSH). The client of the security protocol (such as SSH) can add a calling interface for TEE, such as API, to realize the call to TEE, thereby realizing the interaction process between the client and the server. This lightweight modification can maintain good compatibility and improve the universality and versatility of the solution provided by this embodiment.

[0140] It should be noted that the execution entity of each step of the method provided in the above embodiment can be the same device, or the method can be executed by different devices. For example, the execution entity of steps 701 and 702 can be device A; for another example, the execution entity of step 701 can be device A, and the execution entity of step 702 can be device B; and so on.

[0141] In addition, some of the processes described in the above embodiments and the accompanying drawings include multiple operations that appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order in which they appear in this document or may be executed in parallel. The sequence numbers of the operations, such as 701, 702, etc., are merely used to distinguish between different operations and do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel.

[0142] Accordingly, an embodiment of the present application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the steps in the above-mentioned private key protection method and / or each server access method.

[0143] Figure 10 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application. As shown in Figure 10, the computing device may include: a memory 100a and a processor 100b. The memory 100a is used to store computer programs.

[0144] In some embodiments, the computing device runs a TEE and can be implemented as a service node running the TEE. Accordingly, the processor 100b is coupled to the memory 100a and is configured to execute a computer program for: utilizing a trusted execution environment (TEE) to obtain the target user's public-private key pair to be protected; utilizing the TEE to obtain the target user's data key and the ciphertext of the data key from the key management service KMS; utilizing the data key to encrypt the private key in the public-private key pair in the TEE to obtain the ciphertext of the private key; and utilizing the TEE to return the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key to the user's client, so that the client can store the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key.

[0145] Optionally, when the processor 100b uses TEE to obtain the user's data key and the ciphertext of the data key from the key management service KMS, it is specifically used to: use TEE to call KMS so that KMS can generate the user's data key based on the target user's master key, and encrypt the data key to obtain the ciphertext of the data key; use TEE to receive the data key and the ciphertext of the data key returned by KMS.

[0146] Optionally, when the processor 100b uses the trusted execution environment TEE to obtain the public-private key pair to be protected, it is specifically used to: use the TEE to obtain the key application request provided by the client; use the TEE to generate a public-private key pair for the target user in response to the key application request as the public-private key pair to be protected; or, use the TEE to receive the public-private key pair provided by the client as the public-private key pair to be protected.

[0147] In some embodiments, the processor 100b is also used to: use TEE to obtain a decryption request initiated by the client; the decryption request includes the ciphertext of the random number, the ciphertext of the data key and the ciphertext of the private key; the ciphertext of the random number is obtained by the server responding to the client's access request, and encrypting the random number using the public key in the public-private key pair; using TEE to call KMS to decrypt the ciphertext of the data key to obtain the data key; using the data key to decrypt the ciphertext of the private key in the TEE to obtain the private key; using the private key to decrypt the ciphertext of the random number in the TEE to obtain the plaintext of the random number; returning the plaintext of the random number to the client, so that the client can request the server to verify the access rights of the client based on the plaintext of the random number.

[0148] In some embodiments of the present application, the computing device can also be implemented as a client of the security protocol. Accordingly, the processor 100b is used to: call the Trusted Execution Environment (TEE) to encrypt the private key in the public-private key pair of the target user, so that the TEE can call the KMS to obtain the target user's data key and the ciphertext of the data key, and use the data key to encrypt the private key to obtain the ciphertext of the private key; receive the ciphertext of the private key returned by the TEE, the public key in the public-private key pair, and the ciphertext of the data key; store the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key.

[0149] In some embodiments, the processor 100b is also used to: initiate an access request to the server through the communication component 100c, so that the server responds to the access request and uses the public key to encrypt the random number to obtain the ciphertext of the random number; receive the ciphertext of the random number returned by the server through the communication component 100c; and, initiate a decryption request to the TEE, which decryption request includes the ciphertext of the random number, the ciphertext of the data key and the ciphertext of the private key, so that the TEE calls the KMS to decrypt the ciphertext of the data key to obtain the data key, and use the data key to decrypt the ciphertext of the private key to obtain the private key; and use the private key to decrypt the ciphertext of the random number to obtain the plaintext of the random number; and receive the plaintext of the random number returned by the TEE; thereafter, based on the plaintext of the random number, access the server.

[0150] In some optional embodiments, as shown in FIG10 , the computing device may further include optional components such as a power supply component 100d. In some embodiments, the computing device may be implemented as a terminal device such as a computer. Accordingly, the computing device may further include components such as a display component 100e and an audio component 100f. FIG10 schematically illustrates only some components, and does not imply that the computing device must include all components shown in FIG10 , nor does it imply that the computing device must include only the components shown in FIG10 .

[0151] The computing device provided in this embodiment introduces TEE and KMS to protect the private key in the security protocol. Specifically, TEE calls KMS to obtain the client's user's data key and the ciphertext of the data key, and uses the data key to encrypt the private key in the TEE to obtain the ciphertext of the private key; then, the ciphertext of the private key and the ciphertext of the data key are stored on the client, realizing the encrypted storage of the private key and reducing the risk of private key leakage. On the other hand, the encryption of the private key by TEE keeps the plaintext of the private key in the confidential computing TEE, and the private key cannot be accessed by an external untrusted environment, which can further improve the security of the private key.

[0152] In an embodiment of the present application, the memory is used to store computer programs and can be configured to store various other data to support operations on the device where it is located. The processor can execute the computer program stored in the memory to implement the corresponding control logic. The memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random-access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0153] In the embodiment of the present application, the processor can be any hardware processing device that can execute the logic of the above method. Optionally, the processor can be a central processing unit (CPU), a graphics processing unit (GPU) or a microcontroller unit (MCU); it can also be a programmable device such as a field programmable gate array (FPGA), a programmable array logic device (PAL), a general array logic device (GAL), a complex programmable logic device (CPLD); or an application specific integrated circuit (ASIC) chip; or an advanced reduced instruction set (RISC) processor (Advanced RISC Machines, ARM) or a system on chip (SoC), etc., but is not limited thereto.

[0154] In an embodiment of the present application, the communication component is configured to facilitate wired or wireless communication between the device in which it is located and other devices. The device in which the communication component is located can access a wireless network based on a communication standard, such as Wireless Fidelity (WiFi), 2G or 3G, 4G, 5G or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component can also be based on Near Field Communication (NFC) technology, Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology or other technologies.

[0155] In an embodiment of the present application, the display component may include a liquid crystal display (LCD) and a touch panel (TP). If the display component includes a touch panel, the display component may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensor can not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.

[0156] In embodiments of the present application, a power supply assembly is configured to provide power to various components of the device in which it is located. The power supply assembly may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply assembly is located.

[0157] In an embodiment of the present application, the audio component may be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), and when the device where the audio component is located is in an operating mode, such as call mode, recording mode, and voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal may be further stored in a memory or sent via a communication component. In some embodiments, the audio component further includes a speaker for outputting an audio signal. For example, for a device with a language interaction function, voice interaction with a user may be achieved through the audio component.

[0158] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0159] It should also be noted that the descriptions such as "first" and "second" in this article are used to distinguish different messages, devices, modules, etc., and do not represent the order of precedence, nor do they limit "first" and "second" to different types.

[0160] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical storage, etc.) that contain computer-usable program code.

[0161] The present application is described with reference to the flow chart and / or block diagram of the method, device (or system) and computer program product according to the embodiment of the present application. It should be understood that each flow process and / or box in the flow chart and / or block diagram and the combination of the flow process and / or box in the flow chart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processing machine or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one flow chart flow or multiple flows and / or one box or multiple boxes of the block diagram.

[0162] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0163] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0164] In a typical configuration, a computing device includes one or more processors (such as a CPU, etc.), input / output interfaces, network interfaces, and memory.

[0165] Memory may include non-permanent storage in a computer-readable medium, random-access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0166] Computer storage media is readable storage media, also known as readable media. Readable storage media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random-access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. According to the definition in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0167] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a..." does not preclude the presence of additional identical elements in the process, method, commodity, or apparatus comprising the aforementioned elements.

[0168] The above contents are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.

Claims

1. A private key protection method, characterized in that: include: Use the trusted execution environment (TEE) to obtain the target user's public and private key pairs to be protected; Using the TEE, obtain the target user's data key and the ciphertext of the data key from the key management service KMS; In the TEE, the private key in the public-private key pair is encrypted using the data key to obtain a ciphertext of the private key; The TEE is used to return the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key to the user's client, so that the client can store the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key.

2. The method according to claim 1, characterized in that The method of using the TEE to obtain the user's data key and the ciphertext of the data key from the key management service KMS includes: Using the TEE to call the KMS, the KMS generates the user's data key based on the target user's master key, and encrypts the data key to obtain the ciphertext of the data key; The TEE is used to receive the data key and the ciphertext of the data key returned by the KMS.

3. The method according to claim 1, characterized in that The method of using the trusted execution environment (TEE) to obtain the public and private key pair to be protected includes: Using the TEE, obtaining a key application request provided by the client; using the TEE to generate a public-private key pair for the target user in response to the key application request as the public-private key pair to be protected; or, The TEE is used to receive the public-private key pair provided by the client as the public-private key pair to be protected.

4. The method according to claim 1, wherein Also includes: Using the TEE to obtain a decryption request initiated by the client; the decryption request includes a ciphertext of a random number, a ciphertext of the data key, and a ciphertext of the private key; The ciphertext of the random number is obtained by the server responding to the access request of the client by encrypting the random number using the public key in the public-private key pair; Using the TEE to call the KMS to decrypt the ciphertext of the data key to obtain the data key; Decrypting the ciphertext of the private key using the data key in the TEE to obtain the private key; Decrypting the ciphertext of the random number using the private key in the TEE to obtain the plaintext of the random number; The plain text of the random number is returned to the client, so that the client can request the server to perform access permission verification on the client based on the plain text of the random number.

5. A server access method, characterized in that: include: Use the trusted execution environment (TEE) to obtain the decryption request initiated by the client; The decryption request includes the ciphertext of the random number, the ciphertext of the data key and the ciphertext of the private key in the public-private key pair; the ciphertext of the random number is the ciphertext of the server response. The access request of the client is obtained by encrypting the random number using the public key in the public-private key pair; The client stores the ciphertext of the data key and the ciphertext of the private key; Using the TEE to call KMS to decrypt the ciphertext of the data key to obtain the data key; Decrypting the ciphertext of the private key using the data key in the TEE to obtain the private key; Decrypting the ciphertext of the random number using the private key in the TEE to obtain the plaintext of the random number; The plain text of the random number is returned to the client, so that the client can access the server based on the plain text of the random number.

6. A private key protection method, characterized in that: include: Calling the Trusted Execution Environment (TEE) to encrypt the private key in the target user's public-private key pair, so that the TEE can call the KMS to obtain the target user's data key and the ciphertext of the data key, and then encrypt the private key with the data key to obtain the ciphertext of the private key; Receive the ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key returned by the TEE; The ciphertext of the private key, the public key in the public-private key pair, and the ciphertext of the data key are stored.

7. The method according to claim 6, characterized in that include: Initiating an access request to the server, so that the server responds to the access request and encrypts the random number using the public key to obtain a ciphertext of the random number; Receiving the ciphertext of the random number returned by the server; Initiate a decryption request to the TEE, which includes the ciphertext of the random number, the ciphertext of the data key, and the ciphertext of the private key, so that the TEE calls the KMS to decrypt the ciphertext of the data key to obtain the data key, and use the data key to decrypt the ciphertext of the private key to obtain the private key; and decrypting the ciphertext of the random number using the private key to obtain the plaintext of the random number; Receive the plaintext of the random number returned by the TEE; Based on the plain text of the random number, access the server.

8. A server access method, characterized in that: include: Initiate an access request to the server, so that the server responds to the access request and encrypts the random number using the public key of the public-private key pair of the target user corresponding to the client to obtain a ciphertext of the random number; The client stores the ciphertext of the private key in the public-private key pair and the ciphertext of the data key of the target user; Receiving the ciphertext of the random number returned by the server; Initiate a decryption request to the Trusted Execution Environment (TEE), where the decryption request includes the ciphertext of the random number, the ciphertext of the data key, and the ciphertext of the private key, so that the TEE can call the KMS to decrypt the ciphertext of the data key to obtain the data key, and then use the data key to decrypt the ciphertext of the private key to obtain the private key; and decrypting the ciphertext of the random number using the private key to obtain the plaintext of the random number; Receive the plaintext of the random number returned by the TEE; Based on the plain text of the random number, access the server.

9. A communication system, characterized in that: include: A client, a first service node, and a second service node; The first service node runs a trusted execution environment TEE; The second service node is used to provide key management services; The first service node is configured to perform the steps in the method according to any one of claims 1 to 5; The client is used to execute the steps in the method according to any one of claims 6 to 8.

10. A computing device, characterized in that include: A memory and a processor; wherein the memory is used to store a computer program; The processor is coupled to the memory and configured to execute the computer program to perform the steps of the method performed by the first service node and / or the client in claim 9.

11. A computer-readable storage medium storing computer instructions, characterized in that: When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the steps of the method performed by the first service node and / or the client in claim 9.

Citation Information

Patent Citations

  • Remote certification method and device for trusted application program and electronic equipment

    CN110011801A

  • Key management method and device

    CN114584287A

  • Key management method and device based on trusted execution environment and electronic equipment

    CN114629639A

  • Private key protection and server access method, system and device, and storage medium

    CN116346341A

  • Device and method for updating immobilizer token in digital key sharing system

    US20220131687A1

Cited By

  • Data processing method and device

    CN117176353A

  • Method and apparatus for processing data

    CN117176353B

  • High-efficiency and safe outsourcing computing protocol design of single cloud architecture based on TEE technology

    CN119788333A

  • Key management method and device for large model service, medium, equipment and product

    CN121309226A