Security index query method and device for protecting privacy data
By hybridly utilizing arithmetic sharing and Boolean sharing, the communication overhead is reduced and the computational efficiency is improved in secure index queries that protect privacy data, thus solving the problem of low efficiency in existing technologies.
Patent Information
- Application Number
- CN202310765700.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-26
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2043-06-26
AI Technical Summary
The existing technology has the problems of high communication overhead and low efficiency in secure index query for protecting private data.
A hybrid method of arithmetic sharing and Boolean sharing is adopted to convert the arithmetic sharing slices of the query list into Boolean sharing slices through multi-party joint operations, and the bit string slices of each bit are processed to determine the query value slice corresponding to the target index value.
While protecting privacy data, it reduces communication overhead and improves computing efficiency.
Smart Images

Figure CN116821182B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of this specification relate to the field of computers, and more particularly, to a secure index query method and apparatus for protecting private data. Background Art
[0002] Currently, data held by different data holders may contain users' private information, and data sharing between data holders may infringe on users' privacy. To facilitate data flow between multiple parties, secure multi-party computing (SMC) is used to support joint computing between multiple parties, unlocking the value of data while ensuring that the plaintext information of each party's private data is not leaked during multi-party interaction.
[0003] Secure multi-party computation enables multiple, mutually untrusting parties to securely compute a given function without disclosing any inputs or intermediate results, except for the final result. Secret sharing is a method of distributing a secret among different parties, each receiving a portion of the secret, called a shard. The secret can only be recovered when a sufficient number of shards are shared; a single shard cannot.
[0004] Secret sharing is widely used for secure computing in various scenarios due to its high efficiency in arithmetic and linear algebra operations. Computations based on secret sharing often involve secure index queries that protect private data. This involves inputting a list of secret-shared values and a secret-shared index, and then querying the ciphertext of the query value at the corresponding index position in the list without revealing the query index. Prior art secure index queries require significant communication overhead to protect private data, resulting in low efficiency. Therefore, there is a need for secure index queries that protect private data while maintaining high efficiency. Summary of the Invention
[0005] One or more embodiments of this specification describe a secure index query method and apparatus for protecting private data, which can protect private data while being highly efficient.
[0006] In a first aspect, a secure index query method for protecting private data is provided, wherein a query list has n query values, shards of arithmetic shares of each query value are distributed among multiple parties, and each query value has a corresponding index value. The method is executed by any one of the multiple parties and includes:
[0007] Get the first shard of the arithmetic share of the target index value to be queried;
[0008] Using a first operation performed jointly by multiple parties, convert the first fragment into a second fragment of Boolean sharing of BITS bits; wherein BITS is the number of binary bits of n;
[0009] For each bit of the second fragment, perform the following processing: determine the calculation interval for the i-th bit based on n and the position index of the i-th bit; determine the string fragment of the bit string of length n corresponding to the i-th bit based on the calculation interval and the fragment value of the i-th bit in the second fragment;
[0010] Using a second operation jointly performed by multiple parties, the string fragments of the bit string corresponding to each bit of the second fragment are processed to obtain fragments of an identification string of length n; the identification string has a value of 1 only at the position corresponding to the target index value;
[0011] By using the third operation jointly performed by multiple parties, the fragment of the query value corresponding to the position where the value of the identification string is 1 is determined as the fragment of the target query value corresponding to the target index value.
[0012] In one possible implementation, the multiple parties include a first party, a second party, and a third party, the arithmetic sharing shards of each query value include a first query shard, a second query shard, and a third query shard of the query value, the sum of the first query shard, the second query shard, and the third query shard is the query value, the first party has a first query shard and a second query shard, the second party has a second query shard and a third query shard, and the third party has a third query shard and a first query shard.
[0013] In one possible implementation, the method further includes:
[0014] Perform a base-2 logarithm operation on n to obtain BITS.
[0015] In a possible implementation, determining the calculation interval of the i-th bit according to n and the position index of the i-th bit includes:
[0016] Shift the binary representation of n right by i+1 bits, and use the arithmetic value obtained after the right shift as the calculation interval of the i-th bit.
[0017] In one possible implementation, determining, based on the calculation interval and the fragmentation value of the i-th bit in the second fragmentation, a string fragmentation of a bit string of length n corresponding to the i-th bit includes:
[0018] Assign values to the n bits of the string fragment in sequence; the sequential assignment includes, starting from the highest bit of the string fragment, using the fragment value of the i-th bit in the second fragment for assignment, and then flipping the previous assignment every number of bits of the calculation interval, and assigning a value using the flipped value.
[0019] In one possible implementation, the second operation performed jointly by multiple parties to process the string fragments of the bit string corresponding to each bit of the second fragment to obtain fragments of the identification string of length n includes:
[0020] Based on the string fragments of the bit string corresponding to each bit of the second fragment, a bitwise logical AND operation is performed on the corresponding bit string in conjunction with other parties to obtain a fragment of the identification string with a length of n.
[0021] Furthermore, the performing a bitwise logical AND operation on the corresponding bit strings in conjunction with other parties includes:
[0022] Performing several logical AND operations on binary inputs in conjunction with other parties, wherein the binary input corresponding to the current logical AND operation is the two bit strings, or the intermediate calculation result obtained by one bit string and a previous logical AND operation, or the intermediate calculation result obtained by two previous logical AND operations.
[0023] In one possible implementation, the third operation performed by multiple parties to determine the fragment of the query value corresponding to the position where the value of the identification string is 1 as the fragment of the target query value corresponding to the target index value includes:
[0024] Using a multi-party joint selection operation, based on the values of each position in the identification string, select the selected value corresponding to each position in the identification string; wherein, if the value of the first position in the identification string is 1, the slice of the query value corresponding to the first position is used as the selected value corresponding to the first position; if the value of the first position in the identification string is 0, 0 is used as the selected value corresponding to the first position;
[0025] The selected values obtained at each position are summed, and the summed result is used as the slice of the target query value.
[0026] In a second aspect, a secure index query device for protecting private data is provided, wherein a query list has n query values, arithmetic sharing slices of each query value are distributed among multiple parties, and each query value has a corresponding index value. The device is provided at any one of the multiple parties and includes:
[0027] an acquiring unit, configured to acquire a first shard of the arithmetic share of a target index value to be queried;
[0028] A first joint operation unit is configured to convert the first slice obtained by the obtaining unit into a second slice of Boolean sharing of BITS bits using a first operation performed by multiple parties; wherein BITS is the number of binary bits of n;
[0029] a local processing unit, configured to perform the following processing on each bit of the second slice obtained by the first joint operation unit: determining a calculation interval for the i-th bit based on n and a position index of the i-th bit; and determining a string slice of a bit string of length n corresponding to the i-th bit based on the calculation interval and a slice value of the i-th bit in the second slice;
[0030] a second joint operation unit, configured to process the string fragments of the bit string corresponding to respective bits of the second fragment obtained by the local processing unit using a second operation jointly performed by multiple parties, to obtain fragments of an identification string of length n; wherein the identification string has a value of 1 only at a position corresponding to a target index value;
[0031] The third joint operation unit is used to determine the fragment of the query value corresponding to the position where the value of the identification string is 1 by using the third operation performed by multiple parties as the fragment of the target query value corresponding to the target index value.
[0032] In a third aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method of the first aspect.
[0033] In a fourth aspect, a computing device is provided, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method of the first aspect is implemented.
[0034] Through the method and device provided by the embodiments of this specification, the query list has n query values, and the slices of the arithmetic share of each query value are distributed among multiple parties, and each query value has its corresponding index value. Any party among the multiple parties first obtains the first slice of the arithmetic share of the target index value to be queried; then, using the first operation performed jointly by the multiple parties, the first slice is converted into a second slice of Boolean share of BI TS bits; wherein BI TS is the number of binary bits of n; then, for each bit of the second slice, the following processing is performed respectively: according to n and the position index of the i-th bit, the calculation interval of the i-th bit is determined; according to the calculation interval and the slice value of the i-th bit in the second slice, the string slice of the bit string of length n corresponding to the i-th bit is determined; then, using the second operation performed jointly by the multiple parties, the string slices of the bit string corresponding to each bit of the second slice are processed to obtain slices of the identification string of length n; the identification string is 1 only at the position corresponding to the target index value; finally, using the third operation performed jointly by the multiple parties, the slice of the query value corresponding to the position where the value of the identification string is 1 is determined as the slice of the target query value corresponding to the target index value. As can be seen from the above, the embodiments of this specification utilize a mixed method of arithmetic sharing and Boolean sharing to reduce communication overhead and improve overall computing efficiency while achieving secure queries, thereby being able to protect privacy data while also being highly efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0036] Figure 1 A schematic diagram of an implementation scenario of an embodiment disclosed in this specification;
[0037] Figure 2 A flowchart of a secure index query method for protecting privacy data according to one embodiment is shown;
[0038] Figure 3 A schematic block diagram of a secure index query device for protecting privacy data according to one embodiment is shown. DETAILED DESCRIPTION
[0039] The solution provided in this specification is described below in conjunction with the accompanying drawings.
[0040] Figure 1 It is a schematic diagram of an implementation scenario of an embodiment disclosed in this specification. The implementation scenario involves a secure index query for protecting private data. It is understandable that a secure index query for protecting private data is to input a list of secret shared values and a secret shared index, and query to obtain the ciphertext of the query value at the corresponding index position on this list without leaking the query index. In the embodiment of this specification, the above list can be called a query list, and the query list has n query values. The arithmetic sharing of each query value is distributed among multiple parties, and each query value has its corresponding index value. Through the secure index query, any one of the multiple parties can obtain the target query value corresponding to the target index value. In this process, neither the target index value nor the individual query values in the query list can be leaked. In other words, the query list and the target index value are both private data. It is understandable that the multiple parties can be two, three or four parties, etc., and only three parties are shown in the figure as an example. As Figure 1 As shown, the scenario of secure index query for privacy-preserving data involves participants A, B, and C, also referred to as the first party, second party, and third party, or simply Party A, Party B, and Party C. Each participant can be any device, platform, server, or device cluster with computing and processing capabilities. All parties must jointly implement secure index query while protecting data privacy.
[0041] Practical applications, such as machine learning, often rely on floating-point arithmetic. However, using secret sharing to implement secure floating-point arithmetic incurs high overhead, making it difficult to meet actual computational requirements. Therefore, a common approach is to use fixed-point numbers to approximate floating-point numbers, achieving significant efficiency improvements at the expense of some precision. Secret sharing protocols are typically defined over rings or fields, each with its own advantages and disadvantages. Computations over rings, because the modulo operation can be implicitly handled by the hardware, are more efficient than computations over fields that require manual modulo operation.
[0042] In the embodiments of this specification, fixed-point numbers can be mapped into a ring for operation. The mapping construction process is as follows: Assume is a rational number, we need to Mapping to the integer domain, let Where f is the number of digits of precision, that is, the number of digits of the decimal part, and Int(·) is rounded to the nearest integer. Perform modular operation so that Where k represents the number of bits of x, and the input is mapped to On the ring.
[0043] In the embodiments of this specification, the arithmetic sharing of fixed-point numbers is It also combines Boolean sharing, which is calculated in Among them, the arithmetic sharing shard can be expressed as In the form of , the Boolean shared shard can be expressed as form.
[0044] Take the example of a three-party joint implementation of secure index query. The three computing parties are P0, P1, and P2, and the secret input x is split into three shards (x0, x1, x2), satisfying P i Hold(x i , x i+1 ), and x=(x0+x1+x2)mod 2 k .
[0045] It should be noted that multiple parties can be any number of computing parties. Data holders can serve as computing parties. Data holders and computing parties may or may not have any intersection. Multiple parties have equal status in the security index query process. Therefore, in the subsequent processing flow of the embodiments of this specification, only the processing flow of any one of the multiple parties will be described.
[0046] In addition, the query list is distributed among multiple parties in the form of secret sharing, that is, the arithmetic sharing of each query value included in the query list is distributed among multiple parties, the target index value is distributed among multiple parties in the form of secret sharing, and the target query value corresponding to the target index value is distributed among multiple parties in the form of secret sharing. In other words, the query list, target index value, and target query value are all in the form of ciphertext, that is, in the form of shards. Figure 1 , query list Where n is the length of the query list, the target index value idx∈[0,…,n-1], and the target query value is Party B is any party among multiple parties, which has a fragment of the above query list and the shards of the target index value Through a secure multi-party computation with parties A and C, party B is able to obtain a shard of the target query value. Thus, a secure index query that protects private data is achieved. It is understandable that during the secure index query process, some plaintext data may be known to all parties. For example, the length n of the query list may be in plaintext.
[0047] The following is a brief description of the conventional computing primitives used in the embodiments of this specification, including:
[0048] Addition and constant multiplication operations can be performed directly based on the original additive secret sharing protocol. Each participant only needs to perform the calculation locally.
[0049] Multiplication operation, a fixed-point multiplication operation includes two key calculations. First, the participants use the standard multiplication protocol to complete the integer multiplication operation. After the multiplication is completed, due to the limited precision of the fixed-point data, the calculation result needs to be truncated. The truncation operation is used to truncate the data after the doubled precision: the last f bits of the data are truncated, that is, divided by 2. f ;
[0050] Boolean operations, using the AND protocol to calculate the AND operation of binary inputs;
[0051] Arithmetic Boolean conversion operation, using the A2B protocol to convert the arithmetic share of a number into a Boolean share;
[0052] Select the sharding operation, input two arithmetic shares and one Boolean share, and use the SELECT protocol to select one of the two arithmetic shares based on the 0 or 1 status of the Boolean share.
[0053] The embodiments of this specification propose corresponding solutions for reducing communication overhead and improving overall computing efficiency while achieving secure queries.
[0054] Figure 2A flowchart of a secure index query method for protecting privacy data according to an embodiment is shown. The query list has n query values, and the arithmetic sharing of each query value is distributed among multiple parties. Each query value has its corresponding index value. The method can be based on Figure 1 In the implementation scenario shown, the method is performed by any one of the multiple parties. Figure 2 As shown, the secure index query method for protecting privacy data in this embodiment includes the following steps: Step 21, obtaining a first slice of the arithmetic share of the target index value to be queried; Step 22, using a first operation performed jointly by multiple parties, converting the first slice into a second slice of Boolean share of BITS bits; wherein BITS is the number of binary digits n; Step 23, for each bit of the second slice, performing the following processing: determining the calculation interval of the i-th bit based on n and the position index of the i-th bit; determining the string slice of the bit string of length n corresponding to the i-th bit based on the calculation interval and the slice value of the i-th bit in the second slice; Step 24, using a second operation performed jointly by multiple parties, processing the string slices of the bit string corresponding to each bit of the second slice, obtaining a slice of the identification string of length n; the identification string has a value of 1 only at the position corresponding to the target index value; Step 25, using a third operation performed jointly by multiple parties, determining the slice of the query value corresponding to the position where the value of the identification string is 1 as the slice of the target query value corresponding to the target index value. The specific execution method of each of the above steps is described below.
[0055] First, in step 21, the first slice of the arithmetic share of the target index value to be queried is obtained. It can be understood that for a query list of length n, the index values in the query list usually range from 0 to n-1, and the target index value can be any value from 0 to n-1. The target index value can be represented by idx. Accordingly, the first slice is represented as
[0056] In one example, the multiple parties include a first party, a second party, and a third party, the arithmetic shared shards of each query value include a first query shard, a second query shard, and a third query shard of the query value, the sum of the first query shard, the second query shard, and the third query shard is the query value, the first party has a first query shard and a second query shard, the second party has a second query shard and a third query shard, and the third party has a third query shard and a first query shard.
[0057] In this example, a three-party secret sharing scenario is given, taking the three-party joint implementation of secure index query as an example. The three computing parties are P0, P1, and P2, and the secret input x is split into three shards (x0, x1, x2), satisfying P i Hold(x i , xi+1 ), and x=(x0+x1+x2)mod 2 k The secret input x can represent a query value or a target index value.
[0058] Then, in step 22, the first slice is converted into a second slice of Boolean sharing of BITS bits using a first operation performed jointly by multiple parties; where BITS is the number of binary bits of n. It is understood that the length of the query list is n, and the number of bits of the index value is determined based on n.
[0059] In one example, the method further includes:
[0060] Perform a base-2 logarithm operation on n to obtain BITS.
[0061] For example, BITS=log2(n) is calculated, which is the number of bits required to represent the target index value idx.
[0062] The first operation above can use the A2B protocol to convert the arithmetic share of idx into a Boolean share, and obtain That is, the Boolean sharing of each bit of idx. The above conversion process can be expressed as:
[0063] Next, in step 23, the following processing is performed on each bit of the second fragment: Based on n and the position index of the i-th bit, the calculation interval for the i-th bit is determined; and based on the calculation interval and the fragmentation value of the i-th bit in the second fragment, the string fragment of the bit string of length n corresponding to the i-th bit is determined. It can be understood that the second fragment has a total of BITS bits, and each bit corresponds to a string fragment of the bit string of length n. Therefore, the processing result is BITS string fragments of the bit string of length n.
[0064] In one example, determining the calculation interval of the i-th bit according to n and the position index of the i-th bit includes:
[0065] Shift the binary representation of n right by i+1 bits, and use the arithmetic value obtained after the right shift as the calculation interval of the i-th bit.
[0066] For example, the calculation interval of the i-th bit is interval l=n>>(i+1), where i∈{0, . . . , BI TS-1}.
[0067] In one example, determining, based on the calculation interval and the fragmentation value of the i-th bit in the second fragmentation, a string fragmentation of a bit string of length n corresponding to the i-th bit, includes:
[0068] Assign values to the n bits of the string fragment in sequence; the sequential assignment includes, starting from the highest bit of the string fragment, using the fragment value of the i-th bit in the second fragment for assignment, and then flipping the previous assignment every number of bits of the calculation interval, and assigning a value using the flipped value.
[0069] For example, initialize an empty set and name it bit_masks. Construct the first for loop to traverse each bit of the Boolean mask of idx, starting from the highest bit: calculate the interval as interval l=n>>(i+1), where i represents the i-th bit. Assign the value of the i-th bit in the second fragment, that is, Initialize cur_bit_mask to a list of length n, and perform a second for loop on the n numbers in this list, according to interval and Assign values to this list. Here, the logic of assignment is to assign values every 1 second. Perform a flip, that is, if it is 0, it becomes 1; conversely, if it is 1, it becomes 0. After the second for loop ends, the constructed cur_bit_mask is added to bit_masks. After the first for loop ends, a list of size BITS is obtained, bit_masks, where each element is a list of length n, and the value in the list is 0 or 1, all in the form of Boolean sharing.
[0070] The above process of obtaining BITS bit strings of length n can be implemented by the following code:
[0071]
[0072] It can be understood that the bit_masks obtained after executing the above code contains BITS string fragments of bit strings with a length of n, and cur_bit_mask is a list with a length of n, which can also be regarded as a bit string with a length of n.
[0073] Then, in step 24, a second operation performed jointly by multiple parties is performed to process the string fragments corresponding to the respective bits of the second fragment, thereby obtaining fragments of an identification string of length n; the identification string has a value of 1 only at the position corresponding to the target index value. It will be understood that the identification string has a one-to-one correspondence with the target index value and can uniquely determine the target index value.
[0074] In one example, the second operation performed jointly by multiple parties processes the string fragments of the bit string corresponding to each bit of the second fragment to obtain a fragment of the identification string of length n, including:
[0075] Based on the string fragments of the bit string corresponding to each bit of the second fragment, a bitwise logical AND operation is performed on the corresponding bit string in conjunction with other parties to obtain a fragment of the identification string with a length of n.
[0076] For example, calling the BINARY_AND protocol, performing a bitwise AND operation on the BITS lists in bit_masks, yields an indicator string of length n, where only the position corresponding to idx is 1, and all other positions are 0. This indicator is also stored in Boolean format, meaning that the value of each position is not a plaintext 0 or 1.
[0077] The above process of obtaining the fragmentation of the identification string can be expressed as:
[0078]
[0079] Furthermore, the performing a bitwise logical AND operation on the corresponding bit strings in conjunction with other parties includes:
[0080] Performing several logical AND operations on binary inputs in conjunction with other parties, wherein the binary input corresponding to the current logical AND operation is the two bit strings, or the intermediate calculation result obtained by one bit string and a previous logical AND operation, or the intermediate calculation result obtained by two previous logical AND operations.
[0081] For example, the BINARY_AND protocol mentioned above. The input is Each element v i ={0,1} n .
[0082] This BINARY_AND protocol is implemented by calling the auxiliary calculation sub-protocol HELPER. When calling this sub-protocol HELPER, the start subscript 0 and the end subscript m-1 are additionally passed in to obtain the desired output. The input of the sub-protocol HELPER is Each element v i ={0,1} n , in addition, the input also includes the start subscript L and the end subscript R.
[0083] Calling the sub-protocol HELPER can be expressed as:
[0084]
[0085]
[0086] It is understandable that This is the processing result of the sub-protocol HELPER, and also the processing result of the aforementioned BINARY_AND protocol.
[0087] During the execution of the sub-protocol HELPER, it is determined whether L is equal to R. If so, it means that there is only one element that needs to be ANDed, and it returns directly. If not, it means that the current input is greater than or equal to two elements. Calculate the middle subscript mid = (L + R) >> 1, recursively call the HELPER protocol, and get the result of AND from L to the left part of mid, and the result of AND from mid + 1 to the right part of R. l and r Perform AND and calculate and merge =AND(and l ,and r ). Returns and merge .
[0088] The code implementation of the sub-protocol HELPER can be expressed as:
[0089]
[0090] It is understandable that the sub-protocol HELPER utilizes multiple logical AND operations on binary inputs to implement bitwise AND operations on BITS lists, where BITS can be any integer, for example, 2, 3, 4, 5, etc.
[0091] Finally, in step 25, a third operation is performed jointly by multiple parties to determine the query value slice corresponding to the position where the identifier string value is 1, and use it as the target query value slice corresponding to the target index value. It will be understood that both the identifier string and the query value are distributed among multiple parties in a secret-sharing manner, and the joint operation of multiple parties is required to determine the query value slice corresponding to the position where the identifier string value is 1.
[0092] In one example, the third operation performed by multiple parties to determine the fragment of the query value corresponding to the position where the value of the identification string is 1 as the fragment of the target query value corresponding to the target index value includes:
[0093] Using a multi-party joint selection operation, based on the values of each position in the identification string, select the selected value corresponding to each position in the identification string; wherein, if the value of the first position in the identification string is 1, the slice of the query value corresponding to the first position is used as the selected value corresponding to the first position; if the value of the first position in the identification string is 0, 0 is used as the selected value corresponding to the first position;
[0094] The selected values obtained at each position are summed, and the summed result is used as the slice of the target query value.
[0095] For example, based on the SELECT protocol, the value of the corresponding bit in the input list v is selected according to the value of each bit of the indicator. That is, if indicator[i] = 1, then v[i] is selected; otherwise, 0 is selected. Here, v[i] and 0 are both forms of arithmetic sharing. By adding the n numbers after the above selection, we get
[0096] The code implementation of the aforementioned third operation can be expressed as:
[0097]
[0098]
[0099] It is understandable that all parties gain shards.
[0100] Through the method provided in the embodiments of this specification, the query list has n query values, and the arithmetic sharing of each query value is distributed among multiple parties, and each query value has its corresponding index value. Any party among the multiple parties first obtains the first shard of the arithmetic sharing of the target index value to be queried; then, using the first operation performed jointly by the multiple parties, the first shard is converted into a second shard of Boolean sharing of BI TS bits; wherein BI TS is the number of binary digits of n; then, for each bit of the second shard, the following processing is performed respectively: according to n and the position index of the i-th bit, the calculation interval of the i-th bit is determined; according to the calculation interval and the shard value of the i-th bit in the second shard, the string shard of the bit string of length n corresponding to the i-th bit is determined; then, using the second operation performed jointly by the multiple parties, the string shards of the bit string corresponding to each bit of the second shard are processed to obtain shards of the identification string of length n; the identification string is 1 only at the position corresponding to the target index value; finally, using the third operation performed jointly by the multiple parties, the shard of the query value corresponding to the position where the value of the identification string is 1 is determined as the shard of the target query value corresponding to the target index value. As can be seen from the above, the embodiments of this specification utilize a mixed method of arithmetic sharing and Boolean sharing to reduce communication overhead and improve overall computing efficiency while achieving secure queries, thereby being able to protect privacy data while also being highly efficient.
[0101] According to another embodiment, a secure index query device for protecting privacy data is also provided. The query list has n query values, and the arithmetic sharing of each query value is distributed among multiple parties. Each query value has its corresponding index value. The device is set at any one of the multiple parties and is used to execute the security index query provided in the embodiment of this specification. Figure 2The method shown. Figure 3 FIG. 1 is a schematic block diagram of a secure index query device for protecting privacy data according to an embodiment. Figure 3 As shown, the device 300 includes:
[0102] An acquiring unit 31 is configured to acquire a first shard of the arithmetic share of a target index value to be queried;
[0103] A first joint operation unit 32 is configured to convert the first slice obtained by the obtaining unit 31 into a second slice of Boolean sharing of BITS bits using a first operation performed by multiple parties; wherein BITS is the number of binary bits of n;
[0104] The local processing unit 33 is configured to perform the following processing on each bit of the second fragment obtained by the first joint operation unit 32: determine the calculation interval of the i-th bit according to n and the position index of the i-th bit; determine the string fragment of the bit string of length n corresponding to the i-th bit according to the calculation interval and the fragment value of the i-th bit in the second fragment;
[0105] A second joint operation unit 34 is configured to process the string fragments of the bit string corresponding to the respective bits of the second fragment obtained by the local processing unit 33 using a second operation performed by multiple parties, to obtain fragments of an identification string of length n; the identification string has a value of 1 only at the position corresponding to the target index value;
[0106] The third joint operation unit 35 is configured to determine, by using a third operation performed by multiple parties, a fragment of the query value corresponding to a position where the value of the identification string is 1, as the fragment of the target query value corresponding to the target index value.
[0107] Optionally, as an embodiment, the multiple parties include a first party, a second party and a third party, the arithmetic sharing shards of each query value include a first query shard, a second query shard and a third query shard of the query value, the sum of the first query shard, the second query shard and the third query shard is the query value, the first party has a first query shard and a second query shard, the second party has a second query shard and a third query shard, and the third party has a third query shard and a first query shard.
[0108] Optionally, as an embodiment, the device further includes:
[0109] The bit number determination unit is used to perform a logarithm operation with base 2 on n to obtain BITS.
[0110] Optionally, as an embodiment, the local processing unit 33 is specifically configured to right-shift the binary representation of n by i+1 bits, and use the arithmetic value obtained after the right shift as the calculation interval of the i-th bit.
[0111] Optionally, as an embodiment, the local processing unit 33 is specifically used to assign values to the n bits of the string fragment in sequence; the sequential assignment includes, starting from the highest bit of the string fragment, using the fragment value of the i-th bit in the second fragment for assignment, and then flipping the previous assignment every number of bits of the calculation interval, and assigning a value using the flipped value.
[0112] Optionally, as an embodiment, the second joint operation unit 34 is specifically used to perform bitwise logical AND operations on the corresponding bit strings based on the string fragments of the bit strings corresponding to each bit of the second fragment, in conjunction with other parties, to obtain fragments of the identification string with a length of n.
[0113] Furthermore, the performing a bitwise logical AND operation on the corresponding bit strings in conjunction with other parties includes:
[0114] Performing several logical AND operations on binary inputs in conjunction with other parties, wherein the binary input corresponding to the current logical AND operation is the two bit strings, or the intermediate calculation result obtained by one bit string and a previous logical AND operation, or the intermediate calculation result obtained by two previous logical AND operations.
[0115] Optionally, as an embodiment, the third joint operation unit 35 includes:
[0116] A selection subunit, configured to select, using a multi-party joint selection operation, a selection value corresponding to each position of the identification string according to the value of each position of the identification string; wherein, if the value of the first position of the identification string is 1, the slice of the query value corresponding to the first position is used as the selection value corresponding to the first position; if the value of the first position of the identification string is 0, 0 is used as the selection value corresponding to the first position;
[0117] The summing subunit is used to sum the selected values obtained by the selecting subunit for each position, and use the summing result as the slice of the target query value.
[0118] Through the apparatus provided by the embodiment of this specification, the query table has n query values, and the arithmetic share of each query value is distributed among multiple parties. Each query value has its corresponding index value. Any of the multiple parties first obtains the first arithmetic share of the target index value to be queried by the acquisition unit 31; then, the first joint operation unit 32 uses the first operation performed by the multiple parties to convert the first share into a second share of the Boolean bit BI TS; wherein, BI TS is the number of binary digits of n; then the local processing unit 33 performs the following processing on each bit of the second slice: according to n and the position index of the i-th bit, determine the calculation interval of the i-th bit; according to the calculation interval and the slice value of the i-th bit in the second slice, determine the string slice of the bit string of length n corresponding to the i-th bit; the second joint operation unit 34 then uses the second operation performed by multiple parties to process the string slices of the bit string corresponding to each bit of the second slice, and obtain the slice of the identification string of length n; the identification string is 1 only at the position corresponding to the target index value; finally, the third joint operation unit 35 uses the third operation performed by multiple parties to determine the slice of the query value corresponding to the position where the value of the identification string is 1, as the slice of the target query value corresponding to the target index value. As can be seen from the above, the embodiment of this specification uses a mixture of arithmetic sharing and Boolean sharing to reduce communication overhead and improve overall computing efficiency while achieving secure query, so as to protect privacy data while having high efficiency.
[0119] According to another embodiment, there is also provided a computer readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute a combination of Figure 2 The method described.
[0120] According to another embodiment, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the system realizes the combination of Figure 2 The method described.
[0121] Those skilled in the art will appreciate that, in one or more of the above examples, the functions described herein may be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0122] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.
Claims
1. A secure index query method for protecting private data, wherein a query list has n query values, arithmetic sharing shards of each query value are distributed among multiple parties, and each query value has a corresponding index value. The method is executed by any one of the multiple parties, comprising: Get the first shard of the arithmetic share of the target index value to be queried; Converting the first slice into a second slice of BITS bits of Boolean sharing using a first operation jointly performed by multiple parties; where BITS is the number of binary bits of n; For each bit of the second fragment, perform the following processing: determine the calculation interval for the i-th bit based on n and the position index of the i-th bit; determine the string fragment of the bit string of length n corresponding to the i-th bit based on the calculation interval and the fragment value of the i-th bit in the second fragment; Using a second operation jointly performed by multiple parties, the string fragments of the bit string corresponding to each bit of the second fragment are processed to obtain fragments of an identification string of length n; the identification string has a value of 1 only at the position corresponding to the target index value; By using the third operation jointly performed by multiple parties, the fragment of the query value corresponding to the position where the value of the identification string is 1 is determined as the fragment of the target query value corresponding to the target index value.
2. The method according to claim 1, wherein The multiple parties include a first party, a second party, and a third party. The arithmetic sharing shards of each query value include a first query shard, a second query shard, and a third query shard of the query value. The sum of the first query shard, the second query shard, and the third query shard is the query value. The first party has a first query shard and a second query shard, the second party has a second query shard and a third query shard, and the third party has a third query shard and a first query shard.
3. The method of claim 1, further comprising: Perform a base-2 logarithm operation on n to obtain BITS.
4. The method according to claim 1, wherein The step of determining the calculation interval of the i-th bit according to n and the position index of the i-th bit includes: Shift the binary representation of n right by i+1 bits, and use the arithmetic value obtained after the right shift as the calculation interval of the i-th bit.
5. The method according to claim 1, wherein The determining, based on the calculation interval and the fragmentation value of the i-th bit in the second fragmentation, a string fragmentation of a bit string of length n corresponding to the i-th bit, includes: Assign values to the n bits of the string fragment in sequence; the sequential assignment includes, starting from the highest bit of the string fragment, using the fragment value of the i-th bit in the second fragment for assignment, and then flipping the previous assignment every number of bits of the calculation interval, and assigning a value using the flipped value.
6. The method of claim 1, wherein: The second operation performed jointly by multiple parties to process the string fragments of the bit string corresponding to each bit of the second fragment to obtain fragments of the identification string with a length of n includes: Based on the string fragments of the bit string corresponding to each bit of the second fragment, a bitwise logical AND operation is performed on the corresponding bit string in conjunction with other parties to obtain a fragment of the identification string with a length of n.
7. The method according to claim 6, wherein: The step of performing a bitwise logical AND operation on the corresponding bit strings in conjunction with other parties includes: Performing several logical AND operations on binary inputs in conjunction with other parties, wherein the binary input corresponding to the current logical AND operation is the two bit strings, or the intermediate calculation result obtained by one bit string and a previous logical AND operation, or the intermediate calculation result obtained by two previous logical AND operations.
8. The method of claim 1, wherein: The third operation performed by multiple parties to determine the fragment of the query value corresponding to the position where the value of the identification string is 1 as the fragment of the target query value corresponding to the target index value includes: Using a multi-party joint selection operation, based on the values of each position in the identification string, select the selected value corresponding to each position in the identification string; wherein, if the value of the first position in the identification string is 1, the slice of the query value corresponding to the first position is used as the selected value corresponding to the first position; if the value of the first position in the identification string is 0, 0 is used as the selected value corresponding to the first position; The selected values obtained at each position are summed, and the summed result is used as the slice of the target query value.
9. A secure index query device for protecting private data, wherein a query list has n query values, arithmetic sharing slices of each query value are distributed among multiple parties, each query value has a corresponding index value, and the device is provided at any one of the multiple parties, comprising: an acquiring unit, configured to acquire a first shard of the arithmetic share of a target index value to be queried; A first joint operation unit, configured to convert the first slice obtained by the obtaining unit into a second slice of Boolean sharing of BITS bits using a first operation performed by multiple parties; wherein BITS is the number of binary bits of n; a local processing unit, configured to perform the following processing on each bit of the second slice obtained by the first joint operation unit: determining a calculation interval for the i-th bit based on n and a position index of the i-th bit; and determining a string slice of a bit string of length n corresponding to the i-th bit based on the calculation interval and a slice value of the i-th bit in the second slice; a second joint operation unit, configured to process the string fragments of the bit string corresponding to respective bits of the second fragment obtained by the local processing unit using a second operation jointly performed by multiple parties, to obtain fragments of an identification string of length n; wherein the identification string has a value of 1 only at a position corresponding to a target index value; The third joint operation unit is used to determine the fragment of the query value corresponding to the position where the value of the identification string is 1 by using the third operation performed by multiple parties as the fragment of the target query value corresponding to the target index value.
10. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 8.
11. A computing device comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Query optimization method, device and system for multi-party security database
CN112860738A
Method, device and system for performing form conversion on privacy data fragments
CN113688426A