Key management method, device and electronic device based on trusted execution environment
By generating keys and remote proof materials in a trusted execution environment, the problem of difficult key security is solved, and the secure transmission and storage of data throughout the life cycle is realized, which is particularly suitable for data privacy protection in untrusted environments. .
Patent Information
- Application Number
- CN202210237206.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-10
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2042-03-10
AI Technical Summary
The prior art cannot effectively ensure the security of keys, especially when data is transmitted and stored throughout the life cycle, especially in an untrusted environment, making it difficult to ensure data security.
Using a key management method based on a trusted execution environment, the key and remote proof materials are generated in the server, and the trustworthiness is verified in the terminal device. If the verification is successful, encryption and decryption are performed. Operation to ensure the security of data during transmission.
It realizes the security of data throughout the entire life cycle without relying on additional security hardware and KMS services on the cloud. It is particularly suitable for the scenario where data is out of the domain and untrusted environment, and provides a solution for data privacy protection.
Smart Images

Figure CN114629639B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of information security technology, and in particular, to a key management method based on a trusted execution environment, a key management device based on a trusted execution environment, an electronic device, and a storage medium. Background Art
[0002] With the promulgation and implementation of laws and regulations such as the "Data Security Law" and the "Personal Information Protection Law", protecting the security and privacy of sensitive data has received more and more attention, and data security protection measures need to run through the entire life cycle (storage state, transmission state, and computing state).
[0003] The encryption system is the cornerstone of data security, and key security is the core part of encryption system security. Therefore, providing a secure, reliable, and easy-to-implement key management method throughout the data life cycle can enhance the product's data security compliance capabilities and product competitiveness.
[0004] By refining customer needs, we found that customers have a strong need to protect high-value data from being transferred out of the domain to an untrusted environment for fusion computing with third-party data (data is transferred to an untrusted environment for storage and computing). However, due to factors such as the computing environment not being connected to the Internet and customers not wanting to bear additional security hardware costs and operation and maintenance investments, it is still impossible to provide an effective key management method to ensure key security and, in turn, data security. Summary of the invention
[0005] The embodiment of the present application provides a key management method based on a trusted execution environment to solve the problem that key security cannot be guaranteed.
[0006] Correspondingly, an embodiment of the present application also provides a key management device based on a trusted execution environment, an electronic device and a storage medium to ensure the implementation and application of the above method.
[0007] In order to solve the above problems, an embodiment of the present application discloses a key management method based on a trusted execution environment, the method comprising: applying to a server, the server comprising a trusted execution environment supporting confidential computing, the method comprising:
[0008] generating a key and remote attestation material of the key in the trusted execution environment;
[0009] Transmitting the key and the remote certification material to a terminal device;
[0010] When the terminal device determines that the trusted execution environment is a trusted environment and the key is a trusted key based on the remote attestation material, receiving an encrypted user data key generated by the terminal device encrypting the user data key using the key;
[0011] The encrypted user data key is decrypted using the key to obtain the user data key, so that the trusted execution environment and the terminal device perform data transmission based on the user data key.
[0012] Optionally, the generating of a key and remote attestation material of the key in the trusted execution environment includes:
[0013] generating a key in the trusted execution environment;
[0014] A preset digest algorithm is used to calculate the digest data of the key, and remote certification material of the key is generated based on the digest data.
[0015] Optionally, the method further comprises:
[0016] Obtaining a persistent data key based on hardware-level security instructions; the persistent data key is generated based on a persistent root key protected by hardware built into the server;
[0017] Encrypting the key using the persistent data key, and encrypting the user data key using the persistent data key;
[0018] The encrypted key and the encrypted user data key are stored in a persistent storage area corresponding to the trusted execution environment.
[0019] Optionally, the using the key to decrypt the encrypted user data key to obtain the user data key includes:
[0020] Obtaining the encrypted key from the persistent storage area;
[0021] Decrypting the encrypted key using the persistent data key;
[0022] The encrypted user data key is decrypted using the decrypted key to obtain the decrypted user data key.
[0023] Optionally, the method further comprises:
[0024] When the trusted execution environment and the terminal device perform data transmission, obtaining the encrypted user data key from the persistent storage area;
[0025] Decrypting the encrypted user data key using the persistent data key;
[0026] The decrypted user data key is used to encrypt the data transmitted between the trusted execution environment and the terminal device before transmission.
[0027] Optionally, the persistent storage area allows an authorized trusted execution environment to obtain the encrypted key and the encrypted user data key.
[0028] Optionally, the method further comprises:
[0029] Establishing a trusted encryption channel between the trusted execution environment and another trusted execution environment; the other trusted execution environment is a trusted execution environment supporting confidential computing in other servers;
[0030] When the other trusted execution environment and the terminal device perform data transmission, obtaining the user data key from the trusted execution environment based on the trusted encryption channel;
[0031] The user data key is used to encrypt the data transmitted between the other trusted execution environment and the terminal device before transmission.
[0032] Optionally, data is transmitted between the server and the terminal device online or offline.
[0033] The embodiment of the present application further discloses a key management device based on a trusted execution environment, which is applied to a server, wherein the server includes a trusted execution environment supporting confidential computing, and the device includes:
[0034] A generation module, configured to generate a key and remote attestation material of the key in the trusted execution environment;
[0035] A transmission module, used to transmit the key and the remote certification material to a terminal device;
[0036] a verification module, configured to receive an encrypted user data key generated by the terminal device encrypting the user data key with the key when the terminal device determines that the trusted execution environment is a trusted environment and the key is a trusted key based on the remote proof material;
[0037] The deployment module is used to use the key to decrypt the encrypted user data key to obtain the user data key, so that the trusted execution environment and the terminal device can perform data transmission based on the user data key.
[0038] Optionally, the generation module is used to generate a key in the trusted execution environment; calculate summary data of the key using a preset summary algorithm, and generate remote proof material of the key based on the summary data.
[0039] Optionally, the device also includes: a persistent storage module, used to obtain a persistent data key based on hardware-level security instructions; the persistent data key is generated based on a persistent root key protected by hardware built into the server; the key is encrypting using the persistent data key, and the user data key is encrypting using the persistent data key; the encrypted key and the encrypted user data key are stored in the persistent storage area corresponding to the trusted execution environment.
[0040] Optionally, the deployment module is used to obtain the encrypted key from the persistent storage area; use the persistent data key to decrypt the encrypted key; use the decrypted key to decrypt the encrypted user data key to obtain the decrypted user data key.
[0041] Optionally, the device also includes: a data transmission module, used to obtain the encrypted user data key from the persistent storage area when the trusted execution environment and the terminal device transmit data; use the persistent data key to decrypt the encrypted user data key; use the decrypted user data key to encrypt and transmit the data transmitted between the trusted execution environment and the terminal device.
[0042] Optionally, the persistent storage area allows an authorized trusted execution environment to obtain the encrypted key and the encrypted user data key.
[0043] Optionally, the device also includes: a key transmission module, used to establish a trusted encryption channel between the trusted execution environment and other trusted execution environments; the other trusted execution environment is a trusted execution environment in other servers that supports confidential computing; when the other trusted execution environment transmits data with the terminal device, the user data key is obtained from the trusted execution environment based on the trusted encryption channel; the user data key is used to encrypt the data transmitted between the other trusted execution environment and the terminal device before transmission.
[0044] Optionally, data is transmitted between the server and the terminal device online or offline.
[0045] An embodiment of the present application also discloses an electronic device, including: a processor; and a memory, on which executable code is stored. When the executable code is executed, the processor executes a key management method based on a trusted execution environment as described in one or more of the embodiments of the present application.
[0046] The embodiments of the present application also disclose one or more machine-readable media on which executable codes are stored. When the executable codes are executed, the processor executes the key management method based on the trusted execution environment as described in one or more of the embodiments of the present application.
[0047] Compared with the prior art, the embodiments of the present application have the following advantages:
[0048] In an embodiment of the present application, in a server including a trusted execution environment supporting confidential computing, a key and remote proof material of the key are generated in the trusted execution environment, and the key and the remote proof material are transmitted to a terminal device, wherein, if the terminal device determines that the key is a trusted key based on the remote proof material, the server can receive an encrypted user data key generated after the terminal device encrypts the user data key using the key, decrypt the encrypted user data key using the key, and obtain the user data key, and then the user data key can be used to encrypt and transmit the data between the trusted execution environment and the terminal device. The embodiment of the present application implements remote deployment and management of user data keys based on the trusted execution environment of the server, so that data security can be ensured based on the data interaction between the trusted execution environment and the terminal device using the user data key. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a flowchart of a key management method embodiment based on a trusted execution environment of the present application;
[0050] Figure 2 It is a schematic diagram of a key management based on a trusted execution environment of the present application;
[0051] Figure 3 It is a structural block diagram of an embodiment of a key management device based on a trusted execution environment of the present application;
[0052] Figure 4 It is a schematic diagram of the structure of a device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0054] First, some technical terms involved in the embodiments of the present application are introduced:
[0055] KMS: Key Management Service, key management service.
[0056] Remote Attestation: Remote attestation is a confidential computing technology.
[0057] TEE: Trusted Execution Environment, a confidential computing technology, is an execution environment based on CPU hardware security extensions and completely isolated from the outside world.
[0058] SGX: is a confidential computing technology that provides a trusted execution environment.
[0059] CPU Sealing Key: CPU encryption key.
[0060] PKI: Public Key Infrastructure.
[0061] HSM: Hardware Security Module, a computer hardware device used to protect and manage digital keys used in strong authentication systems and provide related cryptographic operations.
[0062] TPM: Trusted Platform Module, a chip embedded in a computer that provides a root of trust for the computer. The chip's specifications are set by the Trusted Computing Group.
[0063] TCM: trusted cryptography module, a hardware module of the trusted computing platform, provides cryptographic operations for the trusted computing platform, has protected storage space, and corresponds to TPM.
[0064] TPCM: Trusted Platform Control Module, which enables the Trusted Platform Module TPM to control platform resources.
[0065] SaaS: Software-as-a-Service, software as a service, that is, software services are provided through the Internet.
[0066] SSL: Secure Sockets Layer, secure socket protocol.
[0067] Confidential computing (also known as confidential computing / trusted computing) is based on CPU hardware to create a completely isolated trusted execution environment, namely TEE, also called a secure zone. Since confidential computing can encrypt the data being used / executed and place the data in a secure TEE for execution, third parties cannot identify the data in the TEE, thus preventing any third party from tampering with the data being executed in the TEE.
[0068] In addition to being used in the field of cloud computing, TEE can also be used in terminal devices such as mobile phones, tablets, and computers. TEE is used to isolate the collection, storage, and verification of fingerprints, passwords, and facial information. Even if the phone is jailbroken or rooted (a third party obtains the highest authority), the third party cannot obtain the corresponding data, ensuring data security.
[0069] In the specific implementation, the TEE provided by the server chip that supports confidential computing can solve the memory encryption protection of data in operation and prevent the data from being obtained by a third party (unauthorized party) in the computing state; the data transmission and storage encryption and decryption processes can be protected by TEE; therefore, the customer's data key needs to be securely placed inside the TEE, that is, the key management method needs to be extended from the customer's local to the TEE.
[0070] Currently, there are several remote key management methods:
[0071] 1. Solutions based on secure cryptographic chips / hardware (such as HSM hardware cryptographic machines, TCM / TPCM trusted cryptographic modules, etc.):
[0072] 1) Manage the trusted root key through a hardware security module (such as TPM, PCI-E password card, etc.), and the user data key is encrypted and protected by the trusted root key, but this solution requires the existence of secure hardware.
[0073] 2) The trusted root key is protected by secure hardware and cannot be obtained in any way outside the secure hardware. The data encryption and decryption and signature verification processes must be completed inside the secure hardware, and user data operations cannot be completed inside the secure hardware.
[0074] 3) The security hardware has a single function and does not support user-defined executable code running in it.
[0075] 4) Security hardware does not have mature technical implementation for connecting to the TEE trusted execution environment.
[0076] 2. Solutions based on cloud KMS (such as KMS cloud key management service, etc.):
[0077] 1) SaaS services rely on network accessibility.
[0078] 2) Using access key signature to authenticate the service requester, it is difficult to protect the access key in a remote untrusted environment.
[0079] 3) KMS relies on SSL encrypted channels to ensure the security of user data key transmission, but it is difficult to implement secure SSL client security assumptions in a remote untrusted environment.
[0080] 4) Currently, cloud vendors’ KMS does not support remote attestation of TEE.
[0081] In actual applications, the above-mentioned remote key management methods can ensure data security to a certain extent. However, if the data usage environment cannot be connected to the KMS cloud key management service, or the customer is unwilling to bear the hardware cost of HSM or TCM / TPCM, the above methods are not feasible. In addition, the current docking technology between software and hardware key management services or modules and TEE is immature, and there is no complete technical link to ensure key security, so there is no actual case of TEE-based key management.
[0082] In response to the above problems, the embodiment of the present application proposes a key management method based on confidential computing, which does not rely on the KMS cloud key management service or additional offline hardware cryptographic machines, and provides secure key management capabilities for data to be encrypted and protected throughout its life cycle. It is especially suitable for scenarios where data is exported to untrusted environments, and achieves data privacy protection based on the trusted execution environment of confidential computing, which is "data available but invisible". The key management method described in the embodiment of the present application can be applied to privacy computing products, such as the all-in-one machine of privacy computing products, and can achieve full life cycle protection of customers' sensitive data when it leaves the domain.
[0083] Reference Figure 1 , is a flowchart of a key management method embodiment based on a trusted execution environment of the present application, which is applied to a server, wherein the server includes a trusted execution environment supporting confidential computing, and the method includes the following steps:
[0084] Step 102: Generate a key and remote certification material of the key in the trusted execution environment.
[0085] Step 104: Transmit the key and the remote certification material to a terminal device.
[0086] Among them, the terminal device can be a terminal device used by the customer, such as a smart phone, a personal computer, a laptop computer, a tablet computer and a portable wearable device, etc. The server can be implemented as an independent server or a server cluster composed of multiple servers, and the server can interact with multiple terminal devices.
[0087] In a specific implementation, a key and remote proof material of the key are generated in a trusted execution environment (Secure Enclave), such as SGX, and then the key and the remote proof material of the key are sent to a terminal device so that the terminal device can perform verification based on the remote proof material. If the remote proof material is successfully verified, it can be confirmed that the remote proof material is generated in a trusted trusted execution environment, and then it can be trusted that the key is also generated in a trusted trusted execution environment, so the trust key is secure and reliable.
[0088] As an optional example of the present application, asymmetric encryption technology can be used to generate keys in a trusted execution environment. The generated key can be a key pair (asymmetric key) including a public key and a private key, wherein the private key is held by the owner and cannot be published, and the public key is published by the holder to the terminal device. The public key can be used to encrypt data, and the data encrypted with the public key needs to be decrypted using the private key in the public-private key pair. The private key part resides in the trusted execution environment to ensure the security of the private key.
[0089] Correspondingly, if the key is a key pair, a public key and remote proof material of the public key can be generated, and the public key and the remote proof material of the public key can be sent to the terminal device. If the remote proof material is successfully verified, it can be confirmed that the remote proof material is generated in a trusted trusted execution environment, and then the public key (including the corresponding private key) can be trusted to be generated in a trusted trusted execution environment, so the trust public key is safe and reliable.
[0090] It should be noted that data can be transmitted between the terminal device and the trusted execution environment online (data network) or offline (through storage devices such as USB flash drives), and the embodiments of the present application do not impose any restrictions on this.
[0091] Step 106: When the terminal device determines that the trusted execution environment is a trusted environment and the key is a trusted key based on the remote certification material, an encrypted user data key generated by the terminal device encrypting the user data key with the key is received.
[0092] Step 108: Use the key to decrypt the encrypted user data key to obtain the user data key, so that the trusted execution environment and the terminal device can perform data transmission based on the user data key.
[0093] In specific implementations, users may need to transfer some data, such as customers' fingerprints, passwords, facial information and other sensitive data, to an untrusted environment. For example, transferring data to an untrusted environment for fusion calculation with third-party data may easily lead to data security risks such as data leakage. Therefore, the user data key can be used to encrypt the data before transmission. However, if the data is transferred to an untrusted environment, there may still be a risk of data leakage.
[0094] In an embodiment of the present application, if the terminal device verifies that the trusted execution environment to which the data is to be sent is a trusted environment and determines that the key is a trusted key based on remote proof materials, the user data key can be encrypted using the key, and the encrypted user data key can be transmitted to the trusted execution environment online or offline. The trusted execution environment reads the encrypted user data key, and the encrypted user data key can be decrypted using the key (if it is a key pair, the private key is used to obtain the user data key, thereby completing the deployment of the user data key.
[0095] Subsequently, the trusted execution environment and the terminal device can use the user data key to encrypt the data transmitted between the trusted execution environment and the terminal device, so that the data security protection measures run through the entire life cycle, that is, the data is protected in the storage state, transmission state, and computing state.
[0096] Reference Figure 2 , a schematic diagram of key management based on a trusted execution environment of the present application, including TEE SecureEnclave 1 (a trusted execution environment for implementing key management) and a user (a user's terminal device). When deploying user data keys, the following methods can be used:
[0097] 1. The user's terminal device obtains the public key and remote proof material of the public key; among which, the public key is the public key in the asymmetric key generated in TEE SecureEnclave 1, and the remote proof material is generated in TEE Secure Enclave 1 based on the public key; 2. Verify the remote proof material; 3. If the remote proof material is successfully verified, the public key can be trusted; 4. Use the trusted public key to encrypt the user data key, and then transmit the encrypted user data key to TEE SecureEnclave 1; 5. TEE Secure Enclave 1 uses the private key in the asymmetric key to decrypt the encrypted user data key to obtain the user data key, so that the user data key can be deployed in TEE Secure Enclave 1. Subsequently, TEE Secure Enclave 1 can use the user data key to encrypt the data transmitted between it and the user's terminal device before transmitting it.
[0098] In the above-mentioned key management method based on a trusted execution environment, in a server including a trusted execution environment supporting confidential computing, a key and remote proof material of the key are generated in the trusted execution environment, and the key and the remote proof material are transmitted to the terminal device, wherein, if the terminal device determines that the key is a trusted key based on the remote proof material, the server can receive the encrypted user data key generated after the terminal device encrypts the user data key using the key, decrypt the encrypted user data key using the key, and obtain the user data key, and then the user data key can be used to encrypt and transmit the data between the trusted execution environment and the terminal device. The embodiment of the present application implements remote deployment and management of user data keys based on the trusted execution environment of the server, so that data security can be ensured based on the data interaction between the trusted execution environment and the terminal device using the user data key.
[0099] In an exemplary embodiment, the step 102 of generating a key and remote attestation material of the key in the trusted execution environment may include the following steps:
[0100] generating a key in the trusted execution environment;
[0101] A preset digest algorithm is used to calculate the digest data of the key, and remote certification material of the key is generated based on the digest data.
[0102] In an embodiment of the present application, after a key is generated in a trusted execution environment, a preset digest algorithm, such as sha256 or other algorithms, can be used to calculate the summary data of the key to generate remote proof materials of the key based on the summary data, and then remote proof materials, such as SGX DCAP Quote data, are generated based on the summary data.
[0103] After generating the key and remote proof material of the key in the trusted execution environment, the terminal device verifies the remote proof material of the key through the remote proof algorithm of the trusted execution environment, and makes sure that the remote proof material is generated in the trusted execution environment. Then, the terminal device can trust that the key is generated in the trusted execution environment, and therefore trust that the key is secure and reliable. Then, the user data key can be encrypted based on the key and transmitted to the trusted execution environment, completing the deployment of the user data key in the trusted execution environment.
[0104] In the above exemplary embodiment, after the key is generated in the trusted execution environment, summary data of the key is generated based on a summary algorithm, and remote proof material that can remotely prove the key is generated based on the summary data, so that the terminal device can determine that the key is generated in a trusted environment based on the remote proof material, and then determine that the key is generated in the trusted execution environment, so that the terminal device can encrypt its user data key based on the key, and then securely transmit the user data key to the trusted execution environment, thereby ensuring the security of the user data key.
[0105] In an exemplary embodiment, the method may further include the following steps:
[0106] Obtaining a persistent data key based on hardware-level security instructions; the persistent data key is generated based on a persistent root key protected by hardware built into the server;
[0107] Encrypting the key using the persistent data key, and encrypting the user data key using the persistent data key;
[0108] The encrypted key and the encrypted user data key are stored in a persistent storage area corresponding to the trusted execution environment.
[0109] In practical applications, in order to ensure the availability of keys, keys need to be securely and persistently stored.
[0110] In an embodiment of the present application, a hardware-protected persistent root key (hardware root key) built into a server chip that supports confidential computing is used, such as an SGX Sealing Key. The persistent root key is derived from the CPU hardware and is only accessible to a trusted execution environment. It cannot be read by the outside world and has high security. A persistent data key for a specific trusted execution environment is derived based on the persistent root key. The trusted execution environment can obtain the persistent data key through hardware-level security instructions at each life cycle, and other unauthorized Secure Enclaves cannot obtain the persistent data key.
[0111] In an embodiment of the present application, the trusted execution environment uses its own persistent data key to encrypt the private key of the public-private key pair and the user data key deployed by the user. The encrypted private key and the encrypted user data key can be persistently stored outside the trusted execution environment (persistent storage area), where the environment outside the trusted execution environment does not hold the persistent data key and therefore cannot be decrypted.
[0112] In an exemplary embodiment, the persistent storage area allows an authorized trusted execution environment to obtain encrypted keys and encrypted user data keys. For example, the trusted execution environment that generates the keys can serve as an authorized trusted execution environment. In addition, a trusted execution environment trusted by the trusted execution environment that generates the keys can also serve as an authorized trusted execution environment.
[0113] It should be noted that in addition to the key (private key) and user data key, other data can also be encrypted with the persistent data key and saved in the persistent storage area according to actual needs so that the trusted execution environment can obtain and use it. The embodiments of the present application do not limit this.
[0114] In an exemplary embodiment, the step 108, using the key to decrypt the encrypted user data key to obtain the user data key, may include the following steps:
[0115] Obtaining the encrypted key from the persistent storage area;
[0116] Decrypting the encrypted key using the persistent data key;
[0117] The encrypted user data key is decrypted using the decrypted key to obtain the decrypted user data key.
[0118] In the embodiment of the present application, after the key is generated in the trusted execution environment, the key can be encrypted with the persistent data key and saved in the persistent storage area. After receiving the user data key encrypted with the key transmitted by the terminal device, the encrypted key (private key) can be obtained from the persistent storage area, and then the encrypted key can be decrypted with the persistent data key, thereby obtaining the key to decrypt the encrypted user data key, so as to finally obtain the user data key of the terminal device.
[0119] In an exemplary embodiment, the method may further include the following steps:
[0120] When the trusted execution environment and the terminal device perform data transmission, obtaining the encrypted user data key from the persistent storage area;
[0121] Decrypting the encrypted user data key using the persistent data key;
[0122] The decrypted user data key is used to encrypt the data transmitted between the trusted execution environment and the terminal device before transmission.
[0123] In the embodiment of the present application, after the trusted execution environment obtains the user data key, the user data key can be encrypted with the persistent data key and saved in the persistent storage area. When the trusted execution environment and the terminal device perform data transmission, the encrypted user data key can be obtained from the persistent storage area, and then the encrypted user data key can be decrypted with the persistent data key to obtain the user data key, so that the data transmitted between the trusted execution environment and the terminal device can be data encrypted with the user data key, thereby ensuring data security.
[0124] Reference Figure 2 When TEE Secure Enclave 1 generates an asymmetric key, the private key in the asymmetric key can be used to encrypt the user data key using a persistent data key derived from the hardware root key, and then the encrypted user data key is persistently stored in the persistent storage area. In addition, when TEE Secure Enclave 1 obtains the encrypted user data key, it can use the private key (the private key can be obtained from the persistent storage area) to decrypt the encrypted user data key to obtain the user data key, and the user data key can be encrypted using the persistent data key derived from the hardware root key, and then the encrypted user data key is persistently stored in the persistent storage area. Subsequently, when the private key or the user data key is needed, it can be obtained from the persistent storage area and used.
[0125] In an exemplary embodiment, the method may further include the following steps:
[0126] Establishing a trusted encryption channel between the trusted execution environment and another trusted execution environment; the other trusted execution environment is a trusted execution environment supporting confidential computing in other servers;
[0127] When the other trusted execution environment and the terminal device perform data transmission, obtaining the user data key from the trusted execution environment based on the trusted encryption channel;
[0128] The user data key is used to encrypt the data transmitted between the other trusted execution environment and the terminal device before transmission.
[0129] In a specific implementation, through remote key deployment, the user data key can be cached in the trusted execution environment where the key is generated, such as Figure 2 In the TEE Secure Enclave 1 in the embodiment of the present application, in order to expand the scope of use, TEE Secure Enclave 1 and other trusted execution environments, such as Figure 2 TEE Secure Enclave 2 in can establish a trusted encryption channel between two trusted execution environments through remote / local attestation technology between trusted execution environments (for example, remote attestation, local attestation, etc. of SGX), and user data keys can be transferred between trusted execution environments through the trusted encryption channel.
[0130] In an embodiment of the present application, by utilizing the user-defined executable code capability provided by the trusted execution environment, other trusted execution environments (such as TEE Secure Enclave 2) can obtain user data keys from the key-managed trusted execution environment (TEE SecureEnclave 1), thereby achieving a runtime protection effect in other trusted execution environments that limits the use of user data keys within the trusted execution environment.
[0131] The embodiments of the present application avoid the cost of additional security hardware for users, and do not require a network channel to the KMS service on the cloud. It only requires the use of server hardware (CPU) that supports confidential computing and provides CPU Sealing Key and remote attestation capabilities to achieve remote deployment and management of user data keys.
[0132] In summary, the application of the embodiments of the present application has the following advantages: 1. Utilize TEE remote attestation technology to realize authentication of key management service requests, and can be combined with traditional access key authentication methods to improve access security; 2. Utilize TEE remote attestation technology to realize remote authentication and authorization of key generation and usage environment, and define the security boundary of keys; 3. Utilize TEE remote attestation technology to realize secure key deployment; 4. Utilize TEE hardware key derivation technology to realize persistent storage of keys, and can limit the keys required for decryption to only within the range from which hardware keys can be derived or within the allowed secure enclave, eliminating the possibility of key theft; 5. Utilize TEE confidential computing technology to realize completely offline key management.
[0133] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described order of actions, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.
[0134] On the basis of the above embodiments, this embodiment further provides a key management device based on a trusted execution environment, which is applied to electronic devices such as terminal devices and servers.
[0135] Reference Figure 3 , shows a structural block diagram of an embodiment of a key management device based on a trusted execution environment of the present application, which is applied to a server, wherein the server includes a trusted execution environment supporting confidential computing, and the device may specifically include the following modules:
[0136] A generating module 302, configured to generate a key and remote certification material of the key in the trusted execution environment;
[0137] A transmission module 304, configured to transmit the key and the remote certification material to a terminal device;
[0138] A verification module 306 is configured to receive an encrypted user data key generated by the terminal device encrypting the user data key with the key when the terminal device determines that the trusted execution environment is a trusted environment and the key is a trusted key based on the remote proof material;
[0139] The deployment module 308 is used to use the key to decrypt the encrypted user data key to obtain the user data key, so that the trusted execution environment and the terminal device can perform data transmission based on the user data key.
[0140] In an exemplary embodiment, the generation module 302 is used to generate a key in the trusted execution environment; calculate summary data of the key using a preset summary algorithm, and generate remote certification material of the key based on the summary data.
[0141] In an exemplary embodiment, the device also includes: a persistent storage module, used to obtain a persistent data key based on hardware-level security instructions; the persistent data key is generated based on a persistent root key protected by hardware built into the server; the key is encrypting using the persistent data key, and the user data key is encrypting using the persistent data key; the encrypted key and the encrypted user data key are stored in a persistent storage area corresponding to the trusted execution environment.
[0142] In an exemplary embodiment, the deployment module 308 is used to obtain the encrypted key from the persistent storage area; use the persistent data key to decrypt the encrypted key; use the decrypted key to decrypt the encrypted user data key to obtain the decrypted user data key.
[0143] In an exemplary embodiment, the device also includes: a data transmission module, which is used to obtain the encrypted user data key from the persistent storage area when the trusted execution environment and the terminal device transmit data; use the persistent data key to decrypt the encrypted user data key; use the decrypted user data key to encrypt and transmit the data transmitted between the trusted execution environment and the terminal device.
[0144] In an exemplary embodiment, the persistent storage area allows an authorized trusted execution environment to obtain the encrypted key and the encrypted user data key.
[0145] In an exemplary embodiment, the apparatus further includes: a key transmission module, configured to establish a trusted encryption channel between the trusted execution environment and another trusted execution environment; the other trusted execution environment is a trusted execution environment in other servers that supports confidential computing; when the other trusted execution environment transmits data with the terminal device, obtaining the user data key from the trusted execution environment based on the trusted encryption channel; and using the user data key to encrypt and transmit the data transmitted between the other trusted execution environment and the terminal device.
[0146] In an exemplary embodiment, data is transmitted between the server and the terminal device online or offline.
[0147] The embodiment of the present application also provides a non-volatile readable storage medium, which stores one or more modules (programs). When the one or more modules are applied to a device, the device can execute instructions (instructions) of each method step in the embodiment of the present application.
[0148] The present application embodiment provides one or more machine-readable media on which instructions are stored, and when executed by one or more processors, an electronic device executes one or more of the methods described in the above embodiments. In the present application embodiment, the electronic device includes various types of devices such as terminal devices and servers (clusters).
[0149] The embodiments of the present disclosure may be implemented as a device configured as desired using any appropriate hardware, firmware, software, or any combination thereof, and the device may include electronic devices such as terminal devices and servers (clusters). Figure 4 An exemplary apparatus 400 that may be used to implement various embodiments described in this application is schematically illustrated.
[0150] For one embodiment, Figure 4 An exemplary apparatus 400 is shown having one or more processors 402, a control module (chip set) 404 coupled to at least one of the processor(s) 402, a memory 406 coupled to the control module 404, a non-volatile memory (NVM) / storage device 408 coupled to the control module 404, one or more input / output devices 410 coupled to the control module 404, and a network interface 412 coupled to the control module 404.
[0151] The processor 402 may include one or more single-core or multi-core processors, and the processor 402 may include any combination of general-purpose processors or special-purpose processors (such as graphics processors, application processors, baseband processors, etc.). In some embodiments, the device 400 can be used as a terminal device, server (cluster), etc. described in the embodiments of the present application.
[0152] In some embodiments, the apparatus 400 may include one or more computer-readable media (e.g., memory 406 or NVM / storage device 408) having instructions 414 and one or more processors 402 combined with the one or more computer-readable media and configured to execute the instructions 414 to implement a module to perform the actions described in the present disclosure.
[0153] For one embodiment, control module 404 may include any suitable interface controller to provide any suitable interface to at least one of processor(s) 402 and / or any suitable device or component in communication with control module 404 .
[0154] The control module 404 may include a memory controller module to provide an interface to the memory 406. The memory controller module may be a hardware module, a software module, and / or a firmware module.
[0155] The memory 406 may be used, for example, to load and store data and / or instructions 414 for the device 400. For one embodiment, the memory 406 may include any suitable volatile memory, such as a suitable DRAM. In some embodiments, the memory 406 may include a double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).
[0156] For one embodiment, control module 404 may include one or more input / output controllers to provide interfaces to NVM / storage device 408 and input / output device(s) 410 .
[0157] For example, NVM / storage 408 may be used to store data and / or instructions 414. NVM / storage 408 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable non-volatile storage device(s) (e.g., one or more hard disk drives (HDDs), one or more compact disk (CD) drives, and / or one or more digital versatile disk (DVD) drives).
[0158] NVM / storage device 408 may include storage resources that are physically part of the device on which apparatus 400 is installed, or it may be accessible to the device without being part of the device. For example, NVM / storage device 408 may be accessed via input / output device(s) 410 over a network.
[0159] (One or more) input / output devices 410 may provide an interface for the apparatus 400 to communicate with any other appropriate device, and the input / output device 410 may include a communication component, an audio component, a sensor component, etc. The network interface 412 may provide an interface for the apparatus 400 to communicate through one or more networks, and the apparatus 400 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and / or protocols, for example, accessing a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, etc., or a combination thereof for wireless communication.
[0160] For one embodiment, at least one of the processor(s) 402 may be packaged together with the logic of one or more controllers (e.g., a memory controller module) of the control module 404. For one embodiment, at least one of the processor(s) 402 may be packaged together with the logic of one or more controllers of the control module 404 to form a system-in-package (SiP). For one embodiment, at least one of the processor(s) 402 may be integrated on the same die with the logic of one or more controllers of the control module 404. For one embodiment, at least one of the processor(s) 402 may be integrated on the same die with the logic of one or more controllers of the control module 404 to form a system-on-chip (SoC).
[0161] In various embodiments, the device 400 may be, but is not limited to, a terminal device such as a server, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet computer, a netbook, etc.). In various embodiments, the device 400 may have more or fewer components and / or different architectures. For example, in some embodiments, the device 400 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an application-specific integrated circuit (ASIC), and a speaker.
[0162] Among them, the main control chip can be used as a processor or control module in the detection device, sensor data, location information, etc. are stored in a memory or NVM / storage device, the sensor group can be used as an input / output device, and the communication interface may include a network interface.
[0163] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0164] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0165] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable key management terminal device based on a trusted execution environment to produce a machine, so that the instructions executed by the processor of the computer or other programmable key management terminal device based on a trusted execution environment generate instructions for implementing the processes in the processes. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0166] These computer program instructions may also be stored in a computer-readable memory that can guide a computer or other programmable key management terminal device based on a trusted execution environment to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which is implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0167] These computer program instructions can also be loaded onto a computer or other programmable key management terminal device based on a trusted execution environment, so that a series of operation steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide for implementing the key management process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0168] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0169] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0170] The above is a detailed introduction to a key management method and device based on a trusted execution environment, an electronic device and a storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A key management method based on a trusted execution environment, characterized in that: Applied to a server, the server including a trusted execution environment supporting confidential computing, the method comprising: generating a key and remote attestation material of the key in the trusted execution environment; Transmitting the key and the remote certification material to a terminal device; When the terminal device determines that the trusted execution environment is a trusted environment and the key is a trusted key based on the remote attestation material, receiving an encrypted user data key generated by the terminal device encrypting the user data key using the key; The encrypted user data key is decrypted using the key to obtain the user data key, so that the trusted execution environment and the terminal device perform data transmission based on the user data key; the server and the terminal device perform data transmission online or offline.
2. The method according to claim 1, characterized in that The generating of a key and remote attestation material of the key in the trusted execution environment includes: generating a key in the trusted execution environment; A preset digest algorithm is used to calculate the digest data of the key, and remote certification material of the key is generated based on the digest data.
3. The method according to claim 1, characterized in that The method further comprises: Obtaining a persistent data key based on hardware-level security instructions; the persistent data key is generated based on a persistent root key protected by hardware built into the server; Encrypting the key using the persistent data key, and encrypting the user data key using the persistent data key; The encrypted key and the encrypted user data key are stored in a persistent storage area corresponding to the trusted execution environment.
4. The method according to claim 3, characterized in that The step of using the key to decrypt the encrypted user data key to obtain the user data key includes: Obtaining the encrypted key from the persistent storage area; Decrypting the encrypted key using the persistent data key; The encrypted user data key is decrypted using the decrypted key to obtain the decrypted user data key.
5. The method according to claim 3, characterized in that: The method further comprises: When the trusted execution environment and the terminal device perform data transmission, obtaining the encrypted user data key from the persistent storage area; Decrypting the encrypted user data key using the persistent data key; The decrypted user data key is used to encrypt the data transmitted between the trusted execution environment and the terminal device before transmission.
6. The method according to claim 3, characterized in that The persistent storage area allows an authorized trusted execution environment to obtain the encrypted key and the encrypted user data key.
7. The method according to claim 6, characterized in that The method further comprises: Establishing a trusted encryption channel between the trusted execution environment and another trusted execution environment; the other trusted execution environment is a trusted execution environment supporting confidential computing in other servers; When the other trusted execution environment and the terminal device perform data transmission, obtaining the user data key from the trusted execution environment based on the trusted encryption channel; The user data key is used to encrypt the data transmitted between the other trusted execution environment and the terminal device before transmission.
8. A key management device based on a trusted execution environment, characterized in that: Applied to a server, the server including a trusted execution environment supporting confidential computing, the device comprising: A generation module, configured to generate a key and remote attestation material of the key in the trusted execution environment; A transmission module, used to transmit the key and the remote certification material to a terminal device; a verification module, configured to receive an encrypted user data key generated by the terminal device encrypting the user data key with the key when the terminal device determines that the trusted execution environment is a trusted environment and the key is a trusted key based on the remote proof material; A deployment module is used to use the key to decrypt the encrypted user data key to obtain the user data key, so that the trusted execution environment and the terminal device can transmit data based on the user data key; the server and the terminal device can transmit data online or offline.
9. An electronic device, characterized in that: include: processor; and A memory having executable codes stored thereon, which, when executed, enables the processor to execute the key management method based on a trusted execution environment as described in one or more of claims 1-7.
10. One or more machine-readable media having executable codes stored thereon, which, when executed, enable a processor to execute the key management method based on a trusted execution environment as claimed in one or more of claims 1-7.
Citation Information
Patent Citations
Attestation of a host containing a trusted execution environment
CN106462438A
Remote certification method and device for trusted application program and electronic equipment
CN110011801A
Data providing and fusing method and device
CN110750803A
TEE-based credible oracle machine implementation method and device
CN111130800A
Service processing method and device based on trusted execution environment
CN111181720A
Cited By
System and method for providing multi-tenant HSM service ensuring physical isolation based on confidential container
WO2026187065A1
