Multi-party data secure computation method and device, electronic equipment and storage medium

By dividing data into share data and using a trusted execution environment for combined computation, the problem of low performance in multi-party data security computation is solved, and efficient data security transmission and computation are achieved.

CN115964763BActive Publication Date: 2026-08-04WELAB INFORMATION TECH SHENZHEN LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WELAB INFORMATION TECH SHENZHEN LTD
Filing Date
2022-12-20
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

In existing multi-party data security computations, the high number of data exchanges leads to low overall performance.

Method used

The data from each party is divided into shares equal to the number of data parties making the request, and then combined and calculated using a pre-defined database and a trusted execution environment to ensure secure data transmission and accurate calculation results.

Benefits of technology

Without compromising data security, multi-party secure computation is performed on a single physical host, significantly improving overall performance and reducing network transmission time for data interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115964763B_ABST
    Figure CN115964763B_ABST
Patent Text Reader

Abstract

This invention relates to the field of data processing, and discloses a method for secure multi-party data computation, comprising: responding to a request from a first data party for data to be computed, dividing the first data to be computed held by the first data party into a preset number of share data, the preset number being consistent with the number of data parties participating in the request; storing one share data in a first database, and sending the other share data to the other data parties participating in the request; combining the share data received from the other data parties with the share data in the first database to obtain a first combined data; and sending the first combined data to a physical host according to a first trusted execution environment, so that the physical host can interactively compute the first combined data and the combined data uploaded by the other data parties through the corresponding trusted execution environments to obtain a computation result. This invention also provides a multi-party data secure computation device, electronic device, and storage medium. This invention ensures data security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing, and in particular to a method, apparatus, electronic device, and storage medium for multi-party data security computation. Background Technology

[0002] In computing scenarios involving multi-party data sharing and security, multiple data parties participate, each holding different sensitive data. In order to securely complete computing tasks and obtain aggregated results of input data from each data party without knowing the data held by each data party, the following steps are required.

[0003] In typical multi-party data security computations, the initiating party first distributes data fragments to other data parties using encryption. Each data party then performs computations using each received data fragment, exchanges some data with other data parties, and sends the computation results back to the initiating party. The initiating party then aggregates the computation results returned by the other data parties. This computation method suffers from the problem of low overall performance in multi-party data security computation due to the large number of data exchanges. Summary of the Invention

[0004] In view of the above, it is necessary to provide a method for secure multi-party data computation, the purpose of which is to solve the problem of low overall performance of secure multi-party data computation in the existing technology.

[0005] The multi-party data security computation method provided by this invention includes:

[0006] S1. In response to a request for data to be calculated issued by a first data party, the first data party holds the first data to be calculated and divides it into a preset number of share data, wherein the preset number is consistent with the number of data parties participating in the request.

[0007] S2. Store at least one share of data in a preset first database, and send the other share data to other data parties participating in the request besides the first data party;

[0008] S3. Receive share data sent by the other data party, and combine the received share data with the share data of the first database to obtain the first combined data of the first data party.

[0009] S4. Based on the first trusted execution environment generated by the first data party by the preset physical host, the first combined data is sent to the physical host, so that the physical host can perform interactive calculations on the first combined data and the combined data uploaded to the physical host by the other data parties through the corresponding trusted execution environment, and obtain the calculation result of the data to be calculated.

[0010] Optionally, before dividing the first data party's first data to be calculated into a preset number of share data, the method further includes:

[0011] Perform a key initialization operation on the obtained random number of the first data party to generate the first data party's signature certificate and encryption certificate.

[0012] Optionally, the step of performing a key initialization operation on the obtained random number from the first data party to generate the first data party's signature certificate and encryption certificate includes:

[0013] A signature key pair is generated according to a preset encryption algorithm and the random number, wherein the signature key pair includes a first private key and a first public key;

[0014] Sign the first public key to obtain a signature certificate, an encryption certificate, and an encryption key pair digital envelope.

[0015] Optionally, sending other share data to other data parties participating in the request besides the first data party includes:

[0016] The other share data is encrypted using the encryption certificate of the other data party;

[0017] The other share data is signed using the first private key of the signature key pair to obtain the signature value of the first data party. The encrypted other share data, the signature value of the first data party, and the signature certificate of the first data party are then sent to the other data parties.

[0018] Optionally, combining the received share data with the share data of the first database to obtain the first combined data of the first data party includes:

[0019] The received share data is decrypted using the second private key of the encryption key pair to obtain the plaintext data of the received share data.

[0020] Read the signature certificate attached to the received share data and determine whether the signature certificate is stored in the trusted certificate list of the first data party;

[0021] If so, the share data from the first database is read and combined with the received share data to obtain the first combined data from the first data party.

[0022] Optionally, the step of sending the first combined data to the physical host based on the first trusted execution environment generated by the first data party according to the preset physical host includes:

[0023] Read input data from software running in the encrypted memory execution environment of the physical host;

[0024] The input data is subjected to a preset encryption process to generate a first trusted execution environment between the physical host and the first data party;

[0025] The first combined data is sent to the physical host through the first trusted execution environment.

[0026] Optionally, the multi-party data security computation method further includes:

[0027] In the first trusted execution environment, a random number is obtained from the first trusted execution environment to perform a key initialization operation, and a signature certificate and an encryption certificate for the first trusted execution environment are generated;

[0028] The signature certificate and encryption certificate of the first trusted execution environment are exchanged with the signature certificate and encryption certificate of the first data party to generate trusted certificate lists for the first trusted execution environment and the first data party, respectively.

[0029] To address the above problems, the present invention also provides a multi-party data security computing device, the device comprising:

[0030] The partitioning module is used to respond to a request for data to be calculated issued by a first data party, and to partition the first data to be calculated held by the first data party into a preset number of share data, wherein the preset number is consistent with the number of data parties participating in the request;

[0031] The sending module is used to store at least one share of data in a preset first database and send other share data to other data parties participating in the request besides the first data party.

[0032] The combination module is used to receive share data sent by the other data parties, and combine the received share data with the share data of the first database to obtain the first combined data of the first data party.

[0033] The interaction module is used to send the first combined data to the physical host according to the first trusted execution environment generated by the first data party by the preset physical host, so that the physical host can perform interactive calculations on the first combined data and the corresponding combined data uploaded to the physical host by the other data parties through the corresponding trusted execution environment, and obtain the calculation result of the data to be calculated.

[0034] To address the above problems, the present invention also provides an electronic device, the electronic device comprising:

[0035] At least one processor; and,

[0036] A memory communicatively connected to the at least one processor; wherein,

[0037] The memory stores a multi-party data security calculation program that can be executed by the at least one processor, and the multi-party data security calculation program is executed by the at least one processor to enable the at least one processor to perform the above-described multi-party data security calculation method.

[0038] To address the aforementioned problems, the present invention also provides a computer-readable storage medium storing a multi-party data security computation program, which can be executed by one or more processors to implement the aforementioned multi-party data security computation method.

[0039] Compared to existing technologies, this invention divides the data to be calculated held by each data party into shares equal to the number of data parties participating in the request. The received share data is then combined with the share data in the database to obtain the combined data of each data party, ensuring that the entire data of each data party is not leaked and achieving security protection for sensitive data during transmission.

[0040] Based on the first trusted execution environment generated by the physical host for the first data party, the first combined data is sent to the physical host. This allows the physical host to perform interactive computation on the first combined data and the second combined data uploaded by other data parties through their corresponding second trusted execution environments, obtaining the computation result for the data to be computed. When the combined data from each data party is uploaded to the physical host through their respective dedicated trusted execution environments, a closed-loop data transmission environment is formed through multiple dedicated trusted execution environments. The multi-party secure computation appliance is a single physical host, enabling multi-party secure computation to be completed on a single physical host without compromising data security. This significantly reduces network transmission time for data interaction and substantially improves the overall performance of multi-party secure computation. Attached Figure Description

[0041] Figure 1 This is a flowchart illustrating a multi-party data security computation method provided in an embodiment of the present invention;

[0042] Figure 2 This is a schematic diagram of a multi-party data security computing device provided in an embodiment of the present invention;

[0043] Figure 3 This is a schematic diagram of the structure of an electronic device that implements a multi-party data secure computation method according to an embodiment of the present invention;

[0044] The objectives, features, and advantages of this invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0045] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention.

[0046] It should be noted that the descriptions involving "first," "second," etc., in this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.

[0047] This invention provides a method for secure computation of multi-party data. (Refer to...) Figure 1 The diagram shown is a flowchart illustrating a multi-party data security computation method according to an embodiment of the present invention. This method is executed by an electronic device.

[0048] S1. In response to a request for data to be calculated issued by a first data party, the first data party holds the first data to be calculated and divides it into a preset number of share data, wherein the preset number is consistent with the number of data parties participating in the request.

[0049] In this embodiment, the request for data to be computed refers to a request for multiple data parties to jointly participate in secure data computation; there are at least three data parties participating in the request for data to be computed, and the first data party refers to the party that initiates the request for data to be computed; in other embodiments, the request may also be initiated by any of the other data parties, which is not limited here.

[0050] In response to the request for data to be calculated issued by the first data party, each data party divides its own data into a preset number of share data. The number of share data divided by each data party is the same as the number of data parties that participated in the request for data to be calculated.

[0051] For example, three parties, A, B, and C, participate in a multi-party data security computation. The request for the data to be computed in this multi-party data security computation is related to machine learning computation. According to a preset multi-party data partitioning algorithm, the data x_A held by data party A (the first data party) is divided into three shares. In a 64-bit system, the method for decomposing a 64-bit data x_A is as follows: because x_A belongs to modulo 2... n Integer ring Z constructed by operations 2n The value of n is 64. Therefore, x_A can be decomposed into the sum of three random numbers: x_A = x1 + x2 + x3, where x1, x2, ..., x3 are the sum of three random numbers. + indicates modulo 2 n Addition. The three random numbers x1, x2, and x3 are combined in pairs to form the three share data of x_A: (x1, x2), (x2, x3), and (x1, x3). The other data parties B and C also divide their data according to the same method used by data party A.

[0052] The preset multi-party data partitioning algorithm refers to the multi-party data partitioning algorithm of 32-bit or 64-bit systems. The algorithm randomly divides the data held by each data party into three shares, thereby ensuring that each share of data is unique.

[0053] By randomly dividing the held data, even if some share of the data is leaked, it ensures that the entire data of each data party will not be cracked, thus achieving security protection for sensitive data during transmission.

[0054] In one embodiment, before dividing the first data party holding the first data to be calculated into a preset number of share data, the method further includes:

[0055] Perform a key initialization operation on the obtained random number of the first data party to generate the first data party's signature certificate and encryption certificate.

[0056] In one embodiment, the step of performing a key initialization operation on the obtained random number of the first data party to generate the first data party's signature certificate and encryption certificate includes:

[0057] A signature key pair is generated according to a preset encryption algorithm and the random number, wherein the signature key pair includes a first private key and a first public key;

[0058] Sign the first public key to obtain a signature certificate, an encryption certificate, and an encryption key pair digital envelope.

[0059] Random numbers are numbers generated randomly within a certain range, and the probability of obtaining each number within that range is equal. Data transmission is encrypted using signature and encryption certificates from each data provider, ensuring that external parties cannot easily intercept the transmitted data.

[0060] The system performs key initialization on the random number obtained from the first data party according to the preset cryptographic module. The preset cryptographic module refers to a cryptographic module recognized by the State Cryptography Administration (e.g., hardware cryptographic module, software cryptographic module), but other cryptographic modules can also be used, which are not limited here. The preset encryption algorithm includes, but is not limited to, the SM4 algorithm. The system generates an SM2 signature key pair from the random number of the first data party according to the preset encryption algorithm. The signature key pair of the first data party includes a first private key (SignPrivateKey_DataA) and a first public key (SignCert_DataA). The first public key of the signature key pair is exported from the preset cryptographic module and sent to a digital certificate authentication center recognized by the State Cryptography Administration to issue a signature certificate. At the same time as receiving the signature certificate returned from the digital certificate authentication center, the system also returns a digital envelope containing the encryption key pair and an encryption certificate.

[0061] In one embodiment, after obtaining the signature certificate, encryption certificate, and encryption key pair digital envelope, the method further includes:

[0062] The digital envelope is decrypted using the first private key of the first data party to obtain the encryption key pair of the first data party, which includes a second private key (EncPrivateKey_DataA) and a second public key (EncCert_DataA).

[0063] Based on the steps described above for generating the signature certificate and encryption certificate of the first data party from the random number of the first data party, the random numbers of the other data parties are obtained, and the random numbers are initialized with keys according to the preset encryption algorithm of the cryptographic module to generate the signature certificate and encryption certificate of each data party.

[0064] For example, the keys and certificates held by data parties A, B, and C are shown in Table 1:

[0065]

[0066]

[0067] Table 1

[0068] In one embodiment, the multi-party data secure computation method further includes:

[0069] The certificates of each data party are exchanged, a list of trusted certificates of each data party is generated, and stored in the preset database of each data party.

[0070] For example, after exchanging the certificates of data providers A, B, and C, a list of trusted certificates is generated (e.g., the list of trusted certificates contains the exchanged keys and certificates), as shown in Table 2:

[0071]

[0072] Table 2

[0073] Generate a trusted certificate list from the certificates of each data provider and store the trusted certificate list in the database of each data provider. By storing a trusted certificate list in each data provider, only requests from data providers on the trusted certificate list are processed, preventing users not on the trusted certificate list from requesting data at will. This can ensure data security and reduce system resource consumption.

[0074] S2. Store at least one share of data in a preset first database, and send the other share data to other data parties participating in the request besides the first data party;

[0075] In this embodiment, the first data party refers to the party that initiates the request for the data to be calculated, and the other data parties refer to all data parties other than the first data party. There are at least two other data parties, and the specific number of other data parties is not limited here. After each data party divides its own data, it randomly selects a share of the data and stores it in its own preset database, and sends the remaining share of the data to the other data parties that participated in the request for the data to be calculated for exchange.

[0076] For example, data provider A holds data y_A and x_A, data provider B holds data x_B, and data provider C holds data x_C. Based on the multi-party data partitioning algorithm, the data provided by data providers A, B, and C is divided, and the shares held by each data provider are shown in Table 3.

[0077]

[0078] Table 3

[0079] Each data party encrypts the remaining share data and then sends the encrypted remaining share data to the other data parties that have requested the data to be calculated.

[0080] By having each data provider retain a copy of the data, even if the remaining data is leaked during transmission, the thief cannot obtain the complete data, thus increasing the difficulty of cracking the data and solving the problem of inappropriate data storage methods in existing technologies.

[0081] In one embodiment, sending other share data to data parties other than the first data party participating in the request includes:

[0082] The other share data is encrypted using the encryption certificate of the other data party;

[0083] The other share data is signed using the first private key of the signature key pair to obtain the signature value of the first data party. The encrypted other share data, the signature value of the first data party, and the signature certificate of the first data party are then sent to the other data parties. When each data party sends its remaining share data to other data parties for exchange, it encrypts its own remaining share data using the encryption certificate of the exchanging party to obtain the encrypted remaining share data. Then, it signs the remaining share data using the first private key of its own signature key pair to obtain its own signature value. The encrypted remaining share data, its own signature value, and its own signature certificate are then sent to the other data parties that need to exchange data.

[0084] For example, data provider A divides its holding data y_A into three shares: y_A1_share data, y_A2_share data, and y_A3_share data. Data provider A stores the y_A1_share data in a pre-defined database.

[0085] When data party A prepares to send y_A2_share data to data party B, it uses data party B's encryption certificate to encrypt the y_A2_share data according to data party A's trusted certificate list, obtaining the encrypted y_A2_share data. Then, it uses the first private key of data party A's signature key pair to sign the y_A2_share data, obtaining data party A's signature value. Finally, it sends the encrypted y_A2_share data, data party A's signature value, and data party A's signature certificate to data party B. When sending y_A3_share data to data party C, the same method is used. Other data parties also refer to the encryption and signing method of data party A (the first data party) to obtain the encrypted and signed share data of the other data parties.

[0086] S3. Receive share data sent by the other data party, and combine the received share data with the share data of the first database to obtain the first combined data of the first data party.

[0087] In this embodiment, after the other data parties (excluding the first data party) who participated in the request for the data to be calculated executed the above-mentioned step S1 to divide the share data, they selected a share data to store in their respective data party's preset database, and encrypted, signed and sent their remaining share data to other data parties for data exchange.

[0088] After receiving the share data exchanged by other data parties, the first data party combines the received share data with the share data pre-stored in the first database to obtain the first data party's first combined data; other data parties obtain their own combined data by referring to the above method for obtaining the first combined data.

[0089] By exchanging the remaining share data, the combined data packets held by each data party contain data from other data parties, thus enabling the distributed holding of sensitive data by each data party. This ensures the security of data participating in multi-party secure computation and avoids the data leakage problem caused by each data party sending the entire data to the other party or external systems, as is the case in existing technologies.

[0090] In one embodiment, combining the received share data with the share data of the first database to obtain the first combined data of the first data party includes:

[0091] The received share data is decrypted using the second private key of the encryption key pair to obtain the plaintext data of the received share data.

[0092] Read the signature certificate attached to the received share data and determine whether the signature certificate is stored in the trusted certificate list of the first data party;

[0093] If so, the share data from the first database is read and combined with the received share data to obtain the first combined data from the first data party.

[0094] After receiving share data exchanged with other data parties, the first data party decrypts the received share data using the second private key of its encryption key pair to obtain the plaintext data of the received share data. It then reads the sender's signature value and signature certificate attached to the received share data and determines whether the signature certificate is stored in the first data party's trusted certificate list. If the signature certificate is stored in the first data party's trusted certificate list, it uses the signature certificate to verify the signature value attached to the plaintext data. If the signature verification is successful, it proves that the data communicated by both parties is legitimate. The received plaintext data is then combined with the share data pre-stored by the first data party in the first database and packaged in the same folder to obtain the first data party's first combined data. Other data parties follow the same method to obtain the first combined data, decrypting the received share data and verifying the signature to obtain their respective combined data.

[0095] By decrypting the received share data and verifying the signature, the security of the data during transmission can be ensured.

[0096] For example, each data party sends or exchanges share data with the other according to the rules of multi-party secure computation. After the exchange is completed, the combined data held by each data party is shown in Table 4:

[0097]

[0098] Table 4

[0099] S4. Based on the first trusted execution environment generated by the first data party by the preset physical host, the first combined data is sent to the physical host, so that the physical host can perform interactive calculations on the first combined data and the combined data uploaded to the physical host by the other data parties through the corresponding trusted execution environment, and obtain the calculation result of the data to be calculated.

[0100] In this embodiment, the physical host refers to the physical computer deployed in the cloud. The physical host provides the actual hardware environment for multi-party secure computing. Multiple independent, virtual trusted execution environments are generated through a physical host, and each trusted execution environment is associated and bound with each data party to generate a trusted execution environment exclusive to each data party.

[0101] For example, a physical host generates trusted execution environments A, B, and C. After associating and binding data party A with trusted execution environment A, trusted execution environment A is designated as the first trusted execution environment exclusive to data party A. That is, only the administrators of data party A have the authority to use the combined data of data party A and trusted execution environment A. Other data parties refer to the above method for obtaining the first trusted execution environment of the first data party and associate and bind each data party with the corresponding trusted execution environment to obtain their own exclusive trusted execution environment.

[0102] Each data provider uploads its combined data to the physical host through a dedicated trusted execution environment. The physical host then uses virtual network cards or network ports to perform interactive calculations on these combined data, yielding the computational results for the data to be calculated. This trusted execution environment creates a closed-loop data transmission environment, ensuring that data cannot be intercepted from the outside.

[0103] In one embodiment, sending the first combined data to the physical host based on the first trusted execution environment generated by the first data party according to the preset physical host includes:

[0104] Read input data from software running in the encrypted memory execution environment of the physical host;

[0105] The input data is subjected to a preset encryption process to generate a first trusted execution environment between the physical host and the first data party;

[0106] The first combined data is sent to the physical host through the first trusted execution environment.

[0107] In one embodiment, the step of performing a preset encryption process on the input data to generate a first trusted execution environment between the physical host and the first data party includes:

[0108] A proof report is generated based on the input data processed by the physical host's secure CPU;

[0109] After the hardware cryptographic module of the physical host successfully verifies the proof report, a bus session key is generated.

[0110] The bus session key is encrypted using the public key in the user data of the proof report to obtain the ciphertext of the bus session key;

[0111] The identifier ID of the hardware cryptographic module and the ciphertext of the bus session key are used as the key authorization result, and the key authorization result is returned to the software running in the encrypted memory execution environment;

[0112] The ciphertext of the bus session key is decrypted using the private key of the software to obtain the decrypted bus session key.

[0113] When the key corresponding to the identifier ID in the hardware cryptographic module is invoked, the decrypted bus session key is used to protect the invocation process, forming a trusted execution environment for the physical host;

[0114] The trusted execution environment is associated and bound to the first data party and serves as the first trusted execution environment for the first data party.

[0115] The secure CPU of the physical host provides an encrypted memory execution environment for software. The keys for encrypting memory data are randomly generated and managed within the secure CPU chip, and the software code cannot access these keys. However, the key management and services provided by the secure CPU are very limited and cannot meet the needs of software applications for using a large number of keys. Therefore, a hardware cryptographic module needs to be introduced to meet these needs.

[0116] The hardware cryptographic module of the physical host can generate, store, and calculate a large number of keys internally, and only output the calculation results of the keys, thus ensuring the security of the keys and providing secure and comprehensive key management and services for the software.

[0117] However, the relationship between existing secure CPUs and hardware cryptographic modules is loosely coupled. Due to the following two security issues, a trusted execution relationship of "key-private ownership" is not formed between a certain encrypted memory execution environment and a specific key in the hardware cryptographic module:

[0118] 1. The encrypted memory execution environment and the hardware cryptographic module exchange data through an external bus (such as the PCI bus). Existing secure CPU chips cannot encrypt and protect the data transmitted on the external bus through hardware encryption.

[0119] 2. The hardware cryptographic module on the external bus is shared by all encrypted memory execution environments on the same physical host. Although the key inside the hardware cryptographic module is not leaked, it can be accessed by different encrypted memory execution environments on the same physical host.

[0120] To address the two issues mentioned above, this embodiment requires the construction of a new security mechanism within the trusted execution environment:

[0121] Step A1: Configure Key Authorization for the Hardware Cryptographic Module: The secure CPU has a Platform Endorsement Key (PEK) inside the chip. This is an SM2 key pair containing a private key (PEK_Private) and a public key (PEK_Public). The PEK is generated internally by the secure CPU chip during the initialization of the encrypted memory execution environment platform. The secure CPU assigns a unique identifier ID (Env ID) to each encrypted memory execution environment. The secure CPU chip manufacturer assigns a unique identifier ID (Chip ID) to the secure CPU chip.

[0122] When generating a key (the key's unique identifier is HSMKey ID), the hardware cryptographic module must configure authorization information (HSMKeyAuth) for that key. This authorization information is stored in a secure storage space within the hardware cryptographic module and cannot be tampered with by unauthorized external parties. The authorization information (HSMKeyAuth) establishes an authorized binding relationship between a specific key within the hardware cryptographic module and a specific encrypted memory execution environment running on a specific secure CPU chip.

[0123] HSMKeyAuth=(HSMKey ID, Chip ID, Env ID, PEK_Public).

[0124] Step A2: Obtain key authorization from the hardware cryptographic module: When the software running in the encrypted memory execution environment needs to call the key inside the hardware cryptographic module, it generates a bus negotiation key pair (BusKey) inside the encrypted memory execution environment. This is an SM2 key pair containing a private key (BusKey_Private) and a public key (BusKey_Public). The public key (BusKey_Public) is used as input data (ATTESTATION) for constructing secure CPU proofs using user-defined data.

[0125] Input data (ATTESTATION) = (user-defined data USER DATA, random number MNONCE, message digest HASH), where user-defined data USER DATA includes HSMKey ID and BusKey_Public;

[0126] Random number (MNONCE): A one-time random number generated by the software calling the hardware cryptographic module. This random number is also stored in the random number register of the hardware cryptographic module. Each time a new random number is generated, it will overwrite the old random number in the random number register.

[0127] Message digest hash: HASH = SM3(USER DATA||MNONCE);

[0128] The secure CPU generates an attestation report (ATTESTATION_Report) based on the input data (ATTESTATION). ATTESTATION_Report = (Chip ID, Env ID, USER DATA, MNONCE, Report_Signature);

[0129] Report_Signature is the overall SM2 signature of Chip ID, Env ID, USER DATA, and MNONCE using the private key (PEK_Private).

[0130] The software running in the encrypted memory execution environment sends an ATTESTATION_Report to the hardware cryptographic module to request access to the key corresponding to the HSMKey ID. The hardware cryptographic module performs the following verifications:

[0131] Based on the HSMKey ID in USER DATA, read the HSMKeyAuth in its own secure storage space (HSMKeyAuth includes HSMKeyID, ChipID, EnvID, and PEK_Public).

[0132] If reading fails, then verification fails;

[0133] Verify the signature (Report_Signature) of the ATTESTATION_Report using the public key (PEK_Public). If signature verification fails, the verification fails.

[0134] Compare the random number MNONCE in the verification report (ATTESTATION_Report) with the value in its own random number register. If they are not the same, the verification fails.

[0135] Compare the Chip ID and Env ID in the verification report (ATTESTATION_Report) with those in the HSMKeyAuth. If they are different, the verification fails.

[0136] If they are the same, the verification is successful.

[0137] After the hardware cryptographic module successfully verifies the ATTESTATION_Report, it generates a bus session key (BusSessionKey). BusSessionKey is an SM4 symmetric key. Using the public key (BusKey_Public) of USER DATA in the ATTESTATION_Report, the bus session key (BusSessionKey) is encrypted using SM2 to obtain the ciphertext BusSessionKeyCipher. HSMKeyID and BusSessionKeyCipher are returned as the key authorization result to the software running in the encrypted memory execution environment. The software running in the encrypted memory execution environment uses the private key (BusKey_Private) to decrypt BusSessionKeyCipher using SM2 to obtain the bus session key (BusSessionKey).

[0138] Step A3: Call the key of the hardware cryptographic module: After the software running in the encrypted memory execution environment obtains the key authorization result, when it calls the key corresponding to the HSMKey ID in the hardware cryptographic module, it can do so under the protection of the bus session key (BusSessionKey), forming a private and exclusive trusted execution relationship.

[0139] Data exchange between the two parties is encrypted using the BusSessionKey (SM4) and HMAC-SM3 is calculated for integrity and authorization verification.

[0140] In one embodiment, the multi-party data secure computation method further includes:

[0141] In the first trusted execution environment, a random number is obtained from the first trusted execution environment to perform a key initialization operation, and a signature certificate and an encryption certificate for the first trusted execution environment are generated;

[0142] The signature certificate and encryption certificate of the first trusted execution environment are exchanged with the signature certificate and encryption certificate of the first data party to generate trusted certificate lists for the first trusted execution environment and the first data party, respectively.

[0143] Random numbers are numbers generated randomly within a certain range, and the probability of obtaining each number within that range is equal. A Trusted Execution Environment (TEE) can refer to a TEE recognized by the State Cryptography Administration (e.g., Hygon CSV TEE). Within this TEE, the CSV virtual machine uses the national cryptographic SM4 hardware engine to encrypt memory data, constructing a secure TEE. This ensures that host administrators or other users cannot access data within the TEE, supports startup metrics and runtime remote authentication, and guarantees that legitimate user programs are running. The encryption key for the memory within the TEE is generated by a hardware random number generator and is invisible to the software, ensuring user data security.

[0144] Based on a preset encryption algorithm (e.g., SM4 algorithm), the random number generated by the physical host in the first trusted execution environment is used to generate the SM2 signature key pair for the first trusted execution environment. The signature key pair of the first trusted execution environment includes a third private key (SignPrivateKey_TrustA) and a third public key (SignCert_TrustA). The third public key of the signature key pair is exported from the trusted execution environment and sent to the digital certificate authentication center recognized by the State Cryptography Administration to issue a signature certificate. At the same time as receiving the signature certificate returned from the digital certificate authentication center, the digital envelope of the encryption key pair and the encryption certificate are also returned.

[0145] In one embodiment, the multi-party data secure computation method further includes:

[0146] The digital envelope of the first trusted execution environment is decrypted using the third private key pair of the signature key pair of the first trusted execution environment to obtain the encryption key pair of the first trusted execution environment. The encryption key pair includes a fourth private key (EncPrivateKey_TrustA) and a fourth public key (EncCert_TrustA).

[0147] Other data parties' corresponding trusted execution environments obtain their respective trusted execution environment keys and certificates by referring to the method described above for obtaining the first trusted execution environment to generate and hold keys and certificates.

[0148] For example, data parties A, B, and C correspond to trusted execution environments A, B, and C, respectively. Each trusted execution environment generates and holds keys and certificates, as shown in Table 5.

[0149]

[0150] Table 5

[0151] The signing and encryption certificates of each trusted execution environment on the physical host are exchanged with the signing and encryption certificates of data parties A, B, and C, respectively, generating trusted certificate lists for trusted execution environments A, B, and C and data parties A, B, and C, as shown in Table 6-7:

[0152]

[0153]

[0154] Table 6

[0155]

[0156] Table 7

[0157] After generating trusted certificate lists for trusted execution environments A, B, and C and data parties A, B, and C, each trusted execution environment stores its trusted certificate list in its respective database, and each data party stores its trusted certificate list in its respective database.

[0158] In one embodiment, before sending the first combined data to the physical host, the method further includes:

[0159] The first combined data is encrypted using the encryption certificate of the first trusted execution environment;

[0160] The first combined data is signed using the first private key of the first data party's signature key pair to obtain the signature value of the first data party. The encrypted first combined data, the signature value of the first data party, and the signature certificate of the first data party are then sent to the physical host through the first trusted execution environment.

[0161] Following the steps described above for the first data party to encrypt and sign the first combination of data, each data party encrypts and signs its own combination of data, and then uploads the encrypted and signed combination of data to the physical host through a dedicated trusted execution environment.

[0162] In one embodiment, the step of enabling the physical host to perform interactive calculations on the first combined data and the combined data corresponding to the other data uploaded to the physical host through the corresponding trusted execution environment to obtain the calculation result of the data to be calculated includes:

[0163] Step A10: Decrypt the first combined data using the fourth private key of the encryption key pair of the first trusted execution environment of the physical host to obtain the plaintext data of the first combined data; Step A20: Read the signature certificate attached to the first combined data and determine whether the signature certificate is stored in the trusted certificate list of the first trusted execution environment. If so, use the signature certificate to verify the signature value attached to the decrypted plaintext data. After successful signature verification, obtain all share data uploaded by the first data provider.

[0164] Step A30, repeat steps A10-A20 until all share data uploaded by other data providers are obtained, and then perform interactive calculations on the share data from each data provider to obtain the calculation result of the data to be calculated.

[0165] After receiving the combined data uploaded by each data party, the physical host decrypts the received combined data using the fourth private key of the encryption key pair of the trusted execution environment corresponding to the physical host, obtaining the plaintext data of the combined data. It reads the sender's signature value and the sender's signature certificate attached to the received combined data, and determines whether the signature certificate is stored in the trusted certificate list of the corresponding trusted execution environment. If the signature certificate is stored in the trusted certificate list of the corresponding trusted execution environment, it uses the signature certificate to verify the signature of the decrypted plaintext data. If the signature verification is successful, it proves that the data communicated by both parties is legitimate. The plaintext data of each combined data is interactively calculated to obtain the calculation result of the data to be calculated.

[0166] By decrypting and verifying the signatures of each data combination, the security of the data during transmission can be ensured.

[0167] Other data parties refer to the above method for obtaining the first trusted execution environment of the first data party, and associate and bind each data party with the corresponding trusted execution ring to obtain their own exclusive trusted execution environment.

[0168] For example, if the combined data provided by data providers A, B, and C is related to machine learning calculations, then after the calculation is completed, each data provider receives its share of weight (w_share) and its share of offset b (b_share) as the calculation result of the data to be calculated, as shown in Table 8:

[0169]

[0170] Table 8

[0171] After obtaining the calculation result, the calculation result belonging to the first data party (data party A) is encrypted using the encryption certificate of the first data party (the calculation result is w_share1, b_share1). The calculation result of the first data party is then signed using the third private key of the physical host's signing key pair to obtain the physical host's signature value. The physical host's signature value, the physical host's signing certificate, and the encrypted calculation result of the first data party are then sent to the first data party through the first trusted execution environment. Other data parties also refer to the above method of encrypting and signing the calculation result of the first data party to obtain their own encrypted and signed calculation results.

[0172] After receiving the signed and encrypted calculation result from the first data party, the second private key of the first data party's encryption key pair is used to decrypt the signed and encrypted calculation result, obtaining the plaintext data of the first data party's calculation result. The signature value and signature certificate of the physical host attached to the calculation result are read, and it is determined whether the signature certificate is stored in the first data party's trusted certificate list. If so, the signature certificate is used to verify the signature value attached to the decrypted plaintext data. If the signature verification is successful, the plaintext data of the calculation result is used as the first data party's requested calculation result. Other data parties also decrypt and verify the signature of the first data party's calculation result in the same way to obtain their requested calculation results. By encrypting and signing the calculation result before sending, and decrypting and verifying the signature after receiving, the security of all data during transmission is ensured.

[0173] Through the above S1-S4 steps, the data to be calculated held by each data party is divided into shares, which are the same as the number of data parties participating in the request. This ensures that the entire data of each data party will not be leaked, and achieves security protection for sensitive data during transmission.

[0174] When the combined data from various data parties is uploaded to the physical host through their respective dedicated trusted execution environments, a closed-loop data transmission environment is formed through multiple dedicated trusted execution environments, ensuring that the data cannot be stolen from the outside.

[0175] The multi-party secure computation appliance is a single physical host that can perform multi-party secure computations without compromising data security. This significantly reduces network transmission time for data interaction and greatly improves the overall performance of multi-party secure computation.

[0176] like Figure 2 The diagram shown is a schematic diagram of a multi-party data security computing device provided in an embodiment of the present invention.

[0177] The multi-party data security computing device 100 of the present invention can be installed in an electronic device. Depending on the functions implemented, the multi-party data security computing device 100 may include a partitioning module 110, a sending module 120, a combining module 130, and an interaction module 140. The module described in this invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and which are stored in the memory of the electronic device.

[0178] In this embodiment, the functions of each module / unit are as follows:

[0179] The partitioning module 110 is used to respond to a request for data to be calculated issued by a first data party, and to partition the first data to be calculated held by the first data party into a preset number of share data, wherein the preset number is consistent with the number of data parties participating in the request;

[0180] The sending module 120 is used to store at least one share of data in a preset first database and send other share data to other data parties participating in the request besides the first data party.

[0181] The combination module 130 is used to receive the share data sent by the other data party, and combine the received share data with the share data of the first database to obtain the first combined data of the first data party.

[0182] The interaction module 140 is used to send the first combined data to the physical host according to the first trusted execution environment generated by the first data party by the preset physical host, so that the physical host can perform interactive calculations on the first combined data and the corresponding combined data uploaded to the physical host by the other data parties through the corresponding trusted execution environment, and obtain the calculation result of the data to be calculated.

[0183] In one embodiment, before dividing the first data party holding the first data to be calculated into a preset number of share data, the method further includes:

[0184] Perform a key initialization operation on the obtained random number of the first data party to generate the first data party's signature certificate and encryption certificate.

[0185] In one embodiment, the step of performing a key initialization operation on the obtained random number of the first data party to generate the first data party's signature certificate and encryption certificate includes:

[0186] A signature key pair is generated according to a preset encryption algorithm and the random number, wherein the signature key pair includes a first private key and a first public key;

[0187] Sign the first public key to obtain a signature certificate, an encryption certificate, and an encryption key pair digital envelope.

[0188] In one embodiment, sending other share data to data parties other than the first data party participating in the request includes:

[0189] The other share data is encrypted using the encryption certificate of the other data party;

[0190] The other share data is signed using the first private key of the signature key pair to obtain the signature value of the first data party. The encrypted other share data, the signature value of the first data party, and the signature certificate of the first data party are then sent to the other data parties.

[0191] In one embodiment, combining the received share data with the share data of the first database to obtain the first combined data of the first data party includes:

[0192] The received share data is decrypted using the second private key of the encryption key pair to obtain the plaintext data of the received share data.

[0193] Read the signature certificate attached to the received share data and determine whether the signature certificate is stored in the trusted certificate list of the first data party;

[0194] If so, the share data from the first database is read and combined with the received share data to obtain the first combined data from the first data party.

[0195] In one embodiment, sending the first combined data to the physical host based on the first trusted execution environment generated by the first data party according to the preset physical host includes:

[0196] Read input data from software running in the encrypted memory execution environment of the physical host;

[0197] The input data is subjected to a preset encryption process to generate a first trusted execution environment between the physical host and the first data party;

[0198] The first combined data is sent to the physical host through the first trusted execution environment.

[0199] In one embodiment, the multi-party data security computation method further includes:

[0200] In the first trusted execution environment, a random number is obtained from the first trusted execution environment to perform a key initialization operation, and a signature certificate and an encryption certificate for the first trusted execution environment are generated;

[0201] The signature certificate and encryption certificate of the first trusted execution environment are exchanged with the signature certificate and encryption certificate of the first data party to generate trusted certificate lists for the first trusted execution environment and the first data party, respectively.

[0202] like Figure 3 The diagram shown is a structural schematic of an electronic device for implementing a multi-party data security computation method according to an embodiment of the present invention.

[0203] In this embodiment, the electronic device 1 includes, but is not limited to, a memory 11, a processor 12, and a network interface 13 that can be interconnected via a system bus. The memory 11 stores a multi-party data security calculation program 10, which can be executed by the processor 12. Figure 3 Only the electronic device 1, which includes components 11-13 and the multi-party data security computation program 10, is shown. Those skilled in the art will understand that... Figure 3 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.

[0204] The memory 11 includes RAM and at least one type of readable storage medium. The RAM provides a cache for the operation of the electronic device 1; the readable storage medium can be a non-volatile storage medium such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the readable storage medium can be an internal storage unit of the electronic device 1; in other embodiments, the non-volatile storage medium can also be an external storage device of the electronic device 1, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 1. In this embodiment, the readable storage medium of the memory 11 is typically used to store the operating system and various application software installed on the electronic device 1, such as storing the code of the multi-party data security calculation program 10 in one embodiment of the present invention. Furthermore, the memory 11 can also be used to temporarily store various types of data that have been output or will be output.

[0205] In some embodiments, processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. This processor 12 is typically used to control the overall operation of the electronic device 1, such as performing control and processing related to data interaction or communication with other devices. In this embodiment, processor 12 is used to run program code stored in the memory 11 or process data, such as running a multi-party data security computation program 10.

[0206] The network interface 13 may include a wireless network interface or a wired network interface, which is used to establish a communication connection between the electronic device 1 and the terminal (not shown in the figure).

[0207] Optionally, the electronic device 1 may further include a user interface, which may include a display, an input unit such as a keyboard, and optionally, a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the electronic device 1 and to display a visual user interface.

[0208] It should be understood that the embodiments described are for illustrative purposes only and are not limited to this structure in the scope of the patent application.

[0209] The multi-party data security calculation program 10 stored in the memory 11 of the electronic device 1 is a combination of multiple instructions, which, when run in the processor 12, can achieve the following:

[0210] S1. In response to a request for data to be calculated issued by a first data party, the first data party holds the first data to be calculated and divides it into a preset number of share data, wherein the preset number is consistent with the number of data parties participating in the request.

[0211] S2. Store at least one share of data in a preset first database, and send the other share data to other data parties participating in the request besides the first data party;

[0212] S3. Receive share data sent by the other data party, and combine the received share data with the share data of the first database to obtain the first combined data of the first data party.

[0213] S4. Based on the first trusted execution environment generated by the first data party by the preset physical host, the first combined data is sent to the physical host, so that the physical host can perform interactive calculations on the first combined data and the combined data uploaded to the physical host by the other data parties through the corresponding trusted execution environment, and obtain the calculation result of the data to be calculated.

[0214] Specifically, the processor 12's implementation method for the aforementioned multi-party data security computation program 10 can be found in [reference needed]. Figure 1 The descriptions of the relevant steps in the corresponding embodiments are not repeated here.

[0215] Furthermore, if the modules / units integrated in the electronic device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable medium can be non-volatile or non-combustible. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).

[0216] The computer-readable storage medium stores a multi-party data security calculation program 10, which can be executed by one or more processors. The specific implementation of the computer-readable storage medium of the present invention is basically the same as the embodiments of the multi-party data security calculation method described above, and will not be repeated here.

[0217] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.

[0218] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0219] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.

[0220] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0221] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the invention. No appended diagram markings in the claims should be construed as limiting the scope of the claims.

[0222] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a system claim may also be implemented by a single unit or device through software or hardware. The term "second class" is used to indicate names and does not indicate any specific order.

[0223] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for secure multi-party data computation, characterized in that, The method includes: S1. In response to a request for data to be calculated issued by a first data party, the first data party holds the first data to be calculated and divides it into a preset number of share data, wherein the preset number is consistent with the number of data parties participating in the request. S2. Store at least one share of data in a preset first database, and send the other share data to other data parties participating in the request besides the first data party; S3. Receive share data sent by the other data party, and combine the received share data with the share data of the first database to obtain the first combined data of the first data party. S4. Based on the first trusted execution environment generated by the first data party by the preset physical host, the first combined data is sent to the physical host, so that the physical host can perform interactive calculations on the first combined data and the combined data uploaded to the physical host by the other data parties through the corresponding trusted execution environment, and obtain the calculation result of the data to be calculated.

2. The multi-party data security computation method as described in claim 1, characterized in that, Before dividing the first data party holding the first data to be calculated into a preset number of share data, the method further includes: Perform a key initialization operation on the obtained random number of the first data party to generate the first data party's signature certificate and encryption certificate.

3. The multi-party data security computation method as described in claim 2, characterized in that, The step of performing a key initialization operation on the random number obtained from the first data party to generate the signature certificate and encryption certificate of the first data party includes: A signature key pair is generated according to a preset encryption algorithm and the random number, wherein the signature key pair includes a first private key and a first public key; Sign the first public key to obtain a signature certificate, an encryption certificate, and an encryption key pair digital envelope.

4. The multi-party data security computation method as described in claim 3, characterized in that, Sending other share data to other data parties participating in the request besides the first data party includes: The other share data is encrypted using the encryption certificate of the other data party; The other share data is signed using the first private key of the signature key pair to obtain the signature value of the first data party. The encrypted other share data, the signature value of the first data party, and the signature certificate of the first data party are then sent to the other data parties.

5. The multi-party data security computation method as described in claim 3, characterized in that, The step of combining the received share data with the share data of the first database to obtain the first combined data of the first data party includes: The received share data is decrypted using the second private key of the encryption key pair to obtain the plaintext data of the received share data. Read the signature certificate attached to the received share data and determine whether the signature certificate is stored in the trusted certificate list of the first data party; If so, the share data from the first database is read and combined with the received share data to obtain the first combined data from the first data party.

6. The multi-party data security computation method as described in claim 1, characterized in that, The step of sending the first combined data to the physical host based on the first trusted execution environment generated by the first data party according to the preset physical host includes: Read input data from software running in the encrypted memory execution environment of the physical host; The input data is subjected to a preset encryption process to generate a first trusted execution environment between the physical host and the first data party; The first combined data is sent to the physical host through the first trusted execution environment.

7. The multi-party data security computation method as described in claim 1, characterized in that, The method also includes: In the first trusted execution environment, a random number is obtained from the first trusted execution environment to perform a key initialization operation, and a signature certificate and an encryption certificate for the first trusted execution environment are generated; The signature certificate and encryption certificate of the first trusted execution environment are exchanged with the signature certificate and encryption certificate of the first data party to generate trusted certificate lists for the first trusted execution environment and the first data party, respectively.

8. A multi-party data security computing device, characterized in that, The device includes: The partitioning module is used to respond to a request for data to be calculated issued by a first data party, and to partition the first data to be calculated held by the first data party into a preset number of share data, wherein the preset number is consistent with the number of data parties participating in the request; The sending module is used to store at least one share of data in a preset first database and send other share data to other data parties participating in the request besides the first data party. The combination module is used to receive share data sent by the other data parties, and combine the received share data with the share data of the first database to obtain the first combined data of the first data party. The interaction module is used to send the first combined data to the physical host according to the first trusted execution environment generated by the first data party by the preset physical host, so that the physical host can perform interactive calculations on the first combined data and the corresponding combined data uploaded to the physical host by the other data parties through the corresponding trusted execution environment, and obtain the calculation result of the data to be calculated.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores a multi-party data security computation program that can be executed by the at least one processor, the multi-party data security computation program being executed by the at least one processor to enable the at least one processor to perform the multi-party data security computation method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a multi-party data security computation program, which can be executed by one or more processors to implement the multi-party data security computation method as described in any one of claims 1 to 7.