Trusted root implementation method based on trusted execution environment, and communication system
By storing the device's private key in the TEE module of the terminal device and negotiating the communication key with the TEE server to establish an encrypted channel, the problem of the TEE root of trust being easily tampered with is solved, and the security and flexibility of privacy computing are improved.
Patent Information
- Application Number
- PCT/CN2025/091215
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-04-28
- Filing Date
- 2025-04-25
- Publication Date
- 2025-11-06
AI Technical Summary
The root of trust in TEE applications is easily tampered with, leading to security risks.
By storing the device private key in the TEE module of the terminal device and using the TEE client APP to negotiate the communication key with the TEE server, an encrypted channel is established to generate and transmit the scene key and scene content, ensuring that information is transmitted in a trusted execution environment.
It achieves a secure and trustworthy root that is difficult to tamper with, thereby improving the security and flexibility of the privacy computing scheme of TEE.
Smart Images

Figure CN2025091215_06112025_PF_FP_ABST
Abstract
Description
Trusted root implementation method and communication system based on trusted execution environment TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of privacy protection, and in particular to a trusted root implementation method and communication system based on a trusted execution environment. BACKGROUND
[0002] A TEE (Trusted Execution Environment) is a secure hardware isolated environment that can protect confidential information stored therein from being accessed by unauthorized applications or operating systems. However, in actual operation, the trusted root of the TEE application needs to be stored in the client, and these trusted roots are easy to be tampered with, resulting in some security risks. SUMMARY
[0003] One or more embodiments of the present specification provide a trusted root implementation method and communication system based on a trusted execution environment, which can generate secure trusted roots that are difficult to tamper with.
[0004] In a first aspect, a trusted root implementation method based on a trusted execution environment is provided. The method is applicable to a terminal device, and a TEE module of the terminal device stores a device private key. A TEE client APP is deployed in the terminal device. The method comprises: the TEE client APP obtaining the device private key stored in the TEE module and sending the device private key to a TEE server; the TEE server performing communication key negotiation with the TEE module through the TEE client APP based on the device private key and a pre-stored device public key, and constructing an encrypted channel between the TEE module based on the communication key; the device public key matches the device private key; the TEE server generates a scene key and scene content, and sends the scene key and the scene content to the TEE module through the encrypted channel.
[0005] As an optional implementation of the method of the first aspect, the TEE server performs key negotiation with the TEE module through the TEE client APP based on the device private key and the pre-stored device public key, including: the TEE server, in response to receiving the device private key, sends a server key update request and verification information encrypted by the device public key to the TEE module through the TEE client APP; the TEE module, in response to the server key update request, decrypts the verification information through the device private key to obtain verification information in plaintext; the TEE module verifies the verification information in plaintext, and generates the communication key after verification; the TEE module encrypts the communication key by using the device private key, and sends the encrypted communication key to the TEE server through the TEE client APP; and the TEE server decrypts the encrypted communication key by using the device private key to obtain the communication key.
[0006] Specifically, the verification information sent by the TEE server includes a hash value of a key file of the TEE client provided by the TEE server; the TEE client APP, in response to the server key update request, sends a hash value of a key file of itself to the TEE module; the TEE module decrypts the verification information by using the device private key, and performs consistency verification on the hash value of the key file of the TEE client obtained and the hash value of the key file sent by the TEE client APP, and generates the communication key after verification.
[0007] Specifically, when sending the verification information, the TEE server also sends server identity information, and signs the sent information by using the device public key; before verifying the verification information, the TEE module verifies the signature information based on the device private key, performs identity authentication on the TEE server based on the server identity information after verification, decrypts the verification information by using the device private key after authentication, and verifies the verification information.
[0008] Specifically, after generating the communication key, the TEE module also binds the communication key with at least one of a physical identifier of the terminal device, account information of a user, and client information of the TEE client APP.
[0009] As an optional implementation of the method of the first aspect, the TEE server generates a scene key and scene content, and sends the scene key and the scene content to the TEE module through the encrypted channel, comprising: the TEE server encrypts the scene key and the scene content by using the communication key, and sends the encrypted scene key and the encrypted scene content to the TEE module through the TEE client APP; the TEE module decrypts the received encrypted scene key and the received encrypted scene content by using the communication key, to obtain the scene key and the scene content.
[0010] Specifically, when sending the scene key and the scene content through the encrypted channel, the TEE server also sends anti-replay information signed by using the device public key; the TEE module decrypts the scene key and the scene content by using the device private key, and verifies the anti-replay information by using the device private key, and trusts the scene key and the scene content after the verification is passed.
[0011] The second aspect provides another method for implementing a trusted root based on a trusted execution environment, which is applicable to a TEE server, comprising: in response to obtaining a device private key sent by a terminal device, the TEE server performs communication key negotiation with a TEE module of the terminal device through a TEE client APP of the terminal device based on the device private key and a pre-stored device public key, and constructs an encrypted channel with the TEE module based on the communication key; the device public key matches the device private key; in response to the construction of the encrypted channel, the TEE server generates a scene key and scene content, and sends the scene key and the scene content to the TEE module through the encrypted channel.
[0012] As an optional implementation of the method of the second aspect, the TEE server performs communication key negotiation with the TEE module based on the device private key and the pre-stored device public key, comprising: the TEE server sends a server key update request and verification information encrypted by using the device public key to the TEE module through the TEE client APP in response to receiving the device private key; the TEE module decrypts the verification information by using the device private key to obtain verification information plaintext in response to the server key update request; the TEE module verifies the verification information plaintext, and generates the communication key after the verification is passed; the TEE module sends the encrypted communication key to the TEE server through the TEE client APP after encrypting the communication key by using the device private key; and the TEE server decrypts the encrypted communication key by using the device private key to obtain the communication key.
[0013] Specifically, the verification information sent by the TEE server comprises a hash value of a key file of the TEE client provided by the TEE server; the TEE client APP sends a hash value of its own key file to the TEE module in response to the server key update request; the TEE module decrypts the verification information by using the device private key, and performs consistency verification on the obtained hash value of the key file of the TEE client and the hash value of the key file sent by the TEE client APP, and generates the communication key after the verification is passed.
[0014] Specifically, the TEE server sends the server identity information when sending the verification information, and signs the sent information by using the device public key; the TEE module verifies the signature information based on the device private key before verifying the verification information, and performs identity authentication on the TEE server based on the server identity information after the verification is passed, and decrypts the verification information by using the device private key and verifies the verification information.
[0015] As an optional implementation of the method of the second aspect, the TEE server generates a scene key and scene content, and sends the scene key and the scene content to the TEE module through the encrypted channel, comprising: the TEE server encrypts the scene key and the scene content by using the communication key, and sends the encrypted scene key and the encrypted scene content to the TEE module through the TEE client APP; the TEE module decrypts the received encrypted scene key and the encrypted scene content by using the communication key, and obtains the scene key and the scene content.
[0016] Specifically, the TEE server sends the anti-replay information signed by using the device public key when sending the scene key and the scene content through the encrypted channel; the TEE module decrypts the scene key and the scene content by using the device private key, and verifies the anti-replay information by using the device private key, and trusts the scene key and the scene content after the verification is passed.
[0017] The third aspect provides a terminal device comprising a TEE module and a TEE client APP, wherein the device private key is stored in the TEE module; and the terminal device implements the above-mentioned trusted root implementation method based on the trusted execution environment when interacting with the TEE server.
[0018] The fourth aspect provides a TEE server for interacting with a terminal device to implement another trusted root implementation method based on the trusted execution environment.
[0019] In a fifth aspect, a communication system is provided, comprising: a terminal device and a TEE server; a TEE module of the terminal device stores a device private key, and a TEE client APP is deployed in the terminal device; when the terminal device interacts with the TEE server, a trusted root implementation method based on a trusted execution environment is implemented, the method comprising: the TEE client APP acquires the device private key stored in the TEE module, and sends the device private key to the TEE server; the TEE server performs communication key negotiation with the TEE module through the TEE client APP based on the device private key and a pre-stored device public key, and constructs an encrypted channel between the TEE module based on the communication key; the device public key matches the device private key; the TEE server generates a scene key and scene content, and sends the scene key and the scene content to the TEE module through the encrypted channel.
[0020] In a sixth aspect, a privacy computing method is provided, which is suitable for a terminal device, and a TEE client APP is deployed in the terminal device; a TEE module of the terminal device and the TEE client APP both store a scene key and scene content, which are obtained according to the above-mentioned trusted root implementation method based on a trusted execution environment; when the TEE module interacts with a third-party APP installed in the terminal device, a corresponding scene key is selected based on corresponding scene content and sent to the TEE client APP, so as to establish a secure communication between the TEE client APP, and the interaction data between the TEE client APP and the third-party APP is transmitted through the TEE client APP.
[0021] In a seventh aspect, a computer readable storage medium is provided, which stores a computer program, the computer program is executed by a processor to implement the above-mentioned trusted root implementation method based on a trusted execution environment, or to implement another trusted root implementation method based on a trusted execution environment.
[0022] In an eighth aspect, an electronic device is provided, comprising: one or more processors; and a memory associated with the one or more processors, the memory being configured to store program instructions, the program instructions being configured to be executed by the one or more processors to execute the above-mentioned trusted root implementation method based on a trusted execution environment, or to execute another trusted root implementation method based on a trusted execution environment.
[0023] The method of implementing a trusted root based on a trusted execution environment has the beneficial effect that the method configures a terminal device with an initial private key, and can generate a secure trusted root that is not easy to tamper with in a secure manner of key derivation. Further, the method can flexibly use TEE for storage, encryption and decryption, signing and verification, and key derivation in various scenarios, thereby improving the security and flexibility of a privacy computing scheme based on TEE.
[0024] The terminal device, the TEE server, the communication system, and the privacy computing method described in the embodiments of the present specification also have the beneficial effects described above. BRIEF DESCRIPTION OF DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present specification or the related art, the following will briefly introduce the drawings needed to be used in the embodiments or related art descriptions. Obviously, the drawings in the following description are some embodiments of the present specification, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0026] FIG. 1 is a structural schematic diagram of a communication system provided by one or more embodiments of the present specification.
[0027] FIG. 2 is a flow schematic diagram of a method of implementing a trusted root based on a trusted execution environment implemented by a communication system according to one or more embodiments of the present specification.
[0028] FIG. 3 is a working flow schematic diagram of a communication system in a specific business scenario according to one or more embodiments of the present specification.
[0029] FIG. 4 is a flow schematic diagram of a method of implementing a trusted root based on a trusted execution environment suitable for a terminal device according to one or more embodiments of the present specification.
[0030] FIG. 5 is a flow schematic diagram of a method of implementing a trusted root based on a trusted execution environment suitable for a TEE server according to one or more embodiments of the present specification.
[0031] FIG. 6 is a structural schematic diagram of an electronic device according to one or more embodiments of the present specification. DETAILED DESCRIPTION
[0032] In order to enable a person skilled in the art to better understand the technical solutions in the specification, the technical solutions in the specification will be clearly and completely described below in combination with the drawings in the embodiments of the specification. Obviously, the described embodiments are only a part of the embodiments of the specification, rather than all the embodiments. Based on the embodiments in the specification, all other embodiments obtained by a person skilled in the art without creative work should belong to the protection scope of the specification.
[0033] It should be noted that the steps of the corresponding method in other embodiments are not necessarily performed in the order shown and described in the specification. In some other embodiments, the steps included in the method can be more or less than described in the specification. In addition, a single step described in the specification can be divided into multiple steps for description in other embodiments, and multiple steps described in the specification can be combined into a single step for description in other embodiments.
[0034] Those skilled in the art can understand that the terms used in the embodiments of the disclosure are only for the purpose of describing particular embodiments, and are not intended to limit the disclosure. The singular forms "a", "an" and "the" used in the embodiments of the disclosure and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.
[0035] One or more embodiments of the disclosure provide a trusted root implementation method based on a trusted execution environment. Please refer to FIG. 1, which shows a communication system that can be used to implement the trusted root implementation method based on the trusted execution environment. It should be noted that the trusted root implementation method based on the trusted execution environment described in one or more embodiments of the disclosure can be implemented by relying on the communication system shown in FIG. 1, but is not limited to this communication system.
[0036] As shown in FIG. 1, the above-mentioned communication system includes a terminal device 10 and a TEE server 12. The terminal device 10 is connected with the TEE server 12 through a communication link, which can be a wired network or a wireless network. For example, the terminal device 10 can establish a communication connection with the TEE server 12 by using WIFI, Bluetooth, infrared, etc. Alternatively, the terminal device 10 can also establish a communication connection with the TEE server 12 through a mobile network, wherein the network standard of the mobile network can be any one of 2G (GSM), 2.5G (GPRS), 3G (WCDMA, TD-SCDMA, CDMA2000, UTMS), 4G (LTE), 4G+ (LTE+), WiMax, etc.
[0037] The terminal device 10 can be a mobile phone, a computer, an iPad, a smart watch, or the like. The terminal device 10 is provided with a TEE (Trusted Execution Environment) module, and the TEE module stores a device private key. The terminal device 10 is also provided with a TEE client APP. Specifically, before the terminal device 10 is shipped, a manufacturer pre-burns a device private key into the TEE module. After the terminal device 10 is shipped, a user can install the TEE client APP on the terminal device 10. The TEE client APP can call the device private key and interact with the TEE server 12 according to a preset computer program, so as to implement the trusted root implementation method based on the trusted execution environment.
[0038] The TEE server 12 is a server of the TEE client APP, and is configured to provide a function of deriving a scene key and scene content based on a device private key. The TEE server 12 can be any device, apparatus, platform, or cluster of devices having a computing and processing capability. In this embodiment, the implementation form of the TEE server 12 is not limited. For example, the TEE server 12 can be a single server, or a server cluster composed of multiple servers. The TEE server 12 can also be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in a cloud computing service system.
[0039] Referring to FIG. 2, the communication system implements the trusted root implementation method based on the trusted execution environment by performing steps S200 to S204.
[0040] S200: The TEE client APP of the terminal device 10 acquires the device private key stored in the TEE module, and sends the device private key to the TEE server 12.
[0041] In the terminal device 10, the device private key is burned into the TEE module of the terminal device 10 by a manufacturer before the terminal device 10 is shipped. The device private key can be called by the TEE client APP.
[0042] S202: The TEE server 12 performs a communication key negotiation with the TEE module through the TEE client APP based on the device private key and a pre-stored device public key, and constructs an encrypted channel between the TEE server 12 and the TEE module based on the communication key.
[0043] It should be noted that the device public key and the device private key are matched, i.e., the device public key and the device private key are a pair of asymmetric keys. The pair of asymmetric keys can be generated by the TEE server 12, and then the TEE server 12 stores the device public key, and the device private key is obtained by the manufacturer from the TEE server 12 through a trusted channel and is burned in the TEE module of the terminal device 10. The pair of asymmetric keys can also be generated by a trusted agency, and then the device public key is sent to the TEE server 12 through a trusted channel, and the device private key is sent to the manufacturer through a trusted channel, and the device private key is burned in the TEE module of the terminal device 10 by the manufacturer.
[0044] In some implementable embodiments, the TEE server 12 can perform the following communication key negotiation with the TEE module. The specific process includes the following.
[0045] When the TEE server 12 receives the device private key sent by the TEE client APP, the TEE server 12 sends a server key update request and verification information encrypted by the device public key to the TEE client APP.
[0046] The TEE client APP sends the information issued by the TEE server 12 to the TEE module.
[0047] The TEE module decrypts the verification information by the device private key in response to the server key update request to obtain the verification information in plaintext.
[0048] The TEE module verifies the verification information in plaintext, and generates a communication key after verification.
[0049] The TEE module encrypts the communication key by the device private key and sends it to the TEE client APP.
[0050] The TEE client APP sends the encrypted communication key to the TEE server.
[0051] The TEE server decrypts the encrypted communication key by the device private key to obtain the communication key.
[0052] In the above communication key negotiation process, the verification information is used to verify the identity of the TEE server 12, and after the identity is verified, the generation and transmission of the communication key can be performed. The verification information here can be any information that can prove the identity of the TEE server 12, such as the server identity information of the TEE server 12, the related information of the TEE client APP, etc. The verification information can select a single information for single verification, or multiple information for multiple verification, which is not limited in the present embodiment.
[0053] After the TEE module and the TEE server 12 hold the communication key, the TEE module and the TEE server 12 can perform secure communication based on the communication key in subsequent communication process. That is, when the TEE module and the TEE server 12 transmit data, the TEE module and the TEE server 12 can encrypt the transmitted data based on the communication key, thereby establishing a secure channel between the TEE module and the TEE server 12.
[0054] S204: The TEE server 12 generates a scenario key and scenario content, and transmits the scenario key and the scenario content to the TEE module through the encrypted channel.
[0055] The scenario content described above can be pre-set, that is, the TEE server 12 generates the scenario content according to pre-set setting information. The scenario content described above is associated with the corresponding scenario key, and the scenario content is used to describe the use of the corresponding scenario key. The scenario content can be storage, calculation (encryption / decryption / signing / verification), key derivation, and the like.
[0056] The scenario content described above can also be obtained through the encrypted channel described above, that is, the TEE module generates scenario description information according to business requirements, and then transmits the scenario description information to the TEE server 12 through the encrypted channel described above. The TEE server 12 can generate scenario content and a scenario key according to the scenario description information.
[0057] The scenario key described above can be a symmetric key or an asymmetric key, and can be adaptively set according to requirements. The present embodiment does not limit this.
[0058] When the TEE server 12 transmits the scenario key and the scenario content to the TEE module through the encrypted channel, the TEE server 12 encrypts the scenario key and the scenario content by using the communication key, and then transmits the encrypted scenario key and the scenario content to the TEE client APP. The TEE client APP forwards the encrypted scenario key and the scenario content to the TEE module. The TEE module decrypts the received information by using the communication key, and obtains the scenario key and the scenario content.
[0059] The working process of the communication system described above will be further described in combination with specific scenarios. Please refer to FIG. 3, which shows a trusted root implementation method based on a trusted execution environment implemented based on the communication system described above. After the TEE client APP is installed in the terminal device 10, the following initialization process is performed, that is, the trusted root implementation method based on the trusted execution environment described above is performed. The initialization process includes the following steps.
[0060] S301: The TEE client APP of the terminal device 10 sends a request information to the TEE server 12, the request information carrying a device information initialization key library, the device information initialization key library storing a device private key burned by a vendor in the TEE module of the terminal device 10.
[0061] S302: After receiving the device private key, the TEE server 12 issues a server update key request, server identity information, encrypted TEE client key file hash value to the TEE client APP and signs with the device public key.
[0062] The key file type can be adaptively selected based on requirements. It can be pre-configured in the execution programs of the TEE client APP and the TEE server 12, that is, the TEE server 12 selects what key files, and the TEE client APP also selects what key files. The TEE server 12 can also send the names of the selected key files to the TEE client APP together with the hash values of the key files, so that the TEE client APP can extract the hash values of the same key files for verification.
[0063] S303: After receiving the server key update request, the TEE client APP sends the hash values of its own key files, the package name and the information sent by the TEE server 12 to the TEE module.
[0064] S304: The TEE module verifies the information sent by the TEE client APP.
[0065] Specifically, the TEE module can use the device private key to decrypt the verification information, and perform consistency verification on the obtained hash values of the key files of the TEE client and the hash values of the key files sent by the TEE client APP. The TEE module can also verify the authenticity of the key files (stored in the TEE module) according to the package name.
[0066] S305: After verification, the TEE module generates a communication key. The communication key can also be bound to at least one of the device representation of the terminal device, the account, and the information of the TEE client APP.
[0067] S306: The TEE module encrypts the communication key with the device private key and sends it to the TEE client APP.
[0068] S307: The TEE client APP sends the encrypted communication key to the TEE server 12. The TEE server 12 decrypts the encrypted communication key with the device private key to obtain the communication key.
[0069] S308: The TEE server 12 encrypts the scene key and scene content to be updated with the communication key, and signs the anti-replay information with the device public key, and then sends the encrypted scene key and scene content and the anti-replay information signed with the device public key to the TEE client APP. The anti-replay information described above can be a timestamp, a random number, etc., to resist replay attacks in the data transmission process.
[0070] S309: The TEE client APP transmits the encrypted scene key and scene content and the anti-replay information signed with the device public key to the TEE module.
[0071] S310: The TEE module decrypts the received encrypted scene key and scene content with the device private key to obtain the scene key and scene content. After verifying the signature information of the anti-replay information with the device private key, the TEE module trusts the obtained scene key and scene content.
[0072] S311: After the TEE module stores the scene key and scene content, the initialization process described above is completed.
[0073] As can be known from the working principle of the communication system described above, the embodiment can fix a device private key for a terminal device, and then call the device private key through the TEE client APP to perform secure communication with the TEE server, so that the TEE server can obtain the scene key and scene content issued by the TEE server. These scene keys can be used as trusted roots of corresponding scene content. When the TEE module of the terminal device interacts with a third-party APP, the TEE client APP acts as an intermediate agent, that is, the data transmitted by the TEE module is sent to the TEE client APP after being encrypted by the scene key, the TEE client APP sends the data to the third-party APP after decrypting the data with the scene key, and since the third-party APP itself does not have the scene key and the data storage of the TEE client APP and the TEE module are both in the trusted execution environment TEE, the scene key is difficult to be obtained by the outside and is not easy to tamper.
[0074] Corresponding to the communication system described above, in some embodiments, the present specification provides a trusted root implementation method based on a trusted execution environment, which is applicable to a terminal device 10. The TEE module of the terminal device 10 stores a device private key, and the TEE client APP is deployed in the terminal device 10. Please refer to FIG. 4, the method comprises steps S400 to S404.
[0075] S400: The TEE client APP obtains the device private key stored in the TEE module, and sends the device private key to the TEE server 12.
[0076] The device private key is burned into the TEE module of the terminal device 10 by the manufacturer before the terminal device 10 is shipped, and the device private key can be called by the TEE client APP.
[0077] S402: The TEE server 12 performs communication key negotiation with the TEE module through the TEE client APP based on the device private key and the pre-stored device public key, and builds an encrypted channel with the TEE module based on the communication key.
[0078] The device public key and the device private key are matched, that is, the device public key and the device private key are a pair of asymmetric keys. The pair of asymmetric keys can be generated by the TEE server 12, and then the TEE server 12 stores the device public key, and the manufacturer obtains the device private key from the TEE server 12 through a trusted channel and burns it into the TEE module of the terminal device 10. The pair of asymmetric keys can also be generated by a trusted agency, and then the device public key is sent to the TEE server 12 through a trusted channel, and the device private key is sent to the manufacturer through a trusted channel, and the manufacturer burns the device private key into the TEE module of the terminal device 10.
[0079] In some implementable embodiments, the TEE server 12 can perform communication key negotiation with the TEE module in the following manner, and the specific process includes the following.
[0080] When the TEE server 12 receives the device private key sent by the TEE client APP, it sends a server key update request and verification information encrypted by the device public key to the TEE client APP.
[0081] The TEE client APP responds to the server key update request and sends the information issued by the TEE server 12 to the TEE module.
[0082] The TEE module responds to the server key update request and decrypts the verification information by the device private key to obtain the verification information in plaintext.
[0083] The TEE module verifies the verification information in plaintext, and generates a communication key after verification.
[0084] The TEE module encrypts the communication key by the device private key and sends it to the TEE client APP.
[0085] The TEE client APP sends the encrypted communication key to the TEE server.
[0086] The TEE server decrypts the encrypted communication key by the device private key to obtain the communication key.
[0087] In the communication key negotiation process described above, the verification information is used to verify the identity of the TEE server 12, and after the identity is verified, the generation and transmission of the communication key can be performed. The verification information here can be any information that can prove the identity of the TEE server 12, such as the server identity information of the TEE server 12, the related information of the TEE client APP, etc. The verification information can select a single information for single verification, or multiple information for multiple verification, which is not limited by the embodiment.
[0088] After the TEE module and the TEE server 12 hold the communication key, in the subsequent communication process, the communication key can be used for secure communication. That is, when the TEE module and the TEE server 12 transmit data, the transmitted data can be encrypted based on the communication key, thereby establishing a secure channel between the TEE module and the TEE server 12.
[0089] S404: The TEE server 12 generates a scenario key and scenario content, and sends the scenario key and scenario content to the TEE module through the encrypted channel.
[0090] The scenario content described above can be pre-set, that is, the TEE server 12 generates the scenario content according to the pre-set setting information. The scenario content described above is associated with the corresponding scenario key, and the scenario content is used to describe the use of the corresponding scenario key, which can be storage, calculation (encryption / decryption / signature verification), key derivation, etc.
[0091] The scenario content described above can also be obtained through the encrypted channel described above, that is, the TEE module generates scenario description information according to the business requirement, and then sends the scenario description information to the TEE server 12 through the encrypted channel. The TEE server 12 can generate scenario content and scenario key according to the scenario description information.
[0092] The scenario key described above can be a symmetric key or an asymmetric key, which can be adaptively set according to the requirement, and the embodiment does not limit this.
[0093] When the TEE server 12 sends the scenario key and scenario content to the TEE client APP through the encrypted channel, the scenario key and scenario content are encrypted using the communication key, and then the encrypted scenario key and scenario content are sent to the TEE client APP. The TEE client APP forwards the received information to the TEE module, and the TEE module decrypts the received encrypted scenario key and scenario content using the communication key to obtain the plaintext information of the scenario key and scenario content.
[0094] Corresponding to the above communication system, in some embodiments, the present specification also provides another trusted root implementation method based on the trusted execution environment, which is applicable to the TEE server 12. Please refer to FIG. 5, which shows a flowchart of the method, which includes steps S500 to S502.
[0095] S500: In response to obtaining the device private key sent by the terminal device 10, the TEE server 12 performs communication key negotiation with the TEE module of the terminal device 10 through the TEE client APP of the terminal device 10 based on the device private key and the pre-stored device public key, and builds an encrypted channel with the TEE module based on the communication key.
[0096] The above-mentioned device public key and device private key are matched, that is, the device public key and the device private key are a pair of asymmetric keys. The pair of asymmetric keys can be generated by the TEE server 12, and then the TEE server 12 stores the device public key, and the device private key is obtained by the manufacturer from the TEE server 12 through a trusted channel, and is burned in the TEE module of the terminal device 10. The pair of asymmetric keys can also be generated by a trusted agency, and then the device public key is sent to the TEE server 12 through a trusted channel, and the device private key is sent to the manufacturer through a trusted channel, and the device private key is burned in the TEE module of the terminal device 10 by the manufacturer.
[0097] In some implementable embodiments, the TEE server 12 can perform communication key negotiation with the TEE module in the following manner, and the specific process includes the following.
[0098] When the TEE server 12 receives the device private key sent by the TEE client APP, it sends a server key update request and verification information encrypted by the device public key to the TEE client APP.
[0099] The TEE client APP responds to the server key update request and sends the information issued by the TEE server 12 to the TEE module.
[0100] The TEE module responds to the server key update request and decrypts the verification information by the device private key to obtain the verification information in plaintext.
[0101] The TEE module verifies the verification information in plaintext, and generates a communication key after verification.
[0102] The TEE module encrypts the communication key with the device private key and sends it to the TEE client APP.
[0103] The TEE client APP sends the encrypted communication key to the TEE server.
[0104] The TEE server decrypts the encrypted communication key with the device private key to obtain the communication key.
[0105] In the above communication key negotiation process, the verification information is used to verify the identity of the TEE server 12, and after the identity is verified, the generation and transmission of the communication key can be performed. The verification information here can be any information that can prove the identity of the TEE server 12, such as the server identity information of the TEE server 12, the related information of the TEE client APP, etc. The verification information can select a single information for single verification, or multiple information for multiple verification, which is not limited by the embodiment.
[0106] After the TEE module and the TEE server 12 both hold the communication key, in the subsequent communication process, the communication key can be used for secure communication. That is, when the TEE module and the TEE server 12 transmit data, the transmitted data can be encrypted based on the communication key, thereby establishing a secure channel between the TEE module and the TEE server 12.
[0107] S502: In response to the construction of the encrypted channel, the TEE server 12 generates a scene key and scene content, and sends the scene key and the scene content to the TEE module through the encrypted channel.
[0108] The above-mentioned scene content can be pre-set, that is, the TEE server 12 generates the scene content according to the preset setting information. The above-mentioned scene content is associated with the corresponding scene key, and the scene content is used to describe the use of the corresponding scene key, which can be storage, calculation (encryption / decryption / signature verification), key derivation, etc.
[0109] The above-mentioned scene content can also be obtained through the above-mentioned encrypted channel, that is, the TEE module generates scene description information according to business requirements, and then sends the scene description information to the TEE server 12 through the above-mentioned encrypted channel. The TEE server 12 can generate scene content and scene key according to the scene description information.
[0110] The above-mentioned scene key can be a symmetric key or an asymmetric key, which can be adaptively set according to requirements, and the embodiment does not limit this.
[0111] When the TEE server 12 sends the scene key and the scene content to the TEE module through the encrypted channel, the scene key and the scene content are encrypted using the communication key, and then the encrypted scene key and the scene content are sent to the TEE client APP. The TEE client APP forwards the encrypted scene key and the scene content to the TEE module. The TEE module decrypts the received encrypted scene key and scene content using the communication key to obtain the scene key and the scene content, and then stores the scene key and the scene content.
[0112] The embodiment also provides a terminal device including a TEE module and a TEE client APP, and the TEE module stores a device private key. The terminal device implements the above-mentioned trusted root implementation method based on a trusted execution environment applicable to a terminal device when interacting with a TEE server. The specific process is shown in the trusted root implementation method based on a trusted execution environment shown in FIG. 4, which is not described in detail here.
[0113] The embodiment also provides a TEE server for interacting with a terminal device to implement the above-mentioned trusted root implementation method based on a trusted execution environment applicable to a TEE server. The specific process is shown in the trusted root implementation method based on a trusted execution environment shown in FIG. 5, which is not described in detail here.
[0114] The embodiment also provides a privacy computing method based on the above-mentioned trusted root implementation method based on a trusted execution environment. Specifically, the method is a specific application of the terminal device 10 after obtaining the above-mentioned scene key and scene content. The privacy computing method can be applied to the business scene between the TEE module of the terminal device 10 and the third-party APP, such as storage, calculation (encryption / decryption / signing / verification), key derivation, etc. In specific implementation, the above-mentioned TEE client APP can be a separate APP, or can be fixed in the form of sdk to the third-party APP. Since the integrity of the TEE client APP / sdk is verified in the above-mentioned initialization process, it is not worried about being tampered.
[0115] The specific process of the privacy computing method is as follows: when the TEE module interacts with the third-party APP installed in the terminal device 10, first determine the scene content of the business scene, and based on the scene content, the scene key applicable to the business scene can be determined. After determining the scene key, the TEE module sends the scene key to the TEE client APP to establish a secure communication between the TEE module and the TEE client APP. When the TEE module needs to transmit data with the third-party APP, the TEE module encrypts the data to be sent by using the scene key, and then sends the encrypted data to the TEE client APP. The TEE client APP decrypts the data and then sends it to the third-party APP. Similarly, the data sent by the third-party APP to the TEE module can be sent to the TEE client APP first, encrypted by the TEE client APP through the scene key, and then sent to the TEE module. The TEE module decrypts the data through the scene key to obtain the data. In this way, the third-party APP can also communicate securely with the TEE module without holding the scene key. In the whole process, the scene key is in the trusted execution environment and is not exposed to the third-party APP, greatly improving the security and flexibility of privacy computing.
[0116] The embodiments also provide a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the trusted root implementation method based on a trusted execution environment for a terminal device, or the trusted root implementation method based on a trusted execution environment for a TEE server, or the privacy computing method.
[0117] Computer readable storage media includes permanent and non-permanent, removable and non-removable media, which can be implemented by any method or technology to store information. The 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 cassette, disk storage, quantum memory, graphene-based storage medium or other magnetic storage device, 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 paper, computer readable medium does not include transitory computer readable medium, such as modulated data signal and carrier wave.
[0118] The embodiments also provide an electronic device, which includes one or more processors, and a memory associated with the one or more processors, the memory being configured to store program instructions that, when executed by the one or more processors, implement the trusted root implementation method based on a trusted execution environment for a terminal device, or the trusted root implementation method based on a trusted execution environment for a TEE server, or the privacy computing method.
[0119] Please refer to FIG. 6, which shows a structural schematic diagram of the electronic device. The electronic device includes a bus 601, a processor 602, a memory 603 and a communication interface 604. The memory 603 stores a computer program, which, when running on the processor 602, causes the processor 602 to execute the specific steps in the traffic limiting method. It should be understood that the number of processors and memories in the electronic device is not limited in the present application.
[0120] The bus 601 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus 601 can be divided into an address bus, a data bus, a control bus, etc. For convenience of representation, only one line is represented in FIG. 6, but it does not mean that there is only one bus or only one type of bus. The bus 601 can include a path for transmitting information between the components (e.g., the processor 602, the memory 603, and the communication interface 604) of the terminal device.
[0121] The processor 602 can include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP), etc.
[0122] The memory 603 can include a volatile memory (e.g., a random access memory (RAM)), and can also include a non-volatile memory (e.g., a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD)).
[0123] The communication interface 604 uses a transceiver module such as, but not limited to, a network interface card, a transceiver, etc., to enable communication between the electronic device and other devices or communication networks.
[0124] Those skilled in the art should understand that the modules or steps of the present disclosure described above can be implemented by a general computing device, and they can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Alternatively, they can be implemented by program codes executable by a computing device, so that they can be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described can be executed in an order different from that described here, or they can be manufactured into individual integrated circuit modules, or multiple modules or steps among them can be manufactured into a single integrated circuit module. Thus, the present disclosure is not limited to any particular combination of hardware and software.
[0125] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. In particular, the system embodiments are described simply because they are basically similar to the method embodiments, and the relevant parts can be referred to the description of the method embodiments.
[0126] The above describes specific embodiments of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different than the order in which they are recited and still achieve desirable results. In addition, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order, to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous or necessary.
[0127] It should be noted that the above only lists specific embodiments of the disclosure, and obviously the disclosure is not limited to the above embodiments, and there are many similar changes. All variations directly derived or inferred from the disclosure by those skilled in the art shall fall within the protection scope of the disclosure.
Claims
1. A method for implementing a trusted root based on a trusted execution environment, suitable for a terminal device, wherein a device private key is stored in a TEE module of the terminal device, and a TEE client APP is deployed in the terminal device; the method comprises: the TEE client APP acquires the device private key stored in the TEE module, and sends the device private key to a TEE server; the TEE server performs a communication key negotiation with the TEE module through the TEE client APP based on the device private key and a pre-stored device public key, and constructs an encrypted channel with the TEE module based on the communication key; the device public key matches the device private key; the TEE server generates a scenario key and scenario content, and sends the scenario key and the scenario content to the TEE module through the encrypted channel. 2.The method of claim 1, wherein the TEE server performs a communication key negotiation with the TEE module through the TEE client APP based on the device private key and a pre-stored device public key, comprising: the TEE server sends a server key update request and verification information encrypted by the device public key to the TEE module through the TEE client APP in response to receiving the device private key; the TEE module decrypts the verification information by the device private key to obtain verification information plaintext in response to the server key update request; the TEE module verifies the verification information plaintext, and generates the communication key after verification; the TEE module sends the encrypted communication key to the TEE server through the TEE client APP after encrypting the communication key by the device private key; the TEE server decrypts the encrypted communication key by the device private key to obtain the communication key. 3.The method of claim 2, wherein the verification information sent by the TEE server comprises a hash value of a key file of the TEE client provided by the TEE server. the TEE client APP sends a hash value of a key file of itself to the TEE module in response to the server key update request; the TEE module decrypts the verification information by the device private key, and performs consistency verification on the hash value of the TEE client obtained and the hash value of the key file sent by the TEE client APP, and generates the communication key after verification. 4.The method of claim 2, wherein the TEE server sends server identity information when sending the verification information, and signs the sent information by the device public key; the TEE module verifies the signature information by the device private key before verifying the verification information, and performs identity authentication on the TEE server based on the server identity information after verification, and decrypts the verification information by the device private key and verifies the verification information after authentication. 5.The method of claim 2, wherein the TEE module, after generating the communication key, further binds the communication key with at least one of a physical identity of the terminal device, account information of a user, and client information of the TEE client APP. 6.The method of claim 1, wherein the TEE server generates a scene key and scene content, and sends the scene key and the scene content to the TEE module through the encrypted channel, comprising: the TEE server encrypting the scene key and the scene content with the communication key, and sending the encrypted scene key and the encrypted scene content to the TEE module through the TEE client APP; and the TEE module decrypting the received encrypted scene key and the received encrypted scene content with the communication key to obtain the scene key and the scene content. 7.The method of claim 6, wherein the TEE server, when sending the scene key and the scene content through the encrypted channel, further sends anti-replay information signed with the device public key; and the TEE module decrypts the scene key and the scene content with the device private key, and verifies the anti-replay information with the device private key, and trusts the scene key and the scene content after the verification is passed. 8.A method for implementing a trusted root based on a trusted execution environment, applicable to a TEE server, comprising: in response to obtaining a device private key sent by a terminal device, the TEE server, based on the device private key and a pre-stored device public key, performs communication key negotiation with a TEE module of the terminal device through a TEE client APP of the terminal device, and constructs an encrypted channel with the TEE module based on the communication key; the device public key matches the device private key; and in response to the construction of the encrypted channel, the TEE server generates a scene key and scene content, and sends the scene key and the scene content to the TEE module through the encrypted channel. 9.The method of claim 8, wherein the TEE server, based on the device private key and the pre-stored device public key, performs communication key negotiation with the TEE module through the TEE client APP, comprising: the TEE server, in response to receiving the device private key, sends a server key update request and verification information encrypted with the device public key to the TEE module through the TEE client APP; the TEE module, in response to the server key update request, decrypts the verification information with the device private key to obtain verification information in plaintext; the TEE module verifies the verification information in plaintext, and generates the communication key after the verification is passed; the TEE module, after encrypting the communication key with the device private key, sends the encrypted communication key to the TEE server through the TEE client APP; and the TEE server decrypts the encrypted communication key with the device private key to obtain the communication key. 10. The method of claim 9, wherein the verification information sent by the TEE server comprises a hash value of a key file of the TEE client provided by the TEE server. The TEE client APP sends a hash value of its key file to the TEE module in response to the server key update request; The TEE module decrypts the check information by using the device private key, and performs consistency check on the obtained hash value of the key file of the TEE client and the hash value of the key file sent by the TEE client APP. After the check passes, the communication key is generated.
11. The method of claim 9, wherein the TEE server sends server identity information when sending the check information, and signs the sent information by using the device public key; and the TEE module verifies the signature information by using the device private key before verifying the check information, authenticates the TEE server based on the server identity information after the verification passes, and decrypts the check information by using the device private key and verifies the check information after the authentication passes.
12. The method of claim 8, wherein the TEE server generates a scene key and scene content, and sends the scene key and the scene content to the TEE module through the encrypted channel, comprising: The TEE server encrypts the scene key and the scene content by using the communication key, and sends the encrypted scene key and the encrypted scene content to the TEE module through the TEE client APP; The TEE module decrypts the received encrypted scene key and encrypted scene content by using the communication key to obtain the scene key and the scene content.
13. The method of claim 12, wherein the TEE server sends anti-replay information signed by using the device public key when sending the scene key and the scene content through the encrypted channel; and the TEE module decrypts the scene key and the scene content by using the device private key, and verifies the anti-replay information by using the device private key, and trusts the scene key and the scene content after the verification passes.
14. A terminal device comprising a TEE module and a TEE client APP, wherein the device private key is stored in the TEE module; and the terminal device implements the trusted root implementation method based on the trusted execution environment when interacting with the TEE server, as claimed in any one of claims 1 to 7.
15. A TEE server for interacting with a terminal device to implement the trusted root implementation method based on the trusted execution environment, as claimed in any one of claims 8 to 13.
16. A communication system comprising: A terminal device and a TEE server; the device private key is stored in the TEE module of the terminal device, and the TEE client APP is deployed in the terminal device; The terminal device and the TEE server interact to implement the trusted root implementation method based on the trusted execution environment, the method comprising: The TEE client APP obtains the device private key stored in the TEE module, and sends the device private key to the TEE server; The TEE server performs key negotiation with the TEE module through the TEE client APP based on the device private key and the pre-stored device public key, and builds an encrypted channel between the TEE server and the TEE module based on the communication key; the device public key matches the device private key; The TEE server generates a scene key and scene content, and sends the scene key and the scene content to the TEE module through the encrypted channel.
17. A privacy computing method, applicable to a terminal device, wherein a TEE client APP is deployed in the terminal device; a TEE module and the TEE client APP of the terminal device both store a scene key and scene content, and the scene key and the scene content are obtained according to the method of any one of claims 1 to 7. When the TEE module interacts with a third-party APP installed in the terminal device, a corresponding scene key is selected based on corresponding scene content and sent to the TEE client APP to establish a secure communication with the TEE client APP, and interaction data with the third-party APP is transmitted through the TEE client APP.
18. A computer readable storage medium, having a computer program stored thereon, wherein the computer program is executed by a processor to implement the method of any one of claims 1 to 7, or the method of any one of claims 8 to 13.
19. An electronic device, comprising: one or more processors; and a memory associated with the one or more processors, the memory being configured to store program instructions, which, when read and executed by the one or more processors, implement the method of any one of claims 1 to 7, or the method of any one of claims 8 to 13.
Citation Information
Patent Citations
Service processing method and device based on trusted execution environment
CN111181720A
Key management and service processing method, device and system
CN114257382A
Secret-related information maintenance method and device, equipment and storage medium
CN116244750A
Data processing method, device and equipment and readable storage medium
CN116781292A
Trusted root implementation method based on trusted execution environment and communication system
CN118473654A
Cited By
Full-link data security protection system and method based on trusted root
CN121239499A
A trusted root-based full-link data security protection system and method
CN121239499B
Large model service security verification method and device, medium, equipment and product
CN122027366A