A method and apparatus for batched private information retrieval
By combining cuckoo hashing and weighted code encoding with homomorphic encryption technology, the batch privacy information retrieval method was optimized, solving the problem of high computation and communication overhead and achieving efficient privacy-preserving information retrieval.
Patent Information
- Application Number
- CN202310590907.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-22
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2043-05-22
AI Technical Summary
Existing methods for batch privacy information retrieval have excessive computational and communication overhead, making them inefficient for practical applications. In particular, traditional methods such as SealPIR and RA Mahdavi fail to effectively utilize homomorphic encryption features.
By combining Cuckoo Hash technology, weighted code encoding, and homomorphic encryption technology, the query algorithm is optimized. The hash function is agreed upon by the client and server, and the SIMD homomorphic encryption technology is used for encryption and calculation, thereby reducing communication and computation overhead.
It significantly reduces computational and communication overhead, improves query efficiency, and is suitable for practical scenarios, such as batch information retrieval in medical databases, reducing query time and communication volume.
Smart Images

Figure CN116842242B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of cryptography application, and particularly relates to a batch privacy information retrieval method and device. BACKGROUND
[0002] The rapid development of Internet technology makes cloud services become mainstream. Large service providers use databases loaded on cloud servers to provide services for clients. The clients obtain information by accessing the servers on the cloud. However, there is a risk of privacy leakage in this efficient service mode. The server can know the specific content that the user wants to access, which is unacceptable in many privacy-sensitive scenarios, such as medical databases. The information retrieval method based on privacy protection can avoid this security problem.
[0003] The traditional information retrieval method based on privacy protection can only process one query at a time. When the user has multiple requests at the same time, using the repeated running word privacy information retrieval method cannot obtain higher efficiency, which contains a large number of redundant steps. Using the batch privacy information retrieval protocol, the computational overhead is much smaller than the word privacy information query method. However, for the previous batch privacy information retrieval method, such as SealPIR proposed by Hao Chen, it first combines the cuckoo hash technology with batch query. However, due to the use of ordinary coding characteristics, it needs to introduce additional communication overhead while reducing the computational overhead. RA Mahdavi first proposed applying the fixed-weight code encoding to the privacy information retrieval scheme. However, it does not consider the batch retrieval scenario, and the implementation scheme does not fully utilize the characteristics of homomorphic encryption, and the computational efficiency cannot be applied to actual scenarios. SUMMARY
[0004] The purpose of the embodiments of the present application is to provide a batch privacy information retrieval method and device to solve the technical problems of high computational and communication overhead and low practicality in the related art. The fixed-weight code technology and cuckoo hash technology are combined, and the homomorphic encryption calculation characteristics are optimized, which can save the communication overhead and the computational overhead at the same time, has better performance, and can be better applied to actual scenarios.
[0005] According to a first aspect of the embodiments of the present application, a batch privacy information retrieval method is provided, comprising:
[0006] The client and the server agree on the hash function used in the cuckoo hash technology. The sequence number index in the original database is calculated through the cuckoo hash technology. The result of each sequence number index for each hash function is retained to obtain a first hash bucket containing a plurality of baskets. The result of the sequence number index in the first hash bucket is disclosed to the server and the client.
[0007] The client fills the indexes of the batch query into a second hash bucket with the same length as the first hash bucket by using a cuckoo hash algorithm, wherein the indexes are filled in the corresponding positions as the sequence indexes of the batch query in the corresponding baskets of the first hash bucket, and the filling result is encoded by using a weight code coding method;
[0008] The client encrypts the obtained encoding result by using a homomorphic encryption technology as a batch query request and sends the batch query request to the server;
[0009] The server compares the received batch query request with the first hash bucket by using a homomorphic encryption technology to obtain a corresponding intermediate result;
[0010] The server performs corresponding calculation on the intermediate result and the original database to obtain a query result ciphertext corresponding to the batch query request and sends the query result ciphertext to the client;
[0011] The client decrypts the query result ciphertext to obtain the query result of the batch query request.
[0012] Further, the filling result is encoded by using a weight code coding method, specifically, the length n of the largest basket in the first hash bucket is selected as the coding domain of the weight code, the length m of the corresponding weight code is selected, the number k of 1 in the weight code is selected, and the filling result is mapped to the weight code.
[0013] Further, the client encrypts the obtained encoding result by using a homomorphic encryption SIMD technology.
[0014] Further, the process of encrypting the obtained encoding result by using a homomorphic encryption SIMD technology by the client is specifically: for a hash bucket with a length of B, the first B corresponding bits in the hash bucket are encrypted into the same ciphertext, the second B corresponding bits are encrypted into the second ciphertext, and the corresponding positions in the hash bucket are sequentially encrypted into the corresponding ciphertexts, and if the corresponding positions are empty, the weight code is set to 0 by default.
[0015] Further, the server compares the received batch query request with the first hash bucket by using a homomorphic encryption technology to obtain a corresponding intermediate result, including:
[0016] Each sequence index in each basket of the first hash bucket is encoded by using a corresponding weight code;
[0017] For each sequence index, the ciphertext in which the corresponding bit of the current weight code is 1 is selected, and the product of all the selected ciphertexts is calculated by using a homomorphic encryption SIMD technology to obtain a corresponding intermediate result.
[0018] Further, the server performs corresponding calculation on the intermediate result and the original database to obtain the query result ciphertext corresponding to the batch query request, including:
[0019] multiplying the intermediate result and the corresponding position of the original database to obtain the ciphertext of the corresponding position of the original database;
[0020] adding all the results in each basket to form the query result ciphertext.
[0021] Further, when the content length of the corresponding position of the original database exceeds the plaintext domain of the SIMD technology, the content is sliced, and a plurality of query result ciphertexts are formed respectively after query and sent to the client.
[0022] According to a second aspect of the embodiment of the application, a batch private information retrieval device is provided, including:
[0023] a cuckoo hash module configured to agree on a hash function used in cuckoo hash technology between the client and the server, calculate the sequence number index in the original database through the cuckoo hash technology, retain the result of each sequence number index for each hash function, and obtain a first hash bucket containing a plurality of baskets, wherein the result of the sequence number index in the first hash bucket is disclosed to both the server and the client;
[0024] an encoding module configured to fill the indexes of the batch query into a second hash bucket with the same length as the first hash bucket through the cuckoo hash algorithm, wherein the indexes of the batch query are filled as the sequence indexes of the indexes of the batch query in the corresponding basket of the first hash bucket at the corresponding position, and the filling result is encoded in a manner of encoding with a weight code;
[0025] an encryption module configured to encrypt the obtained encoding result using homomorphic encryption technology as a batch query request and send the batch query request to the server;
[0026] a comparison module configured to compare the received batch query request with the first hash bucket using homomorphic encryption technology to obtain the corresponding intermediate result;
[0027] a calculation module configured to perform corresponding calculation on the intermediate result and the original database to obtain the query result ciphertext corresponding to the batch query request and send the query result ciphertext to the client;
[0028] a decryption module configured to decrypt the query result ciphertext to obtain the query result of the batch query request.
[0029] According to a third aspect of the embodiment of the application, an electronic device is provided, including:
[0030] one or more processors;
[0031] a memory storing one or more programs;
[0032] When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to the first aspect.
[0033] According to a fourth aspect of the embodiments of the present application, a computer readable storage medium is provided, which stores computer instructions, and the instructions are executed by a processor to implement the steps of the method according to the first aspect.
[0034] The technical solutions provided by the embodiments of the present application can include the following beneficial effects:
[0035] As can be seen from the above embodiments, the present application re-designs the specific query scheme of batch privacy information retrieval, combines the cuckoo hash, the fixed weight code encoding and the SIMD technology under homomorphic encryption, uses the advantages of different technologies to design and optimize the query algorithm combined with the specific scene, greatly reduces the calculation overhead, reduces the query time required by batch privacy information retrieval, makes the query scheme more suitable for the actual scene, and at the same time, compared with similar schemes, the batch privacy information retrieval under the present scheme can greatly reduce the communication overhead and greatly reduce the size of the uploaded request ciphertext. Specifically, for a database of one million (2 22 million) data (each data length is set to 256 Bytes), when batch completing 2000 queries, the average time required by each query is 3.9 milliseconds, and compared with the previous batch query, the communication volume in the uploading part is reduced by about 75 times. The present scheme can realize batch information retrieval service under privacy protection, and the communication overhead and calculation overhead are much lower than the previous solutions.
[0036] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS
[0037] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present application and, together with the specification, serve to explain the principles of the present application.
[0038] Figure 1 is a flowchart of a batch privacy information retrieval method according to an exemplary embodiment.
[0039] Figure 2 is a schematic diagram of reserving hash function results based on all serial numbers according to an exemplary embodiment.
[0040] Figure 3 is an encryption process diagram of the client sending a request according to an exemplary embodiment.
[0041] Figure 4 is a schematic diagram of an algorithm for traversing the in-baskets order index and for each index according to an exemplary embodiment.
[0042] Figure 5 is a schematic diagram of an algorithm for returning database contents using intermediate results according to an exemplary embodiment.
[0043] Figure 6 is a block diagram of a batch private information retrieval apparatus according to an exemplary embodiment.
[0044] Figure 7 is a schematic diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0045] The exemplary embodiments will be described in detail herein with reference to the attached drawings. In the following description, like reference numerals refer to like elements throughout the description. The following exemplary embodiments are not representative of all embodiments consistent with the present application.
[0046] The terminology used in the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used in the description of the application and the appended claims, the singular forms "a", "an" and "the" are intended to include plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0047] It will be understood that, although the terms first, second, third, etc. can be used herein to describe various information, these terms are not intended to denote a temporal or chronological order. Rather, these terms are used solely to distinguish one from another only. For example, a first information can be termed a second information, and similarly, a second information can also be termed a first information, without departing from the scope of the present application. The word "if' as used herein means "when" or "upon" or "in response to the determination" depending on the context.
[0048] Figure 1 is a flowchart of a batch private information retrieval method according to an exemplary embodiment, as shown in Figure 1 the method can be applied in a terminal and can include the following steps:
[0049] (1) Client and server agree on the hash function used in the cuckoo hashing technology, calculate the sequence index in the original database through the cuckoo hashing technology, retain the result of each sequence index for each hash function, and obtain a first hash bucket containing several baskets, wherein the result of the sequence index in the first hash bucket is disclosed to both the server and the client;
[0050] (2) The client fills the indexes of batch queries into a second hash bucket with the same length as the first hash bucket through the cuckoo hashing algorithm, wherein the corresponding position is filled with the sequence index of the batch query in the corresponding basket of the first hash bucket, and the filling result is encoded in a weighted code encoding manner;
[0051] (3) The client encrypts the obtained encoding result using homomorphic encryption technology as a batch query request and sends it to the server;
[0052] (4) The server compares the received batch query request with the first hash bucket using homomorphic encryption technology to obtain the corresponding intermediate result;
[0053] (5) The server performs corresponding calculation on the intermediate result and the original database to obtain the query result ciphertext corresponding to the batch query request and sends it to the client;
[0054] (6) The client decrypts the query result ciphertext to obtain the query result of the batch query request at the same time.
[0055] In specific implementation, the present application can be applied to scenarios such as medical databases, and the visitor (client) expects to query detailed information of a series of drugs such as corresponding treatment diseases, contraindications, usage instructions, and inventory, while not expecting the medical database owner (server) to know which series of drugs the visitor is interested in, such as the server knowing the list of drugs that the current query user is interested in, which can infer that the client may currently have a certain disease such as hepatitis, and the user's own physical condition should be sensitive private information, which is not expected to be exposed to the server. Unintentional leakage may cause unnecessary trouble, and the possibility of sensitive information leakage may also make some patients worry about the risk of leakage and thus give up the query function, missing some effective treatment information. In addition, the present protocol can also be applied to basic modules in other privacy computing protocols, such as offline acceleration part for single privacy query or batch table lookup operation in privacy machine learning. The following is described in combination with drug information query.
[0056] (1) Client and server agree on the hash function used in the cuckoo hashing technology, calculate the sequence number index in the original database through the cuckoo hashing algorithm, retain the result of each sequence number index for each hash function, and obtain a first hash bucket containing several baskets, wherein the result of the sequence number index in the first hash bucket is public to the server and the client, as shown in the example Figure 2
[0057] The sequence number index in the original database is public to the server and the client, and the element corresponding to the sequence number index is public to the server and not public to the client. In a specific implementation, the server has a medical database, taking a drug database as an example, the database contains detailed descriptions of drugs such as treatment conditions, contraindications, usage instructions, and inventory. The client wants to understand the specific information of a series of drugs, and at the same time does not want to expose its interest in this series of drugs, because such information will indirectly reveal the client's physical condition. The client can query the database through the required drug number to understand the detailed description of the drug, and at the same time support querying multiple drugs. After querying, the server cannot judge which drug information the client is interested in, so as to infer the user's physical condition and other effective information according to the query. The client does not have to worry about the leakage of personal physical condition information in the query process when querying some sensitive disease drugs. The cuckoo hashing technology includes multiple different hash functions, and the cuckoo hashing technology and the specific hash function used here are public to the server and the client. The method usually selects the number of hash functions to be 3.
[0058] Specifically, for each sequence number index, the results of 3 hash functions are calculated and retained in sequence, and the calculated results are evenly distributed in a first hash bucket with a size of B using the cuckoo hashing algorithm. The first hash bucket includes several baskets, and the position of each sequence number index in each basket in the drug database is public to the server and the client.
[0059] For each position in the hash bucket, multiple sequence number indexes are filled in after hash function operation. Assuming that the length of the hash bucket is B, and assuming that the size of the hash bucket is equivalent to copying the original database three times, and the copied database is evenly distributed in B positions using the cuckoo hashing algorithm. In order to facilitate the client to query in each basket in step (2), the length of each basket at this time is much smaller than before the separation, which is very friendly to the privacy information retrieval process. And the result after running all the hash functions is public to the server and the client, that is, the client can know the position of each element in each basket.
[0060] (2) The client fills the index of the batch query into the second hash bucket with the same length as the first hash bucket using the cuckoo hash algorithm, wherein the corresponding position is filled with the sequence index of the index of the batch query in the corresponding basket of the first hash bucket, and the filling result is encoded using the weighted code encoding method.
[0061] Specifically, in this embodiment, the index for batch query is the required drug number. The purpose of this step is to fill all the serial number indexes into a second hash bucket, where the length of the second hash bucket is B. Using the Cuckoo Hash algorithm, under a certain failure rate, L requests for querying can be filled into B positions using this algorithm. When B = 1.5L, the failure rate is (1e-40), which can be ignored. Therefore, in the specific implementation of this application, it is preferable to predetermine the number L of each batch query to determine the length of the hash bucket, and then carry out the specific process of steps (1) to (6). Due to the characteristics of the Cuckoo Hash algorithm, the position where each index in the second hash bucket is filled must be the result of the Cuckoo Hash function, that is, it will definitely appear in the corresponding basket of the first hash bucket. At this time, it is only necessary to use the column index in the basket to select the element.
[0062] It should be noted that since the result obtained in step (1) is public to both parties and retains the results of all hash functions, it is equivalent to re-dividing the database into B baskets after repeating it three times. The client runs the ordinary cuckoo hash algorithm on the index, that is, only one hash result is retained for each index. When a hash collision is encountered, the hash value of the collision result is recalculated using a collision resolution strategy. Each index will only appear once in the hash bucket after the cuckoo hash algorithm. After the client fills all the indexes that need to be queried into the second hash bucket of length B, it is equivalent to retrieving one piece of data from each basket. The size of each basket is much smaller than the size of the original database. The sequence number of each item to be queried after using the cuckoo hash is mapped to the corresponding position, that is, the basket where the element is located is obtained, and the corresponding sequence number index is replaced with the corresponding index that needs to be queried in the basket.
[0063] Specifically, the length n of the largest basket in the first hash bucket is selected as the encoding field of the weighted code, and the length of the corresponding weighted code is m. The number of 1s in the weighted code is selected as k. Usually, this method recommends that k is 2 to achieve a balance between computation and communication. Each specific basket index obtained by (2.2) is encoded using the weighted code. The following pseudocode provides a stable mapping method from ordinary sequence numbers to weighted codes. The length m of the weighted code satisfies Encoding method for ordinal numbers much smaller than ordinary natural numbers:
[0064]
[0065] This algorithm takes an index i as input, which is an integer between 1 and 1, and the length m of the weighted code as input, determining the number of 1s in the weighted code. It outputs the encoded result of the weighted code. Initialize variable j to i and variable l to k. Use a loop to operate on each bit of the m-bit weighted code, where m′ is the currently calculated bit. The algorithm continues until the result of j is greater than or equal to... When the current calculation bit in the output weighted code is 1, the value of l is decreased to indicate that there are still l 1s that have not appeared. When l is 0, the loop is exited, indicating that there are no more 1s in the remaining positions of the weighted code.
[0066] It should be noted that the method for mapping sequence numbers to weighted codes can be randomly defined, as long as the server and client implement the same mapping. In another embodiment, such as Figure 3 As shown, random mapping is used to map the sequence number to the weighted code. When the client and the server use the same mapping from ordinary sequence number to weighted code, it will not affect other steps of this method. In practice, n is much greater than k, and the encoding length of the weighted code is less than that of the ordinary sequence number.
[0067] (3) The client encrypts the obtained encoded result using homomorphic encryption technology and sends it to the server as a batch query request;
[0068] The weighted code result is encrypted using SIMD (Single Instruction Multiple Data) technology from homomorphic encryption. Specifically, the encryption method involves encrypting the first bit of each of the B corresponding bits in the hash bucket into the same ciphertext, encrypting the second bit into the second ciphertext, and so on. If the corresponding position in the hash bucket is empty, then all bits of the weighted code are defaulted to 0. SIMD technology supports encrypting the corresponding bits of N weighted codes from the hash bucket into the same ciphertext at a time, where N depends on the polynomial degree chosen for homomorphic encryption. This degree is public to both the server and client; for simplicity, N = B is chosen in the diagram. See the example below. Figure 3 In practical applications, N typically takes the values 4096, 8192, or 16384.
[0069] Encryption is performed using a symmetric encryption algorithm within homomorphic encryption. Compared to public-key encryption, this reduces the size of the ciphertext, and the entire encrypted result is sent to the server. The number of ciphertexts is m*B / N.
[0070] (4) The server compares the received batch query requests with the first hash bucket using homomorphic encryption to obtain the corresponding intermediate results; such as Figure 4 As shown, the following processes may be included:
[0071] (4.1) Encode each sequence index in each basket of the first hash bucket with the corresponding weight code.
[0072] Specifically, the same weighted code mapping method as in step (2) is used, and the server and client agree in advance to use the same homomorphic encryption algorithm.
[0073] (4.2) For each sequence index, select the ciphertext in which the corresponding bit is 1 in the current weighted code, and use the SIMD technique of homomorphic encryption to calculate the product of all the selected ciphertexts to obtain the corresponding intermediate result. The homomorphic encryption algorithm supports ciphertext multiplication operation, and the SIMD technique can perform the same calculation operation on N baskets at the same time.
[0074] After (4.2), if the weighted code currently being processed is equal to the weighted code of the index of the corresponding basket, then the corresponding position of the product result is encrypted as 1; otherwise, it is 0. Traverse all weighted codes and store all product results.
[0075] (5) The server performs corresponding calculations with the intermediate results and the original database to obtain the encrypted query results corresponding to the batch query requests and sends them to the client, such as... Figure 5 As shown.
[0076] (5.1) Multiply the intermediate result by the corresponding position in the original database to obtain the ciphertext at the corresponding position in the original database;
[0077] (5.2) The results of all columns in each basket are summed to form the encrypted query result, reducing the amount of communication sent back. Since for each basket, after the operation in 4.3, there is at most one encrypted position of 1, the summation of the positions in each basket will not affect the content of the corresponding database position obtained in 5.1.
[0078] In practice, when the length of the database content exceeds the plaintext field of SIMD technology, the database content is sliced, queried separately, and returned. The results obtained in step 4 can be reused.
[0079] For applications with higher communication requirements, such as those involving large database lengths, the results can be recombined and transmitted back by reshaping the database, packaging requests in plaintext, and performing rotation operations. This further reduces communication and computational overhead. When B is less than N, there is still room for compression, specifically as follows:
[0080] The n elements in each basket in (2) can be split into N / B blocks, vertically spliced, and the database reshaped into N baskets, with each basket having a maximum length of n*B / N. At this time, the corresponding encoding length m is reduced accordingly, further reducing the amount of computation in the calculation process. Since the results of the N / B baskets in the returned ciphertext come from the same original basket, only one plaintext corresponding to the ciphertext will be valid information, and the rest will be 0. If the length of the original database information is longer than the single plaintext field of the SIMD technology, it will be sliced and multiple query results will be obtained. By rotating each query result by a factor of B, where the SIMD technology supports rotating the encrypted ciphertext by any number of slots, the results are accumulated, so at most every N / B ciphertexts can be accumulated together without affecting the final query result. For the return communication, it can be reduced by N / B times.
[0081] The rotation and merging algorithm proposed in this application can further compress the size of the returned ciphertext, making it more suitable for real-world network environments. Specifically, it is effective for handling millions of (2^35) data points. 20 When a database with 2,000 data entries (each data entry is 20KB long) completes 2,000 queries in batches, the amortized time required for each query is 0.27 seconds. Compared with previous batch queries, the communication volume in the upload part is reduced by about 75 times, while the downlink communication volume is on par with other similar solutions (if rotation is not performed, the downlink communication volume in this scenario will increase).
[0082] (6) The client decrypts the encrypted query results to obtain the query results of the batch query requests.
[0083] Specifically, the returned ciphertext is decrypted using the private key generated during encryption, employing the homomorphic encryption principle, and simultaneously decoded using the Chinese Remainder Theorem. At this point, the client can obtain the queried information. If a rotation operation is used to recombine the returned results, since the client knows the server's rotation algorithm (meaning the server knows the specific location of the corresponding information), the required drug information can be obtained by rearranging the results.
[0084] Corresponding to the aforementioned embodiments of the batch privacy information retrieval method, this application also provides embodiments of the batch privacy information retrieval device.
[0085] Figure 6 This is a basket diagram illustrating a batch privacy information retrieval device according to an exemplary embodiment. (Refer to...) Figure 6 The device may include:
[0086] The Cuckoo Hash Module 21 is used by the client and the server to agree on the hash function used in the Cuckoo Hash technology. It calculates the sequence index in the original database using the Cuckoo Hash technology, retains the result of each sequence index for each hash function, and obtains a first hash bucket containing several baskets. The result of the sequence index in the first hash bucket is public to both the server and the client.
[0087] Encoding module 22 is used by the client to fill the index of the batch query into a second hash bucket with the same length as the first hash bucket using the cuckoo hash algorithm, wherein the corresponding position is filled with the sequence index of the index of the batch query in the corresponding basket of the first hash bucket, and the filling result is encoded using a weighted code encoding method.
[0088] Encryption module 23 is used by the client to encrypt the obtained encoding result using homomorphic encryption technology as a batch query request and send it to the server.
[0089] Comparison module 24 is used by the server to compare the received batch query requests with the first hash bucket using homomorphic encryption technology to obtain the corresponding intermediate results;
[0090] Calculation module 25 is used by the server to perform corresponding calculations with the original database to obtain the encrypted query results corresponding to the batch query request and send them to the client.
[0091] The decryption module 26 is used by the client to decrypt the encrypted query results, thereby obtaining the query results of the batch query requests simultaneously.
[0092] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0093] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0094] Accordingly, this application also provides an electronic device, including: one or more processors; a memory for storing one or more programs; and when the one or more programs are executed by the one or more processors, causing the one or more processors to implement the batch privacy information retrieval method as described above. Figure 7 The diagram shown is a hardware structure diagram of any device with data processing capabilities for a batch privacy information retrieval method provided in an embodiment of the present invention, except... Figure 7 In addition to the processor, memory, and network interface shown, any data processing device in the embodiment may also include other hardware depending on the actual function of the data processing device, which will not be described in detail here.
[0095] Accordingly, this application also provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the batch privacy information retrieval method described above. The computer-readable storage medium can be an internal storage unit of any data-processing device as described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium can also be an external storage device, such as a plug-in hard disk, smart media card (SMC), SD card, flash card, etc., equipped on the device. Furthermore, the computer-readable storage medium can include both internal storage units of any data-processing device and external storage devices. The computer-readable storage medium is used to store the computer program and other programs and data required by the data-processing device, and can also be used to temporarily store data that has been output or will be output.
[0096] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0097] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.
Claims
1. A method for batch retrieval of privacy information, characterized in that, include: The client and server agree on the hash function used in the Cuckoo Hash technology. The sequence index in the original database is calculated using the Cuckoo Hash technology. The result of each sequence index for each hash function is retained to obtain a first hash bucket containing several baskets. The result of the sequence index in the first hash bucket is public to both the server and the client. The client uses the Cuckoo Hash algorithm to fill the index of the batch query into a second hash bucket with the same length as the first hash bucket. The corresponding position is filled with the sequence index of the index of the batch query in the corresponding basket of the first hash bucket. The filling result is encoded using a weighted code encoding method. The client encrypts the obtained encoded results using homomorphic encryption and sends them as batch query requests to the server. The server compares the received batch query requests with the first hash bucket using homomorphic encryption technology to obtain the corresponding intermediate results; The server performs corresponding calculations with the original database to obtain the encrypted query results corresponding to the batch query requests and sends them to the client. The client decrypts the encrypted query results to obtain the query results of the batch query requests simultaneously. The server compares the received batch query requests with the first hash bucket using homomorphic encryption to obtain the corresponding intermediate results, including: Encode each sequence index within each basket of the first hash bucket using the corresponding weighted code; For each sequence index, select the ciphertext containing the corresponding bit 1 in the current weighted key, and use the SIMD technique of homomorphic encryption to calculate the product of all the selected ciphertexts to obtain the corresponding intermediate result.
2. The method according to claim 1, characterized in that, The filling result is encoded using a weighted code encoding method. Specifically, the length n of the largest basket in the first hash bucket is selected as the encoding field of the weighted code, the length of the corresponding weighted code is m, the number of 1s in the weighted code is selected k, and the filling result is mapped to the weighted code.
3. The method according to claim 1, characterized in that, The client encrypts the obtained encoded result using the SIMD homomorphic encryption technique.
4. The method according to claim 3, characterized in that, The client encrypts the encoded result using the homomorphic encryption (SIMD) technique as follows: For a hash bucket of length B, the first bit of each of the B corresponding bits in the hash bucket is encrypted into the same ciphertext, the second bit is encrypted into the second ciphertext, and so on. If the corresponding position in the hash bucket is empty, then all bits of the default weight code are 0.
5. The method according to claim 1, characterized in that, The server performs corresponding calculations with the intermediate results and the original database to obtain the encrypted query results corresponding to the batch query requests, including: The intermediate result is multiplied by the corresponding position in the original database to obtain the ciphertext at the corresponding position in the original database. Add all the results from each basket together to form the encrypted query results.
6. The method according to claim 5, characterized in that, When the length of the content at the corresponding position in the original database exceeds the plaintext field of SIMD technology, the content is sliced, queried separately, and several ciphertext query results are generated and sent to the client respectively.
7. A batch privacy information retrieval device, characterized in that, include: The Cuckoo Hash module is used by the client and server to agree on the hash function used in the Cuckoo Hash technology. It calculates the sequence index in the original database using the Cuckoo Hash technology, retains the result of each sequence index for each hash function, and obtains a first hash bucket containing several baskets. The result of the sequence index in the first hash bucket is public to both the server and the client. The encoding module is used by the client to fill the index of the batch query into a second hash bucket with the same length as the first hash bucket using the Cuckoo Hash algorithm. The corresponding position is filled with the sequence index of the index of the batch query in the corresponding basket of the first hash bucket, and the filling result is encoded using a weighted code encoding method. The encryption module is used by the client to encrypt the obtained encoded results using homomorphic encryption technology and send them as batch query requests to the server. The comparison module is used by the server to compare the received batch query requests with the first hash bucket using homomorphic encryption technology to obtain the corresponding intermediate results; The calculation module is used by the server to perform corresponding calculations with the original database to obtain the encrypted query results corresponding to the batch query requests and send them to the client. The decryption module is used by the client to decrypt the encrypted query results, thereby obtaining the query results of the batch query requests simultaneously. The server compares the received batch query requests with the first hash bucket using homomorphic encryption to obtain the corresponding intermediate results, including: Encode each sequence index within each basket of the first hash bucket using the corresponding weighted code; For each sequence index, select the ciphertext containing the corresponding bit 1 in the current weighted key, and use the SIMD technique of homomorphic encryption to calculate the product of all the selected ciphertexts to obtain the corresponding intermediate result.
8. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-6.
9. A computer-readable storage medium storing computer instructions thereon, characterized in that, When executed by the processor, this instruction implements the steps of the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Privacy keyword query method, device and system
CN115186145A
Privacy set operation method and system based on fully homomorphic encryption
CN115529118A