Decentralized trust construction method for distributed SGX enclave
By dividing network domains and defining different types of enclaves in the distributed system, and using TLS handshakes and consensus algorithms to establish trust relationships, the centralization problem of distributed SGX enclave trust management is solved and decentralized trust construction and efficiency are achieved. Trust is established, improving system security and performance.
Patent Information
- Application Number
- CN202410853663.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-06-28
AI Technical Summary
In existing remote authentication solutions, trust decisions in distributed systems rely on specific verification services, which can easily lead to trust monopoly and man-in-the-middle attacks. As the system scale increases, trust management complexity and performance bottlenecks increase.
Adopt a decentralized trust building method to divide the network into multiple independent network domains, define authentication enclaves, proof enclaves and user enclaves, establish trust relationships through TLS handshakes and consensus algorithms, create a unified EPID group, and pass four Each stage (preparation, provisioning, authentication, revocation) manages the trust of distributed SGX enclaves.
It realizes decentralized trust management between distributed SGX enclaves, improves the efficiency and security of trust establishment, avoids trust monopoly and man-in-the-middle attacks, and reduces the complexity of trust management.
Smart Images

Figure CN118694594A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of trusted execution environment, and in particular to a decentralized trust building method for distributed SGX enclaves. Background Art
[0002] Intel SGX provides two authentication mechanisms: local authentication and remote authentication. Local authentication allows an enclave to use hardware to generate a signature structure, called a report, that can be verified by another enclave on the same hardware platform. The report contains two measurements, MRENCLAVE and MRSIGNER, other properties of the enclave, the trustworthiness of the hardware TCB, and a string of user data. Remote authentication utilizes the local authentication process. After Intel QE successfully verifies reports from other enclaves on the hardware platform, it uses the EPID group signature algorithm to sign a quote. The quote is then passed from the enclave to the remote entity, which requests the authentication service to verify the quote and makes a trust decision for the enclave based on the returned verification report.
[0003] In order to protect the communication between enclaves from man-in-the-middle attacks, Knauth et al. proposed to use the TLS handshake process to combine the remote authentication process with the existing TLS protocol. The method is to create a pair of public and private keys when the enclave is started, bind the public key in this set of keys to the report in the local authentication process, use the quotation materials to request the authentication verification report of IAS, and use the X.509 certificate embedded with the authentication verification report as the channel certificate between enclaves.
[0004] Although the scheme proposed by Knauth et al. can effectively build two-way trust between enclaves, the current remote authentication scheme has the following problems: ① The trust decision of the relying party of remote authentication on the enclave depends on the specific verification service deployed by the manufacturer of the trusted execution environment. Once the verification service creates a trust monopoly, it is likely to deceive the relying party and make it make the wrong trust decision. ② The evidence used in the remote authentication process may be pre-generated or allowed to be reused. Attackers may intercept and replay evidence in the trust establishment process through man-in-the-middle attacks or other network-level attacks to deceive the relying party's trust. ③ As the scale of distributed systems continues to expand, the number of trust relationships that centralized verification services need to handle has increased dramatically, which has greatly increased the complexity of trust management and even led to performance bottlenecks. Summary of the invention
[0005] Purpose of the invention: The present invention proposes a method for building mutual trust in SGX enclaves in a decentralized manner, which solves the problem of how to establish mutual trust in distributed SGX enclaves safely and efficiently, and makes up for the shortcomings of the prior art.
[0006] Technical solution: To achieve the purpose of the present invention, the technical solution adopted by the present invention is:
[0007] A decentralized trust construction method for distributed SGX enclaves, the steps are as follows: first, all nodes in the network are divided according to the following rules: the entire network is divided into multiple independent network domains, and the nodes in each network domain are divided into two types, namely, authentication nodes and user nodes; in the independent network domain, the authentication node exists only, and there are one or more user nodes; then the following enclave types are defined: authentication enclave, deployed on the authentication node, there is only one authentication enclave on each authentication node, and is used to provide basic services required for authentication for all proof enclaves, including creating a unified EPID group, issuing membership identities for proof enclaves, and synchronizing revocation values; proof enclave, deployed on the user node, there is only one proof enclave on each user node, and is used to provide quotation generation and quotation verification services for all user enclaves; user enclave, deployed on the user node, there are one or more user enclaves on each user node, and is used to perform computing tasks.
[0008] The decentralized trust building method includes four stages: preparation stage, provision stage, authentication stage and revocation stage; the preparation stage starts all authentication enclaves, establishes trust between all authentication enclaves, and creates a unified EPID group; the provision stage initializes all proof enclaves, establishes mutual trust between the proof enclave and the authentication enclave in its network domain, and becomes a member of the EPID group; the authentication stage initializes all user enclaves, the user enclave requests a quotation signed by the proof enclave, and each user enclave exchanges each other's quotations to establish trust with each other; the revocation stage is used to revoke the quotation used by the user enclave to establish trust, so that it cannot be used again in the above authentication stage.
[0009] Furthermore, the four stages of the decentralized trust building method include:
[0010] In the preparation phase, all authentication enclaves are started, trust is established between all authentication enclaves through the remote authentication protocol integrated into the TLS handshake, and a unified EPID group is created through the consensus algorithm.
[0011] In the provisioning phase, all attestation enclaves are initialized, mutual trust between the attestation enclave and the attestation enclave in its network domain is established through the remote attestation protocol integrated into the TLS handshake, and the attestation enclave becomes a member of the EPID group through the EPID join protocol.
[0012] In the authentication phase, all user enclaves are initialized. After completing the local authentication protocol with the attestation enclave on its node, the user enclave requests a quote signed by the attestation enclave; after that, each user enclave exchanges each other's quotes through the remote authentication protocol integrated into the TLS handshake to establish trust in each other.
[0013] The revocation phase is initiated by the user enclave sending the signature on the offer to be revoked to the certification enclave; the certification enclave that receives the revocation request then forwards the signature carried by the revocation request to the authentication enclave in its network domain, and synchronizes it to all network domains through the consensus algorithm in the authentication enclave to complete the revocation.
[0014] Furthermore, the remote authentication protocol integrated into the TLS handshake comprises the following steps:
[0015] (1) The enclave initiating the TLS handshake will contain the hash value h1 = H(pk||n C ||n S )’s SGX quote Q is embedded into the X.509 certificate.
[0016] where n C and n S They represent random numbers used in the Client Hello and Server Hello messages of the TLS handshake, pk represents the public key of the X.509 certificate, H represents the SHA-256 hash function, and || represents the concatenation of binary strings.
[0017] (2) The enclave on the other side of the TLS handshake verifies the X.509 certificate based on the n C 、n S And the public key pk of the certificate calculates a hash value h2=H(pk||n C ||n S ).
[0018] Then check whether the hash value h1 contained in the SGX quotation Q extracted from the X.509 certificate is the same as the recalculated hash value h2. If they are the same, continue the TLS handshake process, otherwise terminate the TLS handshake process.
[0019] Furthermore, the preparation stage includes the following steps:
[0020] (1) All authentication enclaves establish a trust relationship with each other through the remote authentication protocol integrated into the TLS handshake, and elect a leader authentication enclave through the Raft algorithm.
[0021] (2) The elected leader authenticates the enclave to generate the group public key pk g and group private key sk g, create an EPID issuer and an empty revocation list, and pass the public key pk g and the private key sk1 are sent to all other authentication enclaves via a broadcast message.
[0022] (3) The authentication enclave that receives the broadcast message retrieves the public key pk carried in the message G and private key sk G , creating its local EPID issuer and an empty revocation list.
[0023] Furthermore, the supply stage includes the following steps:
[0024] (1) All attestation enclaves establish a mutual trust relationship with the attestation enclaves in their network domain through the remote attestation protocol integrated into the TLS handshake. The attestation enclave generates a random key f to represent its EPID membership identity.
[0025] (2) The proving enclave then requests a random number n from the authentication enclave on its node. I challenge, and use n I A join request is created with key f as a response to the challenge and sent to the attesting enclave, which checks the response to the challenge contained in the join request and generates a membership certificate for the attesting enclave in return.
[0026] (3) The certification enclave requests the public key pk of the EPID group from the authentication enclave G , and initializes an EPID member and an EPID authenticator within it.
[0027] Furthermore, the authentication stage includes the following steps:
[0028] (1) The user enclave completes local authentication with the attestation enclave on its node, and requests the attestation enclave to sign the SGX offer Q containing the hash value h1, and uses the X.509 certificate embedded in the offer Q to initiate a TLS handshake to another user enclave.
[0029] (2) The other side of the TLS handshake enclave extracts the offer Q from the X.509 certificate, calculates the hash value h2, and checks whether the hash value h1 contained in the offer Q is the same as the recalculated hash value h2; if they are different, the TLS handshake is terminated; if they are the same, the offer Q is forwarded to the attestation enclave on its node.
[0030] (3) Based on the quotation Q and the authentication verification report returned by the certification enclave, compare the MRENCLAVE metric value and the MRSIGNER metric value to see if they are the same as the expected value, and decide whether to trust the user enclave based on the comparison result.
[0031] Furthermore, the revocation phase includes the following steps:
[0032] (1) When a user enclave loses its network connection, the user enclave on the other side of the channel initiates a revocation request to the attestation enclave of its node, and attaches the signature on the evidence used to establish trust. The attestation enclave then forwards the revocation request to the authentication enclave of its network domain.
[0033] (2) The authentication enclave L that receives the revocation request γ sends a request to at least A cluster Q consisting of authenticated enclaves sends a five-tuple message <Acc,L,i L ,i L,I ,γ>, where Acc indicates that the message is the Accept message type in the Paxos consensus algorithm, L indicates the authentication enclave, i L Indicates the serial number of the authentication enclave L, i L,I represents the revocation request sequence number initiated by the authentication enclave L, N represents the total number of authentication enclaves, Indicates rounding down.
[0034] (3) When any authentication enclave R receives the message <Acc,L,i L ,i L,I ,γ>, record a triple L ,i L,I ,γ>, and reply a response message to the authentication enclave L <AccOK,i L,I >, where AccOK indicates that the message is a response to the Accept message.
[0035] (4) When the authenticating enclave L receives at least Response message <AccOK,i L,I >, the revocation request γ is recorded in the revocation list to complete the revocation, and the message is sent <Com,L,i L ,i L,I ,γ> to all other authentication enclaves, where Com indicates that the message is the Commit message type in the Paxos consensus algorithm.
[0036] (5) When any authentication enclave R receives the message <Com,L,i L ,i L,I ,γ>, the revocation request γ is recorded in the revocation list to complete the revocation, and a message is replied to the authentication enclave L <Co K,i L,I >, where ComOK indicates that the message is a response to the Commit message.
[0037] Furthermore, a unified EPID group is created through a consensus algorithm, including the steps of:
[0038] (1) Each authentication enclave initializes a random timer t. Once the timer t of an authentication enclave A times out, the authentication enclave increases its internal term number term=trem+1, votes for itself, and sends an election request to all other authentication enclaves in the cluster. <Election,i A ,term>, where Election represents the election message type, i A Represents the serial number of the authentication enclave A;
[0039] (2) If other authentication enclaves that receive the election request have not voted within the term, they will vote for the authentication enclave corresponding to the first election request received and send a message to it.<Vote,term> , where Vote represents the voting message type;
[0040] (3) Once a certified enclave A accumulates at least votes, it becomes the leader authentication enclave in the cluster; after becoming the leader authentication enclave, authentication enclave A generates the group public key pk G and group private key sk G , creates an EPID issuer and sends a broadcast message to all other authenticated enclaves <Notification,i A ,term,pk G ,sk G >, where N represents the total number of authenticated enclaves, Indicates rounding up, Notification represents the broadcast message type, i A Represents the serial number of the certified enclave A, and term represents the elected term;
[0041] (4) Other authentication enclaves that receive the broadcast message retrieve and store the public key pk carried in the message G and private key sk G , and create their own EPID issuer.
[0042] Beneficial effects: Compared with the prior art, the technical solution of the present invention has the following beneficial technical effects:
[0043] The present invention provides a decentralized SGX enclave trust building method for establishing mutual trust relationships between distributed enclaves, and provides a strong channel binding and freshness guarantee mechanism for the evidence used in the remote authentication process, thereby realizing the trust management of distributed enclaves. The method divides all nodes in the network domain into two types, and defines three special enclaves, and realizes the trust management of distributed SGX enclaves through protocols in four stages: preparation stage, supply stage, authentication stage, and revocation stage. Compared with the prior art, the method provided by the present invention can improve the efficiency of establishing trust in distributed SGX enclaves, thereby further improving the security of the SGX distributed autonomous system. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is the overall framework diagram of the present invention.
[0045] Figure 2 It is a flow chart of the preparation stage of the present invention.
[0046] Figure 3 It is a flow chart of the supply phase of the present invention.
[0047] Figure 4 It is a flow chart of the authentication phase of the present invention. DETAILED DESCRIPTION
[0048] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0049] The present invention provides a decentralized trust construction method for distributed SGX enclaves, which divides all nodes in the network domain into two types: authentication nodes and user nodes. There can be a unique authentication node and one or more user nodes in each network domain. Two special enclaves are defined: the authentication enclave and the proof enclave, and the enclave specific to a specific computing function is named the user enclave. The authentication enclave is deployed on the authentication node, and the proof enclave and the user enclave are deployed on the user node. Specifically, it includes a preparation stage, a supply stage, an authentication stage, and a revocation stage.
[0050] The preparation phase starts all authentication enclaves, establishes trust between them through the remote authentication protocol integrated into the TLS handshake, and creates a unified EPID group through the consensus algorithm. The provisioning phase initializes all proof enclaves, establishes mutual trust between the proof enclave and the authentication enclave in its network domain through the remote authentication protocol integrated into the TLS handshake, and becomes a member of the EPID group through the EPID joining protocol. The authentication phase initializes all user enclaves. After completing the local authentication protocol with the proof enclave in its node, the user enclave requests a quote signed by the proof enclave. Afterwards, each user enclave exchanges quotes with each other through the remote authentication protocol integrated into the TLS handshake, thereby establishing trust in each other. The revocation phase is used to revoke the quote used by the user enclave to establish trust, so that it cannot be used again in the above authentication phase. This phase is initiated by the user enclave sending the signature on the quote to be revoked to the proof enclave. The proof enclave that receives the revocation request then forwards the signature carried by the revocation request to the authentication enclave in its network domain, and synchronizes it to all network domains through the consensus algorithm in the authentication enclave, thereby completing the revocation.
[0051] The remote authentication protocol integrated into the TLS handshake consists of the following steps:
[0052] (1) After startup, the enclave generates a key pair, including a public key pk and a private key sk, to identify itself. Then, based on the public key pk and the random number n in the Client Hello message used for the TLS handshake, C and the random number n in the ServerHello message used in the TLS handshake S Calculate a hash value h1=H(pk||n C ||n S ), where H represents the SHA-256 hash function and || represents the concatenation of binary strings.
[0053] The present invention integrates the remote authentication protocol of the SGX enclave on the existing TLS handshake protocol. The integration method is that the SGX remote authentication quotation Q includes the public key pk of the X.509 certificate and the hash value of the splicing of the above-mentioned Client Hello message and Server Hello message.
[0054] (2) The enclave uses h1 as user data and requests the hardware to create a report R for itself. If the enclave is an authentication enclave or a proof enclave, the report R is sent to the Intel QE on its node to sign a quote. Otherwise, if the enclave is a user enclave, the report R is sent to the proof enclave on its node to sign a quote. The quote is uniformly denoted as Q.
[0055] (3) The enclave uses the public key pk to create an X.509 certificate structure, embeds the quotation Q as an extension field into the X.509 certificate structure, signs the X.509 certificate structure using the private key sk, and passes the signed X.509 certificate as the TLS handshake certificate to the enclave on the other side of the channel along with the TLS handshake protocol.
[0056] (4) The enclave on the other side of the channel retrieves the X.509 certificate and extracts the extended field during the verification process of the TLS certificate. The extracted content is recorded as Q. If this enclave is an authentication enclave or a proof enclave, it sends the offer Q to the IAS to obtain the authentication verification report generated by the IAS. Otherwise, if this enclave is a user enclave, it sends the offer Q to the proof enclave on its node to obtain the authentication verification report generated by the proof enclave.
[0057] (5) The enclave on the other side of the channel receives the n C 、n S And the public key pk of the certificate calculates a hash value h2=H(pk||n C ||n S ), where H represents the SHA-256 hash function and || represents the concatenation of binary strings. Then check whether the hash value h1 contained in the quote Q extracted from the X.509 certificate is the same as the hash value h2 recalculated by itself. If they are the same, continue the TLS handshake. Otherwise, abort the TLS handshake.
[0058] The process of creating a unified EPID group through a consensus algorithm utilizes the election algorithm in the distributed consensus protocol Raft, including the following steps:
[0059] (1) Each authentication enclave initializes a random timer t. Once the timer t of an authentication enclave A expires, the authentication enclave increases its internal term number term=trem+1, votes for itself, and sends an election request to all other authentication enclaves in the cluster. <Election,i A ,term>, where Election represents the election message type, i A Represents the serial number of the authentication enclave A.
[0060] (2) If other authentication enclaves that receive election requests have not voted within the term, they will vote for the authentication enclave corresponding to the first election request received and send it<Vote,term> , where Vote represents the voting message type.
[0061] (3) Once a certified enclave A accumulates at least After becoming the leader authentication enclave, authentication enclave A generates a group public key pk G and group private key sk G , creates an EPID issuer and sends a broadcast message to all other authenticated enclaves <Notification,i A ,term,pk G ,sk G >, where N represents the total number of authenticated enclaves, Indicates rounding up, Notification represents the broadcast message type, i A Represents the serial number of the authentication enclave A, and term represents the elected term.
[0062] (4) Other authentication enclaves that receive the broadcast message retrieve and store the public key pk carried in the message G and private key sk G , and create their own EPID issuer.
[0063] The steps to synchronize the signatures that need to be revoked through the consensus algorithm include:
[0064] (1) An authentication enclave L receives a request to revoke a value γ and sends a request to at least A cluster Q consisting of authenticated enclaves sends a five-tuple message <Acc,L,i L ,i L,I ,γ>. Acc indicates that the message is the Accept message type in the Paxos consensus algorithm, L indicates the authentication enclave, i L Indicates the serial number of the authentication enclave L, i L,I represents the revocation request sequence number initiated by the authentication enclave L, N represents the total number of authentication enclaves, Indicates rounding down.
[0065] (2) When any authentication enclave R receives the message <Acc,L,i L ,i L,I ,γ>, record the triple L ,i L,I ,γ>, and reply a response message to the authentication enclave L <AccOk,i L,I >, where AccOK indicates that the message is a response to the Accept message, i L,I Indicates the sequence number of the revocation request initiated by the authentication enclave L.
[0066] (3) When the authenticating enclave L receives at least indivual <AccOK,i L,I >When responding, record γ to the revocation list to complete the revocation and send a message <Com,L,i L ,iL,I ,γ> for all other authentication enclaves, where N represents the total number of authentication enclaves, Indicates rounding down, Com indicates that the message is the Commit message type in the Paxos consensus algorithm, L indicates the authentication enclave, i L Indicates the serial number of the authentication enclave L, i L,I Indicates the sequence number of the revocation request initiated by the authentication enclave L.
[0067] (4) When any authentication enclave R receives the message <Com,L,i L ,i L,I ,γ>, record γ to the revocation list to complete the revocation, and reply to the authentication enclave L <ComOK,i L,I >, where ComOK indicates that the message is a response to the Commit message, i L,I Indicates the sequence number of the revocation request initiated by the authentication enclave L.
[0068] The decentralized trust building method for distributed SGX enclaves described in the present invention is as follows: Figure 1 As shown in Figure 1, the overall process is mainly divided into the preparation stage, the provisioning stage, the authentication stage and the revocation stage. The following will introduce the above four stages in detail.
[0069] 1. Preparation stage.
[0070] like Figure 2 As shown, all authentication enclaves are started on the authentication node, connected to peer entities in other network domains, and establish trust relationships with each other through the remote authentication protocol integrated into the TLS handshake. When all authentication enclaves have completed the establishment of trust relationships, each authentication enclave initializes a random timer t. If the timer t of an authentication enclave A times out, the authentication enclave increases its internal term number term=trem+1, votes for itself, and sends an election request to all other authentication enclaves in the cluster. <Election,i A ,term>. If an authentication enclave that receives an election request has not voted within the term, it will vote for the authentication enclave corresponding to the first election request received and send it<Vote,term> Once a certified enclave A accumulates at least After that, the leader authentication enclave generates a group public key pk G and group private key sk G , create an EPID issuer and an empty revocation list, and pass the public key pk G and private key sk G By broadcasting message <Notification,i A,term,pk G ,sk G >send to all other authenticated enclaves, where N represents the total number of authenticated enclaves, Indicates rounding up, Notification represents the broadcast message type, i A Represents the serial number of the authentication enclave A, and term represents the elected term. The authentication enclave that receives the broadcast message retrieves the public key pk carried in the message G and private key sk G , creating its local EPID issuer and an empty revocation list.
[0071] 2. Supply stage.
[0072] like Figure 3 As shown in Figure 1, all attestation enclaves are started on the user node, connected to the authentication enclave in its network domain, and establish mutual trust through the remote authentication protocol integrated into the TLS handshake. The attestation enclave generates a random private key f to represent its EPID membership. It then requests a random number n from the authentication enclave on its node. I challenge, and use n I The authentication enclave checks the response to the challenge contained in the join request and generates a membership certificate for the attestation enclave in return. The attestation enclave requests the public key pk of the EPID group from the authentication enclave. G , and initializes an EPID member and an EPID authenticator within it.
[0073] 3. Certification stage.
[0074] (1) All user enclaves are started on the user node.
[0075] (2) The user enclave obtains the MRENCLAVE metric of the attestation enclave on its platform, uses the metric as user data to request the hardware to create a report R1 for itself, and sends it to the attestation enclave. The attestation enclave verifies the user data carried in the report R1 to ensure that the user enclave is running on the same node.
[0076] (3) Figure 4 As shown, the user enclave uses the public key pk created when it starts and the random number n in the ClientHello message used for TLS handshake C and the random number n in the Server Hello message S Calculate a hash value h1=H(pk||n C ||nS ), where H represents the SHA-256 hash function and || represents the concatenation of binary strings. It then uses h1 as user data, requests the hardware to create a report R2 for it again, and requests the attestation enclave to sign the report R2, obtaining a quote Q. It then inserts the quote Q into the X.509 certificate used for the TLS handshake, and sends it to the user enclave on the other side of the handshake after self-signing.
[0077] (4) The user enclave on the other side of the handshake extracts the quote Q from the received certificate and sends it to the attestation enclave on its node. The attestation enclave obtains the latest revocation list from the authentication enclave, using the group public key pk G Verify the signature in the offer Q and generate a verification report V for the user enclave.
[0078] (5) The user enclave on the other side of the handshake receives the n C 、n S And the public key pk of the certificate calculates a hash value h2=H(pk||n C ||n S ), where H represents the SHA-256 hash function and || represents the concatenation of binary strings. Next, it checks whether the hash value h1 contained in the quote Q extracted from the X.509 certificate is the same as the hash value h2 recalculated by itself, and decides whether to trust the user enclave based on whether the MRENCLAVE metric and MRSIGNER metric in the verification report V and the quote Q are the same as the expected values.
[0079] (6) The user enclaves on both sides of the handshake exchange their identities and repeat steps (3) to (5) to establish trust in the other direction.
[0080] 4. Cancellation stage.
[0081] When a user enclave loses network connection, the user enclave on the other side of the channel initiates a revocation request to the attestation enclave of its node, with the signature of the evidence they used to establish trust. The attestation enclave then forwards the revocation request to the authentication enclave of its network domain to initiate a revocation proposal. The authentication enclave L that receives the revocation request γ sends a request to at least A cluster of authenticated enclaves sends a message <Acc,L,i L ,i L,I ,γ>, where Acc indicates that the message is the Accept message type in the Paxos consensus algorithm, i L Indicates the serial number of the authentication enclave L, i L,I represents the revocation request sequence number initiated by the authentication enclave L, N represents the total number of authentication enclaves, Indicates rounding down. When any authentication enclave R receives the message <Acc,L,i L ,i L,I ,r>, record a triple L ,i L,I ,γ>, and reply a response message to the authentication enclave L <AccOK,i L,I >, where AccOK indicates that the message is a response to the Accept message. Response message <AccOK,i L,I >, record γ to the revocation list to complete the revocation, and send a message <Com,L,i L ,i L,I ,γ> to all other authentication enclaves, where Com indicates that the message is the Commit message type in the Paxos consensus algorithm. When any authentication enclave R receives the message <Com,L,i L ,i L,I ,γ>, record γ to the revocation list to complete the revocation, and reply to the authentication enclave L <ComOK,i L,I >.
Claims
1. A decentralized trust building method for distributed SGX enclaves, characterized in that: The steps of this method are as follows: First, divide all nodes in the network according to the following rules: The entire network is divided into multiple independent network domains, and the nodes in each network domain are divided into two types, namely authentication nodes and user nodes; In the independent network domain, the authentication node exists only one, and there are one or more user nodes; Then define the following enclave types: An authentication enclave, deployed on the authentication node, with only one authentication enclave on each authentication node, used to provide basic services required for authentication for all attestation enclaves, including creating a unified EPID group, issuing membership identities for attestation enclaves, and synchronizing revocation values; A certification enclave, deployed on the user node, where there is only one certification enclave on each user node, for providing quote generation and quote verification services for all user enclaves; A user enclave, deployed on the user node, wherein each user node has one or more user enclaves for executing computing tasks; The decentralized trust building method includes four stages: preparation stage, provision stage, authentication stage and revocation stage; The preparation phase starts all authentication enclaves, establishes trust between all authentication enclaves, and creates a unified EPID group; The provisioning phase initializes all attestation enclaves, establishes mutual trust between the attestation enclave and the authentication enclave in its network domain, and becomes a member of the EPID group; The authentication phase initializes all user enclaves. The user enclave requests a quote signed by the attestation enclave. Each user enclave exchanges each other’s quotes to establish trust in each other. The revocation phase is used to revoke the offer used when the user enclave established trust, so that it cannot be used again in the above authentication phase.
2. A decentralized trust building method for distributed SGX enclaves according to claim 1, characterized in that: The four stages of the decentralized trust building method include: In the preparation phase, all authentication enclaves are started, trust is established between all authentication enclaves through the remote authentication protocol integrated into the TLS handshake, and a unified EPID group is created through the consensus algorithm; In the provisioning phase, all attestation enclaves are initialized, mutual trust between the attestation enclave and the authentication enclave in its network domain is established through the remote attestation protocol integrated into the TLS handshake, and the attestation enclave becomes a member of the EPID group through the EPID joining protocol; In the authentication phase, all user enclaves are initialized. After completing the local authentication protocol with the attestation enclave on its node, the user enclave requests a quote signed by the attestation enclave. After that, each user enclave exchanges each other's quotes through the remote authentication protocol integrated into the TLS handshake to establish trust in each other. The revocation phase is initiated by the user enclave sending the signature on the offer to be revoked to the certification enclave; the certification enclave that receives the revocation request then forwards the signature carried by the revocation request to the authentication enclave in its network domain, and synchronizes it to all network domains through the consensus algorithm in the authentication enclave to complete the revocation.
3. A decentralized trust building method for distributed SGX enclaves according to claim 2, characterized in that: The remote authentication protocol integrated into the TLS handshake comprises the following steps: (1) The enclave initiating the TLS handshake will contain the hash value h1 = H(pk||n C ||n S )’s SGX quote Q is embedded into the X.509 certificate; Where n C and n S They represent the random numbers in the Client Hello and Server Hello messages used in the TLS handshake, pk represents the public key of the X.509 certificate, H represents the SHA-256 hash function, and ∥ represents the concatenation of binary strings; (2) The enclave on the other side of the TLS handshake verifies the X.509 certificate based on the n C 、n S And the public key pk of the certificate calculates a hash value h2=H(pk||n C ||n S ); Then check whether the hash value h1 contained in the SGX quotation Q extracted from the X.509 certificate is the same as the recalculated hash value h2. If they are the same, continue the TLS handshake process, otherwise terminate the TLS handshake process.
4. A decentralized trust building method for distributed SGX enclaves according to claim 2 or 3, characterized in that: The preparation stage includes the following steps: (1) All authentication enclaves establish a trust relationship with each other through the remote authentication protocol integrated into the TLS handshake, and elect a leader authentication enclave through the Raft algorithm; (2) The elected leader authenticates the enclave to generate the group public key pk G and group private key sk G , create an EPID issuer and an empty revocation list, and pass the public key pk G and private key sk G Sent via a broadcast message to all other authenticated enclaves; (3) The authentication enclave that receives the broadcast message retrieves the public key pk carried in the message G and private key sk G , creating its local EPID issuer and an empty revocation list.
5. A decentralized trust building method for distributed SGX enclaves according to claim 2 or 3, characterized in that: The supply phase includes the following steps: (1) All attestation enclaves establish a mutual trust relationship with the attestation enclaves in their network domain through the remote attestation protocol integrated into the TLS handshake. The attestation enclave generates a random key f to represent its own EPID membership identity; (2) The proving enclave then requests a random number n from the authentication enclave on its node. I challenge, and use n I Create a join request with key f as a response to the challenge and send it to the attesting enclave, which checks the response to the challenge contained in the join request and generates a membership certificate for the attesting enclave in return; (3) The certification enclave requests the public key pk of the EPID group from the authentication enclave G , and initializes an EPID member and an EPID authenticator within it.
6. A decentralized trust building method for distributed SGX enclaves according to claim 2 or 3, characterized in that: The authentication phase includes the following steps: (1) The user enclave completes local authentication with the attestation enclave on its node, and requests the attestation enclave to sign the SGX offer Q containing the hash value h1, and uses the X.509 certificate embedded in the offer Q to initiate a TLS handshake to another user enclave; (2) The other side of the TLS handshake enclave extracts the offer Q from the X.509 certificate, calculates the hash value h2, and checks whether the hash value h1 contained in the offer Q is the same as the recalculated hash value h2; if they are different, the TLS handshake is terminated; if they are the same, the offer Q is forwarded to the certification enclave on its node; (3) Based on the quotation Q and the authentication verification report returned by the certification enclave, compare the MRENCLAVE metric value and the MRSIGNER metric value to see if they are the same as the expected value, and decide whether to trust the user enclave based on the comparison result.
7. A decentralized trust building method for distributed SGX enclaves according to claim 2 or 3, characterized in that: The revocation phase includes the following steps: (1) When a user enclave loses its network connection, the user enclave on the other side of the channel initiates a revocation request to the attestation enclave of its node, and attaches the signature on the evidence used to establish trust. The attestation enclave then forwards the revocation request to the authentication enclave of its network domain. (2) The authentication enclave L that receives the revocation request γ sends a request to at least A cluster Q consisting of authenticated enclaves sends a five-tuple message <Acc,L,i L ,i L,I ,γ>; Acc indicates that the message is of the Accept message type in the Paxos consensus algorithm, L indicates the authentication enclave, and i L Indicates the serial number of the authentication enclave L, i L,I represents the revocation request sequence number initiated by the authentication enclave L, N represents the total number of authentication enclaves, Indicates rounding down; (3) When any authentication enclave R receives the message <Acc,L,i L ,i L,I ,γ>, record a triple L ,i L,I ,γ>, and reply a response message to the authentication enclave L <AccOK,i L,I > AccOK indicates that the message is a response to the Accept message. (4) When the authenticating enclave L receives at least Response message <AccOK,i L,I >, the revocation request γ is recorded in the revocation list to complete the revocation, and the message is sent <Com,L,i L ,i L,I ,γ> to all other authentication enclaves; Com indicates that the message is the Commit message type in the Paxos consensus algorithm; (5) When any authentication enclave R receives the message <Com,L,i L ,i L,I ,γ>, the revocation request γ is recorded in the revocation list to complete the revocation, and a message is replied to the authentication enclave L <ComOK,i L,I > ComOK indicates that the message is a response to the Commit message.
8. A decentralized trust building method for distributed SGX enclaves according to claim 2 or 3, characterized in that: Creating a unified EPID group through a consensus algorithm includes the following steps: (1) Each authentication enclave initializes a random timer t. Once the timer t of an authentication enclave A times out, the authentication enclave increases its internal term number term=trem+1, votes for itself, and sends an election request to all other authentication enclaves in the cluster. <Election,i A ,term>, where Election represents the election message type, i A Represents the serial number of the authentication enclave A; (2) If other authentication enclaves that receive the election request have not voted within the term, they will vote for the authentication enclave corresponding to the first election request received and send a message to it.<Vote,term> , where Vote represents the voting message type; (3) Once a certified enclave A accumulates at least votes, it becomes the leader authentication enclave in the cluster; after becoming the leader authentication enclave, authentication enclave A generates the group public key pk G and group private key sk G , creates an EPID issuer and sends a broadcast message to all other authenticated enclaves <Notification,i A ,term,pk G ,sk G >, where N represents the total number of authenticated enclaves, Indicates rounding up, Notification represents the broadcast message type, i A Represents the serial number of the certified enclave A, and term represents the elected term; (4) Other authentication enclaves that receive the broadcast message retrieve and store the public key pk carried in the message G and private key sk G , and create their own EPID issuer.
Citation Information
Patent Citations
Techniques for remote SGX enclave authentication
CN108462689A
Ciphertext loading method for resisting SGX side channel attack
CN113810382A
Internet of vehicles data sharing implementation method based on block chain and trusted execution environment
CN114117522A
Decentralization point-to-point privacy computing method and system based on SGX
CN115664806A
Cloud data processing method and device based on SGX, equipment and medium
CN117472512A
