A data exchange method, system, device, medium and product
Patent Information
- Application Number
- CN202611496611.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-24
- Publication Date
- 2026-10-30
AI Technical Summary
[0003]本申请提供了一种数据交换方法、系统、设备、介质和产品,以至少解决相关技术中网络隔离需要中转且中转数据对宿主机特权软件完全可见导致的数据窃听、篡改的安全性下降以及传输效率较低的问题
[0010]通过本申请,首先,第一、第二可信执行环境侧分别经过各自网卡接入相互隔离的网络,使得网络域划分不依托对宿主机特权软件透明的普通虚拟机,可以通过两个可信执行环境侧建立的认证关系下的密钥以进行后续的加密传输,防止特权软件的窥探和篡改,也开辟一条经过认证的交换通道,使得跨网数据交换不需要绕行摆渡等间接路径,实现直接连接。其次,在第一可信执行环境侧发起读操作时,读取请求以加密的方式进入,读取请求在跨网交换过程中通过加密的方式保证请求的机密性,防止窃听。同时进行校验处理来生成与校验基准信息关联的多重校验凭证,来保障实时请求数据的完整性和真实性,防止篡改的同时也抵御重放攻击,即使攻击者能够接触共享存储区域,也无法解密请求内容或伪造合法请求。请求经共享存储区域在两个可信执行环境侧间直接交换,省去虚拟交换机中转与网闸摆渡等环节,显著缩短跨网路径。再次,获取由第二可信执行环境侧响应加密读请求,且存入至共享存储区域的响应数据时必须先通过校验基准信息和多重校验凭证的验证,途中被篡改、伪造或重放的响应均无法通过。验证与解密均在第一可信执行环境侧内部完成,明文形式的读取数据自始至终不出可信边界,且验证内嵌于接收流程就地完成,不再依赖额外的串行检查机制。最后,在第一可信执行环境侧发起写操作时,写方向的数据同样以密文形式经共享存储区域直连传递,与读方向共同构成全程密文的双向交换通道,特权软件在任一方向均无明文可窥。签名凭证存入不可变存储区域,对数据自高安全域流向低安全域这一场景实现可追溯,以密文传输加签名凭证的存证,相比于常规方案中占用传输路径的摆渡和串行检查,不会成为传输效率的负担。直至第二可信执行环境侧解密验证后再进行写入,保证写入数据的安全性和完整性的同时,不需要引入第三方检查,实现跨网直连的同时,也提高传输效率。
Smart Images

Figure CN123020243A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network security technology, and in particular to a data exchange method, system, device, medium and product. Background Technology
[0002] Network isolation, while establishing security boundaries, also blocks direct paths for cross-network data exchange. When network domains are virtualized on the same host, data between virtual domains must be relayed through components such as virtual switches or memory on the host machine. Since ordinary virtual machine memory is fully visible to privileged software on the host machine, relayed data is easily spied on and eavesdropped on, thus losing confidentiality, and may also be tampered with, thereby reducing the security of isolation. The ferry and serial checking mechanisms introduced to compensate for these security flaws further reduce transmission efficiency. Therefore, how to improve the efficiency of cross-network data exchange while ensuring network isolation security has become a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0003] This application provides a data exchange method, system, device, medium, and product to at least solve the problems of reduced security and low transmission efficiency caused by network isolation requiring relay and relayed data being fully visible to privileged software on the host machine, which leads to data eavesdropping and tampering.
[0004] This application provides a data exchange method applied to a first trusted execution environment (TEX) connected to a first network via a first network interface card (NIC), establishing an authentication relationship with a second TEX connected to a second network; the method includes: Obtain the key corresponding to the authentication relationship; When a read operation is initiated on the first trusted execution environment side, the first trusted execution environment side uses a key to encrypt and verify the read request, obtains the encrypted read request and the multi-verification credential associated with the verification base information of the read request, and stores it in the shared storage area; when the response data of the encrypted read request is obtained from the second trusted execution environment side and stored in the shared storage area, the response data is verified based on the verification base information and the multi-verification credential to obtain the read data in plaintext form; When a write operation is initiated on the first trusted execution environment side, the first trusted execution environment side uses a key to encrypt and sign the write request and the write data, obtaining encrypted write information and signature credentials, which are stored in the shared storage area and the immutable storage area respectively, so that the second trusted execution environment side can decrypt and verify them before writing.
[0005] This application also provides a data exchange method, applied to a second trusted execution environment side connected to a second network via a second network interface card (NIC), for establishing an authentication relationship with a first trusted execution environment side connected to a first network via a first NIC; the method includes: Obtain the key for the authentication relationship; When a read operation is initiated by the first trusted execution environment, the second trusted execution environment retrieves the encrypted read request stored by the first trusted execution environment from the shared storage area, decrypts the encrypted read request using a key to obtain the read request, determines the read data based on the read request, encrypts and verifies the read data using a key to obtain the encrypted read data and a multi-verification credential associated with the verification benchmark information of the read request, and stores it in the shared storage area as response data to the encrypted read request, so that the first trusted execution environment can verify the response data based on the verification benchmark information and the multi-verification credential to obtain the read data in plaintext form. When a write operation is initiated by the first trusted execution environment, the encrypted write information stored by the first trusted execution environment is obtained from the shared storage area, and the encrypted write information is decrypted using a key to obtain a write request. The first trusted execution environment uses a key to perform signature generation processing on the write request and the write data, and the signature certificate stored in the immutable area verifies the decrypted write request and the write data, and executes the write operation after the verification is successful.
[0006] This application also provides a data exchange system, including a first trusted execution environment side and a second trusted execution environment side deployed on a server. The first trusted execution environment side is connected to a first network via a first network card, and the second trusted execution environment side is connected to a second network via a second network card. The two establish an authentication relationship. The first trusted execution environment side is used to execute the steps of the data exchange method described above; The second trusted execution environment is used to execute the steps of the data exchange method described above to complete the data exchange corresponding to the read and write operations.
[0007] This application also provides an electronic device, including: A memory is used to store computer programs; a processor is used to implement the steps of any of the above data exchange methods when executing a computer program.
[0008] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described data exchange methods.
[0009] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described data exchange methods.
[0010] This application achieves several key improvements. First, the first and second trusted execution environments connect to isolated networks via their respective network interface cards (NICs). This eliminates the need for ordinary virtual machines (VMs) that are transparent to privileged software on the host machine. Encrypted transmission is achieved through keys established by the authentication relationship between the two trusted execution environments, preventing eavesdropping and tampering by privileged software. It also establishes an authenticated exchange channel, enabling direct connection for cross-network data exchange without indirect paths like hops. Second, when a read operation is initiated in the first trusted execution environment, the read request is encrypted. During cross-network exchange, the confidentiality of the request is ensured through encryption, preventing eavesdropping. Simultaneously, verification processing generates multiple verification credentials associated with the verification baseline information, guaranteeing the integrity and authenticity of real-time request data. This prevents tampering and replay attacks; even if an attacker gains access to the shared storage area, they cannot decrypt the request content or forge a legitimate request. The direct exchange of requests between the two trusted execution environments via the shared storage area eliminates the need for virtual switches and network gateways, significantly shortening the cross-network path. Secondly, when obtaining the encrypted read request response from the second trusted execution environment and storing it in the shared storage area, verification must first be performed using the verification benchmark information and multiple verification credentials. Responses that are tampered with, forged, or replayed en route will fail. Verification and decryption are both completed within the first trusted execution environment. Plaintext read data never leaves the trusted boundary, and verification is embedded in the receiving process and completed locally, eliminating the need for additional serial checking mechanisms. Finally, when a write operation is initiated from the first trusted execution environment, the write data is also transmitted in encrypted form directly through the shared storage area, forming a bidirectional exchange channel with the read data, ensuring that privileged software cannot see the plaintext in either direction. The signature credential is stored in an immutable storage area, enabling traceability of data flow from a high-security domain to a low-security domain. Compared to conventional solutions that use encrypted transmission and signature credential storage, this does not burden transmission efficiency. The data is written only after being decrypted and verified by the second trusted execution environment. This ensures the security and integrity of the written data without the need for third-party checks, enabling direct cross-network connections and improving transmission efficiency.
[0011] Because the first and second trusted execution environments connect to isolated networks via their respective network cards and establish authentication relationships, and use keys to encrypt read and write requests and data throughout the entire process, cross-network data remains encrypted throughout the shared storage transfer. The integrity verification of response data is built into the receiving process of the trusted execution environment and completed locally. Response data must be verified based on the verification benchmark information and multiple verification credentials before it can be decrypted. Tampered, forged, or replayed responses will not pass. Plaintext read data never leaves the trusted boundary. In write operations, signature certificates are generated through signature generation processing and stored independently in an immutable storage area, realizing the parallel execution of security supervision and data exchange. Therefore, it can solve the technical problems of reduced security and low transmission efficiency caused by conventional network isolation requiring relay and full visibility, which leads to data eavesdropping and tampering. It achieves the technical effect of effectively improving the efficiency of cross-network data exchange through direct connection exchange channels and end-to-end encrypted transmission mechanism between trusted execution environments while ensuring network isolation security. It can achieve secure, efficient, and traceable cross-network data exchange without the introduction of third-party inspection equipment. Attached Figure Description
[0012] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This application provides a schematic diagram of the architecture of a data exchange system. Figure 2 A flowchart illustrating a data exchange method applied to a first trusted execution environment side, provided as an embodiment of this application; Figure 3 A flowchart illustrating a data exchange method applied to a second trusted execution environment side, provided as an embodiment of this application; Figure 4 A schematic diagram of a data exchange device applied to a first trusted execution environment side, provided in an embodiment of this application; Figure 5 This is a schematic diagram of a data exchange device applied to a second trusted execution environment side, provided as an embodiment of this application. Detailed Implementation
[0014] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0015] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0016] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0017] With the development of technologies such as artificial intelligence and cloud computing, data has become a core production factor. However, data is intangible and non-consumable, and can be copied infinitely at near-zero cost. Therefore, security issues in data circulation and processing cannot be ignored. Network segmentation is an important means of protecting critical data security. Its core lies in ensuring the isolation of core data from networks of different security levels, preventing external attacks and internal leaks.
[0018] With the advancement of digitalization, networks have been divided into critical business and sensitive data zones to create security boundaries, but this has also significantly impacted data exchange. For example, copying data using USB drives poses a risk of virus transmission and is cumbersome. Plaintext file transfers (FTP) are easily blocked. Firewalls, as single nodes, can easily become single points of bottleneck in performance and reliability. While network gateways use data transfer mechanisms to achieve physical isolation, their transmission rates are low, and they typically only support static data exchange, making them unsuitable for high-real-time interactive scenarios.
[0019] Furthermore, while network isolation constructs security boundaries, it also blocks direct paths for cross-network data exchange. When network domains are divided in a virtualized manner on the same host, data between virtual domains must be relayed through components such as virtual switches or memory on the host machine. Ordinary virtual machine memory is fully visible to privileged software on the host machine, making relayed data susceptible to eavesdropping and loss of confidentiality, and potentially susceptible to tampering. This further reduces the security of isolation. The ferry and serial checking mechanisms introduced to compensate for these security flaws further reduce transmission efficiency. The data exchange method provided in this application can solve the above-mentioned technical problems.
[0020] The specific application environment architecture or specific hardware architecture on which the execution of the data exchange method depends is described here.
[0021] Confidential computing utilizes Trusted Execution Environment (TEE) hardware to construct a computing environment with capabilities such as secure isolation, memory encryption, remote authentication, and data encapsulation. This protects the confidentiality and integrity of code and data running within the confidential computing environment from the snooping and tampering of untrusted privileged software. Based on this, this application constructs a server network security isolation and data exchange system using a Trusted Execution Environment. Specifically, a first Trusted Execution Environment (TEE) and a second Trusted Execution Environment (TEE) are established on one host or different hosts. The first and second TEEs establish trust through an authorization and authentication mechanism. The first TEE connects to the first network via a first network interface card (NIC), and the second TEE connects to the second network via a second NIC. The second TEE cannot directly access data on the first network, thus achieving network isolation. Cross-network data exchange is initiated by the first TEE, with data transmitted in encrypted form and audit information recorded in an immutable storage area. Therefore, this application can achieve secure network isolation and efficient cross-network data exchange on the host, ensuring data security and auditable data exchange, and improving operational convenience.
[0022] Figure 1 This is a schematic diagram of the architecture of a data exchange system provided in an embodiment of this application, such as... Figure 1As shown, the system includes a first trusted execution environment (TEX) side 1, a first network interface card (NIC) 3, a second trusted execution environment (TEX) side 2, a second NIC 4, a security check module, an immutable storage area, and a message queue. The immutable storage area provides tamper-proof and traceable audit credentials for write operations. It can be a blockchain module or any storage system with the characteristics of being immutable and verifiable after writing; no specific limitation is made here. Data transmission occurs between the first TEX side 1 and the first NIC 3, with the first NIC 3 connected to a switch or server of the first network. The second TEX side 2 is directly connected to the second NIC 4, which is connected to a server or switch of the second network. It should be noted that the transmission between the first TEX side 1 and the first NIC 3, and between the second TEX side 2 and the second NIC 4, can be encrypted or unencrypted, depending on the network characteristics. For networks requiring a higher level of security, encrypted transmission is preferred. If the transmission processes between the first trusted execution environment side 1 and the first network card 3, and between the second trusted execution environment side 2 and the second network card 4 are all encrypted, then the encryption methods corresponding to the encrypted transmissions can be the same or different, depending on the actual situation.
[0023] The message queue stores read requests sent from servers in the first network to servers in the second network, including attribute information such as the read address, data length, data update time, and challenge information. Upon receiving a response to a read request, the corresponding message is dequeued from the message queue. The security check module verifies the integrity of the read data and performs virus detection. If the detection passes, the first trusted execution environment receives the data. If the detection fails, the first trusted execution environment destroys the data and records the result for auditing. The immutable storage area records write operations performed by the first trusted execution environment, including attribute information such as data hash value, digital signature, user information, and data exchange time, for subsequent auditing.
[0024] The embodiments of this application provide a data exchange method, and the method is described in detail below in conjunction with the execution flow of the data exchange method.
[0025] Figure 2 A flowchart of a data exchange method applied to a first trusted execution environment side provided in this application embodiment is shown below. Figure 2 As shown, this method is applied to a first trusted execution environment (TEX) connected to a first network via a first network interface card (NIC) to establish an authentication relationship with a second trusted execution environment connected to a second network. The method includes: S11: Obtain the key for the authentication relationship; S12: When a read operation is initiated on the first trusted execution environment side, the first trusted execution environment side uses a key to encrypt and verify the read request, obtains the encrypted read request and the multi-verification credential associated with the verification base information of the read request, and stores it in the shared storage area; when the response data of the encrypted read request is obtained from the second trusted execution environment side and stored in the shared storage area, the response data is verified based on the verification base information and the multi-verification credential to obtain the read data in plaintext form; S13: When the first trusted execution environment initiates a write operation, it uses a key to encrypt and sign the write request and the write data to obtain encrypted write information and signature credentials, which are stored in the shared storage area and the immutable storage area respectively, so that the second trusted execution environment can decrypt and verify them before writing.
[0026] Specifically, the first trusted execution environment (TEX) is a confidential virtual machine (VM) created based on the host's hardware resources, i.e., a network-1 TEE. It is a computing environment built with the TEX hardware, possessing capabilities such as secure isolation, memory encryption, remote authentication, and data encapsulation. It connects to the first network via a first network interface card (NIC), and the code and data running within this environment are protected from spying and tampering by untrusted privileged software. Cross-network data exchange can be initiated by either the first TEX or the peer second TEX, without limitation. In this embodiment, the first TEX initiates the exchange, and the second TEX receives the instructions and performs subsequent operations. The execution entity here is the confidential VM running on the server's physical host, which relies on a processor supporting confidential computing extensions. Similarly, the second TEX relies on a processor supporting confidential computing extensions. This processor and the processor of the first TEX are the same processor if they are in the same host processing scenario; otherwise, they are their respective corresponding processors.
[0027] The second trusted execution environment (TEX) is also a confidential virtual machine created based on the host's hardware resources, namely network 2TEE. It can be deployed on the same host as the first TEX or on a different host. It is connected to the second network via a second network card. The second TEX cannot directly access the data of the first network to achieve network isolation when exchanging data across networks.
[0028] An authentication relationship is an authorization and authentication relationship established between a first trusted execution environment (TEX) and a second trusted execution environment (DEA) based on pre-set user permissions. For example, if a first network user A and a second network user B authorize each other, an authentication relationship is established between the first TEX corresponding to user A and the second TEX corresponding to user B.
[0029] The key, a symmetric key negotiated between the first and second trusted execution environments (TEX) based on the established authentication relationship, is used to encrypt the data exchanged between them, specifically the data transmitted to shared memory. Simultaneously, a shared storage region, such as a shared memory region, is constructed outside the first and second TEXs to cache the encrypted data exchanged between them.
[0030] Verification processing is the process of calculating a fixed-length digest value for the object being processed using a hash algorithm. This digest value is a hash value, which changes with any changes to the object being processed. It is used to verify the integrity and authenticity of the data. There is no limitation on the specific hash algorithm used; it can be set according to the actual situation.
[0031] Verification baseline information refers to the information in the read request that serves as the basis for subsequent verification. It includes at least the attribute information and challenge information of the data to be read. The attribute information includes at least one or more of the following: read address, data length, and data update time. The challenge information is a randomly generated challenge value used to subsequently verify the integrity of the read data. Multiple verification credentials are a combination of multiple verification credentials generated through verification processing and associated with the verification baseline information. They include at least a first verification credential and a second verification credential. The first verification credential is a hash value obtained by verifying the encrypted read data, such as hash value H1, used to verify whether the read data has been tampered with. The second verification credential is a hash value obtained by verifying the attribute information, the random challenge value, and the first verification credential, such as hash value H2, used to resist replay attacks.
[0032] The signature generation process is a process of digesting first and then signing. That is, first, the write request and the write data are verified to obtain a digest value, and then the private key of the first trusted execution environment is used to sign the digest value to obtain a digital signature. In other words, it covers the entire process from data preparation to signature output.
[0033] A signature credential is a document used for auditing and tracing write operations. It includes a third-party verification credential obtained by verifying the write request and the written data, and a digital signature obtained by signing the third-party verification credential. It may also include attribute information such as user information and data exchange time. The third-party verification credential, for example, is a hash value H3. The signature credential is written to an immutable storage area, such as a blockchain, to prevent information tampering and for subsequent auditing.
[0034] The key for obtaining the authentication relationship in step S11 is based on setting the authentication relationship between the first trusted execution environment and the second trusted execution environment according to pre-set user permissions. Assuming mutual authorization between the first network user A and the second network user B, the key could be a symmetric key negotiated between the first trusted execution environment corresponding to user A and the second trusted execution environment corresponding to user B, or other keys set by the two trusted execution environments. This key is primarily used to encrypt the exchanged data. A shared storage area is constructed outside the first and second trusted execution environments to cache the encrypted data exchanged between them.
[0035] In step S12, when a read operation is initiated on the first trusted execution environment side, the read request is encrypted and verified using a key, such as... Figure 1 As shown, the first trusted execution environment writes a read request to a message queue. This read request includes attribute information such as the read address, data length, and data update time, as well as random challenge information, all of which serve as verification benchmark information. The first trusted execution environment encrypts the read request using a key and stores the encrypted read request in a shared storage area. The second trusted execution environment reads the encrypted read request from the shared storage area and decrypts it using a key. The second trusted execution environment reads the data according to the read address and data length, encrypts the read data using the key, and calculates the hash value H1 of the encrypted read data, which is the first verification credential. It then calculates the attribute information of the read data, the random challenge value, and the hash value H2 of hash value H1, which is the second verification credential. Finally, it writes the hash values H1, H2, and the encrypted read data as response data into the shared storage area.
[0036] In step S12, based on the verification benchmark information and the multi-verification credential verification response data, plaintext read data is obtained, such as... Figure 1 As shown, the first trusted execution environment reads response data from the shared storage area, extracts the corresponding read request message from the message queue to obtain the verification benchmark information, calculates the attribute information, random challenge information, and hash value of hash value H1 to obtain a new hash value H2, and compares it with hash value H2. If the results are consistent, the hash value of the encrypted read data is calculated and compared with hash value H1. If the results are consistent, the encrypted read data is decrypted using the key to obtain the read data in plaintext form.
[0037] In step S13, when initiating a write operation on the first trusted execution environment side, the first trusted execution environment side uses a key to encrypt and sign the write request and the write data, such as... Figure 1As shown, the first trusted execution environment encrypts the write request using a key and writes the encrypted write request to the shared storage area. The write request includes information such as the write address, data length, and data exchange time. The second trusted execution environment reads the encrypted write request from the shared storage area and decrypts it using the key, preparing to receive the written data. The first trusted execution environment concatenates the write request with the written data, calculates the hash value H3 of the concatenated data, which is the third verification credential, and signs the hash value H3 using the private key of the first trusted execution environment to obtain a digital signature.
[0038] In step S13, the encrypted message and signature certificate are stored in the shared storage area and the immutable storage area respectively, so that the second trusted execution environment can decrypt and verify them before writing them. Figure 1 As shown, the first trusted execution environment writes digital signatures and hash values (H3) and other signature credentials into an immutable storage area for subsequent auditing. The first trusted execution environment encrypts the written data using a key and writes the encrypted data into a shared storage area for the second trusted execution environment to read and decrypt from the shared storage area. After successful verification based on the signature credentials in the immutable storage area, the written data is written to a designated location.
[0039] It should be noted that the data exchange method of this application is suitable for high real-time interactive scenarios, and data is transmitted in real time.
[0040] This application achieves several key improvements. First, the first and second trusted execution environments connect to isolated networks via their respective network interface cards (NICs). This eliminates the need for ordinary virtual machines (VMs) that are transparent to privileged software on the host machine. Encrypted transmission is achieved through keys established by the authentication relationship between the two trusted execution environments, preventing eavesdropping and tampering by privileged software. It also establishes an authenticated exchange channel, enabling direct connection for cross-network data exchange without indirect paths like hops. Second, when a read operation is initiated in the first trusted execution environment, the read request is encrypted. During cross-network exchange, the confidentiality of the request is ensured through encryption, preventing eavesdropping. Simultaneously, verification processing generates multiple verification credentials associated with the verification baseline information, guaranteeing the integrity and authenticity of real-time request data. This prevents tampering and replay attacks; even if an attacker gains access to the shared storage area, they cannot decrypt the request content or forge a legitimate request. The direct exchange of requests between the two trusted execution environments via the shared storage area eliminates the need for virtual switches and network gateways, significantly shortening the cross-network path. Secondly, when obtaining the encrypted read request response from the second trusted execution environment and storing it in the shared storage area, verification must first be performed using the verification benchmark information and multiple verification credentials. Responses that are tampered with, forged, or replayed en route will fail. Verification and decryption are both completed within the first trusted execution environment. Plaintext read data never leaves the trusted boundary, and verification is embedded in the receiving process and completed locally, eliminating the need for additional serial checking mechanisms. Finally, when a write operation is initiated from the first trusted execution environment, the write data is also transmitted in encrypted form directly through the shared storage area, forming a bidirectional exchange channel with the read data, ensuring that privileged software cannot see the plaintext in either direction. The signature credential is stored in an immutable storage area, enabling traceability of data flow from a high-security domain to a low-security domain. Compared to conventional solutions that use encrypted transmission and signature credential storage, this does not burden transmission efficiency. The data is written only after being decrypted and verified by the second trusted execution environment. This ensures the security and integrity of the written data without the need for third-party checks, enabling direct cross-network connections and improving transmission efficiency.
[0041] Because the first and second trusted execution environments connect to isolated networks via their respective network cards and establish authentication relationships, and use keys to encrypt read and write requests and data throughout the entire process, cross-network data remains encrypted throughout the shared storage transfer. The integrity verification of response data is built into the receiving process of the trusted execution environment and completed locally. Response data must be verified based on the verification benchmark information and multiple verification credentials before it can be decrypted. Tampered, forged, or replayed responses will not pass. Plaintext read data never leaves the trusted boundary. In write operations, signature certificates are generated through signature generation processing and stored independently in an immutable storage area, realizing the parallel execution of security supervision and data exchange. Therefore, it can solve the technical problems of reduced security and low transmission efficiency caused by conventional network isolation requiring relay and full visibility, which leads to data eavesdropping and tampering. It achieves the technical effect of effectively improving the efficiency of cross-network data exchange through direct connection exchange channels and end-to-end encrypted transmission mechanism between trusted execution environments while ensuring network isolation security. It can achieve secure, efficient, and traceable cross-network data exchange without the introduction of third-party inspection equipment.
[0042] In some embodiments, before establishing an authentication relationship between the first trusted execution environment (TEX) and the second trusted execution environment (TEX), the method further includes: The first trusted execution environment and the second trusted execution environment perform bidirectional remote authentication to verify the authenticity and integrity of each other's trusted execution environment. After the dual-phase remote verification is passed, the access level between the first network user corresponding to the first trusted execution environment and the second network user corresponding to the second trusted execution environment is determined based on the permission maintenance table generated in advance by registration. When the access level meets the authorization conditions, the first trusted execution environment and the second trusted execution environment establish an authentication relationship.
[0043] Specifically, remote authentication is one of the capabilities of a trusted execution environment (TEE). Establishing authentication and obtaining keys between the first and second TEE sides requires remote authentication. Unlike conventional virtualization solutions, this requires mutual verification between the first and second TEE sides—a two-way remote authentication—to verify the authenticity and integrity of each other's TEE environments. This confirms that the other party is indeed running on genuine TEE hardware and that the code and data within that environment have not been tampered with, thus eliminating the possibility of a forged or tampered environment accessing data exchange. Only after successful verification can the two parties negotiate a session key, i.e., negotiate a symmetric key, or obtain the corresponding key.
[0044] Furthermore, regarding access levels, even if both parties are genuine TEEs, it doesn't guarantee they have the authority to exchange all data. Therefore, a permission maintenance table is introduced. This table is pre-generated through registration-based authorization and records the access levels between the first and second network users. For scenarios involving data transfer from a high-security domain to a low-security domain, it's necessary to obtain the access level of the high-security domain. This means that data flow from a high-security domain to a low-security domain is controlled by the access level. Only when the access level meets the authorization conditions, such as mutual authorization between first network user A and second network user B, will the first trusted execution environment (TEE) corresponding to user A establish an authentication relationship with the second TEE corresponding to user B.
[0045] The two-way remote authentication and authorization confirmation based on the permission maintenance table provided in this embodiment combine environment authenticity verification and user permission verification to prevent access from the forged trusted execution environment side and permission abuse, realize permission management of the first network and the second network, and lay a reliable foundation for subsequent cross-network data exchange with full encryption under the key.
[0046] In some embodiments, the multi-verification credential includes at least a first verification credential and a second verification credential; the first trusted execution environment uses a key to encrypt and verify the read request, obtaining an encrypted read request and a multi-verification credential associated with the verification baseline information of the read request, including: The first trusted execution environment uses a key to encrypt the read request to obtain an encrypted read request, which is then stored in the shared storage area. This allows the second trusted execution environment to read the encrypted read request from the shared storage area and decrypt it using the key to obtain the read request. The first trusted execution environment receives the encrypted read request and the first verification credential obtained by the second trusted execution environment using the key to encrypt and verify the read request. The first trusted execution environment performs verification processing based on the verification benchmark information of the read request and the first verification credential to obtain the second verification credential.
[0047] Specifically, the first trusted execution environment (TEX) encrypts the read request using a key to obtain an encrypted read request, which is then stored in the shared storage area. The second TEX then reads the encrypted read request from the shared storage area and decrypts it using the same key. In other words, the first TEX encrypts the read request using the key, and the second TEX retrieves this encrypted read request from the shared storage area and decrypts it using the same key. The second TEX then determines the data to be read based on the read request, encrypts the data using the same key, and verifies the encryption result to obtain a first verification credential. In other words, both the encrypted read request and the first verification credential are obtained by encrypting and verifying the read request using the same key.
[0048] Furthermore, the second trusted execution environment performs verification processing based on the verification benchmark information of the read request and the first verification credential to obtain the second verification credential. In other words, the second verification credential binds the verification benchmark information, such as attribute information and challenge information, together with the first verification credential, and returns it to the first trusted execution environment as response data through the shared storage area, along with the encrypted read data and the first verification credential.
[0049] The dual-credential mechanism of the first verification credential and the second verification credential provided in this embodiment is as follows: the first verification credential is used to read the integrity of the data to verify whether it has been tampered with, and the second verification credential binds the verification benchmark information with the first verification credential to verify the correspondence between the request and the response, thereby resisting replay attacks. Even if an attacker can access the shared storage area, they cannot forge legitimate response data, thus ensuring the integrity and authenticity of cross-network data reading.
[0050] In some embodiments, the verification benchmark information includes at least attribute information and challenge information of the data to be read; the attribute information includes at least one or more of the following: read address, data length, and data update time; the process of determining the first verification credential includes: Obtain the data to be read, determined by the second trusted execution environment based on the read address and data length of the read request; The data to be read is encrypted using a key to obtain encrypted data. The encrypted read data is verified to obtain the first verification credential. Correspondingly, the process of determining the second verification credential includes: The second verification credential is obtained by performing verification processing based on the attribute information, challenge information, and the first verification credential.
[0051] Specifically, the read request written to the message queue by the first trusted execution environment includes attribute information such as read address, data length, and data update time, as well as random challenge information. This random challenge information is used to subsequently verify the integrity of the read data. After the second trusted execution environment decrypts the read request using the key, it determines and reads the data to be read based on the read address and data length in the read request. It then encrypts the data to be read using the key to obtain encrypted read data. Finally, it verifies the encrypted read data by calculating the hash value H1 of the encrypted read data, and uses the hash value H1 as the first verification credential.
[0052] Correspondingly, the second trusted execution environment performs verification processing based on the attribute information, random challenge value, and hash value H1 of the read data. Specifically, it calculates the hash value H2 of the attribute information, random challenge information, and hash value H1, using hash value H2 as the second verification credential. Then, the second trusted execution environment writes hash value H1, hash value H2, and the encrypted read data into the shared storage area as the response data corresponding to the read request.
[0053] The process for determining the first and second verification credentials provided in this embodiment uses the hash value of the encrypted read data as the first verification credential to ensure integrity verification. The second verification credential is obtained by combining attribute information, random challenge information, and the first verification credential in a verification process. This ensures that each response data is bound to the random challenge data of the current read request, preventing verification from failing when replaying historical responses due to different challenge values, thereby achieving tamper-proof and replay-resistant protection.
[0054] In some embodiments, based on the verification benchmark information and the multi-verification credential verification response data, plaintext read data is obtained, including: Extract the verification baseline information corresponding to the read request from the response data obtained from the shared storage area; The second verification certificate is recalculated and compared with the first verification certificate based on the verification benchmark information to verify the correspondence between the response data and the read request. If the recalculation and comparison pass, an integrity comparison is performed on the encrypted read data in the response data based on the first verification certificate; If the integrity check passes, the encrypted data is decrypted using the key to obtain the plaintext data.
[0055] Specifically, after the first trusted execution environment reads the response data from the shared storage area, it extracts the corresponding read request message from the message queue to obtain the verification benchmark information corresponding to this read request, namely attribute information and random challenge information. Based on the verification benchmark information and the first verification credential, the second verification credential is recalculated and compared to verify that the response data indeed corresponds to this read request, preventing impersonation using responses from other requests or historical responses.
[0056] Regarding the recalculation comparison, the calculation is repeated, and then the result is compared with the previous result. If the recalculation comparison passes, the integrity of the encrypted read data in the response data is then compared based on the first verification credential to verify that the encrypted read data has not been tampered with during transmission through the shared storage area.
[0057] Furthermore, only after both the recalculation and integrity checks pass will the first trusted execution environment decrypt the encrypted data using the key to obtain the plaintext data. It is important to note that both verification and decryption are performed internally within the first trusted execution environment, and the plaintext data never leaves the trusted boundary.
[0058] The multi-layered progressive verification process provided in this embodiment, which includes prior verification of correspondence, subsequent verification of integrity, and final decryption, enables response data that has been tampered with, forged, or replayed during the process to be intercepted before decryption. The verification is embedded in the receiving process and completed locally, without relying on additional serial checking mechanisms, thus ensuring the security of read data without affecting data transmission efficiency.
[0059] In some embodiments, the recalculation and comparison process specifically includes: The verification process is performed based on the attribute information of the verification benchmark information, the challenge information, and the first verification credential to obtain a new second verification credential. If the new second verification document matches the second verification document, then the recalculation comparison is deemed successful. Correspondingly, the complete comparison process specifically includes: The encrypted read data is verified to obtain a new first verification credential. If the new first verification document matches the first verification document, then the complete comparison is considered successful.
[0060] Specifically, the first trusted execution environment uses the same verification process as the second trusted execution environment. It performs verification based on locally stored attribute information, random challenge information, and the first verification credential carried in the response data, such as hash value H1, to recalculate a new second verification credential. This new second verification credential is then compared with the second verification credential carried in the response data, such as hash value H2. If the results match, the recalculation and comparison are considered successful, indicating that the response data corresponds to this read request and the verification baseline information has not been tampered with.
[0061] Correspondingly, the first trusted execution environment verifies the encrypted read data in the response data and recalculates a new first verification credential. This new first verification credential is compared with the first verification credential carried in the response data, such as the hash value H1. If the results match, the complete comparison is considered successful, indicating that the encrypted read data has not been tampered with. If any of the above comparison results are inconsistent, the response data verification is deemed to have failed.
[0062] The comparison process here can be a one-to-one comparison, or it can be based on the original hash values and other methods, such as bucketing, where the high-order bits of the hash values are pre-grouped according to specific rules, and the comparison is only performed with hash values in the same group, avoiding a complete traversal. Faster hash algorithms can also be used, or hardware can be involved to achieve parallel hash calculations, distributing the comparison task to multiple processing units for simultaneous execution. Different comparison methods are not limited in this application; they can be set according to the actual situation.
[0063] The recalculation comparison and complete comparison method provided in this embodiment, which compares the newly calculated voucher with the received voucher for consistency, improves the reliability of data reading verification.
[0064] In some embodiments, the first trusted execution environment uses a key to encrypt and sign the write request and the write data, obtaining encrypted write information and a signature credential, including: The write request and the write data are encrypted using a key to obtain encrypted write request and encrypted write data, which serve as encrypted write information. The signature generation process based on the write request and the written data yields a third verification credential and a digital signature, which serve as the signature credential.
[0065] Specifically, the first trusted execution environment encrypts the write request using a key to obtain an encrypted write request. This encrypted write request is then written to the shared storage area. The write request includes information such as the write address, data length, and data exchange time, so that the second trusted execution environment can read the encrypted write request from the shared storage area and decrypt it using the key, preparing to receive the written data.
[0066] The first trusted execution environment uses a key to encrypt the write data, resulting in encrypted write data, which is then written to the shared storage area. The encrypted write request and the encrypted write data constitute the encrypted write information, ensuring that both write requests and data are transmitted in ciphertext form through the shared storage area.
[0067] Furthermore, the first trusted execution environment performs signature processing based on the write request and the written data, that is, first digesting and then signing, to obtain a third verification credential and a digital signature. This is then written as a signature credential into an immutable storage area to serve as evidence of the operation of writing data from the first network to the second network.
[0068] Typically, when writing to immutable storage areas during write operations, the security domain of the internal network is higher than that of the external network during data transmission between the internal and external networks. Therefore, the controlled leakage channel from the high security domain to the low security domain is traceable, preventing data leakage.
[0069] The encryption and signing process for write operations provided in this embodiment involves encrypting both the write request and the write data before transmission, ensuring that privileged software cannot access the write operation in plaintext. Simultaneously, the signature credential generated through the signing process is independently stored in an immutable storage area, enabling traceability of the data transmission channel and preventing malicious first-party data leakage.
[0070] In some embodiments, a third verification credential and a digital signature are obtained by performing a signature generation process based on the write request and the write data, including: The write request and the write data are concatenated to obtain the concatenated write information; The concatenated written information is verified to obtain a third verification credential. Obtain the private key from the first trusted execution environment; A digital signature is obtained by signing a third-party verification credential using a private key.
[0071] Specifically, the first trusted execution environment concatenates the write request and the write data to obtain the concatenated write information. Regarding the concatenation method, it can be a direct concatenation with sequential merging, directly joining the byte streams or character streams of the two data parts in sequence; it can also be a structured concatenation with a delimiter, inserting a known delimiter between the two data parts that will not conflict with the main text; or it can be a standardized concatenation with a uniform format. There are no restrictions here; it can be set according to the actual situation.
[0072] The concatenated write information is then verified, specifically by calculating the hash value H3 of the concatenated data. This hash value H3 is used as the third verification credential. Since the third verification credential is obtained through verification involving both the write request and the written data, any modification to the write request or the written data will cause the third verification credential to change, thus binding the write operation request and the data together.
[0073] Furthermore, the first trusted execution environment uses its own private key to sign the hash value H3 to obtain a digital signature. Then, the first trusted execution environment writes the encrypted write request, the digital signature, and the hash value H3 into an immutable storage area. The signature credential may also include attribute information such as user information and data exchange time for subsequent auditing.
[0074] The signature generation process provided in this embodiment, which includes splicing, digesting, and private key signing, ensures the integrity of the write request and the written data through a third verification credential. The private key signature binds the write operation to the identity of the first trusted execution environment side, achieving non-repudiation. The signature credential is written to an immutable storage area such as a blockchain, preventing the audit information itself from being tampered with and providing a reliable basis for subsequent traceability.
[0075] In some embodiments, the writing process, after decryption and verification by the second trusted execution environment, includes: The second trusted execution environment reads the encrypted write information from the shared storage area and uses the key to decrypt the encrypted write information to obtain the write data in plaintext form. The second trusted execution environment performs signature verification on the plaintext write data based on the signature credential, and writes the plaintext write data to the write position corresponding to the write request if the verification is successful.
[0076] Specifically, the encrypted data is transmitted to the second trusted execution environment via the shared storage area. The second trusted execution environment reads the encrypted data from the shared storage area and decrypts it using a key to obtain the plaintext data. Since the data remains in ciphertext throughout the entire cross-network transmission process, and decryption only occurs within the second trusted execution environment, the confidentiality of the data is guaranteed.
[0077] Furthermore, the second trusted execution environment reads the signature certificate stored by the first trusted execution environment from the immutable storage area. Based on the signature certificate, it performs signature verification processing on the plaintext write data to verify that the write data indeed originated from the first trusted execution environment and has not been tampered with during transmission. If the verification passes, the second trusted execution environment writes the plaintext write data to the write location corresponding to the write request and writes the verification result to the log.
[0078] The decryption and signature-based verification process provided in this embodiment on the second trusted execution environment side ensures the security and integrity of the written data. At the same time, the verification basis comes from an immutable storage area that cannot be tampered with, eliminating the need to introduce third-party inspection equipment. This enables direct cross-network connection writing while ensuring that the write operation is auditable and traceable.
[0079] In some embodiments, the second trusted execution environment performs signature verification processing on the plaintext written data based on the signature credential, including: The second trusted execution environment concatenates the plaintext write data with the encrypted write request to obtain the new concatenated write information. The newly concatenated written information is verified to obtain a new third verification credential. If the new third verification credential matches the original third verification credential, then the signature verification is considered successful.
[0080] Specifically, the second trusted execution environment concatenates the write request with plaintext write data using the same concatenation interface as the first trusted execution environment, resulting in a new concatenated write information. The write request used for concatenation can be either a write request decrypted using a key by the second trusted execution environment or an encrypted write request obtained from the shared storage area, as long as the concatenation interface agreed upon by both sides remains consistent. The second trusted execution environment then verifies the new concatenated write information and recalculates a new third verification credential, namely the hash value H4.
[0081] Furthermore, the second trusted execution environment reads the digital signature and the third verification credential (hash value H3) from the immutable storage area, verifies the digital signature, and compares hash value H3 with hash value H4. If the new third verification credential matches, the signature verification is successful, and the data is written to the specified write address. If the results are inconsistent, the data is written to the buffer instead of the actual write location, and the second trusted execution environment writes the verification result to the log.
[0082] The signature verification process provided in this embodiment compares a newly calculated third verification credential with the third verification credential in the immutable storage area. Any tampering with the write request or the written data will result in a mismatch. The mismatched data is diverted to the cache area instead of the formal write location, preventing suspicious data from entering the second network. At the same time, the verification result is written to the log, realizing the integrity and security protection of write-direction data exchange.
[0083] In some embodiments, the method further includes: During the process of encrypting the read request when initiating a read operation on the first trusted execution environment side, and / or during the process of encrypting the write request and the written data when initiating a write operation on the first trusted execution environment side, random numbers are introduced for randomized encryption so that the same plaintext request and / or data generates different ciphertexts in different data exchanges.
[0084] Specifically, during the encryption of read requests using a key, and / or during the encryption of write requests and written data using a key, random numbers are introduced into the encryption operation to perform randomized encryption. Because the random numbers introduced in each encryption are different, the same plaintext will generate completely different ciphertexts in different data exchanges. Attackers cannot infer the plaintext content by observing the repeating patterns of the ciphertext in the shared storage area.
[0085] Furthermore, data between the first trusted execution environment and the second trusted execution environment is transmitted in ciphertext via a shared storage area. Combined with randomized encryption, this can prevent bus eavesdropping attacks and side-channel attacks. Even if an attacker listens to the bus or collects side-channel information for a long time, they will not be able to establish a correlation between the ciphertext and the plaintext based on the statistical characteristics of the ciphertext.
[0086] The randomized encryption method that introduces random numbers provided in this embodiment effectively defends against side-channel attacks and bus eavesdropping attacks, further improving the confidentiality of data during cross-network data exchange.
[0087] In some embodiments, after obtaining the read data in plaintext form, the method further includes: The first trusted execution environment performs security checks on plaintext data read from the data side. If the detection passes, the plaintext read data is received to increment the current data exchange count corresponding to the second trusted execution environment by 1. If the detection fails, the plaintext read data is destroyed, and a feedback message indicating that the detection failed is sent to the second trusted execution environment, so that the current data exchange count corresponding to the second trusted execution environment is reduced by 1; Generate the inspection results of the read data in plaintext and write them to the log.
[0088] Specifically, the first trusted execution environment (TEX) performs security checks on the plaintext read data using a security inspection module. These checks include virus scanning to prevent data from the second network from carrying viruses into the first network. If the check passes, the TEX corresponding to user A on the first network receives the plaintext read data and increments the current data exchange count for the corresponding TEX by 1. If the check fails, the TEX destroys the plaintext read data and sends a failure feedback message to the TEX corresponding to user B on the second network. Upon receiving this feedback, the TEX decrements the corresponding current data exchange count by 1.
[0089] The first trusted execution environment generates a plaintext check result for the read data and writes the check result to the log. Regardless of whether the check passes or fails, the check result for this read data is recorded for subsequent auditing and tracing.
[0090] The security detection and data exchange count maintenance mechanism provided in this embodiment ensures the security of the first network environment through virus checks, destroying data that fails the check and preventing it from entering the first network. Furthermore, it drives the synchronous increase or decrease of the data exchange count between the two parties based on the detection results, ensuring that the data exchange count always reflects the confirmed successful exchange status.
[0091] In some embodiments, the method further includes: The first trusted execution environment sets up a message queue in the corresponding trusted zone to store read requests for read operations and write requests for write operations. A shared storage area is constructed outside the first and second trusted execution environments to store encrypted data; the encrypted data includes at least encrypted read requests, multi-factor authentication credentials, encrypted write information, and signature credentials.
[0092] Specifically, the message queue is set up in a trusted zone within the first trusted execution environment, meaning the message queue is within the protection scope of the trusted execution environment. The stored read request and write request metadata, along with challenge information, are protected from eavesdropping and tampering by untrusted privileged software, thus forming the control plane for data exchange.
[0093] The shared storage area is built outside the first trusted execution environment and the second trusted execution environment. It is used to store encrypted data, including encrypted read requests, multi-factor authentication credentials, encrypted write information and signature credentials, etc. It carries the transmission of encrypted data blocks and constitutes the data plane for data exchange.
[0094] Upon receiving a response to a read request, i.e., after receiving the response data, the corresponding message in the message queue is dequeued. Based on the message status of the message queue, flow control, timeout retransmission, and replay prevention for data exchange can be implemented. For example, a message for which no response is received within a preset time can be retransmitted, and duplicate responses to dequeued messages are identified as replays and rejected.
[0095] The reconfiguration of the message queue and shared storage area provided in this embodiment separates the control plane and the data plane. The control plane resides in the trusted area to ensure the trustworthiness of request metadata and challenge information, while the data plane carries the efficient transmission of encrypted data, ensuring both security and efficiency and reliability of cross-network data exchange.
[0096] In some embodiments, after verifying the response data based on the verification benchmark information and the multi-verification credential, and before obtaining the read data in plaintext form, the method further includes: The first trusted execution environment side and the second trusted execution environment side shall respectively maintain the corresponding data exchange counts synchronously; If the response data passes the verification based on the verification benchmark information and multiple verification credentials, the consistency verification process is performed between the number of data exchanges maintained by the first trusted execution environment and the number of data exchanges carried in the response data. If the consistency verification passes, the encrypted read data in the response data is decrypted to obtain the read data in plaintext form.
[0097] Specifically, the first trusted execution environment side and the second trusted execution environment side synchronously maintain the corresponding data exchange counts. Each time a successful data exchange is completed, the data exchange counts of both sides are updated synchronously, making the data exchange counts a synchronous state jointly maintained by both sides. The response data can also carry the data exchange counts currently maintained by the second trusted execution environment side.
[0098] Based on the verification of the response data using the verification benchmark information and multiple verification credentials, the first trusted execution environment performs consistency verification on the number of data exchanges maintained locally and the number of data exchanges carried in the response data, so as to continue verification based on the verification of multiple verification credentials.
[0099] Only if the consistency verification also passes will the encrypted read data in the response data be decrypted to obtain the plaintext read data. If an attacker replays historical responses or data exchange is lost, the number of data exchanges between the two parties will be inconsistent, and the response data can be intercepted before decryption.
[0100] This embodiment provides consistency verification by adding the number of data exchanges on top of multi-factor authentication. It introduces the exchange status maintained synchronously by both parties into the verification process, further resisting replay attacks and promptly detecting data loss or corruption, thus providing an additional layer of security for cross-network data exchange.
[0101] Furthermore, this application also provides a data exchange method applied to the second trusted execution environment side. Figure 3 A flowchart of a data exchange method applied to a second trusted execution environment side provided in this application embodiment is shown below. Figure 3 As shown, an authentication relationship is established with the first trusted execution environment connected to the first network via the first network interface card; the method includes: S21: Obtain the key for the authentication relationship; S22: When a read operation is initiated by the first trusted execution environment, the second trusted execution environment obtains the encrypted read request stored by the first trusted execution environment from the shared storage area, decrypts the encrypted read request using a key to obtain the read request; determines the read data according to the read request, encrypts and verifies the read data using a key to obtain the encrypted read data and a multi-verification credential associated with the verification base information of the read request, and stores it in the shared storage area as response data to the encrypted read request, so that the first trusted execution environment can verify the response data based on the verification base information and the multi-verification credential to obtain the read data in plaintext form; S23: When a write operation is initiated by the first trusted execution environment, the encrypted write information stored by the first trusted execution environment is obtained from the shared storage area, and the encrypted write information is decrypted using the key to obtain a write request; the first trusted execution environment uses the key to perform signature generation processing on the write request and the write data, and the signature certificate stored in the immutable area verifies the decrypted write request and the write data, and executes the write operation after the verification is successful.
[0102] Specifically, in step S22, the read operation involves the second trusted execution environment reading the encrypted read request stored by the first trusted execution environment from the shared storage area, and decrypting it using a key to obtain the read request. Data is read according to the read address and data length in the read request. The read data is then encrypted using the key, and a hash value H1 is calculated. The attribute information of the read data, random challenge information, and the hash value H2 of hash value H1 are then calculated. Hash value H1, hash value H2, and the encrypted read data are written as response data to the shared storage area, so that the first trusted execution environment can decrypt the read data in plaintext form after verification based on the verification benchmark information and multiple verification credentials.
[0103] In step S23, the write operation involves the second trusted execution environment reading the encrypted write request stored by the first trusted execution environment from the shared storage area and decrypting it using a key, preparing to receive the written data. It then reads the encrypted write data from the shared storage area and decrypts it using the key to obtain the plaintext write data. Next, the second trusted execution environment concatenates the write request with the plaintext write data, calculates the hash value H4 of the concatenated data, reads the digital signature and hash value H3 from the immutable storage area, verifies the digital signature, and compares hash value H3 with hash value H4. If the results match, the write data is written to the specified write address; if the results do not match, the write data is written to the cache, and the verification result is written to the log.
[0104] The description of the features of the data exchange method applied to the second trusted execution environment side in the corresponding embodiment can be found in the relevant description of the data exchange method applied to the first trusted execution environment side described above. It will not be repeated here, but it has the same beneficial effects as the data exchange method applied to the first trusted execution environment side described above.
[0105] Furthermore, this application also provides a data exchange system, including a first trusted execution environment side and a second trusted execution environment side deployed on a server. The first trusted execution environment side is connected to a first network via a first network interface card (NIC), and the second trusted execution environment side is connected to a second network via a second NIC. The two establish an authentication relationship. The first trusted execution environment side is used to execute the steps of the data exchange method applied to the first trusted execution environment side as described above; The second trusted execution environment side is used to execute the steps of the data exchange method applied to the second trusted execution environment side as described above to complete the data exchange corresponding to the read and write operations.
[0106] Specifically, cross-network data exchange occurs directly between the first trusted execution environment (TEX), the second trusted execution environment (TEX), and the shared storage area, without the need for a network gateway. This results in high data transmission efficiency and simple operation. Furthermore, each second network user has only one TEX, ensuring a clear correspondence in data exchange. Additionally, the first and second TEXs can contain other applications, which can run concurrently with data transmission without interference.
[0107] For a description of the data exchange system provided in this application, please refer to the above method embodiments. This application will not repeat the description here, as it has the same beneficial effects as the above data exchange method.
[0108] In some embodiments, the data exchange system further includes an acceleration device; the acceleration device includes a first acceleration device for interconnecting a first trusted execution environment side and a second acceleration device for interconnecting a second trusted execution environment side; Construct an equal number of first trusted execution environment sides and second trusted execution environment sides according to the number of network users of the first network and the number of network users of the second network; The first trusted execution environment is interconnected with the first acceleration device, and the second trusted execution environment is interconnected with the second acceleration device; The relationship between the first network interface card (NIC) and the first trusted execution environment (TEX), and between the second NIC and the second TEX, is either one-to-one or one-to-many. Data transmission between these two TEXs is determined by the network characteristics of the server. Specifically, let n be the number of first network users on the server host. n confidential virtual machines (VMs) are built on the host, with each first network user corresponding to one VM, which constitutes the first TEX. Let m be the number of second network users on the server host. m confidential VMs are built on the host, with each second network user corresponding to one VM, which constitutes the second TEX. The confidential VMs can interconnect with acceleration devices such as Graphics Processing Units (GPUs) and Field-Programmable Gate Arrays (FPGAs). The interconnection between the confidential VMs and acceleration devices can be achieved through shared memory or based on the TEE Device Interface Security Protocol (TDISP), allowing applications within the confidential VMs to utilize the computing power of the acceleration devices.
[0109] The relationship between the first network interface card (NIC) and the first trusted execution environment (TEX) can be one-to-one or one-to-many, and the relationship between the second NIC and the second TEX can also be one-to-one or one-to-many. Data transmission between them is determined by the corresponding network properties. For example, if the first network is a high-security domain, encrypted data transmission occurs between the first TEX and the first NIC, while the second TEX is directly connected to the second NIC. Alternatively, a distinction can be made between internal and external networks. If both the first and second networks are internal networks, encrypted data transmission occurs between the first NIC and the first TEX, and between the second NIC and the second TEX. If one of the first and second networks is an internal network and the other is an external network, encrypted data transmission occurs between the NIC on the internal network and its corresponding TEX, while unencrypted data transmission occurs between the NIC on the external network and its corresponding TEX. If both the first and second networks are external networks, unencrypted data transmission occurs between the first NIC and the first TEX, and between the second NIC and the second TEX. Alternatively, the security domain level can be used to determine this. If both networks have a higher security domain level, then both will use encrypted transmission; if only one network has a higher security domain level, then encrypted transmission will be used for that network. These settings can be configured according to the actual situation and are not limited here.
[0110] This embodiment provides a user-built confidential virtual machine and an interconnection setup between the confidential virtual machine and the acceleration device, enabling each network user to have an independent trusted execution environment, achieving user-level isolation and preventing mutual interference between users. The one-to-one or one-to-many relationship between the network card and the trusted execution environment, as well as the transmission method determined by the network characteristics, take into account both deployment flexibility and the differentiated needs of networks with different security levels.
[0111] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0112] The embodiments of this application also provide a data exchange device applied to a first trusted execution environment side, which is connected to a first network via a first network card, and establishes an authentication relationship with a second trusted execution environment side connected to a second network; Figure 4 A schematic diagram of a data exchange device applied to a first trusted execution environment side is provided as an embodiment of this application, as shown below. Figure 4 As shown, it includes: The first acquisition module 11 is used to acquire the key corresponding to the authentication relationship; The first read operation module 12 is used to encrypt and verify the read request using a key when the first trusted execution environment initiates a read operation, thereby obtaining an encrypted read request and a multi-verification credential associated with the verification base information of the read request, and storing it in the shared storage area; when the second trusted execution environment responds to the encrypted read request and stores the response data in the shared storage area, it verifies the response data based on the verification base information and the multi-verification credential to obtain the read data in plaintext form. The first write operation module 13 is used to encrypt and sign the write request and write data using a key when a write operation is initiated on the first trusted execution environment side, so as to obtain encrypted write information and signature certificate, and store them in the shared storage area and immutable storage area respectively, so that the second trusted execution environment side can decrypt and verify them before writing.
[0113] In addition, a data exchange device for use in a second trusted execution environment is provided, which is used in a second trusted execution environment connected to a second network via a second network card to establish an authentication relationship with a first trusted execution environment connected to a first network via a first network card; Figure 5 A schematic diagram of a data exchange device applied to a second trusted execution environment side is provided in an embodiment of this application, as shown below. Figure 5 As shown, it includes: The second acquisition module 14 is used to acquire the key for the authentication relationship; The second read operation module 15 is used to, when a read operation is initiated by the first trusted execution environment, obtain the encrypted read request stored by the first trusted execution environment from the shared storage area, decrypt the encrypted read request using a key to obtain the read request; determine the read data according to the read request, encrypt and verify the read data using a key to obtain the encrypted read data and the multi-verification credential associated with the verification benchmark information of the read request, and store it in the shared storage area as response data in response to the encrypted read request, so that the first trusted execution environment can verify the response data based on the verification benchmark information and the multi-verification credential to obtain the read data in plaintext form. The second write operation module 16 is used to obtain the encrypted write information stored by the first trusted execution environment side from the shared storage area when the write operation is initiated by the first trusted execution environment side, and use the key to decrypt the encrypted write information to obtain a write request; the first trusted execution environment side uses the key to perform signature generation processing on the write request and the write data, and the signature certificate stored in the immutable area verifies the decrypted write request and the write data, and executes the write after the verification is passed.
[0114] For a description of the features in the embodiment corresponding to the data exchange device, please refer to the relevant description in the embodiment corresponding to the data exchange method, which will not be repeated here.
[0115] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above-described data exchange method embodiments.
[0116] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described data exchange method embodiments at runtime.
[0117] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0118] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described data exchange method embodiments.
[0119] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described data exchange method embodiments.
[0120] Any of the components, modules, units, parts, methods, and operations described herein can be implemented using software, firmware, hardware (e.g., fixed logic circuitry), manual processing, or any combination thereof. Alternatively or additionally, any functionality described herein can be executed at least in part by one or more hardware logic components, such as, but not limited to, a central processing unit (CPU), FPGA, application-specific integrated circuit (ASIC), application-specific standard product (ASSP), system-on-chip (SoC), complex programmable logic device (CPLD), microcontroller unit (MCU), etc. The terms "system," "computing device," or "apparatus" as used herein encompass various means, devices, and machines for processing data, including, for example, one or more programmable processors, computers, SoCs, or combinations thereof. The apparatus may also include code that creates an execution environment for the computer program in question, such as code constituting processor firmware, protocol stacks, database management systems, operating systems, cross-platform runtime environments, virtual machines, or combinations thereof. The aforementioned computer program (also known as a program, software, software application, application (App), script, or code) can be written in any form of programming language, including compiled or interpreted languages, declarative or procedural languages, and can be deployed in any form, including as a standalone program or as a module, component, subroutine, object, or other unit suitable for a computing environment.
[0121] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0122] The data exchange method, system, device, medium, and product provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this application. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of this application.
Claims
1. A data exchange method, characterized in that, The method is applied to a first trusted execution environment (TEX) connected to a first network via a first network interface card (NIC) to establish an authentication relationship with a second trusted execution environment connected to a second network; the method includes: Obtain the key corresponding to the authentication relationship; When a read operation is initiated on the first trusted execution environment side, the first trusted execution environment side uses a key to encrypt and verify the read request, obtains an encrypted read request and a multi-verification credential associated with the verification benchmark information of the read request, and stores it in the shared storage area; when the response data of the encrypted read request is obtained from the second trusted execution environment side and stored in the shared storage area, the response data is verified based on the verification benchmark information and the multi-verification credential to obtain the read data in plaintext form; When a write operation is initiated on the first trusted execution environment side, the first trusted execution environment side uses a key to encrypt and sign the write request and the write data to obtain encrypted write information and signature credentials, which are stored in the shared storage area and the immutable storage area respectively, so that the second trusted execution environment side can decrypt and verify them before writing.
2. The data exchange method according to claim 1, characterized in that, The multi-verification credentials include at least a first verification credential and a second verification credential; the first trusted execution environment uses a key to encrypt and verify the read request, obtaining an encrypted read request and a multi-verification credential associated with the verification baseline information of the read request, including: The first trusted execution environment uses the key to encrypt the read request to obtain the encrypted read request, and stores it in the shared storage area, so that the second trusted execution environment can read the encrypted read request from the shared storage area and decrypt the encrypted read request using the key to obtain the read request; the first trusted execution environment receives the encrypted read request and the first verification credential obtained by the second trusted execution environment using the key to encrypt and verify the read request. The first trusted execution environment performs verification processing based on the verification benchmark information of the read request and the first verification credential to obtain the second verification credential.
3. The data exchange method according to claim 2, characterized in that, The verification benchmark information includes at least the attribute information and challenge information of the data to be read; The attribute information includes at least one or more of the following: read address, data length, and data update time; The process of determining the first verification credential includes: Obtain the data to be read, determined by the second trusted execution environment based on the read address and the data length of the read request; The data to be read is encrypted using the key to obtain encrypted read data; The encrypted read data is verified to obtain the first verification credential; Correspondingly, the process of determining the second verification credential includes: The second verification credential is obtained by performing verification processing based on the attribute information, the challenge information, and the first verification credential.
4. The data exchange method according to claim 3, characterized in that, Based on the verification benchmark information and multiple verification credentials, the response data is verified to obtain plaintext read data, including: Extract the verification baseline information corresponding to the read request from the response data obtained from the shared storage area; The second verification certificate is recalculated and compared based on the verification benchmark information and the first verification certificate to verify the correspondence between the response data and the read request; If the recalculation and comparison pass, an integrity comparison is performed on the encrypted read data in the response data based on the first verification certificate; If the integrity check passes, the encrypted read data is decrypted using the key to obtain the read data in plaintext form.
5. The data exchange method according to claim 4, characterized in that, The recalculation and comparison process specifically includes: Based on the attribute information of the verification benchmark information, the challenge information, and the first verification credential, a new second verification credential is obtained; If the new second verification document matches the second verification document, then the recalculation comparison is deemed successful. Correspondingly, the complete comparison process specifically includes: The encrypted read data is verified to obtain a new first verification credential; If the new first verification document matches the first verification document, then the complete comparison is considered successful.
6. The data exchange method according to claim 1, characterized in that, The first trusted execution environment uses a key to encrypt and sign the write request and the write data, obtaining encrypted write information and a signature credential, including: The key is used to encrypt the write request and the write data respectively to obtain encrypted write request and encrypted write data, which are used as the encrypted write information; Based on the write request and the write data, a signature generation process is performed to obtain a third verification credential and a digital signature, which serve as the signature credential.
7. The data exchange method according to claim 6, characterized in that, Based on the write request and the write data, a signature generation process is performed to obtain a third verification credential and a digital signature, including: The write request and the write data are concatenated to obtain the concatenated write information. The concatenated written information is verified to obtain the third verification credential. Obtain the private key from the first trusted execution environment side; The digital signature is obtained by signing the third verification credential using the private key.
8. The data exchange method according to claim 6, characterized in that, Write to the second trusted execution environment after decryption and verification, including: The second trusted execution environment reads the encrypted write information from the shared storage area and uses the key to decrypt the encrypted write information to obtain plaintext write data; The second trusted execution environment performs signature verification processing on the plaintext write data based on the signature credential, and writes the plaintext write data to the write position corresponding to the write request if the verification is successful.
9. The data exchange method according to claim 8, characterized in that, The second trusted execution environment performs signature verification processing on the plaintext written data based on the signature credential, including: The second trusted execution environment concatenates the plaintext write data with the encrypted write request to obtain new concatenated write information; The newly concatenated written information is verified to obtain a new third verification credential. If the new third verification credential matches the original third verification credential, then the signature verification is considered successful.
10. The data exchange method according to claim 1, characterized in that, Before establishing the authentication relationship between the first trusted execution environment (TEX) and the second trusted execution environment (DEA), the method further includes: The first trusted execution environment side and the second trusted execution environment side perform bidirectional remote authentication to mutually verify the authenticity and integrity of the trusted execution environment side in which the other side is located; After the dual-phase remote verification is passed, the access level between the first network user corresponding to the first trusted execution environment side and the second network user corresponding to the second trusted execution environment side is determined based on the permission maintenance table generated in advance by registration. When the access permission level meets the authorization conditions, the first trusted execution environment side and the second trusted execution environment side establish the authentication relationship.
11. The data exchange method according to claim 1, characterized in that, The method further includes: During the process of encrypting the read request by initiating a read operation on the first trusted execution environment side, and / or during the process of encrypting the write request and the write data by initiating a write operation on the first trusted execution environment side, random numbers are introduced for randomized encryption, so that the same plaintext request and / or data generates different ciphertexts in different data exchanges.
12. The data exchange method according to claim 1, characterized in that, After obtaining the read data in plaintext format, the method further includes: The first trusted execution environment performs security checks on plaintext read data. If the detection passes, the plaintext read data is received to increment the current data exchange count on the second trusted execution environment side by 1; If the detection fails, the plaintext read data is destroyed, and a feedback message indicating that the detection failed is sent to the second trusted execution environment side so that the current data exchange count corresponding to the second trusted execution environment side is reduced by 1; Generate the inspection results of the read data in plaintext and write them to the log.
13. The data exchange method according to claim 1, characterized in that, The method further includes: The first trusted execution environment sets up a message queue in the corresponding trusted area to store read requests for read operations and write requests for write operations. The shared storage area is constructed outside the first trusted execution environment and the second trusted execution environment, and the encrypted data is stored in the shared storage area; wherein the encrypted data includes at least the encrypted read request, the multi-verification credential, the encrypted write information and the signature credential.
14. The data exchange method according to claim 1, characterized in that, After verifying the response data based on the verification benchmark information and multiple verification credentials, and before obtaining the read data in plaintext form, the method further includes: The first trusted execution environment side and the second trusted execution environment side respectively synchronously maintain the corresponding number of data exchanges; If the response data passes the verification based on the verification benchmark information and the multiple verification credentials, the consistency verification process is performed between the number of data exchanges maintained by the first trusted execution environment and the number of data exchanges carried in the response data. If the consistency verification passes, the encrypted read data in the response data is decrypted to obtain the read data in plaintext form.
15. A data exchange method, characterized in that, The method is applied to a second trusted execution environment (TEX) connected to a second network via a second network interface card (NIC) to establish an authentication relationship with a first TEX connected to a first network via a first NIC; the method includes: Obtain the key for the authentication relationship; When a read operation is initiated by the first trusted execution environment (TEX), the second TEX retrieves the encrypted read request stored by the first TEX from the shared storage area, decrypts the encrypted read request using the key to obtain a read request, determines the read data based on the read request, encrypts and verifies the read data using the key to obtain encrypted read data and a multi-verification credential associated with the verification benchmark information of the read request, and stores it in the shared storage area as response data to the encrypted read request, so that the first TEX can verify the response data based on the verification benchmark information and the multi-verification credential to obtain read data in plaintext form. When a write operation is initiated by the first trusted execution environment, the encrypted write information stored by the first trusted execution environment is obtained from the shared storage area, and the encrypted write information is decrypted using a key to obtain a write request. The first trusted execution environment uses a key to perform signature generation processing on the write request and the write data, and the signature certificate stored in the immutable area verifies the decrypted write request and the write data, and executes the write operation after the verification is successful.
16. A data exchange system, characterized in that, This includes a first trusted execution environment (TEX) side and a second trusted execution environment side deployed on a server. The first TEX side is connected to a first network via a first network interface card (NIC), and the second TEX side is connected to a second network via a second NIC. The two TEX sides establish an authentication relationship. The first trusted execution environment side is used to perform the steps of the data exchange method as described in any one of claims 1 to 14; The second trusted execution environment side is used to execute the steps of the data exchange method as described in claim 15 to complete the data exchange corresponding to the read and write operations.
17. The data exchange system according to claim 16, characterized in that, The data exchange system further includes acceleration devices; the acceleration devices include a first acceleration device for interconnecting the first trusted execution environment side and a second acceleration device for interconnecting the second trusted execution environment side; Construct an equal number of first trusted execution environment sides and second trusted execution environment sides according to the number of network users of the first network and the number of network users of the second network; The first trusted execution environment is interconnected with the first acceleration device, and the second trusted execution environment is interconnected with the second acceleration device; The relationship between the first network interface card (NIC) and the first trusted execution environment (TEX) side, and between the second NIC and the second TEX side, is one-to-one or one-to-many; and the data transmission between the first NIC and the first TEX side, and between the second NIC and the second TEX side, is determined by the network properties corresponding to the server.
18. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the data exchange method as described in any one of claims 1 to 15.
19. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the data exchange method as described in any one of claims 1 to 15.
20. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the data exchange method as described in any one of claims 1 to 15.
