Data processing method, device, medium and electronic device for secure computing
By conducting a round of masked data exchange in multi-party secure calculations and directly calculating the product of arithmetic sharing and Boolean sharing forms, the problem of large communication volume in the conversion of Boolean sharing and arithmetic sharing is solved, and the calculation efficiency is improved.
Patent Information
- Application Number
- CN202311559334.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-21
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2043-11-21
AI Technical Summary
In multi-party secure computation, the conversion between Boolean sharing and arithmetic sharing forms requires a large amount of communication, which affects computing efficiency.
By conducting a round of masked data exchange between the two parties, the product of the first data in the form of arithmetic sharing and the second data in the form of Boolean sharing is directly calculated, avoiding the process of converting Boolean sharing into arithmetic sharing and reducing data communication. quantity.
The business processing efficiency of security computing is improved, the data communication volume is reduced, and direct multiplication calculation is realized.
Smart Images

Figure CN117556441B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of secure multi-party computing, and in particular, to a data processing method, device, medium and electronic device for secure computing. Background Art
[0002] Secure multi-party computing is also called multi-party secure computing. Multiple parties can jointly calculate the result of a function without disclosing the input data of each party in the function. The result of the calculation is made public to one or more of the parties. Typical applications of secure multi-party computing include joint statistical analysis of multi-party data with privacy protection, machine learning, etc. The function here is a statistical operation function, a machine learning algorithm, etc.
[0003] In the process of multi-party secure computing, in order to prevent the disclosure of data and intermediate computing results of each party, the data or intermediate results can be held by each party in a shared form. A single party holds a data shard, and the shards held by each party are merged together to restore the corresponding data. Usually, the calculation is kept in a shared state. In this way, the number of data communications and the amount of communication in multi-party secure computing are important factors affecting the efficiency of secure computing. Summary of the invention
[0004] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0005] In a first aspect, the present disclosure provides a data processing method for secure computing, wherein the secure computing is used for two participants to collaboratively calculate the product of first data and second data, wherein the first data is in an arithmetic shared form between the two participants, and the second data is in a Boolean shared form between the two participants, and the method is applied to any of the participants, and the method includes:
[0006] generating first masked data according to a first arithmetic slice of the first data held by the participant and a first Boolean slice of the second data held by the participant, and generating second masked data according to the first Boolean slice;
[0007] sending the first masked data and the second masked data to other parties;
[0008] receiving third masked data and fourth masked data sent by the other participants, wherein the third masked data is generated based on a second arithmetic slice of the first data held by the other participants and a second Boolean slice of the second data held by the other participants, and the fourth masked data is generated based on the second Boolean slice;
[0009] A first intermediate result is generated based on the first Boolean slice, the second mask data, the third mask data, and the fourth mask data.
[0010] In a second aspect, the present disclosure provides a data processing device for secure computing, wherein the secure computing is used for two participants to collaboratively calculate the product of first data and second data, wherein the first data is in an arithmetic shared form between the two participants, and the second data is in a Boolean shared form between the two participants, and the device is applied to any of the participants, and the device comprises:
[0011] a first generating module, configured to generate first mask data according to a first arithmetic slice of the first data held by the participant and a first Boolean slice of the second data held by the participant, and to generate second mask data according to the first Boolean slice;
[0012] A sending module, used for sending the first masked data and the second masked data to other participants;
[0013] a receiving module, configured to receive third masked data and fourth masked data sent by the other participants, wherein the third masked data is generated based on a second arithmetic slice of the first data held by the other participants and a second Boolean slice of the second data held by the other participants, and the fourth masked data is generated based on the second Boolean slice;
[0014] The second generating module is configured to generate a first intermediate result based on the first Boolean slice, the second mask data, the third mask data and the fourth mask data.
[0015] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the data processing method for secure computing provided in the first aspect of the present disclosure.
[0016] In a fourth aspect, the present disclosure provides an electronic device, including:
[0017] a storage device having a computer program stored thereon;
[0018] A processing device is used to execute the computer program in the storage device to implement the steps of the data processing method for secure computing provided in the first aspect of the present disclosure.
[0019] In the above technical solution, when calculating the product of first data in the form of arithmetic sharing between two participants and second data in the form of Boolean sharing between the two participants, the two participants can realize the direct multiplication calculation of the first data and the second data through a round of masked data exchange without converting the Boolean sharing into arithmetic sharing, thereby eliminating the communication volume of the two participants in the conversion between Boolean sharing and arithmetic sharing, which can greatly reduce the data communication volume for calculating the product of Boolean sharing and arithmetic sharing, and improve the business processing efficiency of secure computing.
[0020] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings:
[0022] Figure 1 The present invention is a flowchart of a data processing method for secure computing according to an exemplary embodiment.
[0023] Figure 2 is a data interaction diagram of secure computing according to an exemplary embodiment.
[0024] Figure 3 is a data interaction diagram of secure computing according to another exemplary embodiment.
[0025] Figure 4 The invention is a block diagram showing a data processing device for secure computing according to an exemplary embodiment.
[0026] Figure 5 The diagram is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0027] Before introducing the specific embodiments of the present disclosure, the specific application scenarios of multi-party secure computing and the terms involved in the present disclosure are first introduced and explained.
[0028] In practical applications, for the purpose of privacy protection, multi-party secure computing algorithms are usually black box algorithms, and the data transmission behavior between the computing nodes equipped with multi-party secure computing algorithms is opaque. As discussed in the background technology, typical applications of multi-party secure computing include machine learning, among which multi-party secure computing technology can be used to protect privacy data during the reasoning and training stages of machine learning, mainly involving the protection of model parameters and the protection of the data of each participant during the training process.
[0029] At present, common privacy-preserving machine learning solutions based on secure multi-party computing include: privacy-preserving machine learning protocols based on obfuscated circuits, oblivious transmission and other technologies, and executing two-party secure multi-party computing protocols to complete nonlinear operations such as activation functions. Based on secret sharing technology, multiple parties are allowed to participate in machine learning network model training or prediction, and the process will not reveal data or model information.
[0030] In addition to the above application areas, multi-party secure computing can also be applied to privacy-protected network security detection, joint statistical analysis of privacy-protected multi-party data, spam cleaning and filtering of encrypted emails, advertising conversion and other fields.
[0031] Ring: refers to a set that defines two operations, addition and multiplication, and forms a commutative group for addition, a semigroup for multiplication for elements other than 0, and multiplication satisfies the distributive law for addition.
[0032] The ring of addition and multiplication is defined above, where addition is defined as integer addition modulo (mod) N, and multiplication is defined as integer multiplication mod N, where N is an integer greater than 1.
[0033] Secret Sharing is also called secret splitting or secret sharing. Its basic principle is to split a secret (such as a key, private data, etc.) into multiple shares and give them to different data parties for safekeeping. Only when parties exceeding a threshold number merge their shards can the secret be restored; Shares obtained from parties less than the threshold number cannot restore any information of the secret. In multi-party secure computing, the threshold number is usually the same as the number of participants, and the shares into which the secret is split can also be called shards.
[0034] Secret sharing is an important means in the process of multi-party secure computing. Several commonly used forms of secret sharing in multi-party secure computing include arithmetic sharing, Boolean sharing, and Yao's sharing. The following takes sharing secret data x as an example to describe various sharing methods.
[0035] Arithmetic sharing is also called sum sharing. In a two-party secure computation, an integer x is divided into two pieces x=x L +x R Modulo 2 N The shared form (translated to [0, 2 N -1] interval) is distributed and stored in two parties, that is, X is stored in two parties in a shared form in ring A, So that one party does not know x R, the other party does not know x L , neither party can obtain the complete form of x, x R and x L is the arithmetic share (Arithmetic Shares) or A-Shares of x. Further, two parties can be expanded to multiple parties, such as x = x1 + x2 + ... + x d Assuming N = 64, a single shard of x in a single participant can be represented by a 64-byte binary number. The way to split a data x into and share forms is, for example: randomly generate (d-1) 2 64 The values in the (e.g., randomly generated 64-byte binary numbers) are taken as (d-1) fragments, which are recorded as x1, x2, ..., x d-1 , and pair 2 64 (Translate to [0, 2 64 -1] interval) as another slice, such as x d =x-x1-x2-…-x d-1 .
[0036] Boolean sharing is a secret sharing method that performs XOR operations on bits. For example, still taking two participants as an example, assume that x is a one-bit data (valued at 0 or 1), and x0⊕x1 is used to form a Boolean sharing form between the two participants. x0 and x1 are two Boolean slices (Bool Shares) or B-Shares of x in the two participants, both of which are 0 or 1. That is, x is stored in the two parties in a shared form in ring B. Represents an XOR operation. A single participant does not know the shards held by another participant, so it cannot infer the data x.
[0037] Yao's sharing is a sharing method related to garbled circuits. This disclosure does not involve this sharing method and will not be described in detail here.
[0038] Among them, in secure two-party computation, the A-shares form is more suitable for arithmetic operations, such as addition, multiplication, etc., while the B-shares form is more suitable for logical operations, such as AND, OR, etc. However, sometimes mixed operations are performed on A-shares and B-shares.
[0039] For example, when calculating the expression if (x>y) then a else 0, we will first calculate b=(x>y), the result of which is a B-shares, and then calculate b*a.
[0040] However, when calculating b*a, b is B-Shares and a is A-Shares, and the two cannot be directly multiplied.
[0041] For example, when performing select a.key, max(b.value) from a join b group by a.key, a.key will be one-hot encoded, that is, each row of a.key is converted into an m-dimensional vector (m is the number of possible values of a.key), only one of the m dimensions of the vector is 1, and the rest are 0, and then each dimension of the one-hot encoding is multiplied by b.value. The multiplication here is also a multiplication of B-shares and A-shares.
[0042] To calculate the multiplication of B-shares and A-shares, the usual approach is to use the Boolean to Arithmetic Sharing (B2A) conversion to convert B-shares into A-shares, and then multiply them by A-shares.
[0043] However, B2A conversion usually has huge communication and computational overhead, as shown in Table 1 below:
[0044] Table 1 Cost of multiplying B-shares and A-shares
[0045] Offline Online Online communication round Total1 B2A N log N 4N log N log N 5N log N multiplication N 4N 1 5N Total2 N(log N+1) 4N(log N+1) log N+1 5N(log N
[0046] In view of this, the present disclosure provides a data processing method, device, medium and electronic device for secure computing.
[0047] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0048] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0049] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0050] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0051] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0052] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0053] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0054] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0055] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0056] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0057] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0058] Figure 1 FIG. 1 is a flow chart showing a data processing method for secure computing according to an exemplary embodiment. Figure 1 As shown, the above data processing method may include the following S101 to S104.
[0059] In S101, first mask data is generated according to a first arithmetic slice of first data held by a participant and a first Boolean slice of second data held by the participant, and second mask data is generated according to the first Boolean slice.
[0060] In the present disclosure, secure computing is used for two parties to collaboratively compute the product of first data and second data, the first data being in an arithmetic shared form between the two parties, and the second data being in a Boolean shared form between the two parties. It is understandable that the first data and the second data in the present disclosure may be any data that is not convenient for disclosure, and may include but is not limited to data representing user personal information, trade secrets, model parameters of a neural network model, and the like. The multi-party secure computing method provided in the embodiments of the present disclosure may be applied to ciphertext multiplication operations in tasks such as data calculation, cleaning, analysis, model training, storage, and database query based on ciphertext.
[0061] The above data processing method can be applied to any of the two participants. The above two participants can be called the first party and the second party. The present disclosure takes the application of the above data processing method to the first party as an example for explanation, that is, the participant in the above S101 is the first party, wherein the first party holds the first arithmetic slice a0 of the first data a and the first Boolean slice b0 of the second data b, and the second party (i.e., the other participant) holds the second arithmetic slice a1 of the first data a and the second Boolean slice b1 of the second data b; And N>1.
[0062] In S102, the first masked data and the second masked data are sent to other participants.
[0063] In S103, the third masked data and the fourth masked data sent by other participants are received.
[0064] In the present disclosure, the third masked data is generated based on the second arithmetic slice of the first data held by the other party and the second Boolean slice of the second data held by the other party, and the fourth masked data is generated based on the second Boolean slice.
[0065] The other participants generate third masked data based on the second arithmetic slice of the first data held by themselves and the second Boolean slice of the second data held by themselves, and generate fourth masked data according to the second Boolean slice; then, send the third masked data and the fourth masked data to the above-mentioned participants; the above-mentioned participants receive the third masked data and the fourth masked data.
[0066] In S104, a first intermediate result is generated based on the first Boolean slice, the second mask data, the third mask data, and the fourth mask data.
[0067] At the same time, the other participants generate a second intermediate result based on the second Boolean slice, the first masked data, the second masked data, and the fourth masked data. Afterwards, the two participants can share the intermediate results generated by each of them, and aggregate and merge the intermediate results generated by the two parties to obtain the final calculation result (i.e., the product of the first data and the second data).
[0068] The participants mask the data fragments they hold and share them with other participants. In this way, the two participants can directly multiply the first data and the second data through only one round of masked data exchange. The first masked data and the third masked data are both N bits, the second masked data and the fourth masked data are both 1 bit, and the online communication volume is (2N+2) bits.
[0069] It should be noted that the above S103 may be executed before the above S102, may be executed after the above S102, or may be executed simultaneously with the above S102, which is not specifically limited in the present disclosure.
[0070] In the above technical solution, when calculating the product of first data in the form of arithmetic sharing between two participants and second data in the form of Boolean sharing between the two participants, the two participants can realize the direct multiplication calculation of the first data and the second data through a round of masked data exchange without converting the Boolean sharing into arithmetic sharing, thereby eliminating the communication volume of the two participants in the conversion between Boolean sharing and arithmetic sharing, which can greatly reduce the data communication volume for calculating the product of Boolean sharing and arithmetic sharing, and improve the business processing efficiency of secure computing.
[0071] The following is a detailed description of the specific implementation method of generating the first masked data according to the first arithmetic slice of the first data held by the participant and the first Boolean slice of the second data held by the participant in the above S101. Specifically, it can be achieved by the following steps (11) to (13):
[0072] Step (11): Obtain the first random number in the N-th power space modulo 2.
[0073] The first random number belongs to the N-th power space modulo 2, that is, the value range of the first random number is [0, 2 N -1].
[0074] Step (12): Use the first random number to perform masking processing on the first arithmetic slice to obtain fifth masked data.
[0075] For example, the first random number may be used to perform masking processing on the first arithmetic slice by the following equation (1) to obtain fifth masked data:
[0076]
[0077] Among them, δa0 is the fifth masking data; is the first random number.
[0078] Step (13): Generate first mask data according to the fifth mask data and the first Boolean slice.
[0079] For example, the first mask data may be generated according to the fifth mask data and the first Boolean slice by the following equation (2):
[0080]
[0081] Wherein, C1 is the first mask data.
[0082] The following is a detailed description of the specific implementation method of generating the second mask data according to the first Boolean slice in the above S101. Specifically, it can be achieved by the following steps (21) and (22):
[0083] Step (21): Obtain a third random number in the modulo 2 space.
[0084] The third random number belongs to the modulo 2 space, that is, the value of the third random number is 0 or 1.
[0085] Step (22): Use the third random number to mask the first Boolean slice to obtain second masked data.
[0086] For example, the third random number may be used to mask the first Boolean slice using the following equation (3) to obtain the second masked data:
[0087]
[0088] Among them, δb0 is the second masking data; is the third random number.
[0089] The following is a detailed description of the specific implementation method for the other participants to generate the third masked data based on the second arithmetic slice of the first data held by themselves and the second Boolean slice of the second data held by themselves. Specifically, it can be achieved through the following steps (31) to (33):
[0090] Step (31): Obtain a fourth random number in the Nth power space modulo 2.
[0091] The fourth random number belongs to the N-th power space of modulo 2, that is, the value range of the fourth random number is [0, 2 N -1].
[0092] Step (32): Use the fourth random number to mask the second arithmetic slice to obtain sixth masked data.
[0093] For example, the fourth random number may be used to perform masking processing on the second arithmetic slice by the following equation (4) to obtain sixth masked data:
[0094]
[0095] Among them, δa1 is the sixth masking data; is the fourth random number.
[0096] Step (33): Generate third masked data according to the sixth masked data and the second Boolean slice.
[0097] For example, the third mask data may be generated according to the sixth mask data and the second Boolean slice by the following equation (5):
[0098]
[0099] Wherein, C2 is the third mask data.
[0100] The specific implementation method of generating the fourth mask data according to the second Boolean slice is described in detail below. Specifically, it can be achieved by the following steps (41) and (42):
[0101] Step (41): Obtain the fifth random number in the modulo 2 space.
[0102] The fifth random number belongs to the modulo 2 space, that is, the value of the fifth random number is 0 or 1.
[0103] Step (42): Use the fifth random number to mask the second Boolean slice to obtain fourth masked data.
[0104] For example, the fifth random number may be used to perform masking processing on the second Boolean slice by the following equation (6) to obtain fourth masked data:
[0105]
[0106] Among them, δb1 is the fourth masking data; is the fifth random number.
[0107] The following is a detailed description of a specific implementation method of generating the first intermediate result based on the first Boolean slice, the second mask data, the third mask data and the fourth mask data in the above S104. Specifically, the above method may further include the following steps:
[0108] Get a second random number in the space of N powers modulo 2.
[0109] The second random number belongs to the N-th power space of modulo 2, that is, the value range of the second random number is [0, 2 N -1].
[0110] At this time, the above S104 may include: generating a first intermediate result based on the first random number, the second random number, the first Boolean slice, the second masked data, the third masked data, the fourth masked data, and the fifth masked data.
[0111] For example, based on the first random number, the second random number, the first Boolean slice, the second masked data, the third masked data, the fourth masked data, and the fifth masked data, a first intermediate result is generated by the following equation (7):
[0112]
[0113] Among them, y0 is the first intermediate result; u0 is the second random number, f(b,a)=a if b==1 else 0.
[0114] The following is a detailed description of a specific implementation method for generating the second intermediate result by the other participants based on the second Boolean fragment, the first masked data, the second masked data and the fourth masked data. Specifically, the method may further include the following steps:
[0115] Get the sixth random number in the space of powers modulo 2.
[0116] The sixth random number belongs to the N-th power space of modulo 2, that is, the value range of the sixth random number is [0, 2 N -1].
[0117] At this time, other participants may generate a second intermediate result based on the fourth random number, the sixth random number, the second Boolean slice, the first masked data, the second masked data, the fourth masked data, and the sixth masked data.
[0118] For example, other participants may generate a second intermediate result through the following equation (8) based on the fourth random number, the sixth random number, the second Boolean slice, the first masked data, the second masked data, the fourth masked data, and the sixth masked data:
[0119]
[0120] Among them, y1 is the second intermediate result; u1 is the sixth random number.
[0121] After the two parameters obtain the first intermediate result and the second intermediate result, the two can be added to reach the final calculation result (i.e., the product of the first data and the second data). Specifically, the above method can also include the following two steps:
[0122] Obtaining a second intermediate result generated by another participant, wherein the second intermediate result is generated based on the second Boolean slice, the first masked data, the second masked data, and the fourth masked data;
[0123] A sum of the first intermediate result and the second intermediate result is determined as a product of the first data and the second data.
[0124] In addition to being executed by the above-mentioned parties, the above-mentioned steps can also be executed by other electronic devices other than the above-mentioned two parties. In this case, the other electronic device obtains the first intermediate result and the second intermediate result from the two parties respectively, and then determines the sum of the two as the product of the first data and the second data.
[0125] The correctness of the above protocol (i.e., first intermediate result + second intermediate result = first data * second data) is guaranteed by the following equation:
[0126]
[0127] in,
[0128] The following is a detailed description of the specific implementation of obtaining the first random number in the N-power space modulo 2 in step (11). Specifically, it can be implemented in a variety of ways. In one implementation, Figure 2 As shown, a Boolean-arithmetic-arithmetic triple (ie, BA2A triple) can be generated by a semi-trusted third party, wherein the triple includes a first random number The second random number u0, the third random number The fourth random number The fifth random number And the sixth random number u1, where these six random numbers satisfy the constraint condition Afterwards, the semi-trusted third party will The second random number u0, the third random number Send to the above parties and send the fourth random number The fifth random number The sixth random number u1 is sent to other participants. The above operation can be performed offline, and the offline communication volume is (4N+2) bits, where the first random number The fourth random number The second random number u0 and the sixth random number u1 are both N bits, and the third random number and the fifth random number Therefore, the above-mentioned participants can obtain the first random number, the second random number and the third random number.
[0129] In another embodiment, if Figure 3 As shown, a participant generates a first random number in the N-power space of modulo 2 based on a first seed held by itself, wherein a semi-trusted third party synchronously generates the first random number based on the first seed held by itself. Similarly, a participant generates a second random number in the N-power space of modulo 2 based on a second seed held by itself, wherein the semi-trusted third party synchronously generates the second random number based on the second seed held by itself; a participant generates a third random number in the modulo 2 space based on a third seed held by itself, wherein the semi-trusted third party synchronously generates the third random number based on the third seed held by itself. At the same time, other participants generate a fourth random number in the N-power space of modulo 2 based on a fourth seed held by themselves, wherein the semi-trusted third party synchronously generates the fourth random number based on the fourth seed held by itself. Similarly, other participants generate a fifth random number in the modulo 2 space based on a fifth seed held by themselves, wherein the semi-trusted third party synchronously generates the fifth random number based on the fifth seed held by itself. Afterwards, the semi-trusted third party generates a fifth random number based on the first random number generated locally. The second random number u0, the third random number The fourth random number The fifth random number Based on constraints Calculate a sixth random number u1 and send the sixth random number u1 to other participants.
[0130] First random number The second random number u0, the third random number Generated locally by the participant, the fourth random number and the fifth random number It is generated locally by other participants. Therefore, the semi-trusted third party only needs to send the sixth random number u1 to other participants. The sending operation can be performed offline, and the offline communication volume is N bits.
[0131] In yet another embodiment, the Boolean-arithmetic-arithmetic triples may be generated based on an oblivious transfer protocol or a homomorphic encryption method.
[0132] In one implementation, the first data may be a query field in a Structured Query Language (SQL) statement, and the second data may be a query condition in the SQL statement.
[0133] For example, the above data processing method can be executed when the following SQL statement is run:
[0134] select sum(a)from table1 where b;
[0135] In another embodiment, in the field of machine learning, to calculate RELU(a), b=DRELU(a)=(a>0) may be calculated first, and then f(b,a) may be calculated.
[0136] Figure 4 is a block diagram of a data processing device for secure computing according to an exemplary embodiment. The secure computing is used for two participants to collaboratively calculate the product of first data and second data, the first data being in an arithmetic sharing form between the two participants, and the second data being in a Boolean sharing form between the two participants. The device 300 is applied to any of the participants, such as Figure 4 As shown, the device 300 includes:
[0137] A first generating module 301, configured to generate first mask data according to a first arithmetic slice of the first data held by the participant and a first Boolean slice of the second data held by the participant, and to generate second mask data according to the first Boolean slice;
[0138] A sending module 302, configured to send the first masked data and the second masked data to other participants;
[0139] The receiving module 303 is configured to receive third masked data and fourth masked data sent by the other participants, wherein the third masked data is generated based on the second arithmetic slice of the first data held by the other participants and the second Boolean slice of the second data held by the other participants, and the fourth masked data is generated based on the second Boolean slice;
[0140] The second generating module 304 is configured to generate a first intermediate result based on the first Boolean slice, the second mask data, the third mask data and the fourth mask data.
[0141] In the above technical solution, when calculating the product of first data in the form of arithmetic sharing between two participants and second data in the form of Boolean sharing between the two participants, the two participants can realize the direct multiplication calculation of the first data and the second data through a round of masked data exchange without converting the Boolean sharing into arithmetic sharing, thereby eliminating the communication volume of the two participants in the conversion between Boolean sharing and arithmetic sharing, which can greatly reduce the data communication volume for calculating the product of Boolean sharing and arithmetic sharing, and improve the business processing efficiency of secure computing.
[0142] Optionally, the first generating module 301 includes:
[0143] An acquisition submodule, used for acquiring a first random number in the N-th power space modulo 2;
[0144] a masking submodule, configured to perform masking processing on the first arithmetic slice using the first random number to obtain fifth masked data;
[0145] A generating submodule is configured to generate first mask data according to the fifth mask data and the first Boolean slice.
[0146] Optionally, the device 300 further includes:
[0147] A first acquisition module, used to acquire a second random number in the N-th power space modulo 2;
[0148] The second generating module 302 is used to generate a first intermediate result based on the first random number, the second random number, the first Boolean slice, the second mask data, the third mask data, the fourth mask data and the fifth mask data.
[0149] Optionally, the first acquisition module is used to generate a first random number in the Nth power space modulo 2 based on a first seed held by the participant, wherein the semi-trusted third party synchronously generates the first random number based on the first seed held by itself.
[0150] Optionally, the first acquisition module is used to generate a Boolean-arithmetic-arithmetic triplet based on an oblivious transfer protocol or a homomorphic encryption method, wherein the Boolean-arithmetic-arithmetic triplet includes the first random number.
[0151] Optionally, the generating submodule is used to generate first mask data according to the fifth mask data and the first Boolean slice by using the following formula:
[0152]
[0153] Wherein, C1 is the first mask data; b0 is the first Boolean slice; δa0 is the fifth mask data.
[0154] Optionally, the first data is a query field in a structured query language statement, and the second data is a query condition in the structured query statement.
[0155] Optionally, the device 300 further includes:
[0156] A second acquisition module, configured to acquire a second intermediate result generated by the other participant, wherein the second intermediate result is generated based on the second Boolean slice, the first masked data, the second masked data, and the fourth masked data;
[0157] A determination module is used to determine the sum of the first intermediate result and the second intermediate result as the product of the first data and the second data.
[0158] The present disclosure also provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the above-mentioned data processing method for secure computing provided by the present disclosure.
[0159] Reference below Figure 5 , which shows a schematic diagram of the structure of an electronic device (such as a terminal device or a server) 600 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0160] like Figure 5 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0161] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0162] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0163] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0164] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0165] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0166] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: generates first mask data according to the first arithmetic slice of the first data held by the participant and the first Boolean slice of the second data held by the participant, and generates second mask data according to the first Boolean slice; sends the first mask data and the second mask data to other participants; receives third mask data and fourth mask data sent by the other participants, wherein the third mask data is generated based on the second arithmetic slice of the first data held by the other participants and the second Boolean slice of the second data held by the other participants, and the fourth mask data is generated based on the second Boolean slice; generates a first intermediate result based on the first Boolean slice, the second mask data, the third mask data and the fourth mask data.
[0167] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0168] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0169] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of the module does not limit the module itself in some cases. For example, the sending module may also be described as "a module for sending the first masked data and the second masked data to other participants".
[0170] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0171] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0172] According to one or more embodiments of the present disclosure, Example 1 provides a data processing method for secure computing, wherein the secure computing is used for two participants to collaboratively compute the product of first data and second data, wherein the first data is in an arithmetic shared form between the two participants, and the second data is in a Boolean shared form between the two participants, and the method is applied to any of the participants, and the method includes:
[0173] generating first masked data according to a first arithmetic slice of the first data held by the participant and a first Boolean slice of the second data held by the participant, and generating second masked data according to the first Boolean slice;
[0174] sending the first masked data and the second masked data to other parties;
[0175] receiving third masked data and fourth masked data sent by the other participants, wherein the third masked data is generated based on a second arithmetic slice of the first data held by the other participants and a second Boolean slice of the second data held by the other participants, and the fourth masked data is generated based on the second Boolean slice;
[0176] A first intermediate result is generated based on the first Boolean slice, the second mask data, the third mask data, and the fourth mask data.
[0177] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, wherein generating first mask data according to a first arithmetic slice of the first data held by the participant and a first Boolean slice of the second data held by the participant includes:
[0178] Get the first random number in the N-power space modulo 2;
[0179] Using the first random number to perform masking processing on the first arithmetic slice to obtain fifth masked data;
[0180] First mask data is generated according to the fifth mask data and the first Boolean slice.
[0181] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 2, wherein the method further includes:
[0182] Obtain a second random number in the N-power space modulo 2;
[0183] The generating a first intermediate result based on the first Boolean slice, the second mask data, the third mask data, and the fourth mask data comprises:
[0184] A first intermediate result is generated based on the first random number, the second random number, the first Boolean slice, the second masked data, the third masked data, the fourth masked data, and the fifth masked data.
[0185] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 2, wherein obtaining a first random number in the N-th power space modulo 2 includes:
[0186] Based on a first seed held by the participant, a first random number in a modulo 2 power space is generated, wherein a semi-trusted third party synchronously generates the first random number based on the first seed held by itself.
[0187] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 2, wherein obtaining a first random number in the N-th power space modulo 2 includes:
[0188] A Boolean-arithmetic-arithmetic triplet is generated based on an oblivious transfer protocol or a homomorphic encryption method, wherein the Boolean-arithmetic-arithmetic triplet includes the first random number.
[0189] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 2, wherein generating first mask data according to the fifth mask data and the first Boolean slice includes:
[0190] According to the fifth mask data and the first Boolean slice, the first mask data is generated by the following formula:
[0191]
[0192] Wherein, C1 is the first mask data; b0 is the first Boolean slice; δa0 is the fifth mask data.
[0193] According to one or more embodiments of the present disclosure, Example 7 provides the method described in any one of Examples 1-6, wherein the first data is a query field in a structured query language statement, and the second data is a query condition in the structured query statement.
[0194] According to one or more embodiments of the present disclosure, Example 8 provides the method of any one of Examples 1-6, wherein the method further includes:
[0195] Obtaining a second intermediate result generated by the other party, wherein the second intermediate result is generated based on the second Boolean slice, the first masked data, the second masked data, and the fourth masked data;
[0196] A sum of the first intermediate result and the second intermediate result is determined as a product of the first data and the second data.
[0197] According to one or more embodiments of the present disclosure, Example 9 provides a data processing device for secure computing, wherein the secure computing is used for two participants to collaboratively compute the product of first data and second data, wherein the first data is in an arithmetic shared form between the two participants, and the second data is in a Boolean shared form between the two participants, and the device is applied to any of the participants, and the device includes:
[0198] a first generating module, configured to generate first mask data according to a first arithmetic slice of the first data held by the participant and a first Boolean slice of the second data held by the participant, and to generate second mask data according to the first Boolean slice;
[0199] A sending module, used for sending the first masked data and the second masked data to other participants;
[0200] a receiving module, configured to receive third masked data and fourth masked data sent by the other participants, wherein the third masked data is generated based on a second arithmetic slice of the first data held by the other participants and a second Boolean slice of the second data held by the other participants, and the fourth masked data is generated based on the second Boolean slice;
[0201] The second generating module is configured to generate a first intermediate result based on the first Boolean slice, the second mask data, the third mask data and the fourth mask data.
[0202] According to one or more embodiments of the present disclosure, Example 10 provides a computer-readable medium having a computer program stored thereon, which implements the steps of any of the methods described in Examples 1-8 when executed by a processing device.
[0203] According to one or more embodiments of the present disclosure, Example 11 provides an electronic device, including:
[0204] a storage device having a computer program stored thereon;
[0205] A processing device is used to execute the computer program in the storage device to implement the steps of any one of the methods described in Examples 1-8.
[0206] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0207] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0208] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Claims
1. A data processing method for secure computing, wherein the secure computing is used by two participants to collaboratively compute the product of first data and second data, wherein the first data is in an arithmetic shared form between the two participants, and the second data is in a Boolean shared form between the two participants, characterized in that: The method is applied to any of the participants, and the method includes: generating first masked data according to a first arithmetic slice of the first data held by the participant and a first Boolean slice of the second data held by the participant, and generating second masked data according to the first Boolean slice; sending the first masked data and the second masked data to other parties; receiving third masked data and fourth masked data sent by the other participants, wherein the third masked data is generated based on a second arithmetic slice of the first data held by the other participants and a second Boolean slice of the second data held by the other participants, and the fourth masked data is generated based on the second Boolean slice; generating a first intermediate result based on the first Boolean slice, the second mask data, the third mask data, and the fourth mask data; Obtaining a second intermediate result generated by the other party, wherein the second intermediate result is generated based on the second Boolean slice, the first masked data, the second masked data, and the fourth masked data; A sum of the first intermediate result and the second intermediate result is determined as a product of the first data and the second data.
2. The method according to claim 1, characterized in that The generating first masked data according to the first arithmetic slice of the first data held by the participant and the first Boolean slice of the second data held by the participant comprises: Get the first random number in the N-power space modulo 2; Using the first random number to perform masking processing on the first arithmetic slice to obtain fifth masked data; First mask data is generated according to the fifth mask data and the first Boolean slice.
3. The method according to claim 2, characterized in that The method further comprises: Obtain a second random number in the N-power space modulo 2; The generating a first intermediate result based on the first Boolean slice, the second mask data, the third mask data, and the fourth mask data comprises: A first intermediate result is generated based on the first random number, the second random number, the first Boolean slice, the second masked data, the third masked data, the fourth masked data, and the fifth masked data.
4. The method according to claim 2, characterized in that: The obtaining of a first random number in a modulo 2 N-power space includes: Based on a first seed held by the participant, a first random number in a modulo 2 power space is generated, wherein a semi-trusted third party synchronously generates the first random number based on the first seed held by itself.
5. The method according to claim 2, characterized in that: The obtaining of a first random number in a modulo 2 N-power space includes: A Boolean-arithmetic-arithmetic triplet is generated based on an oblivious transfer protocol or a homomorphic encryption method, wherein the Boolean-arithmetic-arithmetic triplet includes the first random number.
6. The method according to claim 2, characterized in that The step of generating first mask data according to the fifth mask data and the first Boolean slice comprises: According to the fifth mask data and the first Boolean slice, the first mask data is generated by the following formula: Wherein, C1 is the first mask data; b0 is the first Boolean slice; δa0 is the fifth mask data.
7. The method according to any one of claims 1 to 6, characterized in that The first data is a query field in a structured query language statement, and the second data is a query condition in the structured query language statement.
8. A data processing device for secure computing, wherein the secure computing is used for two participants to collaboratively compute the product of first data and second data, wherein the first data is in an arithmetic shared form between the two participants, and the second data is in a Boolean shared form between the two participants, characterized in that: The device is applied to any of the participants, and the device includes: a first generating module, configured to generate first mask data according to a first arithmetic slice of the first data held by the participant and a first Boolean slice of the second data held by the participant, and to generate second mask data according to the first Boolean slice; A sending module, used for sending the first masked data and the second masked data to other participants; a receiving module, configured to receive third masked data and fourth masked data sent by the other participants, wherein the third masked data is generated based on a second arithmetic slice of the first data held by the other participants and a second Boolean slice of the second data held by the other participants, and the fourth masked data is generated based on the second Boolean slice; A second generating module, configured to generate a first intermediate result based on the first Boolean slice, the second mask data, the third mask data and the fourth mask data; A second acquisition module, configured to acquire a second intermediate result generated by the other participant, wherein the second intermediate result is generated based on the second Boolean slice, the first masked data, the second masked data, and the fourth masked data; A determination module is used to determine the sum of the first intermediate result and the second intermediate result as the product of the first data and the second data.
9. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processing device, the steps of the method described in any one of claims 1 to 7 are implemented.
10. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 7.
