Secure communication method and device based on trusted execution environment and computer equipment

By performing remote authentication and key negotiation in the application's operating environment, and encrypting data with TEE public and private keys, the problem of privacy risks in data secure communication in the prior art is solved, and efficient and secure data transmission is achieved.

CN119128933APending Publication Date: 2024-12-13SHANGHAI PUDONG DEVELOPMENT BANK
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411152075.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The prior art poses a privacy risk when protecting data secure communication, especially when applications or systems are maliciously tampered with, the confidentiality of data is difficult to guarantee.

Method used

By remote authentication in the application's operating environment, key negotiation is carried out using TEE (Trusted Execution Environment) public and private keys to generate negotiation keys, and the uploaded data is encrypted to ensure the security of the data during transmission.

Benefits of technology

It effectively avoids the risk of data privacy leakage, greatly guarantees the security of data, and ensures the confidentiality and integrity of data during transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119128933A_ABST
    Figure CN119128933A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a secure communication method and device based on a trusted execution environment, and computer equipment. The method comprises the following steps: sending a security authentication request to an application to remotely authenticate the running environment of the application; receiving and verifying the remote authentication report; when the remote authentication report passes the verification, obtaining a TEE public key in the remote authentication report; generating a public key and a private key; generating a first negotiation key by using the private key and the TEE public key; uploading the to-be-uploaded data encrypted by the first negotiation key and the public key to the application, so that the application processes the to-be-uploaded data based on the public key and obtains a processing result; and receiving the processing result and performing decryption by using the first negotiation key to obtain a plaintext processing result. According to the method, the running environment of the application is verified in a remote authentication manner, so that the running environment of the distributed application is ensured to be credible; and the to-be-uploaded data is encrypted through the first negotiation key, so that the risk of data privacy leakage is avoided, and the data security is greatly guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of data security technology, and in particular to a secure communication method, apparatus, and computer device based on a trusted execution environment. Background Art

[0002] Protecting the confidentiality of application data is crucial for secure data communication. In the prior art, data security is often ensured through methods such as data encryption, access control, data masking, monitoring and auditing, and secure coding practices. However, all of the above methods have some limitations. For example, the method of data encryption is to convert data into ciphertext so that only objects with the correct key can decrypt and obtain the data; although this method can protect the confidentiality of data, once the data is decrypted in the application environment, there is a risk of exposure to the application or system, and if the application or system is maliciously tampered with, it will pose a threat to the privacy of the data. For example, the method of access control is to limit the permission to access data so that only authorized users can access the data; the method of access control still has challenges in user authorization, and the application may require stronger authentication and permission control to ensure privacy. For another example, the method of data masking is to hide sensitive information in the data while retaining the availability of the data through data desensitization, data masking, or data replacement; although this method masks sensitive information, it may still allow the application or system to access some sensitive information, resulting in privacy risks.

[0003] In view of this, the embodiments of this specification aim to provide a secure communication method and device based on a trusted execution environment. Summary of the invention

[0004] In view of the above-mentioned problems in the prior art, the purpose of the embodiments of this specification is to provide a secure communication method, apparatus and computer device based on a trusted execution environment to solve the problem that most of the methods for protecting data in the prior art have some privacy risks.

[0005] In order to solve the above technical problems, the specific technical solutions of the embodiments of this specification are as follows:

[0006] In a first aspect, an embodiment of the present specification provides a secure communication method based on a trusted execution environment, including:

[0007] Sending a security authentication request to the application to remotely authenticate the operating environment of the application, wherein the security authentication request carries a challenge content using a random string;

[0008] Receiving a remote authentication report issued by the firmware of the operating environment in which the application is located;

[0009] Verifying the remote authentication report;

[0010] When the verification of the remote authentication report is passed, obtaining the TEE public key in the remote authentication report;

[0011] Generate public and private keys;

[0012] Perform key negotiation using the private key and the TEE public key to generate a first negotiated key;

[0013] uploading the data to be uploaded encrypted by the first negotiated key and the public key to the application, so that the application processes the encrypted data to be uploaded based on the public key and obtains a processing result;

[0014] The processing result fed back by the application is received, and the processing result is decrypted using the first negotiated key to obtain a plaintext processing result.

[0015] Specifically, verifying the remote authentication report includes:

[0016] Verifying the subject of the remote authentication report; and

[0017] Parse and verify the Quote issued in the remote authentication report.

[0018] Furthermore, verifying the subject of the remote authentication report may include:

[0019] Obtaining a report public key in the remote authentication report body;

[0020] Using the report public key, determining whether the integrity of the remote authentication report body has passed the verification;

[0021] If the integrity of the remote authentication report body passes the verification, obtaining a response value in the remote authentication report body, wherein the response value is generated by the firmware of the operating environment according to the challenge content;

[0022] Determining whether the response value is consistent with the challenge content;

[0023] If they are consistent, it is determined that the subject of the remote authentication report has passed the verification;

[0024] Otherwise, it is determined that the subject of the remote authentication report has not passed the verification and an alarm is sent.

[0025] Preferably, verifying the subject of the remote authentication report further includes:

[0026] Obtaining a timestamp of when the remote authentication report was generated;

[0027] Determine whether the difference between the generated timestamp and the current timestamp is less than a preset difference threshold;

[0028] If not, it is determined that the subject of the remote authentication report has not passed the verification and an alarm is sent;

[0029] If so, it is determined that the subject of the remote authentication report has passed the verification.

[0030] Preferably, verifying the subject of the remote authentication report further includes:

[0031] Obtaining the firmware version and type of the operating environment according to the main body of the remote authentication report;

[0032] The firmware version and type are verified according to preset verification rules.

[0033] Specifically, the Quote issued in the remote authentication report is verified, including:

[0034] Verify each certificate in the certificate chain step by step;

[0035] Verify the metric values ​​in the Quote; and

[0036] Verify the key fields in Quote.

[0037] Furthermore, the certificate chain includes a root key certificate, a signature key certificate, a chip approval key certificate and a platform approval key certificate level by level, and verifying each certificate in the certificate chain level by level includes:

[0038] Performing a first verification on the certificate signature of the root key certificate using the public key of the root key certificate;

[0039] Determine whether the first check passes;

[0040] If yes, perform a second verification on the certificate signature of the signing key certificate using the public key of the signing key certificate and determine whether the second verification passes;

[0041] If yes, perform a third verification on the certificate signature of the chip recognition key certificate using the public key of the chip recognition key certificate and determine whether the third verification passes;

[0042] If so, performing a fourth verification on the certificate signature of the platform-recognized key certificate using the public key of the platform-recognized key certificate and determining whether the fourth verification passes;

[0043] If yes, it is determined that the certificate chain passes the verification and a certification report is generated;

[0044] Otherwise, it is determined that the certificate chain has failed the verification and an alarm is sent.

[0045] Furthermore, the application processes the encrypted data to be uploaded based on the public key and obtains a processing result, including:

[0046] The application uses the public key and the TEE private key to perform key negotiation to generate a second negotiation key;

[0047] The application parses and processes the data to be uploaded by using the second negotiated key based on the operating environment;

[0048] The second negotiated key is used to encrypt the processed result to obtain the processed result.

[0049] Furthermore, the application parses and processes the data to be uploaded based on the operating environment using the second negotiated key, including:

[0050] The application calls the upload interface of the sidecar service to upload the intermediate result obtained during the processing, wherein the sidecar service is in the running environment, and the sidecar service is used to encrypt the intermediate result using the key derived from the running environment and then store it on the disk;

[0051] Also includes:

[0052] The application calls the download interface of the sidecar service to download the required data in the processing process, wherein the sidecar service is also used to decrypt the required data using the key derived from the operating environment.

[0053] In a second aspect, an embodiment of the present specification provides a secure communication device based on a trusted execution environment, including:

[0054] A sending module, used for sending a security authentication request to an application to remotely authenticate the operating environment of the application, wherein the security authentication request carries a challenge content using a random string as a challenge content;

[0055] A first receiving module, configured to receive a remote authentication report issued by the firmware of the running environment where the application is located;

[0056] A verification module, used for verifying the remote authentication report;

[0057] An acquisition module, configured to acquire the TEE public key in the remote authentication report after the verification of the remote authentication report passes;

[0058] A generation module, used to generate public and private keys;

[0059] A negotiation module, configured to perform key negotiation using the private key and the TEE public key to generate a first negotiation key;

[0060] an uploading module, used to upload the data to be uploaded encrypted by the first negotiated key and the public key to the application, so that the application processes the encrypted data to be uploaded based on the public key and obtains a processing result;

[0061] The second receiving module is used to receive the processing result fed back by the application, and decrypt the processing result using the first negotiated key to obtain a plaintext processing result.

[0062] In a third aspect, an embodiment of the present specification provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method provided by the above technical solution when executing the computer program.

[0063] In a fourth aspect, an embodiment of the present specification provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method provided by the above technical solution is implemented.

[0064] In a fifth aspect, an embodiment of the present specification provides a computer program product, comprising at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded and executed by a processor to implement the method provided by the above technical solution.

[0065] By adopting the above-mentioned technical scheme, the secure communication method, apparatus and computer equipment based on a trusted execution environment provided in the embodiments of this specification verify the operating environment of the application through remote authentication, thereby ensuring that the operating environment of the distributed application is a trusted execution environment; and encrypting the data to be uploaded through the first negotiated key, thereby avoiding the risk of data privacy leakage and greatly ensuring data security.

[0066] In order to make the above and other purposes, features and advantages of the embodiments of this specification more obvious and easy to understand, the following specifically cites preferred embodiments and describes them in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0068] Figure 1 A schematic diagram showing the steps of a secure communication method based on a trusted execution environment provided by an embodiment of this specification is shown;

[0069] Figure 2 A schematic diagram showing the steps of verifying the subject of a remote authentication report is shown;

[0070] Figure 3 A schematic diagram showing another step of verifying the subject of the remote authentication report;

[0071] Figure 4 This is a schematic diagram of the structure of the certificate chain in the embodiment of this specification;

[0072] Figure 5 A schematic diagram of the steps of verifying each certificate in the certificate chain step by step is shown;

[0073] Figure 6 A schematic diagram showing the steps of applying a public key to process the encrypted data to be uploaded and obtaining the processing result;

[0074] Figure 7 Another schematic diagram of the steps of the secure communication method based on a trusted execution environment provided by an embodiment of this specification is shown;

[0075] Figure 8 A schematic diagram of the structure of a secure communication device based on a trusted execution environment provided in an embodiment of this specification is shown;

[0076] Fig. 9 A schematic diagram of the structure of a computer device provided in an embodiment of this specification is shown.

[0077] Description of the accompanying symbols:

[0078] 81. Sending module;

[0079] 82. A first receiving module;

[0080] 83. Verification module;

[0081] 84. Get module;

[0082] 85. Generate module;

[0083] 86. Negotiation module;

[0084] 87. Upload module;

[0085] 88. A second receiving module;

[0086] 902. Computer equipment;

[0087] 904, processor;

[0088] 906. Memory;

[0089] 908, driving mechanism;

[0090] 910, input / output module;

[0091] 912. Input device;

[0092] 914. Output device;

[0093] 916. Presentation equipment;

[0094] 918. Graphical user interface;

[0095] 920, network interface;

[0096] 922, communication link;

[0097] 924. Communication bus. DETAILED DESCRIPTION

[0098] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.

[0099] It should be noted that the terms "first", "second", etc. in this specification and claims and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of this specification described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0100] The embodiments of this specification provide a secure communication method, apparatus, and computer device based on a trusted execution environment, which can solve the problem that various data protection measures in the prior art are prone to data privacy risks. Figure 1It is a schematic diagram of the steps of a secure communication method based on a trusted execution environment provided in an embodiment of this specification. This specification provides method operation steps as described in the embodiment or flowchart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only order of execution. When the actual system or device product is executed, it can be executed in the order or in parallel according to the method shown in the embodiment or the accompanying drawings. The method is executed by the client (also called the challenger), as shown in FIG. Figure 1 As shown, the method may include:

[0101] S101: Sending a security authentication request to an application to remotely authenticate the running environment of the application, wherein the security authentication request carries a random character string as challenge content.

[0102] In the embodiments of this specification, the application is run in a distributed environment. The application's running environment can support the use of remote authentication technology to verify the credibility of its environment.

[0103] S102: Receive a remote authentication report issued by the firmware of the running environment where the application is located.

[0104] S103: Verify the remote authentication report.

[0105] The challenger verifies the remote attestation report to ensure that the application is running in a trusted environment, the Trusted Execution Environment (TEE), and has not been maliciously tampered with. The Trusted Execution Environment provides a trusted isolation environment in which applications can run without interference from the operating system or other applications.

[0106] S104: When the verification of the remote authentication report is passed, the TEE public key in the remote authentication report is obtained.

[0107] The TEE public key will be fed back to the challenger along with the remote authentication report (while the TEE private key is stored on a special hardware device of the TEE and can only be used by the special hardware device within the TEE).

[0108] S105: Generate a public key and a private key.

[0109] Here, the public key and the private key are randomly generated by the challenger, and the public key is paired with the private key.

[0110] S106: Use the private key and the TEE public key to perform key negotiation to generate a first negotiated key.

[0111] S107: Uploading the data to be uploaded encrypted by the first negotiated key and the public key to the application, so that the application processes the encrypted data to be uploaded based on the public key and obtains a processing result.

[0112] The private key and the TEE public key are used to negotiate and obtain a first negotiated key, which is used to encrypt the data to be uploaded, thereby enhancing the security of the data to be uploaded during transmission with the distributed application and ensuring the security of the data after transmission.

[0113] S108: Receive the processing result fed back by the application, and use the first negotiated key to decrypt the processing result to obtain a plaintext processing result.

[0114] Therefore, the embodiment of this specification provides a secure communication method based on a trusted execution environment, which verifies the operating environment of the application through remote authentication, thereby ensuring that the operating environment of the distributed application is a trusted execution environment; and encrypts the uploaded data through the first negotiated key, thereby avoiding the risk of data privacy leakage; therefore, data security is greatly guaranteed.

[0115] Furthermore, in the embodiment of this specification, step S103: verifying the remote authentication report further includes:

[0116] Verifying the subject of the remote authentication report; and

[0117] Parse and verify the Quote issued in the remote authentication report.

[0118] That is, the verification of the remote authentication report includes two parts: the verification of its main body and the verification of its partially issued quote. Only when the verification of these two parts is passed can the uniqueness and reliability of the remote authentication report be represented.

[0119] like Figure 2 As shown, verifying the subject of the remote authentication report further includes:

[0120] S201: Obtain the report public key in the remote authentication report body.

[0121] The report public key is different from the public key generated by the challenger and the TEE public key. The report public key is generated by the firmware that issues the remote authentication report and is used to verify the integrity of the remote authentication report body.

[0122] S202: Using the report public key, determine whether the integrity of the remote authentication report body has passed the verification.

[0123] Specifically, the integrity check of the remote authentication report body may be:

[0124] When generating the main body of the remote authentication report, the firmware of the trusted execution environment generates a hash value (recorded as the first hash value) for the content of the main body of the remote authentication report according to a predetermined hash algorithm; and feeds back the hash value and the report public key to the challenger together with the remote authentication report.

[0125] After the challenger obtains the report public key, he performs hash calculation on the main body of the remote authentication report to obtain a hash value (recorded as the second hash value); then the challenger verifies whether the first hash value is consistent with the second hash value; if the first hash value is inconsistent with the second hash value, it indicates that the remote authentication report is likely to be tampered with, and thus it is determined that it has failed the integrity check; if they are consistent, it indicates that the remote authentication report is unlikely to be tampered with, and thus it has passed the integrity check.

[0126] S203: If the integrity of the remote authentication report body passes the verification, a response value in the remote authentication report body is obtained, where the response value is generated by the firmware of the operating environment according to the challenge content.

[0127] That is, the integrity check of the remote authentication report body can serve as the basis and prerequisite for the response value verification.

[0128] S204: Determine whether the response value is consistent with the challenge content.

[0129] That is, after receiving the security authentication request sent by the challenger, the firmware of the trusted execution environment will generate a remote authentication report for the challenge content in the security authentication request to characterize the uniqueness of the remote authentication report.

[0130] S205: If they are consistent, it is determined that the subject of the remote authentication report has passed the verification.

[0131] This indicates that the remote authentication report is likely to have been tampered with, and thus the operating environment of the application is untrustworthy.

[0132] S206: Otherwise, it is determined that the subject of the remote authentication report has not passed the verification and an alarm is sent.

[0133] That is, when the second hash value obtained using the report public key is inconsistent with the first hash value (that is, when the main body of the remote authentication report is incomplete), and / or when the response value in the main body of the remote authentication report is inconsistent with the challenge content generated by the challenger, it is determined that the main body of the remote authentication report has failed the verification.

[0134] In the embodiments of the present specification, when verifying the main body of the remote authentication report, priority is given to verifying the integrity of the remote authentication report. When the integrity fails the verification, there is no need to perform related verification on the response value, which can simplify the verification method.

[0135] Furthermore, if Figure 3 As shown, verifying the subject of the remote authentication report also includes:

[0136] S301: Obtain the generation timestamp of the remote authentication report.

[0137] S302: Determine whether the difference between the generated timestamp and the current timestamp is less than a preset difference threshold.

[0138] The current timestamp is the timestamp when the challenger receives the remote authentication report. The preset difference threshold can be set to 30 seconds.

[0139] S303: If not, it is determined that the subject of the remote authentication report has not passed the verification and an alarm is sent.

[0140] If the difference between the generated timestamp and the current timestamp is greater than or equal to 30 seconds, it is considered that the remote authentication report is likely to be a historical report or an expired report, and it is likely that a malicious attacker has used the historical report to replay the attack or the report is likely to be invalid. Therefore, at this time, it is determined that the main body of the remote authentication report has not passed the verification.

[0141] S304: If yes, it is determined that the subject of the remote authentication report has passed the verification.

[0142] On the contrary, if the difference between the generated timestamp and the current timestamp is less than 30 seconds, it is considered that the remote authentication report is generated by the firmware of the operating environment in response to the challenger's security authentication request and is timely. Therefore, the remote authentication report is recognized as having passed the verification.

[0143] In the embodiments of this specification, Figure 3 The method steps for verifying the subject of the remote authentication report using the timestamp shown can be performed as follows Figure 2 After the verification method shown, the subject of the remote authentication report is further verified by the timestamp on the basis of the integrity check and the response value check, so as to further ensure the reliability of the remote authentication report, thereby ensuring the credibility of the operating environment in which the application is located. In the embodiments of this specification, the method of verifying the subject of the remote authentication report by the timestamp is simple, convenient and easy to implement.

[0144] Furthermore, in the embodiment of this specification, verifying the subject of the remote authentication report may also include:

[0145] The firmware version and type of the operating environment are obtained according to the main body of the remote authentication report.

[0146] The firmware version and type are verified according to preset verification rules.

[0147] In a specific embodiment, according to the preset verification rules, the version and type of the firmware can be verified by determining whether the version of the firmware is higher than the preset version value (for example, it can be set to 1.0); and when the method provided in the embodiment of this specification uses Haiguang CSV (China Secure Virtualization) technology as TEE to implement, determine whether the version of the operating environment is Haiguang CSV. That is, when the version of the firmware is lower, it is considered that there may be some security risks; and determine whether the type of the operating environment is consistent with the type of the hardware and software device that provides the application operating environment.

[0148] Furthermore, in the embodiment of this specification, verifying the Quote issued in the remote authentication report further includes:

[0149] Verify each certificate in the certificate chain step by step;

[0150] Verify the metric values ​​in Quote; and

[0151] Verify the key fields in Quote.

[0152] That is, the verification of the Quote issued in the remote authentication report may include three small parts, and the core of these three small parts is the verification of the certificate chain.

[0153] Figure 4 is a schematic diagram of the structure of the certificate chain, such as Figure 4 As shown, the certificate chain includes a root key certificate, a signature key certificate, a chip endorsement key certificate and a platform endorsement key certificate in sequence. In the embodiment of the present specification, the operating environment of the application can be provided by Hygon CSV, and the certificates at each level in the above certificate chain can be HRK (Hygon Root Key) certificate, i.e., Hygon root key certificate, which is obtained by downloading from a Hygon server; HSK (Hygon CSV Signing Key) certificate, i.e., Hygon signature key certificate; CEK (Chip Endorsement Key) certificate, i.e., chip endorsement key certificate, also known as chip endorsement key certificate, which is derived from the chip key; and PEK (Platform Endorsement Key) certificate, i.e., platform endorsement key certificate, also known as platform endorsement key certificate.

[0154] If Figure 5 As shown, each certificate in the certificate chain is verified step by step, which may include:

[0155] S501: Perform a first verification on the certificate signature of the root key certificate using the public key of the root key certificate.

[0156] The root key certificate is downloaded from the Haiguang server and serves as the root of trust in the entire certificate chain, so it is only necessary to verify the signatures of each certificate step by step. The first verification of the certificate signature of the root key certificate is to perform a hash calculation on the subject of the root key certificate according to the public key of the root key certificate, and compare the obtained hash value with the pre-obtained hash value. If the two hash values ​​are consistent, the first verification of the root key certificate passes; otherwise, it is considered that the first verification fails.

[0157] S502: Determine whether the first verification is passed.

[0158] S503: If yes, perform a second verification on the certificate signature of the signing key certificate using the public key of the signing key certificate and determine whether the second verification passes.

[0159] The second verification method for the signature key certificate is similar to the first verification method described above, that is, using the public key of the signature key certificate to perform hash calculation on the signature key certificate, and then comparing the obtained hash value with another pre-obtained hash value.

[0160] S504: If yes, perform a third verification on the certificate signature of the chip recognition key certificate using the public key of the chip recognition key certificate and determine whether the third verification passes.

[0161] S505: If yes, perform a fourth verification on the certificate signature of the platform-recognized key certificate using the public key of the platform-recognized key certificate and determine whether the fourth verification passes.

[0162] The processes of the third and fourth checks are similar to the process of the first check, and will not be described again here.

[0163] S506: If yes, determine that the certificate chain passes the verification and generate a certification report.

[0164] That is, if and only if all levels of the certificate chain pass the verification, the certificate chain is determined to have passed the verification, and a certification report is automatically generated.

[0165] S507: Otherwise, it is determined that the certificate chain fails the verification and an alarm is sent.

[0166] That is, in the above-mentioned certificate verification at each level, if any one of the certificates fails to pass the verification, the certificate chain is determined to have failed the verification; and when any one of the certificates fails to pass the verification, there is no need to perform the verification process for the certificates at the lower levels.

[0167] Specifically, in the embodiment of this specification, the metric value in Quote is verified as follows:

[0168] Compare the measurement values ​​in the Quote with the expected measurement values; the measurement values ​​in the Quote are automatically generated by the firmware of the application's operating environment for security measurement of the operating environment; the expected measurement values ​​are officially pre-released. When the measurement values ​​in the Quote are inconsistent with the expected measurement values, the operating environment is considered untrustworthy, and the remote authentication report is determined to have failed the verification, and data communication with the application is rejected.

[0169] In the embodiment of this specification, the key fields in Quote are also verified, wherein the key fields are mainly the report public key generated by the firmware (i.e. Figure 2 In the method shown, the report public key used when verifying the subject of the remote authentication report). That is to say, when verifying the Quote issued in the remote authentication report, it is possible to verify whether the report public key required for verifying the subject of the remote authentication report is correct.

[0170] like Figure 6 As shown, in the embodiment of this specification, step S107, so that the application processes the encrypted data to be uploaded based on the public key and obtains the processing result, further includes:

[0171] S601: The application uses the public key and the TEE private key to negotiate a key and generate a second negotiated key.

[0172] The second negotiated key = the public key generated by the challenger * TEE private key; and the first negotiated key at the challenger = the private key generated by the challenger * TEE public key, and the second negotiated key is symmetrical to the first negotiated key. Therefore, only when the operating environment of the application is a trusted environment, the application can obtain the public key fed back by the challenger, obtain the TEE private key from the special hardware device of the TEE, and negotiate to obtain the second negotiated key.

[0173] S602: The application parses and processes the data to be uploaded using the second negotiated key based on the operating environment.

[0174] The application parses and processes the data uploaded by the challenger in a trusted operating environment, so that the data uploaded by the challenger is "available but not visible" to the application, thereby protecting the confidentiality and privacy of the data.

[0175] S603: The application encrypts the processing result using the second negotiated key to obtain the processing result.

[0176] Through the method provided in the embodiments of this specification, end-to-end data protection can be achieved based on TEE.

[0177] Further, in the embodiment of this specification, step S602: the application parses and processes the data to be uploaded based on the operating environment using the second negotiated key, including:

[0178] The application calls the upload interface of the sidecar service to upload the intermediate result obtained during the processing, wherein the sidecar service is in the running environment, and the sidecar service is used to encrypt the intermediate result using the key derived from the running environment and then store it on the disk;

[0179] Also includes:

[0180] The application calls the download interface of the sidecar service to download the required data in the processing process, wherein the sidecar service is also used to decrypt the required data using the key derived from the operating environment.

[0181] That is, in the embodiments of this specification, the distributed application running in the trusted execution environment is composed of multiple independent components or nodes, which can run in different physical locations and communicate through network connections. When processing data, each application can act as a data producer and store the intermediate results obtained from the data processing on the disk; it can also act as a data consumer and download the required data from the data storage component when other data support is needed in the process of processing the intermediate data.

[0182] In the embodiments of this specification, data is encrypted based on a TEE-derived key and then stored on disk, and the data is decrypted using a TEE-derived key, thereby ensuring the security of data storage and use between application nodes in a distributed environment.

[0183] The secure communication method based on a trusted execution environment provided in the embodiments of this specification is: (1) based on a trusted execution environment (TEE), so that the data interacting between the challenger and the application is protected from being leaked in this environment; (2) combined with remote authentication technology: before the challenger interacts with the application, the challenger can audit the trusted state of the application running environment in real time to ensure that the running environment of the application is trusted; (3) based on the public-private key pair generated by the challenger and the TEE private key and TEE public key of the trusted execution environment, data encryption and decryption are performed to ensure the end-to-end protection of sensitive data between the challenger and the application, and to achieve "available but invisible" sensitive data; (4) based on the key derived from the TEE, data protection of distributed applications is performed to achieve protection of data stored on the disk and downloaded for use, and to achieve secure distributed data management. Combining the above four points, the method provided in the embodiments of this specification can achieve privacy protection for the entire life cycle of data, greatly improving the security and reliability of data communication.

[0184] like Figure 7 As shown, the embodiment of this specification also provides a secure communication method based on a trusted execution environment, such as Figure 7 As shown, the method includes:

[0185] S701: The challenger sends a security authentication request to the application, wherein the security authentication request carries a random string as challenge content;

[0186] S702: the application feeds back a remote authentication report to the challenger, where the remote authentication report is generated by signing the firmware of the running environment of the application;

[0187] S703: The challenger verifies the remote authentication report;

[0188] S704: When the remote authentication report passes the verification, the challenger obtains the TEE public key in the remote authentication report;

[0189] S705: The challenger generates a public key and a private key;

[0190] S706: The challenger uses the private key and the TEE public key to negotiate a key and generate a first negotiated key;

[0191] S707: The challenger uploads the data to be uploaded and the public key encrypted by the first negotiated key to the application;

[0192] S708: The application performs key negotiation using the public key and the TEE private key to generate a second negotiated key;

[0193] S709: The application uses the second negotiated key to parse and process the data to be uploaded, and feeds back the processing result encrypted by the second negotiated key to the challenger;

[0194] S710: The challenger uses the first negotiated key to decrypt the processing result to obtain a plaintext processing result.

[0195] Based on the above-mentioned secure communication method based on a trusted execution environment, the embodiments of this specification also provide a secure communication device based on a trusted execution environment. The device may include a system (including a distributed system), software (application), module, component, server, client, etc. using the method described in the embodiments of this specification and a device combined with necessary implementation hardware. Based on the same innovative concept, the device in one or more embodiments provided in the embodiments of this specification is as described in the following embodiments. Since the implementation scheme and method for solving the problem of the device are similar, the implementation of the specific device in the embodiments of this specification can refer to the implementation of the aforementioned method, and the repetitions will not be repeated. As used below, the term "unit" or "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0196] like Figure 8 As shown, this specification provides a secure communication device based on a trusted execution environment, including:

[0197] A sending module 81 is used to send a security authentication request to an application to remotely authenticate the operating environment of the application, wherein the security authentication request carries a challenge content using a random string;

[0198] A first receiving module 82, configured to receive a remote authentication report issued by the firmware of the running environment where the application is located;

[0199] A verification module 83, used to verify the remote authentication report;

[0200] An acquisition module 84 is used to acquire the TEE public key in the remote authentication report after the verification of the remote authentication report is passed;

[0201] A generating module 85, for generating a public key and a private key;

[0202] A negotiation module 86, configured to perform key negotiation using the private key and the TEE public key to generate a first negotiated key;

[0203] An uploading module 87, configured to upload the data to be uploaded encrypted by the first negotiated key and the public key to the application, so that the application processes the encrypted data to be uploaded based on the public key and obtains a processing result;

[0204] The second receiving module 88 is used to receive the processing result fed back by the application, and decrypt the processing result using the first negotiated key to obtain a plain text processing result.

[0205] The beneficial effects obtained by the device provided in the embodiments of this specification are consistent with the beneficial effects obtained by the above method and will not be repeated here.

[0206] like Fig. 9 As shown, a computer device provided by an embodiment of this specification, the secure communication device based on a trusted execution environment in this specification can be a computer device in this embodiment, executing the above method of this specification. The computer device 902 may include one or more processors 904, such as one or more central processing units (CPUs), and each processing unit may implement one or more hardware threads. The computer device 902 may also include any memory 906, which is used to store any kind of information such as code, settings, data, etc. Non-restrictive, for example, the memory 906 may include any one or more combinations of the following: any type of RAM, any type of ROM, flash memory device, hard disk, optical disk, etc. More generally, any memory can use any technology to store information. Further, any memory can provide volatile or non-volatile retention of information. Further, any memory can represent a fixed or removable component of the computer device 902. In one case, when the processor 904 executes an associated instruction stored in any memory or a combination of memories, the computer device 902 can perform any operation of the associated instruction. The computer device 902 also includes one or more drive mechanisms 908 for interacting with any storage, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.

[0207] The computer device 902 may also include an input / output module 910 (I / O) for receiving various inputs (via input devices 912) and for providing various outputs (via output devices 914). A specific output mechanism may include a presentation device 916 and an associated graphical user interface (GUI) 918. In other embodiments, the input / output module 910 (I / O), the input device 912, and the output device 914 may not be included, and the computer device 902 may be used as a computer device in a network. The computer device 902 may also include one or more network interfaces 920 for exchanging data with other devices via one or more communication links 922. One or more communication buses 924 couple the components described above together.

[0208] The communication link 922 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 922 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc. governed by any protocol or combination of protocols.

[0209] Corresponding to Figures 1 to 3 , Figures 5 to 7 In addition to the method shown, an embodiment of the specification also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are executed.

[0210] The embodiment of the present specification also provides a computer-readable instruction, wherein when the processor executes the instruction, the program therein causes the processor to execute the following Figures 1 to 3 , Figures 5 to 7 method.

[0211] The embodiments of the present specification also provide a computer program product, including at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded and executed by a processor to implement the following Figures 1 to 3 , Figures 5 to 7 method.

[0212] It should be understood that in the various embodiments of this specification, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this specification.

[0213] It should also be understood that in the embodiments of this specification, the term "and / or" is only a description of the association relationship of the associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this specification generally indicates that the associated objects before and after are in an "or" relationship.

[0214] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this specification can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this specification.

[0215] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0216] In the several embodiments provided in this specification, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or it can be an electrical, mechanical or other form of connection.

[0217] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of this specification.

[0218] In addition, each functional unit in each embodiment of this specification may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0219] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this specification is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of this specification. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0220] Specific embodiments are used in this specification to illustrate the principles and implementation methods of this specification. The description of the above embodiments is only used to help understand the methods and core ideas of this specification. At the same time, for those skilled in the art, according to the ideas of this specification, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on this specification.

Claims

1. A secure communication method based on a trusted execution environment, It is characterized in that include: Sending a security authentication request to the application to remotely authenticate the operating environment of the application, wherein the security authentication request carries a challenge content using a random string; Receiving a remote authentication report issued by the firmware of the operating environment in which the application is located; Verifying the remote authentication report; When the verification of the remote authentication report is passed, obtaining the TEE public key in the remote authentication report; Generate public and private keys; Perform key negotiation using the private key and the TEE public key to generate a first negotiated key; uploading the data to be uploaded encrypted by the first negotiated key and the public key to the application, so that the application processes the encrypted data to be uploaded based on the public key and obtains a processing result; The processing result fed back by the application is received, and the processing result is decrypted using the first negotiated key to obtain a plaintext processing result.

2. The method according to claim 1, It is characterized in that Verifying the remote authentication report further includes: Verifying the subject of the remote authentication report; and Parse and verify the Quote issued in the remote authentication report.

3. The method according to claim 2, It is characterized in that Verifying the subject of the remote authentication report further includes: Obtaining a report public key in the remote authentication report body; Using the report public key, determining whether the integrity of the remote authentication report body has passed the verification; If the integrity of the remote authentication report body passes the verification, obtaining a response value in the remote authentication report body, where the response value is generated by the firmware of the operating environment according to the challenge content; Determining whether the response value is consistent with the challenge content; If they are consistent, it is determined that the subject of the remote authentication report has passed the verification; Otherwise, it is determined that the subject of the remote authentication report has not passed the verification and an alarm is sent.

4. The method according to claim 3, It is characterized in that Verifying the subject of the remote authentication report also includes: Obtaining a timestamp of when the remote authentication report was generated; Determine whether the difference between the generated timestamp and the current timestamp is less than a preset difference threshold; If not, it is determined that the subject of the remote authentication report has not passed the verification and an alarm is sent; If so, it is determined that the subject of the remote authentication report has passed the verification.

5. The method according to claim 3, It is characterized in that Verifying the subject of the remote authentication report also includes: Obtaining the firmware version and type of the operating environment according to the main body of the remote authentication report; The firmware version and type are verified according to preset verification rules.

6. The method according to claim 2, It is characterized in that Verifying the Quote issued in the remote authentication report further includes: Verify each certificate in the certificate chain step by step; Verify the metric values ​​in the Quote; and Verify the key fields in Quote.

7. The method according to claim 6, It is characterized in that The certificate chain includes a root key certificate, a signature key certificate, a chip approval key certificate and a platform approval key certificate in a step-by-step manner. Verifying each certificate in the certificate chain step-by-step includes: Performing a first verification on the certificate signature of the root key certificate using the public key of the root key certificate; Determine whether the first check passes; If yes, perform a second verification on the certificate signature of the signing key certificate using the public key of the signing key certificate and determine whether the second verification passes; If yes, perform a third verification on the certificate signature of the chip recognition key certificate using the public key of the chip recognition key certificate and determine whether the third verification passes; If so, performing a fourth verification on the certificate signature of the platform-recognized key certificate using the public key of the platform-recognized key certificate and determining whether the fourth verification passes; If yes, it is determined that the certificate chain passes the verification and a certification report is generated; Otherwise, it is determined that the certificate chain has failed verification and an alarm is sent.

8. The method according to claim 1, It is characterized in that So that the application processes the encrypted data to be uploaded based on the public key and obtains the processing result, further comprising: The application uses the public key and the TEE private key to perform key negotiation to generate a second negotiation key; The application parses and processes the data to be uploaded by using the second negotiated key based on the operating environment; The second negotiated key is used to encrypt the processed result to obtain the processed result.

9. The method according to claim 8, It is characterized in that The application, based on the operating environment, uses the second negotiated key to parse and process the data to be uploaded, including: The application calls the upload interface of the sidecar service to upload the intermediate result obtained during the processing, wherein the sidecar service is in the running environment, and the sidecar service is used to encrypt the intermediate result using the key derived from the running environment and then store it on the disk; Also includes: The application calls the download interface of the sidecar service to download the required data in the processing process, wherein the sidecar service is also used to decrypt the required data using the key derived from the operating environment.

10. A secure communication device based on a trusted execution environment, It is characterized in that include: A sending module, used for sending a security authentication request to an application to remotely authenticate the operating environment of the application, wherein the security authentication request carries a challenge content using a random string as a challenge content; A first receiving module, configured to receive a remote authentication report issued by the firmware of the running environment where the application is located; A verification module, used for verifying the remote authentication report; An acquisition module, configured to acquire the TEE public key in the remote authentication report after the verification of the remote authentication report passes; A generation module, used to generate public and private keys; A negotiation module, configured to perform key negotiation using the private key and the TEE public key to generate a first negotiation key; an uploading module, used to upload the data to be uploaded encrypted by the first negotiated key and the public key to the application, so that the application processes the encrypted data to be uploaded based on the public key and obtains a processing result; The second receiving module is used to receive the processing result fed back by the application, and decrypt the processing result using the first negotiated key to obtain a plaintext processing result.

11. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 9 is implemented.

12. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

13. A computer program product, It is characterized in that The method comprises at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded and executed by a processor to implement the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Method and equipment for authentication between applications

    CN104468074A

  • Data security assurance method in hybrid cloud environment based on service grid

    CN112511560A

  • Remote authentication method and device for distributed TEE application

    CN116388992A

  • Remote authentication system and method based on distributed trusted execution environment application

    CN118233218A

  • Host authentication method, host authentication device and related equipment

    CN118312946A