Data transmission method and device based on trusted execution environment, medium, equipment and product
By determining the trustworthiness of both communicating parties before data transmission and performing encryption and signature processing in a trusted execution environment, the security problem of data transmission in a distributed service architecture is solved, and secure and reliable data transmission between different trusted execution environments is achieved.
Patent Information
- Application Number
- CN202510977622.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-15
- Publication Date
- 2025-10-17
AI Technical Summary
In a multi-node, clustered distributed service architecture, how can user data be securely transmitted to the target computing cluster, ensuring the security and reliability of data transmission, especially when the trusted execution environments deployed by the two communicating parties are inconsistent?
Before data transmission, it is necessary to determine whether the two communicating parties are trustworthy, and to ensure the security of data transmission through encryption and signature mechanisms, including generating and verifying signatures in a trusted execution environment, and ensuring that the data is decrypted at the trusted end.
It enables secure and reliable data transmission between trusted execution environments, improves the applicability of data transmission, supports scenarios where both communicating parties deploy trusted execution environments or only one party deploys a trusted execution environment, and enhances the security and reliability of data transmission.
Smart Images

Figure CN120811673A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of data security, in particular, to a data transmission method and device based on a trusted execution environment, a medium, equipment and product. BACKGROUND
[0002] With the increasing demand for large-scale confidential computing, the structure of confidential computing services is becoming more and more complex, and multi-node, clustered distributed service architecture has gradually become a standard for confidential computing business scenarios, which has brought the problem of how to more securely transmit user (or a computing node) data to a target computing cluster. SUMMARY
[0003] This summary is provided to introduce a selection of concepts that are further described below in the detailed description. This summary is not intended to identify key or essential features of the claimed subject matter, nor is it used to limit the scope of the claimed subject matter's scope.
[0004] In a first aspect, the present disclosure provides a data transmission method based on a trusted execution environment, applied to a first end, comprising:
[0005] Before sending first data to a second end, determining whether the second end is trusted; wherein the second end is deployed in a first trusted execution environment;
[0006] If the second end is trusted, the first data is encrypted to obtain ciphertext data, and a signature is generated according to the identity of the first end;
[0007] The ciphertext data and the signature are sent to the second end; wherein the second end is used to determine whether the first end is trusted according to the signature, and decrypt the ciphertext data when the first end is trusted.
[0008] In a second aspect, the present disclosure provides a data transmission method based on a trusted execution environment, applied to a second end, wherein the second end is deployed in a first trusted execution environment, comprising:
[0009] In response to receiving ciphertext data and a signature sent by a first end, determining whether the first end is trusted according to the signature; the first end is used to encrypt first data to obtain the ciphertext data when the second end is trusted, generate the signature according to the identity of the first end, and send the ciphertext data and the signature to the second end;
[0010] Decrypt the ciphertext data when the first end is trusted.
[0011] In a third aspect, the present disclosure provides a data transmission device based on a trusted execution environment, applied to a first end, comprising:
[0012] a first determining module configured to determine whether a second end is trusted before sending first data to the second end, wherein the second end is deployed in a first trusted execution environment;
[0013] an encryption module configured to encrypt the first data to obtain ciphertext data and generate a signature according to an identifier of the first end if the second end is trusted;
[0014] a first sending module configured to send the ciphertext data and the signature to the second end, wherein the second end is configured to determine whether the first end is trusted according to the signature and decrypt the ciphertext data if the first end is trusted.
[0015] In a fourth aspect, the present disclosure provides a data transmission device based on a trusted execution environment, applied to a second end, wherein the second end is deployed in a first trusted execution environment, comprising:
[0016] a second determining module configured to determine whether a first end is trusted according to a signature in response to receiving ciphertext data and the signature sent by the first end, wherein the first end is configured to encrypt first data to obtain the ciphertext data, generate the signature according to an identifier of the first end, and send the ciphertext data and the signature to the second end if the second end is trusted;
[0017] a decryption module configured to decrypt the ciphertext data if the first end is trusted.
[0018] In a fifth aspect, the present disclosure provides a computer readable medium having a computer program stored thereon, wherein the computer program is executed by a processing device to implement the steps of the data transmission method based on a trusted execution environment provided in the first aspect of the present disclosure, or to implement the steps of the data transmission method based on a trusted execution environment provided in the second aspect of the present disclosure.
[0019] In a sixth aspect, the present disclosure provides an electronic device comprising: a storage device having a computer program stored thereon; and a processing device configured to execute the computer program in the storage device to implement the steps of the data transmission method based on a trusted execution environment provided in the first aspect of the present disclosure, or to implement the steps of the data transmission method based on a trusted execution environment provided in the second aspect of the present disclosure.
[0020] In a seventh aspect, the present disclosure provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the data transmission method based on a trusted execution environment provided in the first aspect of the present disclosure, or implements the steps of the data transmission method based on a trusted execution environment provided in the second aspect of the present disclosure.
[0021] In the above technical solution, the first end needs to determine whether the second end deployed in the trusted execution environment is trusted before sending data to the second end, and sends the ciphertext data and the signature generated based on the identifier of the first end to the second end when the second end is trusted; the second end, after receiving the signature and the ciphertext data sent by the first end, first verifies whether the first end is trusted according to the signature, and decrypts the ciphertext data when the first end is trusted. In this way, the encryption transmission and post-transmission decryption of data can be completed on the premise that the first end and the second end trust each other, so that the data transmission between the first end and the second end is more secure and reliable, thereby realizing the confidential computing service. In addition, the above data transmission method based on a trusted execution environment not only supports the scenario where both communication parties deploy a trusted execution environment (i.e., the first end deploys a trusted execution environment), but also supports the scenario where only one of the communication parties deploys a trusted execution environment (i.e., the first end does not deploy a trusted execution environment), thereby improving the applicability of the data transmission method.
[0022] Other features and advantages of the present disclosure will be described in detail in the following detailed description section. BRIEF DESCRIPTION OF DRAWINGS
[0023] The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings in which:
[0024] Figure 1 is a flowchart of a data transmission method based on a trusted execution environment applied to a first end according to an exemplary embodiment.
[0025] Figure 2 is a schematic diagram of a trusted communication link according to an exemplary embodiment.
[0026] Figure 3 is a process schematic diagram of a data transmission method based on a trusted execution environment according to an exemplary embodiment.
[0027] Figure 4 is a flowchart of a data transmission method based on a trusted execution environment applied to a second end according to an exemplary embodiment.
[0028] Figure 5 is a block diagram of a trusted execution environment based data transmission apparatus applied to a first end according to an exemplary embodiment.
[0029] Figure 6 is a block diagram of a trusted execution environment based data transmission apparatus applied to a second end according to an exemplary embodiment.
[0030] Figure 7 is a structural schematic diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0031] Embodiments of the present disclosure will be described more fully hereinafter with reference to the accompanying drawings. While several embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms and should not be construed as being limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and fully convey the scope of the present disclosure to those skilled in the art. It should be understood that the drawings and embodiments of the present disclosure are only for illustrative purposes and are not intended to limit the scope of protection of the present disclosure.
[0032] It should be understood that each step recited in the method embodiments of the present disclosure can be executed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the execution of the steps shown. The scope of the present disclosure is not limited in this respect.
[0033] The term “comprising” and variations thereof as used herein are used inclusively, i.e., “comprising, but not limited to.” The term “based on” is “based, at least in part, on.” The term “one embodiment” means “at least one embodiment”; the term “another embodiment” means “at least one additional embodiment”; the term “some embodiments” means “at least some embodiments.” Related terms are defined in the description that follows.
[0034] It should be noted that the terms “first”, “second”, and the like in the present disclosure are merely used to distinguish different devices, modules or units, and do not imply the order or interdependence of the functions performed by these devices, modules or units.
[0035] It should be noted that the terms “one”, “multiple” in the present disclosure are illustrative and not limiting, and those skilled in the art should understand that “one or more” should be understood unless otherwise explicitly stated in the context.
[0036] The names of the messages or information exchanged between the plurality of devices in the embodiments of the present disclosure are merely for illustrative purposes, and are not intended to limit the scope of the messages or information.
[0037] It can be understood that, before using the technical solutions disclosed in the embodiments of the present disclosure, the type of information involved in the present disclosure, the use range, the use scenario, etc. should be informed to the relevant user and the authorization of the relevant user should be obtained through appropriate means according to relevant laws and regulations, wherein the relevant user can include any type of right subject, such as an individual, an enterprise, or a group.
[0038] For example, in response to receiving the active request of the user, the prompt information is sent to the relevant user to explicitly prompt the relevant user that the operation requested to be performed will need to obtain and use the information of the relevant user, so that the relevant user can voluntarily choose whether to provide the information to the software or hardware such as the electronic device, the application program, the server or the storage medium, etc. performing the operation of the technical solutions of the present disclosure according to the prompt information.
[0039] As an optional but non-limiting implementation manner, in response to receiving the active request of the relevant user, the prompt information can be sent to the relevant user in the form of a pop-up window, and the prompt information can be presented in the form of text in the pop-up window. In addition, the pop-up window can also carry selection controls for the user to select "agree" or "disagree" to provide information to the electronic device.
[0040] It can be understood that the above notification and user authorization process is only illustrative and does not limit the implementation manner of the present disclosure, and other manners meeting the relevant laws and regulations can also be applied to the implementation manner of the present disclosure.
[0041] It can be understood that the data involved in the present technical solution (including but not limited to the data itself, the obtaining, use, storage or deletion of the data) should comply with the requirements of the relevant laws and regulations and the relevant provisions.
[0042] Figure 1 is a flowchart of a trusted execution environment-based data transmission method applied to a first end according to an exemplary embodiment. As shown in Figure 1 The trusted execution environment-based data transmission method applied to the first end can include the following S101-S103.
[0043] In S101, before sending the first data to the second end, it is determined whether the second end is trusted, and the second end is deployed in the first trusted execution environment.
[0044] In the present disclosure, a Trusted Execution Environment (TEE) is a secure area within a Central Processing Unit (CPU) that runs in a separate environment and in parallel with an operating system. The CPU ensures that the confidentiality and integrity of code and data in the TEE are protected. By using both hardware and software to protect data and code, the TEE is more secure than the operating system. A trusted application running in the TEE can access the full functionality of the device's main processor and memory, while hardware isolation protects these components from user-installed applications running in the main operating system (i.e., the normal operating system, Normal OS).
[0045] In one possible implementation, the first end can be a terminal, and the second end can be a service node in the cloud.
[0046] In another implementation, the first end can be a service node in a computing cluster, and the second end can be another service node in the computing cluster.
[0047] Before data communication, the first end and the second end need to be mutually trusted, which means that a verification process is performed on whether the identity of each other is trusted before the two ends communicate with each other. Figure 2 As shown, in order to ensure data security, the first end and the second end need to perform identity trust verification and transmit and communicate with the ciphertext data during data communication.
[0048] In S102, if the second end is trusted, the first data is encrypted to obtain ciphertext data, and a signature is generated according to the identity of the first end.
[0049] In S103, the ciphertext data and the signature are sent to the second end, and the second end is used to determine whether the first end is trusted according to the signature, and to decrypt the ciphertext data when the first end is trusted.
[0050] In the present disclosure, if the second end is trusted, the encrypted transmission of data can be performed. Meanwhile, in order to facilitate the second end to verify the trustworthiness of the first end, a signature can be generated according to the identity (for example, ID) of the first end, and the signature is sent to the second end together with the ciphertext data; as Figure 3As shown, after receiving the signature and ciphertext data, the second end first verifies the credibility of the first end based on the signature (i.e., verifies the signature), and only when it determines that the first end is trustworthy based on the signature, does it decrypt the ciphertext data to obtain the plaintext data, i.e., the first data, and then perform confidential computing based on the first data; if the second end determines that the first end is untrustworthy based on the signature, it will no longer decrypt the ciphertext data, i.e., it will refuse to provide confidential computing services to the first end, thereby avoiding leakage of its own data.
[0051] If the second end is not trustworthy, the data transmission is terminated. At this time, indication information for indicating that the second end is not trustworthy may be generated.
[0052] Among them, the second end can pre-generate a second key pair including a second public key and a second private key, and share the second public key with the first end. In this way, the first end can use the second public key to encrypt the first data to obtain ciphertext data. Subsequently, when the second end determines that the first end is trustworthy, it can use the second private key to decrypt the ciphertext data to obtain the first data.
[0053] In the above technical solution, before sending data to the second end, the first end first needs to determine whether the second end deployed in the trusted execution environment is trustworthy; and when the second end is trustworthy, the ciphertext data and the signature generated based on the identifier of the first end are sent to the second end; after receiving the signature and ciphertext data sent by the first end, the second end first verifies whether the first end is trustworthy based on the signature, and decrypts the ciphertext data when the first end is trustworthy. In this way, the encrypted transmission and post-transmission decryption of the data can be completed under the premise of mutual trust between the first end and the second end, making the data transmission between the first end and the second end more secure and reliable, thereby realizing confidential computing services. In addition, the above-mentioned data transmission method based on the trusted execution environment not only supports the scenario where both communicating parties deploy the trusted execution environment (i.e., the first end deploys the trusted execution environment), but also supports the scenario where only one of the communicating parties deploys the trusted execution environment (i.e., the first end does not deploy the trusted execution environment), thereby improving the applicability of the data transmission method.
[0054] The following describes in detail the specific implementation of determining whether the second end is trustworthy in S101. Specifically, this can be achieved through various implementations. In one implementation, the first end can perform a trustworthiness verification on the second end before each data transmission. Specifically, S101 can include the following steps (a1) and (a2).
[0055] Step (a1): Send a remote certification request to the second end.
[0056] The second end is used to generate a remote attestation report based on the remote attestation request and send the remote attestation report to the first end.
[0057] Step (a2): Based on the remote attestation report received from the second end, the second end is subjected to credibility verification to determine whether the second end is credible.
[0058] like Figure 3 As shown, the second end includes a remote attestation component. Before sending the first data to the second end, the first end can first send a remote attestation request to the remote attestation component of the second end; after receiving the remote attestation request, the remote attestation component can measure the second end, obtain corresponding measurement values, and include these measurement values in a remote attestation report and send it to the first end; after receiving the remote attestation report, the first end can compare the measurement values in the remote attestation report with the measurement reference value of the second end. If the two are consistent, the second end is determined to be trustworthy; otherwise, the second end is determined to be untrustworthy.
[0059] In the above embodiment, the first end performs credibility verification on the second end each time before sending data, which can ensure the real-time credibility of the second end.
[0060] In another embodiment, during data transmission with the second end, the first end may verify the credibility of the second end at a preset time interval. Specifically, the above S101 may include the following steps (b1) to (b4).
[0061] Step (b1): Determine whether the time interval between the current moment and the first moment reaches a preset time interval.
[0062] In the present disclosure, the first moment is the moment when the first end most recently performed credibility verification on the second end. If the time interval between the current moment and the first moment reaches a preset time interval, or the first end has not performed credibility verification on the second end, then before sending the first data, it is necessary to perform credibility verification on the second end. In this case, the following steps (b2) and (b3) can be executed. If the time interval between the current moment and the first moment does not reach the preset time interval, it indicates that the first end has recently performed credibility verification on the second end. In this case, the verification result of the most recent credibility verification on the second end can be directly reused to determine whether the second end is trustworthy, that is, the following step (b4) can be executed.
[0063] Step (b2): Send a remote certification request to the second end.
[0064] The second end is used to generate a remote attestation report based on the remote attestation request and send the remote attestation report to the first end.
[0065] Step (b3): Based on the remote attestation report received from the second end, the second end is subjected to credibility verification to determine whether the second end is credible.
[0066] Step (b4): determining whether the second end is trusted according to the verification result of the last time the first end performs the trust verification on the second end.
[0067] Specifically, if the verification result of the last time the first end performs the trust verification on the second end is that the second end is trusted, it is directly determined that the second end is trusted, and if the verification result of the last time the first end performs the trust verification on the second end is that the second end is not trusted, it is directly determined that the second end is not trusted.
[0068] In the above embodiment, the first end performs the trust verification on the second end at a preset time interval during the data transmission with the second end, which can reduce the data communication amount and data processing amount between the two ends.
[0069] The trust verification of the first end on the second end can be performed in a non-TEE environment, and in order to avoid data leakage of the second end, the first end can perform the trust verification on the second end in a TEE environment. Specifically, as shown in Figure 3 The second TEE is deployed in the first end; at this time, the above step (a2) can include: performing the trust verification on the second end according to the remote attestation report in the second TEE.
[0070] As shown in Figure 3 The first end includes a first application deployed in a non-TEE and a client deployed in a second TEE, and the second end includes a server and a remote attestation component, wherein the server corresponds to the client, and the first end can send a remote attestation request to the remote attestation component of the second end before sending the first data to the second end; after receiving the remote attestation request, the remote attestation component can measure the second end to obtain corresponding measurement values, and send the measurement values in a remote attestation report to the server in the second end; since the TEE of the first end does not have communication capability, after obtaining the remote attestation report, the server in the second end can send the remote attestation report to the first application in the non-TEE of the first end first; after receiving the remote attestation report, the first application can forward it to the client in the second TEE, wherein the client is installed with a secure operating system (Secure OS); after receiving the remote attestation report, the client can perform the trust verification on the second end according to the remote attestation report.
[0071] The following detailed description is made for the specific implementation of the above S102 of encrypting the first data to obtain ciphertext data and generating a signature according to the identity of the first end. In one embodiment, the first end can encrypt and generate a signature for the first data in a non-TEE, that is, the first application in the non-TEE uses the second public key to encrypt the first data to obtain ciphertext data, and generates a signature according to the identity of the first end through the first application.
[0072] To avoid the first data being cracked due to the second public key being leaked, as shown in Figure 3 The second TEE can be deployed on the first end, and the second public key can be stored in the second TEE by a key management service in the client in the second TEE, that is, the second public key is stored in the second TEE. Specifically, S102 can include the following steps:
[0073] The first data is encrypted by the second public key in the second TEE to obtain ciphertext data, and a signature is generated according to the identifier in the second TEE; and the second end is configured to decrypt the ciphertext data by the second private key when the first end is trusted.
[0074] As shown in Figure 3 The first end includes a first application deployed in a non-TEE and a client deployed in a second TEE, and the second end includes a server, and the first data is encrypted by the second public key in the second TEE to obtain ciphertext data, and a signature is generated according to the identifier in the second TEE, which can include the following steps: the first data is encrypted by the second public key in the client to obtain ciphertext data, and a signature is generated according to the identifier in the client; and the ciphertext data and the signature are sent to the first application by the client.
[0075] S103 can include the following steps:
[0076] The ciphertext data and the signature are sent to the server by the first application.
[0077] Specifically, as shown in Figure 3 The first application in the non-TEE of the first end can send a data encryption request to the client in the second TEE, wherein the data encryption request includes the first data; after receiving the data encryption request, the client in the second TEE encrypts the first data by a data encryption service in the client by using the second public key to obtain ciphertext data if the second end is trusted; at the same time, a signature is generated according to the identifier of the first end by a signature service in the client; since the TEE of the first end does not have communication capability, the client can send the ciphertext data and the signature to the first application in the non-TEE of the first end after generating the ciphertext data and the signature, so that the first application forwards the ciphertext data and the signature to the server in the second end.
[0078] In a possible implementation, as shown in Figure 3 The first end includes a first application deployed in a non-TEE and a client deployed in a second TEE, and the second end includes a server, and S102 can include the following two steps:
[0079] The first data is encrypted by the client to obtain ciphertext data, and a signature is generated according to the identifier of the first end by the client;
[0080] The ciphertext data and the signature are sent to the first application through the client.
[0081] The above S103 may include:
[0082] The encrypted data and signature are sent to the server through the first application.
[0083] Specifically, if Figure 3 As shown, the second public key can be saved by the key management service in the client in the second TEE, that is, the second public key is saved in the second TEE, and the first application in the non-TEE of the first end can send a data encryption request to the client in the second TEE, wherein the data encryption request includes the first data; after receiving the data encryption request, the client in the second TEE uses the second public key to encrypt the first data through the data encryption service in the client to obtain ciphertext data if the second end is trustworthy; at the same time, a signature is generated according to the identifier of the first end through the signature service in the client; since the TEE of the first end does not have communication capabilities, after generating the ciphertext data and signature, the client can send it to the first application in the non-TEE of the first end, so that the first application forwards the ciphertext data and signature to the server in the second end.
[0084] The following describes in detail the specific implementation of generating a signature based on the identifier of the first end in S103. Specifically, this can be achieved through various implementations. In one implementation, the signature can be generated using asymmetric encryption. Specifically, the identifier of the first end can be encrypted using the first private key to obtain the signature.
[0085] The first end pre-generates a first key pair including a first public key and a first private key, and shares the first public key with the second end. The second end is used to decrypt the signature using the first public key and determine whether the first end is trustworthy based on the decryption result.
[0086] like Figure 3 As shown, the first public key is managed by the key management service on the second end. The first end encrypts the identifier using the first private key to obtain a signature, which is then sent to the second end. Upon receiving the signature, the second end can decrypt the signature using the first public key. If the decryption result matches the identifier of the first end, the first end is deemed acceptable. If the decryption result does not match the identifier of the first end, the first end is deemed untrustworthy.
[0087] In another embodiment, the signature can be generated by a hash operation. Specifically, the first salt value and the identifier can be concatenated to obtain first concatenated data, wherein the first end and the second end pre-agreed on the first salt value; then, the first concatenated data can be hashed using a first hash algorithm to obtain the signature.
[0088] The first end and the second end pre-agree the first hash algorithm; and the second end is configured to determine whether the first end is trustworthy based on the first salt value, the first hash algorithm and the identity. The first salt value (Salt) can be a random string pre-agreed between the first end and the second end, used to increase the difficulty of cracking the signature.
[0089] When generating the signature based on the identity of the first end, the first end can first splice the first salt value pre-agreed with the second end with the identity of the first end to obtain first spliced data, and then perform hash operation on the first spliced data by using the first hash algorithm pre-agreed with the second end to obtain the signature. In this way, after receiving the signature, the second end can reproduce the signature in the same way, and determine whether the first end is trustworthy based on the comparison result of the reproduced signature and the received signature.
[0090] Specifically, after receiving the signature, the second end can first splice the first salt value pre-agreed with the first end with the identity of the first end to obtain second spliced data, and then perform hash operation on the second spliced data by using the first hash algorithm pre-agreed with the first end to obtain the first hash value, i.e., the reproduced hash value; if the first hash value is consistent with the received signature, it is determined that the first end is trustworthy, and if the first hash value is inconsistent with the received signature, it is determined that the first end is untrustworthy.
[0091] Figure 4 is a flowchart of a data transmission method based on a trusted execution environment applied to a second end according to an example embodiment, wherein the second end is deployed in a first trusted execution environment. As shown in Figure 4 the data transmission method based on the trusted execution environment applied to the second end can include the following S201 and S202.
[0092] In S201, in response to receiving the ciphertext data and the signature sent by the first end, it is determined whether the first end is trustworthy according to the signature, wherein the first end is configured to encrypt the first data to obtain the ciphertext data when the second end is trustworthy, generate a signature based on the identity of the first end, and send the ciphertext data and the signature to the second end.
[0093] In S202, the ciphertext data is decrypted when the first end is trustworthy.
[0094] In the technical solution, before sending data to the second end, the first end needs to determine whether the second end deployed in the trusted execution environment is trusted, and when the second end is trusted, the ciphertext data and the signature generated based on the identity of the first end are sent to the second end; after receiving the signature and the ciphertext data sent by the first end, the second end first verifies whether the first end is trusted according to the signature, and when the first end is trusted, the ciphertext data is decrypted. In this way, the encryption transmission and post-transmission decryption of data can be completed on the premise of mutual trust between the first end and the second end, so that the data transmission between the first end and the second end is more secure and reliable, thereby realizing the confidential computing service. In addition, the data transmission method based on the trusted execution environment not only supports the scenario that both communication parties deploy the trusted execution environment (that is, the first end deploys the trusted execution environment), but also supports the scenario that only one of the communication parties deploys the trusted execution environment (that is, the first end does not deploy the trusted execution environment), thereby improving the applicability of the data transmission method.
[0095] Optionally, the data transmission method based on the trusted execution environment applied to the second end further comprises:
[0096] generating a remote attestation report based on the remote attestation request in response to receiving the remote attestation request sent by the first end;
[0097] sending the remote attestation report to the first end, wherein the first end is configured to verify the trustworthiness of the second end according to the remote attestation report received from the second end to determine whether the second end is trusted.
[0098] Optionally, determining whether the first end is trusted according to the signature comprises:
[0099] decrypting the signature by using the first public key to obtain a decryption result; wherein the first end pre-generates a first key pair including a first public key and a first private key, and shares the first public key with the second end, and the signature is obtained by encrypting the identity by using the first private key by the first end;
[0100] if the decryption result is consistent with the identity, it is determined that the first end is trusted.
[0101] Optionally, determining whether the first end is trusted according to the signature comprises:
[0102] splicing the first salt value with the identity to obtain second splicing data; wherein the first end and the second end have pre-agreed on the first salt value;
[0103] performing a hash operation on the second splicing data by using a first hash algorithm to obtain a first hash value; wherein the first end and the second end have pre-agreed on the first hash algorithm;
[0104] if the first hash value is consistent with the signature, it is determined that the first end is trusted.
[0105] Optionally, the second end is pre-generated with a second key pair including a second public key and a second private key, and shares the second public key with the first end, which is used to encrypt the first data using the second public key to obtain ciphertext data when the second end is trusted;
[0106] decrypting the ciphertext data, comprising:
[0107] decrypting the ciphertext data using the second private key.
[0108] The specific implementation manners of each step in the data transmission method based on the trusted execution environment applied to the second end according to the embodiments of the present disclosure have been described in detail in the data transmission method based on the trusted execution environment applied to the first end according to the embodiments of the present disclosure, and will not be repeated here.
[0109] Figure 5 is a block diagram of a data transmission apparatus based on a trusted execution environment applied to a first end according to an example embodiment. As shown in Figure 5 the data transmission apparatus based on the trusted execution environment applied to the first end 300 comprises:
[0110] a first determination module 301 configured to determine whether a second end is trusted before sending first data to the second end, wherein the second end is deployed in a first trusted execution environment;
[0111] an encryption module 302 configured to encrypt the first data to obtain ciphertext data and generate a signature according to an identifier of the first end if the second end is trusted;
[0112] a first sending module 303 configured to send the ciphertext data and the signature to the second end, wherein the second end is configured to determine whether the first end is trusted according to the signature, and decrypt the ciphertext data when the first end is trusted.
[0113] In the technical solution, before sending data to the second end, the first end needs to determine whether the second end deployed in the trusted execution environment is trusted, and when the second end is trusted, the first end sends the ciphertext data and the signature generated based on the identity of the first end to the second end; after receiving the signature and the ciphertext data sent by the first end, the second end first verifies whether the first end is trusted according to the signature, and when the first end is trusted, the second end decrypts the ciphertext data. In this way, the encryption transmission and post-transmission decryption of data can be completed on the premise that the first end and the second end trust each other, so that the data transmission between the first end and the second end is more secure and reliable, and the confidential computing service is realized. In addition, the data transmission method based on the trusted execution environment not only supports the scenario that both communication parties deploy the trusted execution environment (that is, the first end deploys the trusted execution environment), but also supports the scenario that only one of the communication parties deploys the trusted execution environment (that is, the first end does not deploy the trusted execution environment), thereby improving the applicability of the data transmission method.
[0114] Optionally, the first determining module 301 comprises:
[0115] a first sending sub-module, configured to send a remote attestation request to the second end; wherein the second end is configured to generate a remote attestation report based on the remote attestation request, and send the remote attestation report to the first end;
[0116] a trustworthiness verification sub-module, configured to perform trustworthiness verification on the second end according to the remote attestation report received from the second end, to determine whether the second end is trusted.
[0117] Optionally, the first determining module 301 comprises:
[0118] a first determining sub-module, configured to determine whether a time interval between a current time and a first time reaches a preset time interval; wherein the first end performs trustworthiness verification on the second end according to the preset time interval during data transmission with the second end, and the first time is a time when the first end last performed trustworthiness verification on the second end;
[0119] a second sending sub-module, configured to send a remote attestation request to the second end if the time interval reaches the preset time interval or the first end has not performed trustworthiness verification on the second end; wherein the second end is configured to generate a remote attestation report based on the remote attestation request, and send the remote attestation report to the first end;
[0120] a trustworthiness verification sub-module, configured to perform trustworthiness verification on the second end according to the remote attestation report received from the second end, to determine whether the second end is trusted.
[0121] Optionally, the first determining module 301 further comprises:
[0122] a second determining sub-module, configured to determine whether the second end is trustworthy according to a verification result of the last time that the first end performs trustworthiness verification on the second end, if the time interval does not reach the preset time interval.
[0123] Optionally, the first end is deployed with a second trusted execution environment.
[0124] The trustworthiness verification sub-module is configured to perform trustworthiness verification on the second end according to the remote attestation report in the second trusted execution environment.
[0125] Optionally, the encryption module 302 is configured to encrypt the identity by using a first private key to obtain the signature; wherein the first end is previously generated with a first key pair comprising a first public key and the first private key, and shares the first public key with the second end; the second end is configured to decrypt the signature by using the first public key, and determines whether the first end is trustworthy according to a decryption result.
[0126] Optionally, the encryption module 302 comprises:
[0127] a first concatenating sub-module, configured to concatenate a first salt value with the identity to obtain first concatenated data; wherein the first end and the second end are previously agreed on the first salt value;
[0128] a first hash operation sub-module, configured to perform hash operation on the first concatenated data by using a first hash algorithm to obtain the signature; wherein the first end and the second end are previously agreed on the first hash algorithm; the second end is configured to determine whether the first end is trustworthy based on the first salt value, the first hash algorithm and the identity.
[0129] Optionally, the first end is deployed with a second trusted execution environment, and the second end is previously generated with a second key pair comprising a second public key and a second private key, and shares the second public key with the first end, wherein the second public key is saved in the second trusted execution environment;
[0130] The encryption module 302 is configured to encrypt the first data by using the second public key in the second trusted execution environment to obtain the ciphertext data, and generate the signature according to the identity in the second trusted execution environment; wherein the second end is configured to decrypt the ciphertext data by using the second private key when the first end is trustworthy.
[0131] Optionally, the first end comprises a first application deployed in a non-trusted execution environment and a client deployed in a second trusted execution environment, and the second end comprises a server;
[0132] The encryption module 302 comprises:
[0133] An encryption sub-module, through which the user encrypts the first data through the client to obtain the ciphertext data, and generates the signature according to the identity through the client;
[0134] A third sending sub-module, configured to send the ciphertext data and the signature to the first application through the client;
[0135] The first sending module 303 is configured to send the ciphertext data and the signature to the server through the first application.
[0136] Figure 6 is a block diagram of a trusted execution environment-based data transmission apparatus applied to a second end according to an exemplary embodiment, wherein the second end is deployed in a first trusted execution environment. As shown in Figure 6 The trusted execution environment-based data transmission apparatus applied to the second end 400 comprises:
[0137] A second determining module 401, configured to determine whether the first end is trusted according to the signature in response to receiving the ciphertext data and the signature sent by the first end; the first end is configured to encrypt first data to obtain the ciphertext data, generate the signature according to the identity of the first end, and send the ciphertext data and the signature to the second end when the second end is trusted;
[0138] A decryption module 402, configured to decrypt the ciphertext data when the first end is trusted.
[0139] In the technical solution, before sending data to the second end, the first end needs to determine whether the second end deployed in the trusted execution environment is trusted, and when the second end is trusted, the ciphertext data and the signature generated based on the identifier of the first end are sent to the second end; after receiving the signature and the ciphertext data sent by the first end, the second end first verifies whether the first end is trusted according to the signature, and when the first end is trusted, the ciphertext data is decrypted. In this way, the encryption transmission and post-transmission decryption of data can be completed on the premise that the first end and the second end trust each other, so that the data transmission between the first end and the second end is more secure and reliable, and the confidential computing service is realized. In addition, the data transmission method based on the trusted execution environment not only supports the scenario that both communication parties deploy the trusted execution environment (that is, the first end deploys the trusted execution environment), but also supports the scenario that only one of the communication parties deploys the trusted execution environment (that is, the first end does not deploy the trusted execution environment), thereby improving the applicability of the data transmission method.
[0140] Optionally, the trusted execution environment-based data transmission apparatus 400 applied to the second end further includes:
[0141] The generating module is configured to generate a remote attestation report based on the remote attestation request in response to receiving the remote attestation request sent by the first end.
[0142] The second sending module is configured to send the remote attestation report to the first end, where the first end is configured to perform trust verification on the second end according to the remote attestation report received from the second end, to determine whether the second end is trusted.
[0143] Optionally, the second determining module 401 includes:
[0144] The decryption submodule is configured to decrypt the signature by using the first public key to obtain a decryption result, where the first end has previously generated a first key pair including the first public key and a first private key, and has shared the first public key with the second end, and the signature is obtained by encrypting the identifier by using the first private key by the first end.
[0145] The third determining submodule is configured to determine that the first end is trusted if the decryption result is consistent with the identifier.
[0146] Optionally, the second determining module 401 includes:
[0147] The second splicing submodule is configured to splice the first salt value and the identifier to obtain second splicing data, where the first end and the second end have previously agreed on the first salt value.
[0148] a second hash operation sub-module, configured to perform a hash operation on the second spliced data by using a first hash algorithm to obtain a first hash value, wherein the first end and the second end have agreed on the first hash algorithm in advance;
[0149] a fourth determination sub-module, configured to determine that the first end is trusted if the first hash value is consistent with the signature.
[0150] Optionally, the second end has a second key pair including a second public key and a second private key generated in advance, and the second public key is shared with the first end, and the first end is configured to encrypt the first data by using the second public key to obtain the ciphertext data when the second end is trusted;
[0151] the decryption module is configured to decrypt the ciphertext data by using the second private key.
[0152] In addition, the present disclosure also provides a computer readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the above-mentioned data transmission method based on a trusted execution environment applied to a first end provided by the present disclosure, or the steps of the above-mentioned data transmission method based on a trusted execution environment applied to a second end provided by the present disclosure.
[0153] The present disclosure also provides a computer program product comprising a computer program, which, when executed by a processor, implements the steps of the above-mentioned data transmission method based on a trusted execution environment applied to a first end provided by the present disclosure, or the steps of the above-mentioned data transmission method based on a trusted execution environment applied to a second end provided by the present disclosure.
[0154] Reference will now be made to the following description Figure 7 which shows a structural schematic diagram of an electronic device (e.g., a terminal or a server) 600 suitable for implementing embodiments of the present disclosure. The terminal in the embodiments of the present disclosure can include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Personal Computers), PMPs (Portable Multimedia Players), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), and the like, as well as fixed terminals such as digital TVs, desktop computers, and the like. Figure 7 The electronic device shown is only an example and should not impose any limitation on the functions and use range of the embodiments of the present disclosure.
[0155] As Figure 7As shown, the electronic device 600 can include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601 that can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 602 or loaded into a random access memory (RAM) 603 from a storage device 608. Various programs and data required for the operation of the electronic device 600 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0156] Generally, the following devices can be connected to the I / O interface 605: input devices 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 608 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 609. The communication devices 609 can allow the electronic device 600 to communicate wirelessly or wired with other devices to exchange data. Although Figure 7 The electronic device 600 is shown with various devices, but it should be understood that all of the illustrated devices are not required, nor are they all required to practice or have the electronic device. More or fewer devices can alternatively be implemented.
[0157] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through the communication devices 609, or installed from the storage devices 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-described functions defined in the methods of the embodiments of the present disclosure are performed.
[0158] It should be noted that the computer-readable medium described above can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium can be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any suitable combination of the foregoing. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program used by or in connection with an instruction execution system, apparatus or device. In the disclosure, the computer-readable signal medium can include a data signal propagated in baseband or propagated as a carrier wave in a propagated data signal, in which the computer-readable program code is contained. Such a propagated data signal can take many forms, including but not limited to, an electromagnetic signal, an optical signal, or any suitable combination of the foregoing. The computer-readable signal medium can also be any computer-readable medium that can send, propagate or transfer the program for use by or in connection with an instruction execution system, apparatus or device. The program code contained in the computer-readable medium can be transmitted by any suitable medium, including but not limited to, wire, cable, RF (radio frequency), etc., or any suitable combination of the foregoing.
[0159] In some embodiments, the client, server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communications of any form or medium (e.g., a communications network). Examples of communications networks include local area networks ("LANs"), wide area networks ("WANs"), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
[0160] The computer-readable medium described above can be included in the electronic device described above; or can exist separately from the electronic device and not be assembled into the electronic device.
[0161] The computer readable medium carries one or more programs when executed by the electronic device cause the electronic device to: before sending first data to a second end, determine whether the second end is trustworthy, wherein the second end is deployed in a first trusted execution environment; if the second end is trustworthy, encrypt the first data to obtain ciphertext data, and generate a signature according to an identity of the first end; and send the ciphertext data and the signature to the second end; wherein the second end is configured to determine whether the first end is trustworthy according to the signature, and decrypt the ciphertext data if the first end is trustworthy.
[0162] Alternatively, the computer readable medium carries one or more programs when executed by the electronic device cause the electronic device to: in response to receiving ciphertext data and a signature sent by a first end, determine whether the first end is trustworthy according to the signature; the first end is configured to encrypt first data to obtain the ciphertext data, generate the signature according to an identity of the first end, and send the ciphertext data and the signature to the second end if the second end is trustworthy; and decrypt the ciphertext data if the first end is trustworthy.
[0163] Computer program code for carrying out operations of the present disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0164] The computer program product of the first aspect can include one or more non-transitory computer-readable media storing instructions that, when executed, cause one or more processors to perform the operations of the first aspect. The one or more non-transitory computer-readable media can include, for example, magnetic media such as one or more magnetic disks, magnetic tapes or cassettes; optical media such as one or more compact discs, optical discs or Blu-ray discs; magneto-optical media such as one or more floptical discs; solid state media such as one or more solid state drives or other flash memory arrays; or any suitable combination of these. The one or more non-transitory computer-readable media can be encoded with instructions that, when executed, cause one or more processors to perform the operations of the first aspect.
[0165] The modules described in the embodiments of the present disclosure can be implemented by software, or by hardware. In some cases, the name of a module does not constitute a limitation on the module itself. For example, a first sending module can also be described as a module that sends the ciphertext data and the signature to the second end.
[0166] The functions described above in the detailed description of the present disclosure can be performed at least in part by one or more hardware logic components. For example, and without limitation, illustrative types of hardware logic components that can be used include Field-programmable Gate Arrays (FPGAs), Program-specific Integrated Circuits (ASICs), Program-specific Standard Products (ASSPs), System-on-a-chip systems (SOCs), Complex Programmable Logic Devices (CPLDs), etc.
[0167] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0168] According to one or more embodiments of the present disclosure, example 1 provides a data transmission method based on a trusted execution environment, applied to a first end, comprising:
[0169] Before sending first data to a second end, determining whether the second end is trusted; wherein the second end is deployed in a first trusted execution environment;
[0170] If the second end is trusted, encrypting the first data to obtain ciphertext data, and generating a signature according to an identifier of the first end;
[0171] Sending the ciphertext data and the signature to the second end; wherein the second end is configured to determine whether the first end is trusted according to the signature, and decrypt the ciphertext data when the first end is trusted.
[0172] According to one or more embodiments of the present disclosure, example 2 provides the method of example 1, wherein the determination of whether the second end is trusted comprises:
[0173] Sending a remote attestation request to the second end; wherein the second end is configured to generate a remote attestation report based on the remote attestation request, and send the remote attestation report to the first end;
[0174] Verifying the trustworthiness of the second end according to the remote attestation report received from the second end, to determine whether the second end is trusted.
[0175] According to one or more embodiments of the present disclosure, example 3 provides the method of example 1, wherein the determination of whether the second end is trusted comprises:
[0176] Determining whether a time interval between a current time and a first time reaches a preset time interval; wherein the first end verifies the trustworthiness of the second end according to the preset time interval during data transmission with the second end, and the first time is a time when the first end last verified the trustworthiness of the second end;
[0177] If the time interval reaches the preset time interval or the first end has not verified the trustworthiness of the second end, sending a remote attestation request to the second end; wherein the second end is configured to generate a remote attestation report based on the remote attestation request, and send the remote attestation report to the first end;
[0178] Verifying the trustworthiness of the second end according to the remote attestation report received from the second end, to determine whether the second end is trusted.
[0179] According to one or more embodiments of the present disclosure, example 4 provides the method of example 3, wherein the determining whether the second end is trustworthy further comprises:
[0180] If the time interval does not reach the preset time interval, determining whether the second end is trustworthy according to a verification result of a last time when the first end verifies the trustworthiness of the second end.
[0181] According to one or more embodiments of the present disclosure, example 5 provides the method of any one of examples 2-4, wherein the first end is deployed with a second trusted execution environment;
[0182] The verifying the trustworthiness of the second end according to the remote attestation report received from the second end comprises:
[0183] The verifying the trustworthiness of the second end according to the remote attestation report in the second trusted execution environment.
[0184] According to one or more embodiments of the present disclosure, example 6 provides the method of example 1, wherein the generating the signature according to the identity of the first end comprises:
[0185] Encrypting the identity by using a first private key to obtain the signature; wherein the first end is previously generated with a first key pair including a first public key and the first private key, and shares the first public key with the second end; and the second end is used to decrypt the signature by using the first public key, and determines whether the first end is trustworthy according to the decryption result.
[0186] According to one or more embodiments of the present disclosure, example 7 provides the method of example 1, wherein the generating the signature according to the identity of the first end comprises:
[0187] Splicing a first salt value with the identity to obtain first splicing data; wherein the first end and the second end are previously agreed on the first salt value;
[0188] Hashing the first splicing data by using a first hash algorithm to obtain the signature; wherein the first end and the second end are previously agreed on the first hash algorithm; and the second end is used to determine whether the first end is trustworthy based on the first salt value, the first hash algorithm and the identity.
[0189] According to one or more embodiments of the present disclosure, example 8 provides the method of example 1, wherein the first end is deployed with a second trusted execution environment, the second end is previously generated with a second key pair including a second public key and a second private key, and shares the second public key with the first end, wherein the second public key is saved in the second trusted execution environment;
[0190] encrypting the first data to obtain ciphertext data, and generating a signature according to an identifier of the first end, comprises:
[0191] encrypting the first data by using the second public key in the second trusted execution environment to obtain the ciphertext data, and generating the signature according to the identifier in the second trusted execution environment; wherein the second end is configured to decrypt the ciphertext data by using the second private key when the first end is trusted.
[0192] According to one or more embodiments of the present disclosure, example 9 provides the method of example 1, the first end comprises a first application deployed in a non-trusted execution environment and a client deployed in a second trusted execution environment, and the second end comprises a server;
[0193] encrypting the first data to obtain ciphertext data, and generating a signature according to an identifier of the first end, comprises:
[0194] encrypting the first data by using the client to obtain the ciphertext data, and generating the signature according to the identifier by using the client;
[0195] sending the ciphertext data and the signature to the first application by using the client;
[0196] sending the ciphertext data and the signature to the second end, comprises:
[0197] sending the ciphertext data and the signature to the server by using the first application.
[0198] According to one or more embodiments of the present disclosure, example 10 provides a data transmission method based on a trusted execution environment, applied to a second end, wherein the second end is deployed in a first trusted execution environment, comprising:
[0199] in response to receiving ciphertext data and a signature sent by a first end, determining whether the first end is trusted according to the signature; the first end is configured to encrypt first data to obtain the ciphertext data, generate the signature according to an identifier of the first end, and send the ciphertext data and the signature to the second end when the second end is trusted;
[0200] decrypting the ciphertext data when the first end is trusted.
[0201] According to one or more embodiments of the present disclosure, example 11 provides the method of example 10, the method further comprises:
[0202] In response to receiving the remote attestation request sent by the first end, generating a remote attestation report based on the remote attestation request;
[0203] sending the remote attestation report to the first end, wherein the first end is configured to perform trust verification on the second end according to the remote attestation report received from the second end to determine whether the second end is trustworthy.
[0204] According to one or more embodiments of the present disclosure, example 12 provides the method of example 10, and the determining whether the first end is trustworthy according to the signature comprises:
[0205] decrypting the signature by using a first public key to obtain a decryption result, wherein the first end has previously generated a first key pair comprising the first public key and a first private key, and shared the first public key with the second end, and the signature is encrypted by the first end by using the first private key on the identity;
[0206] if the decryption result is consistent with the identity, it is determined that the first end is trustworthy.
[0207] According to one or more embodiments of the present disclosure, example 13 provides the method of example 10, and the determining whether the first end is trustworthy according to the signature comprises:
[0208] splicing a first salt value with the identity to obtain second spliced data, wherein the first end and the second end have previously agreed on the first salt value;
[0209] performing a hash operation on the second spliced data by using a first hash algorithm to obtain a first hash value, wherein the first end and the second end have previously agreed on the first hash algorithm;
[0210] if the first hash value is consistent with the signature, it is determined that the first end is trustworthy.
[0211] According to one or more embodiments of the present disclosure, example 14 provides the method of example 10, and the second end has previously generated a second key pair comprising a second public key and a second private key, and shared the second public key with the first end, and the first end is configured to encrypt the first data by using the second public key to obtain the ciphertext data when the second end is trustworthy;
[0212] the decrypting the ciphertext data comprises:
[0213] decrypting the ciphertext data by using the second private key.
[0214] According to one or more embodiments of the present disclosure, example 15 provides a data transmission apparatus based on a trusted execution environment, applied to a first end, comprising:
[0215] a first determining module configured to determine whether a second end is trusted before sending first data to the second end, wherein the second end is deployed in a first trusted execution environment;
[0216] an encrypting module configured to encrypt the first data to obtain ciphertext data and generate a signature according to an identifier of the first end if the second end is trusted;
[0217] a first sending module configured to send the ciphertext data and the signature to the second end, wherein the second end is configured to determine whether the first end is trusted according to the signature, and decrypt the ciphertext data if the first end is trusted.
[0218] According to one or more embodiments of the present disclosure, example 16 provides a data transmission apparatus based on a trusted execution environment, applied to a second end, wherein the second end is deployed in a first trusted execution environment, comprising:
[0219] a second determining module configured to determine whether a first end is trusted according to a signature in response to receiving ciphertext data and the signature sent by the first end, wherein the first end is configured to encrypt first data to obtain the ciphertext data, generate the signature according to an identifier of the first end, and send the ciphertext data and the signature to the second end if the second end is trusted;
[0220] a decrypting module configured to decrypt the ciphertext data if the first end is trusted.
[0221] According to one or more embodiments of the present disclosure, example 17 provides a computer readable medium having stored thereon a computer program, which, when executed by a processing apparatus, implements the steps of the method of any one of examples 1-14.
[0222] According to one or more embodiments of the present disclosure, example 18 provides an electronic device, comprising:
[0223] a storage apparatus having stored thereon a computer program;
[0224] a processing apparatus configured to execute the computer program in the storage apparatus to implement the steps of the method of any one of examples 1-14.
[0225] According to one or more embodiments of the present disclosure, example 19 provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the method of any one of examples 1-14.
[0226] The above description is only preferred embodiments of the present disclosure and the explanation of the principles of the applied technology. Those skilled in the art should understand that the disclosed range of the present disclosure is not limited to the technical solutions formed by the specific combinations of the above technical features, and should also cover other technical solutions formed by the above technical features or their equivalent features in any combination without departing from the above disclosed concept. For example, the technical solutions formed by the above features and the technical features disclosed in the present disclosure (but not limited to) with similar functions are replaced with each other.
[0227] In addition, although each operation is described in a particular order, this should not be understood as requiring the operations to be performed in the specific order shown or in a sequential order. In certain circumstances, multitasking and parallel processing can be advantageous. Similarly, although several implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments can also be combined in a single embodiment. Conversely, various features described in the context of a single embodiment can also be implemented separately or in any suitable subcombination.
[0228] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely illustrative of the example forms of implementing the claims. As to the means of implementing the device in the above-described embodiments, the specific manner in which the various modules perform operations has been described in detail in the embodiments related to the method, and will not be described here.
Claims
1. A data transmission method based on a trusted execution environment, characterized in that: Applied to the first end, including: Before sending the first data to the second end, determining whether the second end is trustworthy; wherein the second end is deployed in a first trusted execution environment; If the second end is trustworthy, encrypting the first data to obtain ciphertext data, and generating a signature based on the identifier of the first end; The ciphertext data and the signature are sent to the second end; wherein the second end is used to determine whether the first end is trustworthy based on the signature, and decrypt the ciphertext data if the first end is trustworthy.
2. The method according to claim 1, characterized in that The determining whether the second end is trustworthy includes: Sending a remote attestation request to the second end; wherein the second end is configured to generate a remote attestation report based on the remote attestation request and send the remote attestation report to the first end; Performing credibility verification on the second end according to the remote attestation report received from the second end to determine whether the second end is credible.
3. The method according to claim 1, characterized in that The determining whether the second end is trustworthy includes: Determining whether the time interval between the current moment and the first moment reaches a preset time interval; wherein the first end performs credibility verification on the second end at the preset time interval during data transmission with the second end, and the first moment is the moment when the first end most recently performed credibility verification on the second end; If the time interval reaches the preset time interval or the first end has not performed credibility verification on the second end, sending a remote attestation request to the second end; wherein the second end is configured to generate a remote attestation report based on the remote attestation request and send the remote attestation report to the first end; Performing credibility verification on the second end according to the remote attestation report received from the second end to determine whether the second end is credible.
4. The method according to claim 3, characterized in that The determining whether the second end is trustworthy further includes: If the time interval does not reach the preset time interval, determining whether the second end is trustworthy based on a result of the most recent credibility verification performed by the first end on the second end.
5. The method according to any one of claims 2 to 4, characterized in that A second trusted execution environment is deployed in the first end; The performing credibility verification on the second end according to the remote attestation report received from the second end includes: Performing credibility verification on the second end according to the remote attestation report in the second trusted execution environment.
6. The method according to claim 1, characterized in that Generating a signature according to the identifier of the first end includes: The identifier is encrypted using a first private key to obtain the signature; wherein the first end pre-generates a first key pair including a first public key and the first private key, and shares the first public key with the second end; the second end is used to decrypt the signature using the first public key, and determine whether the first end is trustworthy based on the decryption result.
7. The method according to claim 1, characterized in that Generating a signature according to the identifier of the first end includes: splicing the first salt value with the identifier to obtain first spliced data; wherein the first end and the second end pre-agreed on the first salt value; A first hash algorithm is used to perform a hash operation on the first spliced data to obtain the signature; wherein the first end and the second end have pre-agreed on the first hash algorithm; and the second end is used to determine whether the first end is trustworthy based on the first salt value, the first hash algorithm, and the identifier.
8. The method according to claim 1, characterized in that A second trusted execution environment is deployed in the first end, the second end pre-generates a second key pair including a second public key and a second private key, and shares the second public key with the first end, wherein the second public key is stored in the second trusted execution environment; The encrypting the first data to obtain ciphertext data and generating a signature according to the identifier of the first end includes: The first data is encrypted using the second public key in the second trusted execution environment to obtain the ciphertext data, and the signature is generated according to the identifier in the second trusted execution environment; wherein the second end is used to decrypt the ciphertext data using the second private key when the first end is trusted.
9. The method according to claim 1, characterized in that The first end includes a first application deployed in a non-trusted execution environment and a client deployed in a second trusted execution environment, and the second end includes a server; The encrypting the first data to obtain ciphertext data and generating a signature according to the identifier of the first end includes: Encrypting the first data by the client to obtain the ciphertext data, and generating the signature by the client according to the identifier; Sending the ciphertext data and the signature to the first application through the client; The sending the ciphertext data and the signature to the second end includes: The ciphertext data and the signature are sent to the server through the first application.
10. A data transmission method based on a trusted execution environment, characterized in that: The method is applied to a second end, wherein the second end is deployed in a first trusted execution environment, and includes: In response to receiving the ciphertext data and the signature sent by the first end, determining whether the first end is trustworthy based on the signature; if the second end is trustworthy, the first end is configured to encrypt the first data to obtain the ciphertext data, generate the signature based on the identifier of the first end, and send the ciphertext data and the signature to the second end; When the first end is trustworthy, the ciphertext data is decrypted.
11. The method according to claim 10, characterized in that The method further comprises: In response to receiving the remote attestation request sent by the first end, generating a remote attestation report based on the remote attestation request; The remote attestation report is sent to the first end, wherein the first end is used to perform credibility verification on the second end according to the remote attestation report received from the second end to determine whether the second end is credible.
12. The method according to claim 10, characterized in that Determining whether the first end is trustworthy according to the signature includes: Decrypting the signature using the first public key to obtain a decryption result; wherein the first end has pre-generated a first key pair including the first public key and a first private key, and shares the first public key with the second end, and the signature is obtained by the first end encrypting the identifier using the first private key; If the decryption result is consistent with the identifier, it is determined that the first end is trustworthy.
13. The method according to claim 10, characterized in that Determining whether the first end is trustworthy according to the signature includes: splicing the first salt value and the identifier to obtain second spliced data; wherein the first end and the second end pre-agreed with the first salt value; Performing a hash operation on the second concatenated data using a first hash algorithm to obtain a first hash value; wherein the first end and the second end pre-agreed on the first hash algorithm; If the first hash value is consistent with the signature, the first end is determined to be trustworthy.
14. The method according to claim 10, characterized in that The second end pre-generates a second key pair including a second public key and a second private key, and shares the second public key with the first end, and the first end is configured to encrypt the first data using the second public key to obtain the ciphertext data when the second end is trusted; Decrypting the ciphertext data includes: The ciphertext data is decrypted using the second private key.
15. A data transmission device based on a trusted execution environment, characterized in that: Applied to the first end, including: A first determination module is configured to determine whether the second end is trustworthy before sending the first data to the second end; wherein the second end is deployed in a first trusted execution environment; an encryption module, configured to encrypt the first data to obtain ciphertext data if the second end is trustworthy, and generate a signature according to the identifier of the first end; The first sending module is used to send the ciphertext data and the signature to the second end; wherein the second end is used to determine whether the first end is trustworthy based on the signature, and decrypt the ciphertext data if the first end is trustworthy.
16. A data transmission device based on a trusted execution environment, characterized in that: The method is applied to a second end, wherein the second end is deployed in a first trusted execution environment, and includes: a second determining module configured to, in response to receiving the ciphertext data and the signature sent by the first end, determine whether the first end is trustworthy based on the signature; if the second end is trustworthy, the first end is configured to encrypt the first data to obtain the ciphertext data, generate the signature based on the identifier of the first end, and send the ciphertext data and the signature to the second end; A decryption module is used to decrypt the ciphertext data when the first end is trusted.
17. A computer-readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method according to any one of claims 1 to 14 are implemented.
18. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 14.
19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 14 are implemented.
Citation Information
Patent Citations
Data security transmission method, certificate correlation method, server, system and medium
CN113556230A
Data transmission method and device, data transaction terminal and data supplier
CN114240428A
Data transmission method and related equipment
CN114553590A
Method and device for executing data transmission protocol
CN116248265A
Remote attestation method and device, electronic equipment and storage medium
CN117579331A
Cited By
Data migration method and device, equipment, storage medium and program product
CN121543098A
Data migration method, device, equipment, storage medium and program product
CN121543098B