Hidden trace query method and device, equipment and medium
By using multiple hash functions in the privacy information retrieval technology to generate the target query ciphertext and pass the ciphertext between the server and the client, the existing PIR technology has solved the problem of high computing complexity and communication complexity in large-scale data set scenarios, and efficient query and privacy protection are achieved.
Patent Information
- Application Number
- CN202411876245.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-11
AI Technical Summary
The existing private information retrieval (PIR) technology has high computational complexity and communication complexity in large-scale data set scenarios, and cannot effectively support batch query.
By mapping the target keywords to the query using multiple hash functions, the target query ciphertext is generated, and the ciphertext is passed between the server and the client. The server obtains the intersection of query keywords from the source data file based on the target query ciphertext, and encrypts the query keywords in the intersection to generate the query field ciphertext. The client uses the target keyword to decrypt the obtained ciphertext to obtain the target query field.
It reduces the computational complexity and communication complexity, improves query efficiency in large-scale data set scenarios, and effectively protects the client's query information privacy.
Smart Images

Figure CN119808152A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to privacy information retrieval technology, and specifically to an anonymous query method, device, equipment and medium. Background Art
[0002] In the digital age, privacy protection has become an important issue that cannot be ignored. With the rapid development of big data and cloud computing, the risk of user data leakage is increasing. In order to meet this challenge, Private Information Retrieval (PIR) technology came into being and became a powerful tool for protecting user privacy.
[0003] However, the existing solutions for implementing PIR have high computational complexity and communication complexity, which makes them unsuitable for scenarios with large-scale data sets. When the amount of data is large, batch queries cannot be well supported. Summary of the invention
[0004] The present invention provides a method, device, equipment and medium for anonymous query.
[0005] According to one aspect of the present disclosure, there is provided an anonymous query method, which is applied to a server, and the method includes:
[0006] Obtaining a target query ciphertext sent by a client, wherein the target query ciphertext is obtained by mapping a target keyword to be queried using multiple hash functions;
[0007] According to the target query ciphertext, obtaining a first query keyword intersection from each query keyword of the source data file;
[0008] Calculate each query keyword in the first query keyword intersection according to a first Hash function to obtain a query keyword Hash set;
[0009] Encrypting the query field corresponding to each query keyword in the intersection of the first query keywords in the source data file using the corresponding query keyword to obtain a query field ciphertext;
[0010] Sending the query keyword hash set and the query field ciphertext to the client;
[0011] The query keyword hash set and the query field ciphertext are used to enable the client to use the target keyword to decrypt the target query field corresponding to the target keyword.
[0012] According to another aspect of the present disclosure, there is provided a method for anonymous query, which is applied to a client, and the method includes:
[0013] Using multiple hash functions to map the target keywords to be queried, obtaining a target query ciphertext, and sending the target query ciphertext to the server;
[0014] Obtaining a query keyword hash set and a query field ciphertext from the server, wherein the query keyword hash set includes a result of calculating the target keyword by a first hash function, and the query field ciphertext is encrypted using the query keyword corresponding to each query field in the source data file;
[0015] Obtaining a second query keyword intersection from the query keyword hash set according to the target keyword;
[0016] Extracting a target ciphertext corresponding to the intersection of the second query keywords from the query field ciphertext;
[0017] The target ciphertext is decrypted using the target keyword to obtain a target query field corresponding to the target keyword.
[0018] According to another aspect of the present disclosure, there is provided a stealth query device, which is configured on a server side and includes:
[0019] An acquisition module, used for acquiring a target query ciphertext sent by a client, wherein the target query ciphertext is obtained by mapping a target keyword to be queried using multiple hash functions;
[0020] A first intersection module, configured to obtain a first query keyword intersection from each query keyword in the source data file according to the target query ciphertext;
[0021] A first hash module, configured to calculate each query keyword in the intersection of the first query keywords according to a first hash function to obtain a query keyword hash set;
[0022] An encryption module, configured to encrypt the query field corresponding to each query keyword in the first query keyword intersection set in the source data file using the query keyword corresponding thereto to obtain a query field ciphertext;
[0023] A sending module, used to send the query keyword hash set and the query field ciphertext to the client;
[0024] The query keyword hash set and the query field ciphertext are used to enable the client to use the target keyword to decrypt the target query field corresponding to the target keyword.
[0025] According to another aspect of the present disclosure, there is provided a stealth query device, which is configured on a client, and includes:
[0026] A query ciphertext acquisition module is used to map the target keywords to be queried using multiple hash functions to obtain the target query ciphertext, and send the target query ciphertext to the server;
[0027] A field ciphertext acquisition module, used to acquire a query keyword hash set and a query field ciphertext from the server, wherein the query keyword hash set includes a result of calculating the target keyword by a first hash function, and the query field ciphertext is encrypted using the query keyword corresponding to each query field in the source data file;
[0028] A second intersection module, configured to obtain a second query keyword intersection from the query keyword hash set according to the target keyword;
[0029] A ciphertext extraction module, used to extract a target ciphertext corresponding to the intersection of the second query keywords from the query field ciphertext;
[0030] The decryption module is used to decrypt the target ciphertext using the target keyword to obtain a target query field corresponding to the target keyword.
[0031] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0032] at least one processor; and
[0033] a memory communicatively connected to the at least one processor; wherein,
[0034] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the anonymous query method described in any embodiment of the present disclosure.
[0035] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the anonymous query method described in any embodiment of the present disclosure.
[0036] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which, when executed by a processor, implements the anonymous query method according to any embodiment of the present disclosure.
[0037] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0039] Figure 1 is a schematic diagram of an anonymous query method applied to a server according to an embodiment of the present disclosure;
[0040] Figure 2 is a schematic diagram of an anonymous query method applied to a client according to an embodiment of the present disclosure;
[0041] Figure 3 is a schematic diagram of an anonymous query method according to an embodiment of the present disclosure;
[0042] Figure 4 is a schematic diagram of another anonymous query method according to an embodiment of the present disclosure;
[0043] Figure 5 is a schematic diagram of an anonymous query device configured on a server according to an embodiment of the present disclosure;
[0044] Figure 6 is a schematic diagram of an anonymous query device configured on a client according to an embodiment of the present disclosure;
[0045] Figure 7 It is a block diagram of an electronic device used to implement the anonymous query method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0046] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0047] Figure 1 This is a schematic diagram of an anonymous query method applied to a server according to an embodiment of the present disclosure. This embodiment can be applied to the case of implementing anonymous query in the process of private information retrieval, and relates to the field of computer technology, and in particular to private information retrieval technology. The method can be executed by an anonymous query device configured on the server, which is implemented in software and / or hardware, preferably configured on the server, which can be any computer device or smart terminal, etc. Figure 1 As shown, the method specifically includes the following:
[0048] S101. Obtain a target query ciphertext sent by a client, wherein the target query ciphertext is obtained by mapping a target keyword to be queried using multiple hash functions.
[0049] S102: Obtain a first query keyword intersection from each query keyword in the source data file according to the target query ciphertext.
[0050] S103: Calculate each query keyword in the first query keyword intersection according to the first Hash function to obtain a query keyword Hash set.
[0051] S104: Encrypt the query field corresponding to each query keyword in the first query keyword intersection in the source data file using the corresponding query keyword to obtain a query field ciphertext.
[0052] S105: Send the query keyword hash set and the query field ciphertext to the client.
[0053] Specifically, in order to conceal the query information of the client during the query process, it is necessary to map the target keyword to be queried to obtain the target query ciphertext, and the server performs a query based on the target query ciphertext and obtains the corresponding query field.
[0054] For example, the target query ciphertext can be obtained by inserting the target keyword into a Bloom filter or a cuckoo filter. The target query ciphertext is composed of target fingerprint information on multiple index bits, and the multiple index bits are calculated based on multiple hash functions for the target keyword. The target fingerprint information is mapped to the corresponding index bits using multiple hash functions for the target keyword. Taking the Bloom filter as an example, the target keyword (denoted as key c ) inserts the Bloom filter to obtain the target query ciphertext (denoted as BF C ). During the insertion process, multiple hash functions are used to calculate the target keyword, and the result is used as the index bit, and then the value on the index bit is set to 1 to obtain the target fingerprint information. For details about the Bloom filter and the cuckoo filter, please refer to the introduction in the prior art, which will not be repeated here.
[0055] The client sends the target query ciphertext to the server, and the server obtains the first query keyword intersection from each query keyword in the source data file according to the target query ciphertext. Among them, the source data in the source data file all correspond to their own query keywords. The server traverses the source data file according to the target query ciphertext, obtains the query keywords that have an intersection with the target query ciphertext, and finally obtains the first query keyword intersection.
[0056] In one implementation, the query keywords in the source data file may be mapped using the same multiple hash functions used when generating the target fingerprint information to obtain the query keyword ciphertext. Then the query keyword ciphertext is traversed to extract the first query keyword intersection including the target query ciphertext. Still taking the Bloom filter as an example, the server inserts the query keyword in the source data file into the Bloom filter and maps it according to the same multiple hash functions to obtain the query keyword ciphertext.
[0057] Next, the server calculates each query keyword in the first query keyword intersection according to the first hash function to obtain a query keyword hash set. Then, the query field corresponding to each query keyword in the first query keyword intersection in the source data file is encrypted using the corresponding query keyword to obtain a query field ciphertext, and the query keyword hash set and the query field ciphertext are sent to the client.
[0058] The query keyword hash set and the query field ciphertext are used to enable the client to use the target keyword to decrypt the target query field corresponding to the target keyword. In other words, the client can use the target keyword as a key and decrypt the target query field corresponding to the target keyword based on the query keyword hash set and the query field ciphertext.
[0059] Therefore, the technical solution of the embodiment of the present disclosure uses multiple hash functions to map the target keyword to obtain the target query ciphertext, and hides the keyword information to be queried on the client and the server. C When we only know that the value of the specified index bit in the ciphertext is 0 or 1, we cannot determine BF C The specific keywords contained in . Taking the cuckoo filter as an example, the chained cuckoo hash table generated by the client only records the element index in the hash table. When traversing the hash table, the server cannot determine the specific elements contained therein, and only needs to count the samples that fall at the specified index position. Therefore, the above methods can all play a role in hiding the query information, so that the query information of the client will not be leaked to the server.
[0060] At the same time, the disclosed embodiment also uses symmetric encryption to protect the content of the field to be queried corresponding to the keyword, that is, the server uses the query keyword to encrypt the query field, and the client can only decrypt the corresponding target query field based on the target keyword. The query field corresponding to the keyword other than the target keyword cannot be decrypted, thereby ensuring the security of other data. Therefore, on the one hand, compared with the homomorphic encryption method commonly used in the prior art, the symmetric encryption method in the disclosed embodiment, while ensuring the security of the query information, also reduces the computational complexity of the scheme, has higher computational efficiency, and reduces the overall communication complexity of the scheme. For example, when AES (Advanced Encryption Standard) is used for encryption, the ciphertext length is smaller than that of homomorphic encryption, thereby reducing the communication complexity.
[0061] In one embodiment, fingerprint information of non-target keywords is also mixed into the target query ciphertext. That is to say, m index bits corresponding to non-target keywords in the target query ciphertext are randomly selected and set to 1, so that the target query ciphertext sent by the client to the server not only contains information about the target keyword, but also other keywords are mixed in. The server traverses the query keywords in the source data file based on the obfuscated target query ciphertext, and the first query keyword intersection obtained is also a query keyword mixed with other non-target keywords. In this process, since the obfuscation of the target keyword is achieved, the server is even less able to know the target keyword of the client, thereby further improving the security and anonymity of the query information.
[0062] In another embodiment, the method of the embodiment of the present disclosure further includes:
[0063] Perform hash segmentation on each query keyword of the source data file to obtain multiple sub-files, wherein each sub-file corresponds to a unique label;
[0064] Correspondingly, according to the target query ciphertext, a first query keyword intersection is obtained from each query keyword of the source data file, including:
[0065] Get the target number corresponding to the target keyword sent by the client;
[0066] According to the target query ciphertext, a first query keyword intersection is obtained from each query keyword of the target sub-file corresponding to the target label.
[0067] Specifically, when the amount of data on the client and server is large, the computing efficiency can be improved by file segmentation. The server performs hash segmentation on each query keyword of the source data file to obtain multiple sub-files, wherein each sub-file corresponds to a unique label, that is, the hash value mapped by the hash function in the hash segmentation. When the client needs to query data, it is necessary to first calculate the target keyword using the same hash function in the hash segmentation, so that it can be obtained in which label sub-file the target keyword falls. When the client sends the target query ciphertext to the server, the target label of the sub-file is also sent. The server first obtains the target sub-file corresponding to the target label, and then obtains the first query keyword intersection from each query keyword of the target sub-file according to the target query ciphertext. In this way, when the server performs a query, it only needs to traverse in one sub-file, which greatly reduces the amount of calculation, thereby improving the query efficiency.
[0068] Figure 2 This is a schematic diagram of a method for anonymous querying applied to a client according to an embodiment of the present disclosure. This embodiment can be applied to the case of anonymous querying in the process of private information retrieval, and relates to the field of computer technology, and in particular to private information retrieval technology. The method can be executed by an anonymous querying device configured on a client, which is implemented in software and / or hardware, and is preferably configured on a client, which can be any computer device or smart terminal, etc. Figure 2 As shown, the method specifically includes the following:
[0069] S201. Use multiple hash functions to map target keywords to be queried, obtain target query ciphertext, and send the target query ciphertext to the server.
[0070] S202: Obtain a query keyword hash set and a query field ciphertext from the server.
[0071] The query keyword hash set includes the result of calculating the target keyword by the first hash function, and the query field ciphertext is encrypted using the query keyword corresponding to each query field in the source data file.
[0072] S203: Obtain a second query keyword intersection from the query keyword hash set according to the target keyword.
[0073] S204: Extract the target ciphertext corresponding to the second query keyword intersection from the query field ciphertext.
[0074] S205: Decrypt the target ciphertext using the target keyword to obtain a target query field corresponding to the target keyword.
[0075] The client can insert the target keyword into a Bloom filter or a cuckoo filter to map the target keyword to be queried using multiple hash functions to obtain the target query ciphertext. The server processes the target query ciphertext, obtains the query keyword hash set and the query field ciphertext, and returns them to the client. The query keyword hash set includes the result of the target keyword calculated by the first hash function, and the query field ciphertext is encrypted using the query keyword corresponding to each query field in the source data file.
[0076] In this way, the client can obtain the second query keyword intersection from the query keyword hash set according to the target keyword. Specifically, the query keyword hash set can be traversed according to the target keyword, and the second query keyword intersection can be obtained from the query keyword hash set. Specifically, the target keyword can be calculated using the first hash function to obtain a hash value, and then the query keyword including the hash value in the query keyword hash set can be obtained to obtain the second query keyword intersection. Then, the target ciphertext corresponding to the second query keyword intersection is extracted from the query field ciphertext. Finally, the target ciphertext is decrypted using the target keyword to obtain the target query field corresponding to the target keyword.
[0077] In one implementation, multiple hash functions are used to map the target keywords to be queried to obtain the target query ciphertext, including:
[0078] Insert the target keyword into the Bloom filter or the cuckoo filter to obtain the target query ciphertext; wherein the target query ciphertext is composed of target fingerprint information on multiple index bits, and the target fingerprint information is mapped to the corresponding index bits by using multiple hash functions to the target keyword.
[0079] In another implementation, fingerprint information of non-target keywords is also mixed into the target query ciphertext.
[0080] Accordingly, the target keyword is inserted into the Bloom filter or the cuckoo filter to obtain the target query ciphertext, including:
[0081] Insert the target keyword into the Bloom filter or the Cuckoo filter to obtain the initial query ciphertext;
[0082] Randomly select a set number of random index bits from the index bits corresponding to the non-target fingerprint information of the initial query ciphertext;
[0083] Insert the fingerprint information of non-target keywords at the random index position to obtain the target query ciphertext.
[0084] Therefore, the client obfuscates the target query ciphertext, that is, mixes the fingerprint information of non-target keywords, making it even more difficult for the server to know the client's target keywords during the query process, thereby further improving the security and anonymity of the query information.
[0085] In addition, the method of the embodiment of the present disclosure also includes:
[0086] Calculate the target keyword according to the second hash function, determine the target number corresponding to the target keyword, and send the target number to the server;
[0087] Among them, the target label is used to enable the server to obtain the query keyword hash set and query field ciphertext from the target sub-file corresponding to the target label; the target sub-file is obtained by the server by hashing each query keyword of the source data file based on the second hash function.
[0088] That is to say, the server performs hash segmentation on each query keyword of the source data file to obtain multiple sub-files, wherein each sub-file corresponds to a unique label. The client also calculates the target keyword according to the same hash function as in the hash segmentation to determine the target label corresponding to the target keyword, that is, to determine the sub-file to which the target keyword belongs, and then sends the target label to the server at the same time as sending the target query ciphertext. The server obtains the first query keyword intersection from each query keyword of the target sub-file corresponding to the target label based on the target query ciphertext. As a result, the amount of calculation is greatly reduced, the query efficiency is improved, and the user's query needs can be met even in the case of a large amount of data.
[0089] Figure 3 : is a schematic diagram of a method for anonymous query according to an embodiment of the present disclosure. As shown in the figure, the method is implemented by the cooperation of the client and the server. The client and the server can be any intelligent terminal, server or computer device, and the embodiment of the present disclosure does not make any limitation on this. Specifically, the method is as follows:
[0090] S1: The client uses multiple hash functions to map the target keywords to be queried, obtains the target query ciphertext, and sends the target query ciphertext to the server.
[0091] S2: The server obtains the first query keyword intersection from each query keyword in the source data file according to the target query ciphertext.
[0092] S3: The server calculates each query keyword in the first query keyword intersection according to the first hash function to obtain a query keyword hash set.
[0093] S4: The server encrypts the query field corresponding to each query keyword in the first query keyword intersection in the source data file using the corresponding query keyword to obtain the query field ciphertext, and sends the query keyword hash set and the query field ciphertext to the client.
[0094] S5: The client obtains a second query keyword intersection from the query keyword hash set according to the target keyword.
[0095] S6: The client extracts the target ciphertext corresponding to the intersection of the second query keywords from the query field ciphertext.
[0096] S7: The client uses the target keyword to decrypt the target ciphertext and obtains the target query field corresponding to the target keyword.
[0097] It can be seen that the technical solution of the disclosed embodiment uses multiple hash functions to map the target keyword to obtain the target query ciphertext, hiding the keyword information of the client and the server. At the same time, symmetric encryption technology is also used to protect the content of the to-be-queried field corresponding to the keyword, that is, the server encrypts the query field using the query keyword, and the client can only decrypt the corresponding target query field based on the target keyword. The query field corresponding to the keyword other than the target keyword cannot be decrypted. On the basis of ensuring the security of other data, the amount of calculation is reduced, with higher calculation efficiency, and the overall communication complexity of the solution is reduced.
[0098] Figure 4 is a schematic diagram of another anonymous query method according to an embodiment of the present disclosure. In this embodiment, an anonymous query based on a Bloom filter is used as an example for detailed description. As shown in the figure, the method includes:
[0099] S1': The server performs hash segmentation on the query keyword in the source data file to obtain sub-files f i .
[0100] Here, i represents the number of sub-files obtained by segmentation, which is related to the process of hash segmentation. The specific process of hash segmentation can be found in the prior art and will not be described here.
[0101] S2': The client sends the target keyword key to be queried c Insert the Bloom filter to get the target query ciphertext BF C .
[0102] Among them, the target query ciphertext BF C It can be in the form of an array. c During the insertion of the Bloom filter, the index bit in the array that hashes the target keyword is set to 1, and the remaining index bits remain 0.
[0103] S3': The client randomly selects BF C The m index bits with values of 0 are reset to 1.
[0104] Therefore, the target keywords can be obfuscated to further ensure that the server does not obtain the client's query information.
[0105] S4': The client calculates the hash value of the target keyword, determines the identifier i of the sub-file, and sends BF C and i to the server.
[0106] It should be noted that, in order to determine the identifier i of the sub-file, the client uses the same hash function as the server in hash segmentation to perform calculations, thereby determining the identifier i.
[0107] S5': The server will f i Insert the elements in Bloom filter to get BF i .
[0108] S6': The server side according to BF C Traversing BF i , extract the query keyword intersection S.
[0109] Among them, by traversing BF i The index set of 1 is determined by the BF C The same query keyword, namely BF i In and BF C There are query keywords with intersection.
[0110] It should also be noted that in this embodiment, the server first i Insert the elements in Bloom filter to get BF i Then, according to the BF C In another embodiment, f may not be i Insert the elements in the Bloom filter and directly use multiple hash functions to i Map the elements in and determine the index set corresponding to BF C The intersection of the index sets with 1 in , thereby obtaining the query keyword intersection S.
[0111] S7': The server performs hash calculation on the query keyword in S to obtain SH(S), encrypts the query field corresponding to the query keyword using the corresponding query keyword using AES to obtain [R], and sends<SH(S),[R]> to the client.
[0112] The key used for AES encryption is the query keyword corresponding to each query field.
[0113] S8': The client responds to the target keyword key c Perform hash calculation to get CH(key c ), traverse SH(S), extract the intersection S' of the query keywords and [R'] corresponding to S'.
[0114] S9': The client performs AES decryption on [R'] according to the target keyword to obtain the target query field R'.
[0115] In summary, the technical solution of the embodiment of the present disclosure utilizes a Bloom filter (or a cuckoo filter) to hide the keyword information of the client and the server; utilizes symmetric encryption to protect the content of the to-be-queried field corresponding to the keyword, with small computational complexity and high computational efficiency and security, thereby reducing the overall communication complexity of the solution; by randomly obfuscating the index bits in the Bloom filter generated by the client, other non-client keywords are mixed into the intersection of the keywords obtained by the server, thereby further improving the security of the keywords and enhancing the effect of hidden queries; by dividing the data on the server into blocks and performing keyword queries based on the blocks, the efficiency of the algorithm is further improved.
[0116] Figure 5 Schematic diagram of an anonymous query device configured on a server according to an embodiment of the present disclosure. This embodiment can be applied to the case of implementing anonymous query in the process of private information retrieval, and relates to the field of computer technology, and in particular to private information retrieval technology. The device can implement the anonymous query method on the server described in any embodiment of the present disclosure. Figure 5 As shown, the device 500 specifically includes:
[0117] An acquisition module 501 is used to acquire a target query ciphertext sent by a client, wherein the target query ciphertext is obtained by mapping a target keyword to be queried using multiple hash functions;
[0118] A first intersection module 502 is used to obtain a first query keyword intersection from each query keyword of the source data file according to the target query ciphertext;
[0119] A first hash module 503, configured to calculate each query keyword in the first query keyword intersection according to a first hash function to obtain a query keyword hash set;
[0120] An encryption module 504 is used to encrypt the query field corresponding to each query keyword in the first query keyword intersection set in the source data file using the corresponding query keyword to obtain a query field ciphertext;
[0121] A sending module 505, configured to send the query keyword hash set and the query field ciphertext to the client;
[0122] The query keyword hash set and the query field ciphertext are used to enable the client to use the target keyword to decrypt the target query field corresponding to the target keyword.
[0123] Optionally, the first intersection module 502 includes:
[0124] A mapping unit, used to map the query keywords in the source data file using the multiple hash functions to obtain the query keyword ciphertext;
[0125] The extraction unit is used to traverse the query keyword ciphertext and extract the first query keyword intersection including the target query ciphertext.
[0126] Optionally, the target query ciphertext is obtained by inserting the target keyword into a Bloom filter or a cuckoo filter;
[0127] The target query ciphertext is composed of target fingerprint information on multiple index bits, and the multiple index bits are calculated based on the multiple hash functions on the target keywords.
[0128] Optionally, fingerprint information other than the target keyword is mixed into the target query ciphertext.
[0129] Optionally, the device further comprises:
[0130] A segmentation module, used for performing hash segmentation on each query keyword of the source data file to obtain multiple sub-files, wherein each sub-file corresponds to a unique label;
[0131] Accordingly, the first intersection module 502 is specifically used for:
[0132] Obtaining a target number corresponding to the target keyword sent by the client;
[0133] According to the target query ciphertext, a first query keyword intersection is obtained from each query keyword of the target subfile corresponding to the target label.
[0134] Figure 6 Schematic diagram of an anonymous query device configured on a client according to an embodiment of the present disclosure. This embodiment can be applied to the case of implementing anonymous query in the process of private information retrieval, and relates to the field of computer technology, and in particular to private information retrieval technology. The device can implement the anonymous query method on the client described in any embodiment of the present disclosure. Figure 6 As shown, the device 600 specifically includes:
[0135] The query ciphertext acquisition module 601 is used to map the target keyword to be queried using multiple hash functions to obtain the target query ciphertext, and send the target query ciphertext to the server;
[0136] A field ciphertext acquisition module 602 is used to acquire a query keyword hash set and a query field ciphertext from the server, wherein the query keyword hash set includes a result of calculating the target keyword by a first hash function, and the query field ciphertext is encrypted using the query keyword corresponding to each query field in the source data file;
[0137] A second intersection module 603, configured to obtain a second query keyword intersection from the query keyword hash set according to the target keyword;
[0138] A ciphertext extraction module 604, configured to extract a target ciphertext corresponding to the intersection of the second query keywords from the query field ciphertext;
[0139] The decryption module 605 is used to decrypt the target ciphertext using the target keyword to obtain a target query field corresponding to the target keyword.
[0140] Optionally, the query ciphertext acquisition module 601 is specifically used for:
[0141] Inserting the target keyword into a Bloom filter or a cuckoo filter to obtain the target query ciphertext;
[0142] The target query ciphertext is composed of target fingerprint information on multiple index positions, and the multiple index positions are calculated based on the multiple hash functions on the target keywords.
[0143] Optionally, fingerprint information other than the target keyword is mixed into the target query ciphertext.
[0144] Optionally, the query ciphertext acquisition module 601 includes:
[0145] An insertion module, used for inserting the target keyword into a Bloom filter or a cuckoo filter to obtain an initial query ciphertext;
[0146] A selection module, configured to randomly select a set number of random index bits from the index bits corresponding to the non-target fingerprint information in the initial query ciphertext;
[0147] The obfuscation module is used to insert the fingerprint information of the non-target keyword into the random index position to obtain the target query ciphertext.
[0148] Optionally, the device further comprises:
[0149] A label determination module, used to calculate the target keyword according to a second Hash function, determine the target label corresponding to the target keyword, and send the target label to the server;
[0150] Among them, the target label is used to enable the server to obtain the query keyword hash set and query field ciphertext from the target sub-file corresponding to the target label; the target sub-file is obtained by the server performing hash segmentation on each query keyword of the source data file based on the second hash function.
[0151] The above-mentioned product can execute the method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0152] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0153] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0154] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0155] like Figure 7 As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0156] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0157] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as the anonymous query method applied to the server. For example, in some embodiments, the anonymous query method applied to the server may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the anonymous query method applied to the server described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to execute the anonymous query method applied to the server in any other appropriate manner (eg, by means of firmware).
[0158] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0159] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0160] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0161] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0162] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0163] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services. The server may also be a server of a distributed system, or a server combined with a blockchain.
[0164] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, machine learning / deep learning technology, big data processing technology, knowledge graph technology, and other major directions.
[0165] Cloud computing refers to a technology system that uses network access to elastically scalable shared physical or virtual resource pools. Resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on demand and in a self-service manner. Cloud computing technology can provide efficient and powerful data processing capabilities for technical applications such as artificial intelligence and blockchain, as well as model training.
[0166] In addition, according to an embodiment of the present disclosure, the present disclosure also provides another electronic device, another readable storage medium and another computer program product, which are used to execute one or more steps of the anonymous query method applied to the client described in any embodiment of the present disclosure. The specific structure and program code can be found in Figure 7 The description of the contents of the illustrated embodiment will not be repeated here.
[0167] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions provided by this disclosure can be achieved, and this document does not limit this.
[0168] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for anonymous query, applied to a server, comprising: Obtaining a target query ciphertext sent by a client, wherein the target query ciphertext is obtained by mapping a target keyword to be queried using multiple hash functions; According to the target query ciphertext, obtaining a first query keyword intersection from each query keyword of the source data file; Calculate each query keyword in the first query keyword intersection according to a first Hash function to obtain a query keyword Hash set; Encrypting the query field corresponding to each query keyword in the intersection of the first query keywords in the source data file using the corresponding query keyword to obtain a query field ciphertext; Sending the query keyword hash set and the query field ciphertext to the client; The query keyword hash set and the query field ciphertext are used to enable the client to use the target keyword to decrypt the target query field corresponding to the target keyword.
2. The method according to claim 1, wherein: The step of obtaining a first query keyword intersection from each query keyword of the source data file according to the target query ciphertext includes: Mapping the query keywords in the source data file using the multiple hash functions to obtain the query keyword ciphertext; The query keyword ciphertext is traversed to extract a first query keyword intersection including the target query ciphertext.
3. The method according to claim 1, wherein: The target query ciphertext is obtained by inserting the target keyword into a Bloom filter or a cuckoo filter; The target query ciphertext is composed of target fingerprint information on multiple index bits, and the multiple index bits are calculated based on the multiple hash functions on the target keywords.
4. The method according to claim 3, wherein: The target query ciphertext also contains fingerprint information that is not the target keyword.
5. The method according to claim 1, further comprising: Performing hash segmentation on each query keyword of the source data file to obtain multiple sub-files, wherein each sub-file corresponds to a unique label; Correspondingly, obtaining a first query keyword intersection from each query keyword of the source data file according to the target query ciphertext includes: Obtaining a target number corresponding to the target keyword sent by the client; According to the target query ciphertext, a first query keyword intersection is obtained from each query keyword of the target subfile corresponding to the target label.
6. A method for anonymous query, applied to a client, comprising: Using multiple hash functions to map the target keywords to be queried, obtaining a target query ciphertext, and sending the target query ciphertext to the server; Obtaining a query keyword hash set and a query field ciphertext from the server, wherein the query keyword hash set includes a result of calculating the target keyword by a first hash function, and the query field ciphertext is encrypted using the query keyword corresponding to each query field in the source data file; Obtaining a second query keyword intersection from the query keyword hash set according to the target keyword; Extracting a target ciphertext corresponding to the intersection of the second query keywords from the query field ciphertext; The target ciphertext is decrypted using the target keyword to obtain a target query field corresponding to the target keyword.
7. The method according to claim 6, wherein: The method of mapping the target keyword to be queried by using multiple hash functions to obtain the target query ciphertext includes: Inserting the target keyword into a Bloom filter or a cuckoo filter to obtain the target query ciphertext; The target query ciphertext is composed of target fingerprint information on multiple index positions, and the multiple index positions are calculated based on the multiple hash functions on the target keywords.
8. The method according to claim 7, wherein: The target query ciphertext also contains fingerprint information that is not the target keyword.
9. The method according to claim 8, wherein: The step of inserting the target keyword into a Bloom filter or a cuckoo filter to obtain the target query ciphertext includes: Inserting the target keyword into a Bloom filter or a cuckoo filter to obtain an initial query ciphertext; Randomly select a set number of random index bits from the index bits corresponding to the non-target fingerprint information in the initial query ciphertext; The fingerprint information of the non-target keyword is inserted into the random index position to obtain the target query ciphertext.
10. The method according to claim 6, further comprising: Calculate the target keyword according to the second Hash function, determine the target number corresponding to the target keyword, and send the target number to the server; Among them, the target label is used to enable the server to obtain the query keyword hash set and query field ciphertext from the target sub-file corresponding to the target label; the target sub-file is obtained by the server performing hash segmentation on each query keyword of the source data file based on the second hash function.
11. A anonymous tracking query device, configured at a server, comprising: An acquisition module, used for acquiring a target query ciphertext sent by a client, wherein the target query ciphertext is obtained by mapping a target keyword to be queried using multiple hash functions; A first intersection module, configured to obtain a first query keyword intersection from each query keyword in the source data file according to the target query ciphertext; A first hash module, configured to calculate each query keyword in the intersection of the first query keywords according to a first hash function to obtain a query keyword hash set; An encryption module, configured to encrypt the query field corresponding to each query keyword in the first query keyword intersection set in the source data file using the query keyword corresponding thereto to obtain a query field ciphertext; A sending module, used to send the query keyword hash set and the query field ciphertext to the client; The query keyword hash set and the query field ciphertext are used to enable the client to use the target keyword to decrypt the target query field corresponding to the target keyword.
12. A stealth query device, configured on a client, comprising: A query ciphertext acquisition module is used to map the target keywords to be queried using multiple hash functions to obtain the target query ciphertext, and send the target query ciphertext to the server; A field ciphertext acquisition module, used to acquire a query keyword hash set and a query field ciphertext from the server, wherein the query keyword hash set includes a result of calculating the target keyword by a first hash function, and the query field ciphertext is encrypted using the query keyword corresponding to each query field in the source data file; A second intersection module, configured to obtain a second query keyword intersection from the query keyword hash set according to the target keyword; A ciphertext extraction module, used to extract a target ciphertext corresponding to the intersection of the second query keywords from the query field ciphertext; The decryption module is used to decrypt the target ciphertext using the target keyword to obtain a target query field corresponding to the target keyword.
13. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the anonymous query method described in any one of claims 1-5 or 6-10.
14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable a computer to execute the anonymous query method according to any one of claims 1-5 or 6-10.
15. A computer program product, comprising a computer program, which, when executed by a processor, implements the anonymous query method according to any one of claims 1-5 or 6-10.