Data anonymity query method, device, electronic device and storage medium
By employing homomorphic encryption techniques using Bloom filters and obfuscated Bloom filters, the security and accuracy of online hidden queries are achieved, addressing the issue of insufficient server-side risk resistance in online hidden queries and ensuring the security and efficiency of data hidden queries.
Patent Information
- Application Number
- CN202410789284.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-06-19
AI Technical Summary
In online anonymous query scenarios, how can we maintain the security of anonymous queries while efficiently and accurately performing data queries, improve the server's resilience, and avoid server-side query errors caused by client-side erroneous information?
Homomorphic encryption is performed using Bloom filters and obfuscated Bloom filters. By generating query ciphertext, match-blinded ciphertext, and obfuscated response ciphertext, homomorphic computation and blinding processing are performed to ensure secure communication between the client and the server. After the server determines that the query identifier matches, it sends back the blinded ciphertext to restore the query data.
This enables the server to determine whether a query identifier matches and obtain relevant data without disclosing the query identifier, reducing computational and communication complexity, avoiding economic losses caused by malicious client actions, and improving the server's resilience.
Smart Images

Figure CN118551122B_ABST
Abstract
Description
Background Art
[0002] Private Information Retrieval (PIR) refers to the query party (such as the client Guest) hiding the keywords or customer identity (ID) information of the query object, and the data service party (i.e. the query party, such as the server Host) provides matching query results but cannot know which specific query object it corresponds to. Online PIR refers to executing PIR in a real-time interactive network environment. The specific query process is as follows:
[0003] Each time the guest initiates an ID query request, when the ID matches the host's database, the host will send the data corresponding to the ID to the guest, otherwise the guest will not get any ID or data information from the host side. After the PIR ends, the guest knows whether the query identifier matches, but the host does not know whether the query identifier matches.
[0004] In the online PIR scenario, the host needs to settle based on whether the query identifier matches. In order to meet this application requirement, the guest is currently required to synchronize the information of whether the query identifier matches to the host. However, the guest may send wrong information to the host, which may easily lead to host query errors, and the host's risk resistance is not high.
[0005] Therefore, how to efficiently and accurately implement hidden query of data while maintaining the security of hidden query and improving the risk resistance of the server is an urgent problem to be solved. Summary of the invention
[0006] The embodiments of the present application provide a data anonymity query method, device, electronic device and storage medium, which are used to efficiently and accurately implement the anonymity query of data while maintaining the security of the anonymity query, thereby improving the risk resistance of the server.
[0007] The present invention provides a method for querying data anonymity, including:
[0008] After mapping the query identifier according to the preset Bloom filter parameters, the generated query ciphertext is sent to the server; the server stores a data set consisting of multiple identifiers and corresponding data;
[0009] Receive the matching degree blinded ciphertext and the obfuscated response blinded ciphertext returned by the server; the matching degree blinded ciphertext is used to characterize: the matching degree between the query identifier and the identifier in the data set, and the obfuscated response blinded ciphertext is related to the query data corresponding to the query identifier; the matching degree blinded ciphertext and the obfuscated response blinded ciphertext are obtained by performing homomorphic calculation and blinding processing on the target Bloom filter and the target obfuscated Bloom filter based on the query ciphertext; the target Bloom filter and the target obfuscated Bloom filter are obtained by mapping the data set based on the Bloom filter parameters;
[0010] Sending a matching result ciphertext generated based on the matching degree blinded ciphertext to the server; the matching result ciphertext is used to determine whether there is an identifier matching the query identifier in the data set;
[0011] According to the first blinded ciphertext returned by the server after determining that the query identifier matches, the obfuscated response blinded ciphertext is restored to obtain the query data.
[0012] Another data anonymity query method provided in an embodiment of the present application includes:
[0013] Receiving a query ciphertext sent by a client, wherein the query ciphertext is generated by mapping the query identifier according to a preset Bloom filter parameter;
[0014] According to the query ciphertext, homomorphic calculation and blinding processing are performed on the target Bloom filter and the target confused Bloom filter to obtain a blinded ciphertext of matching degree representing the matching degree between the query identifier and the identifier in the data set in the Bloom space, and a blinded ciphertext of confused response related to the query data corresponding to the query identifier, and send them to the client; the target Bloom filter and the target confused Bloom filter are obtained by mapping the data set based on the Bloom filter parameters, and the data set consists of multiple identifiers and corresponding data;
[0015] According to the matching result ciphertext generated based on the matching degree blinded ciphertext sent by the client, it is determined that there is an identifier matching the query identifier in the data set, and then the first blinded ciphertext used for blinding processing to obtain the obfuscated response blinded ciphertext is sent to the client, so that the client restores the obfuscated response blinded ciphertext to obtain the query data based on the first blinded ciphertext.
[0016] The present application provides a data anonymity query device, comprising:
[0017] A first communication unit is used to send a query ciphertext generated after mapping the query identifier according to a preset Bloom filter parameter to a server; the server stores a data set consisting of multiple identifiers and corresponding data;
[0018] The second communication unit is used to receive the matching degree blinded ciphertext and the obfuscated response blinded ciphertext returned by the server; the matching degree blinded ciphertext is used to characterize: the matching degree between the query identifier and the identifier in the data set, and the obfuscated response blinded ciphertext is related to the query data corresponding to the query identifier; the matching degree blinded ciphertext and the obfuscated response blinded ciphertext are obtained by performing homomorphic calculation and blinding processing on the target Bloom filter and the target obfuscated Bloom filter based on the query ciphertext; the target Bloom filter and the target obfuscated Bloom filter are obtained by mapping the data set based on the Bloom filter parameters;
[0019] A third communication unit is used to send a matching result ciphertext generated based on the matching degree blinded ciphertext to the server; the matching result ciphertext is used to determine whether there is an identifier matching the query identifier in the data set;
[0020] The fourth communication unit is used to restore the obfuscated response blinded ciphertext to obtain the query data according to the first blinded ciphertext returned by the server after determining that the query identifier matches.
[0021] Optionally, the second communication unit is further used for:
[0022] Receive multiple coefficient ciphertexts returned by the server; wherein the multiple coefficient ciphertexts are obtained by homomorphically encrypting the coefficients of the target annihilation polynomial, the value of the target annihilation polynomial at the plaintext corresponding to the second blinded ciphertext is a preset value, and the second blinded ciphertext is used for blinding processing to obtain the matching degree blinded ciphertext; the multiple coefficient ciphertexts are used to generate the matching result ciphertext.
[0023] Optionally, before sending the matching result ciphertext generated based on the matching degree blinded ciphertext to the server, the third communication unit is further used to:
[0024] Decrypting the matching degree blinded ciphertext to obtain matching degree blinded plaintext;
[0025] Constructing a target annihilation polynomial after coefficient encryption according to the plurality of coefficient ciphertexts;
[0026] Homomorphically calculating the target annihilation polynomial after the coefficients are encrypted, and taking a first value at the matching degree blinded plaintext; wherein, when the query identifier matches, the matching degree blinded ciphertext is the second blinded ciphertext, and the plaintext corresponding to the first value is the preset value;
[0027] The first value is used as the matching result ciphertext.
[0028] Optionally, the plaintext corresponding to the first blinded ciphertext is: a random number used for blinding processing to obtain the obfuscated response blinded ciphertext;
[0029] Before the fourth communication unit restores the obfuscated response blinded ciphertext to obtain the query data according to the first blinded ciphertext returned by the server, the second communication unit is further used to:
[0030] Decrypting the obfuscated response blinded ciphertext to obtain the obfuscated response blinded plaintext;
[0031] The fourth communication unit is specifically used for:
[0032] Based on the plaintext corresponding to the first blinded ciphertext, the obfuscated response blinded plaintext is unblinded to obtain the query data.
[0033] Optionally, if the data set includes multiple buckets, each bucket is used to store a partial identifier and corresponding data, and the target Bloom filter and the target confusion Bloom filter corresponding to each bucket are obtained based on the corresponding bucket mapping, then each bucket corresponds to a ciphertext pair consisting of a matching degree blinded ciphertext and a confusion response blinded ciphertext;
[0034] The second communication unit is specifically used for:
[0035] Receiving multiple ciphertext pairs returned by the server;
[0036] Decrypting the matching degree blinded ciphertext to obtain matching degree blinded plaintext includes:
[0037] The ciphertext pair corresponding to the bucket identifier is decrypted to obtain the matching degree blinded plaintext and the obfuscated response blinded plaintext; wherein the bucket identifier is used to identify: when the query identifier exists in the data set, the bucket where the query identifier is located; when the query identifier matches, the obfuscated response blinded plaintext is deblinded to obtain the query data.
[0038] Optionally, the third communication unit is further used for:
[0039] Homomorphically encrypt multiple different powers of the matching degree blinded plaintext to obtain corresponding multiple power matching degree blinded ciphertexts; the multiple different powers are determined according to the number of buckets;
[0040] The multiple power matching degree blinded ciphertexts are sent to the server, so that the server determines a first blinded ciphertext corresponding to the bucket identifier according to the multiple power matching degree blinded ciphertexts.
[0041] Optionally, before sending the matching result ciphertext generated based on the matching degree blinded ciphertext to the server, the third communication unit is further used to:
[0042] The matching result ciphertext is blinded.
[0043] Optionally, the Bloom filter parameters include: k hash functions, and the lengths m of the target Bloom filter and the target confused Bloom filter; the k is less than the m; and the first communication unit is further used to generate the query ciphertext in the following manner:
[0044] Mapping the query identifiers respectively through the k hash functions to obtain k hash values;
[0045] Based on the k hash values, generate an m-bit array;
[0046] The m query ciphertexts obtained by homomorphically encrypting the bit array are used as the query ciphertexts.
[0047] Another data anonymity query device provided in an embodiment of the present application includes:
[0048] A first transmission unit, configured to receive a query ciphertext sent by a client, wherein the query ciphertext is generated by mapping the query identifier according to a preset Bloom filter parameter;
[0049] A second transmission unit is used to perform homomorphic calculation and blinding processing on the target Bloom filter and the target confused Bloom filter according to the query ciphertext, to obtain a blinded ciphertext of matching degree representing the matching degree between the query identifier and the identifier in the data set in the Bloom space, and a blinded ciphertext of confused response related to the query data corresponding to the query identifier, and send them to the client; the target Bloom filter and the target confused Bloom filter are obtained by mapping the data set based on the Bloom filtering parameters, and the data set consists of multiple identifiers and corresponding data;
[0050] The third transmission unit is used to determine that there is an identifier matching the query identifier in the data set according to the matching result ciphertext generated based on the matching degree blinded ciphertext sent by the client, and then send the first blinded ciphertext used for blinding processing to obtain the obfuscated response blinded ciphertext to the client, so that the client can restore the obfuscated response blinded ciphertext to obtain the query data according to the first blinded ciphertext.
[0051] Optionally, the Bloom filter parameters include: k hash functions, and the lengths m of the target Bloom filter and the target confusion Bloom filter, and correspondingly, there are m query ciphertexts;
[0052] The second transmission unit is specifically used for:
[0053] After multiplying the plaintext corresponding to each query ciphertext in the m query ciphertexts with the element at the corresponding position in the target Bloom filter, encrypting the sum of the obtained products to obtain a matching degree ciphertext;
[0054] Based on the second blinded ciphertext, the matching degree ciphertext is blinded to obtain the matching degree blinded ciphertext; wherein, when the matching degree plaintext corresponding to the matching degree ciphertext is k, the matching degree blinded ciphertext is the second blinded ciphertext; when the query identifier matches, the matching degree plaintext is k, otherwise, the matching degree plaintext is less than k.
[0055] Optionally, the lengths of the target Bloom filter and the target confusion Bloom filter are m, and correspondingly, there are m query ciphertexts;
[0056] The second transmission unit is specifically used for:
[0057] After multiplying the plaintext corresponding to each query ciphertext in the m query ciphertexts with the element at the corresponding position in the target obfuscated Bloom filter, the sum of the obtained products is encrypted to obtain an obfuscated response ciphertext;
[0058] Based on the first blinded ciphertext, the obfuscated response ciphertext is blinded to obtain the obfuscated response blinded ciphertext; wherein, when the query identifier matches, the obfuscated response plaintext corresponding to the obfuscated response ciphertext is the query data, otherwise, the obfuscated response plaintext is a random number.
[0059] Optionally, before the third transmission unit determines, according to the matching result ciphertext generated based on the matching degree blinded ciphertext sent by the client, that there is an identifier matching the query identifier in the data set, the second transmission unit is further configured to:
[0060] Constructing a target annihilation polynomial, wherein a value of the target annihilation polynomial at the plaintext corresponding to the second blinded ciphertext is a preset value;
[0061] Performing homomorphic encryption on each coefficient of the target annihilation polynomial to obtain a plurality of coefficient ciphertexts;
[0062] The multiple coefficient ciphertexts are sent to the client, so that the client generates the matching result ciphertext according to the multiple coefficient ciphertexts and the matching degree blinded ciphertext.
[0063] Optionally, the third transmission unit is specifically used to:
[0064] Decrypting the matching result ciphertext to obtain the matching result plaintext;
[0065] If the plain text of the matching result is a preset value, it is determined that there is an identifier matching the query identifier in the data set.
[0066] Optionally, if the data set includes multiple buckets, each bucket is used to store a partial identifier and corresponding data, and the target Bloom filter and the target confusion Bloom filter corresponding to each bucket are obtained based on the corresponding bucket mapping, then each bucket corresponds to a ciphertext pair consisting of a matching degree blinded ciphertext and a confusion response blinded ciphertext;
[0067] Before determining that there is an identifier matching the query identifier in the data set according to the matching result ciphertext generated based on the matching degree blinded ciphertext sent by the client, the third transmission unit is further used to:
[0068] Receive multiple power matching degree blinded ciphertexts sent by the client; wherein the multiple power matching degree blinded ciphertexts are obtained by homomorphically encrypting multiple different powers of the matching degree blinded plaintext, and the multiple different powers are determined according to the number of buckets; the matching degree blinded plaintext is obtained by decrypting the matching degree blinded ciphertext in the ciphertext pair corresponding to the bucket identifier; the bucket identifier is used to identify: when the query identifier exists in the data set, the bucket where the query identifier is located; the multiple power matching degree blinded ciphertexts are used to determine the first blinded ciphertext corresponding to the bucket identifier.
[0069] Optionally, each bucket corresponds to a group of first blinded ciphertexts and second blinded ciphertexts, and the second blinded ciphertexts are used for blinding processing to obtain the matching degree blinded ciphertexts; and the third transmission unit is specifically used for:
[0070] Sending the first blinded ciphertext corresponding to the bucket identifier to the client; wherein the first blinded ciphertext corresponding to the bucket identifier is determined in the following manner:
[0071] Constructing a target interpolation polynomial, wherein the value of the target polynomial at each plaintext corresponding to the second blinded ciphertext is the plaintext corresponding to the first blinded ciphertext under the corresponding bucket identifier;
[0072] Homomorphically calculating a second value of the target interpolation polynomial at the matching degree blinded ciphertext corresponding to the bucket identifier according to the multiple power matching degree blinded ciphertexts;
[0073] The second value is used as the first blinded ciphertext corresponding to the bucket identifier.
[0074] An electronic device provided in an embodiment of the present application includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any one of the above-mentioned data anonymity query methods.
[0075] An embodiment of the present application provides a computer-readable storage medium, which includes a computer program. When the computer program is executed on an electronic device, the computer program is used to enable the electronic device to execute the steps of any one of the above-mentioned data anonymity query methods.
[0076] An embodiment of the present application provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device performs the steps of any one of the above-mentioned data anonymity query methods.
[0077] The beneficial effects of this application are as follows:
[0078] The embodiments of the present application provide a data anonymity query method, device, electronic device and storage medium. Specifically, the embodiments of the present application use Bloom filters and obfuscated Bloom filters, combined with homomorphic encryption algorithms to construct an online anonymity query method. Based on this method, the client and the server communicate through ciphertext, which ensures the security of communication, protects the query identifier of the client, and protects the database information of the server. At the same time, the client does not directly encrypt the query identifier and send it to the server, and the server does not directly encrypt the corresponding query data and send it to the client, but uses Bloom filters and obfuscated Bloom filters to map the query identifier and then encrypt it. After the server receives the query identifier, homomorphic calculation can be performed to obtain a matching degree blinded ciphertext that represents the matching degree between the query identifier and the identifier in the data set stored by the server, as well as an obfuscated response blinded ciphertext related to the query data corresponding to the query identifier.
[0079] In the case of query identifier matching, the obfuscated response blinded ciphertext physically associates the query identifier with the data items that may correspond to the data set, but due to the addition of obfuscation steps and blinding processing, direct decryption cannot immediately reveal which specific data or its exact content. In this way, after the subsequent server determines that the query identifier matches based on the matching result ciphertext fed back by the client, it will then feed back to the client the first blinded ciphertext used for blinding processing to generate the obfuscated response blinded ciphertext. The client can restore the obfuscated response ciphertext based on the ciphertext to obtain the corresponding query data, solving the problem of the server knowing whether the query identifier matches without leaking it to the server, while reducing the computational / communication complexity. At this time, the client does not need to synchronize the information of whether the query identifier matches to the server, thereby avoiding the risk of the client doing evil and causing economic losses to the server. While maintaining the security of hidden queries, the hidden query of data is efficiently and accurately realized, improving the risk resistance of the server.
[0080] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0082] Figure 1 A logical diagram of the first hidden query method in the related art;
[0083] Figure 2 A logical diagram of a second hidden query method in the related art;
[0084] Figure 3 A schematic diagram of an application scenario in an embodiment of the present application;
[0085] Figure 4 A schematic diagram of the interaction logic between a client and a server in an embodiment of the present application;
[0086] Figure 5 This is a flowchart of an implementation method of a data anonymity query method in an embodiment of the present application;
[0087] Figure 6 A schematic diagram of a target Bloom filter generation process in an embodiment of the present application;
[0088] Figure 7 A schematic diagram of a process for generating a target confusion Bloom filter in an embodiment of the present application;
[0089] Figure 8 A logical diagram of the first round of interaction between a client and a server in an embodiment of the present application;
[0090] Fig. 9 A logical diagram of a second round of interaction between a client and a server in an embodiment of the present application;
[0091] Fig.10 This is a flowchart of another method for querying data anonymity in an embodiment of the present application;
[0092] Fig.11 A schematic diagram of a calculation logic of a matching degree plaintext in an embodiment of the present application;
[0093] Fig.12A schematic diagram of a calculation logic for obfuscating a response plaintext in an embodiment of the present application;
[0094] Fig.13 A schematic diagram of bucketing a data set in an embodiment of the present application;
[0095] Fig.14 This is a timing diagram of interaction between the client and the server in a bucketing situation in an embodiment of the present application;
[0096] Fig.15 A schematic diagram of the structure of a data anonymity query device in an embodiment of the present application;
[0097] Fig.16 It is a schematic diagram of the composition structure of another data anonymity query device in an embodiment of the present application;
[0098] Fig.17 A schematic diagram of a hardware structure of an electronic device to which an embodiment of the present application is applied;
[0099] Fig.18 The present invention is a schematic diagram of the hardware structure of another electronic device to which the embodiments of the present application are applied. DETAILED DESCRIPTION
[0100] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.
[0101] The following is an introduction to some concepts involved in the embodiments of the present application.
[0102] 1. Host: The server in the hidden query, that is, the party that provides data, which is also called the queried party. For example, the Host can be a server for providing data (such as marketing data, product data, financial data, knowledge data, etc.), or it can be a third-party platform, or a backend server of a third-party platform, which is not limited in the present embodiment.
[0103] 2. Guest: The client in the hidden query, that is, the party that initiates the query, is also called the query party. For example, Guest can be a client with hidden query function, through which the user can perform hidden query.
[0104] 3. Bloom Filter (BF): It is a highly space-efficient probabilistic data structure designed to check whether an element is likely to exist in a set. The core of the Bloom filter is a very long binary vector (bit array) and a series of random mapping functions (hash functions).
[0105] Specifically, the Bloom filter maps the key-value set into a bit array. After each element x in the Key-Value set is mapped by k hash functions, k positions in an array are obtained, and the values corresponding to these k positions are set to 1. When searching for x, x is mapped by k hash functions. If these k positions in the array are all 1, it means that x is in the set; otherwise, it means that x is not in the set.
[0106] In the embodiment of the present application, the target Bloom filter refers to a bit array obtained by mapping the data set stored on the server side. Specifically, for each identifier in the data set, the above-listed methods can be used for mapping to finally generate the target Bloom filter.
[0107] 4. Garbled Bloom Filter (GBF): It is a data structure improved based on the traditional Bloom filter. It is mainly used to efficiently determine whether an element belongs to a set, while providing a certain degree of privacy protection or data obfuscation capabilities. In form, it is similar to the Bloom filter and is also a bit array, but each position contains not only one bit, but a fixed-length string (such as a random number), which enables it to store information in a more secure or obfuscated way, so it can also be regarded as a random array.
[0108] Specifically, the obfuscated Bloom filter maps the Key-Value set into a random array. After each element (x, y) in the Key-Value set is mapped by k hash functions, k positions in an array are obtained. Random numbers are assigned to the values corresponding to these k positions, and the sum of these random numbers is required to be equal to y. When searching for x, if x is in the set, according to the mapping of k hash functions on x, the random numbers corresponding to these k positions are summed to obtain y. At this time, (x, y) is in the set; otherwise, y is a random number.
[0109] In the embodiment of the present application, the target obfuscated Bloom filter refers to a random array obtained by mapping the data set stored on the server side. Specifically, for each identifier in the data set and its corresponding data, the above-listed methods can be used to map and finally generate the target obfuscated Bloom filter.
[0110] 5. Homomorphic encryption: It is an advanced encryption technology that allows specific types of calculations to be performed directly on encrypted data without first decrypting it. The result of the calculation is consistent with the result of the same calculation on the plaintext data after decryption. This means that data can be safely entrusted to a third party for processing (such as a cloud computing service provider) without the processor having to understand the actual content of the data, thus protecting data privacy.
[0111] The following are some data and specific algorithms related to homomorphic encryption:
[0112] (1) Key pair generation: private key sk, public key PK, the public key is made public and the private key is kept secret.
[0113] (2) Encryption: Input plaintext m and public key PK, and output ciphertext Enc(m).
[0114] (3) Decryption: Input ciphertext Enc(m) and private key sk, and output ciphertext m.
[0115] (4) Homomorphic addition: Input ciphertext Enc(m1) and Enc(m2), and output ciphertext Enc(m1+m2).
[0116] (5) Encrypted plain text addition / multiplication: Enc(m1+m2) / Enc(m1*m2).
[0117] (6) Homomorphic inner product operation: Input ciphertext Enc(u i ) and plaintext w i ,calculate , where i=1, 2, …, l. This operation requires l-1 ciphertext multiplications and l-1 homomorphic additions.
[0118] (7) Homomorphic polynomial calculation: Input ciphertext Enc(c i ) represent the i-th coefficient c of the polynomial P(X) i The corresponding ciphertext, and the plaintext x, calculate, , the specific approach is to calculate x i , then execute Enc(c i ) and x i The ciphertexts are multiplied and then the calculated ciphertexts are homomorphically added.
[0119] 6. Blinding: It is an information security and privacy protection technology, which is mainly used for data processing or information exchange without revealing the original data content. This technology temporarily modifies sensitive data by introducing random variables or specific transformations, so that even if the data is observed or analyzed by a third party during the processing, the original information cannot be directly restored, thereby protecting the privacy and security of the data. In an embodiment of the present application, the matching degree ciphertext can be blinded to obtain the matching degree blinded ciphertext through the second blinded ciphertext; the obfuscated response ciphertext can be blinded to obtain the obfuscated response blinded ciphertext through the first blinded ciphertext.
[0120] According to the characteristics of homomorphic encryption, correspondingly, the matching degree plaintext can be blinded through the plaintext corresponding to the second blinded ciphertext to obtain the matching degree blinded plaintext, and the matching degree blinded plaintext is then homomorphically encrypted to obtain the matching degree blinded ciphertext; similarly, the obfuscated response plaintext can be blinded through the plaintext corresponding to the first blinded ciphertext to obtain the obfuscated response blinded plaintext, and the obfuscated response blinded plaintext is then homomorphically encrypted to obtain the obfuscated response blinded ciphertext.
[0121] Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing.
[0122] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The backend services of the technical network system require a large amount of computing and storage resources, such as video websites, image websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the backend system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.
[0123] The data anonymity query method in the embodiment of the present application can be implemented in combination with database technology under cloud technology.
[0124] In short, a database can be seen as an electronic filing cabinet - a place where electronic files are stored, and users can add, query, update, delete, and other operations on the data in the files. The so-called "database" is a collection of data that is stored together in a certain way, can be shared with multiple users, has as little redundancy as possible, and is independent of the application. Cloud database refers to a database service provided in a cloud computing environment, which allows users to store, manage, and access data through a network (usually the Internet) without having to manage the underlying hardware.
[0125] A database management system (DBMS) is a computer software system designed for managing databases. It generally has basic functions such as storage, retrieval, security, and backup. Database management systems can be classified according to the database model it supports, such as relational, Extensible Markup Language (XML); or according to the type of computer it supports, such as server clusters, mobile phones; or according to the query language used, such as Structured Query Language (SQL), XQuery; or according to the performance focus, such as maximum scale, maximum operating speed; or other classification methods. Regardless of the classification method used, some DBMS can cross categories, for example, supporting multiple query languages at the same time.
[0126] In an embodiment of the present application, the server stores a data set consisting of multiple identifiers and corresponding data, which can be stored in a cloud database to realize cloud storage of data. Cloud storage has flexible scalability, can perform elastic resource adjustment, quickly adapt to business changes, and be deployed globally to improve user experience; in addition, cloud storage can strengthen data protection, encryption, and fast backup and recovery, and comply with regulatory requirements in many places; in addition, cloud storage management is simple, and through automated operation and maintenance and centralized control, it can effectively reduce dependence on manpower, improve efficiency, and so on.
[0127] The following is a brief introduction to the design concept of the embodiment of the present application:
[0128] PIR is a strategy adopted to protect the privacy of personal privacy on public network platforms. When a user retrieves information on a database, it will use certain methods to prevent the database server from knowing the relevant information of the user's query statement, thereby protecting the user's query privacy. The development and popularization of hidden queries not only requires the continuous improvement of privacy confidentiality technology, but also requires people to continuously enhance their awareness of privacy protection. In current real life, hidden queries have a large application space in fields such as medical databases and patent databases that have high requirements for retrieval privacy.
[0129] There are mainly two types of hidden query solutions in related technologies:
[0130] The first type of solution: using asymmetric encryption and oblivious transmission.
[0131] Oblivious transfer means that the query party wants to obtain the i-th data among n data from the data service provider, but it needs to ensure that the query party can only get the i-th data and cannot get other data, and the data service provider cannot know which data the query party has obtained. Oblivious transfer requires the query party to know where the data it wants to query is located. Usually, the query party cannot know the specific location of the query before querying.
[0132] like Figure 1 As shown, it is a logical schematic diagram of the first hidden query method in the related art, which embodies the workflow of a hidden query method based on asymmetric encryption and oblivious transmission. Figure 1 The steps shown in:
[0133] Step 1: Add random key to encrypt ID query. In this step, the querying application sends the query request to the anonymous query component. The query request contains the ID of the object to be found, and in order to protect privacy, this ID will be encrypted with a random key. This random key is generated by the querying application, which ensures that even if someone intercepts the query request, the true identity of the query object cannot be easily identified.
[0134] Step 2: Obfuscated candidate set encrypted with parameter secret key. This step occurs in the anonymous service component. After receiving the query request, the anonymous service component will process the query parameters. Since the query parameters have been encrypted, the anonymous service component needs to decrypt the query parameters before proceeding to the next step. The decrypted query parameters will be used to locate the nth candidate option.
[0135] Step 3: Locate the nth candidate option. In this step, the cloaking service component will locate the nth candidate option in the database based on the decrypted query parameters. The candidate option here may be a data item, a row in a data table, or other types of data.
[0136] Step 4: Obliviously transmit the returned results, query the nth one. In this step, the anonymous service component returns the query results to the querying application. However, in order to avoid directly exposing the query results, the anonymous service component will take some special measures, such as encrypting the query results, or returning only part of the query results. This method can effectively protect the privacy of the query results.
[0137] Step 5: Evidence storage, accounting, and settlement. In this step, the anonymous service component will record and audit the query process. This includes saving copies of the query request and query results, and making detailed accounting of the query process. In addition, the anonymous service component will also settle based on the query results, such as calculating the query fee or updating the account balance of the querying party.
[0138] For problem sizes N and n, the required computing time is: n+N asymmetric encryption and decryption calculations, and n 1 out of N oblivious transfer calculations. Among them, single asymmetric encryption and decryption and 1 out of n oblivious transfer protocol (OT) both require high computing power.
[0139] The second type of solution: adopt oblivious pseudo-random function (OPRF) to implement it, and use oblivious transmission to implement the oblivious pseudo-random function, so that when the IDs of Guest and Host are the same, the output of the pseudo-random function is the same, when the IDs of Guest and Host are different, the output of the pseudo-random function is two random elements.
[0140] like Figure 2 As shown in FIG. 1 , it is a logical diagram of the second hidden query method in the related art, which embodies a privacy query scheme based on an inadvertent pseudo-random function. Figure 2 In the example, the host has a dataset that stores the original data (data_i) and its corresponding identifier (id_i), and the guest submits a set of queries, each of which corresponds to a query identifier (id). The OPRF module is the middle layer responsible for processing the input from the host and the guest.
[0141] Specifically, the Host passes each identifier (id) in the data set to the OPRF module, and the Guest also passes the query identifier (id) of the query object to the OPRF module. After receiving the input from the Host and the Guest, the OPRF module generates a pseudo-random function value corresponding to each query object. The Host extracts the corresponding query result from the original data based on the pseudo-random function value generated by the OPRF module. The Guest can also obtain the corresponding query result based on the pseudo-random function value generated by the OPRF module. After that, the Host extracts the corresponding query result from the original data and sends it to the Guest. In this way, the query result finally obtained by the Guest is the original data corresponding to the query object with the same pseudo-random function output as the query result sent by the Host.
[0142] However, in this case, Guest will also obtain query results for other query objects, such as data_2 corresponding to id_2, and the security of the query cannot be guaranteed.
[0143] In view of this, the embodiments of the present application propose a data anonymity query method, device, electronic device and storage medium. Specifically, the embodiments of the present application use Bloom filters and obfuscated Bloom filters, combined with homomorphic encryption algorithms to construct an online anonymity query method. Based on this method, the client and the server communicate through ciphertext, which ensures the security of communication, protects both the query identifier of the client and the database information of the server. At the same time, the client does not directly encrypt the query identifier and send it to the server, and the server does not directly encrypt the corresponding query data and send it to the client. Instead, the query identifier is mapped and then encrypted using Bloom filters and obfuscated Bloom filters. After the server receives the query identifier, homomorphic calculations can be performed to obtain a blinded ciphertext representing the degree of match between the query identifier and the identifier in the data set stored by the server, as well as a blinded ciphertext of obfuscated responses related to the query data corresponding to the query identifier.
[0144] In the case of query identifier matching, the obfuscated response blinded ciphertext physically associates the query identifier with the data items that may correspond to the data set, but due to the addition of obfuscation steps and blinding processing, direct decryption cannot immediately reveal which specific data or its exact content. In this way, after the subsequent server determines that the query identifier matches based on the matching result ciphertext fed back by the client, it will then feed back to the client the first blinded ciphertext used for blinding processing to generate the obfuscated response blinded ciphertext. The client can restore the obfuscated response ciphertext based on the ciphertext to obtain the corresponding query data, solving the problem of the server knowing whether the query identifier matches without leaking it to the server, while reducing the computational / communication complexity. At this time, the client does not need to synchronize the information of whether the query identifier matches to the server, thereby avoiding the risk of the client doing evil and causing economic losses to the server. While maintaining the security of hidden queries, the hidden query of data is efficiently and accurately realized, improving the risk resistance of the server.
[0145] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.
[0146] like Figure 3 As shown, it is a schematic diagram of an application scenario in an embodiment of the present application. The application scenario diagram includes a terminal device 310 and a server 320. Among them, the terminal device 310 serves as a query party, and the server 320 serves as a data service party.
[0147] In the embodiment of the present application, the terminal device 310 includes but is not limited to mobile phones, tablet computers, laptop computers, desktop computers, e-book readers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals and other devices; a client (i.e., Guest) with a hidden query function can be installed on the terminal device, and the client can be software (such as a browser, data hidden query software, etc.), or a web page, a small program, etc.
[0148] The server (Host) in the hidden query is used to store a data set consisting of multiple identifiers and corresponding data. The data set can be in the form of a Key-Value set, with the identifier as the Key and the data corresponding to the identifier as the Value. Figure 3 In the data set shown in , x0, x1, x2, x3, etc. are identifiers, and data0, data1, data2, data3, etc. are data Values.
[0149] Specifically, the Host may be a server for providing data, or a third-party platform, or a backend server of a third-party platform. Figure 3 The server 320 in the example may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0150] It should be noted that the data anonymity query method in each embodiment of the present application can be executed by an electronic device, which may be a terminal device 310 or a server 320, that is, the method can be executed by the terminal device 310 or the server 320 alone, or can be executed jointly by the terminal device 310 and the server 320.
[0151] For example, when the terminal device 310 and the server 320 jointly execute, the terminal device 310 may be installed with a client having a hidden query function, and the server 320 (i.e., the service end) may store a data set {(x0, data0), (x1, data1), (x2, data2), (x3, data3), ...}. Figure 4 , briefly explains the interaction logic between the client and the server during online hidden query.
[0152] Specifically, Figure 4The following is a schematic diagram of the interaction logic between a client and a server in an embodiment of the present application. The data anonymity query method proposed in the present application is an efficient online anonymity query method based on Bloom filter, and only two rounds of interaction are required between the client and the server.
[0153] The first round of interaction: The client calculates the Bloom filter representation of the query identifier x, encrypts it and sends the query ciphertext to the server; the server homomorphically calculates the values of the target Bloom filter and the target obfuscated Bloom filter and performs blinding processing, and then sends the matching degree blinded ciphertext and obfuscated response blinded ciphertext. The specific process is as follows:
[0154] The client maps the query identifier according to the preset Bloom filter parameters and sends the generated query ciphertext to the server; the server stores a data set consisting of multiple identifiers and corresponding data.
[0155] The server receives the query ciphertext sent by the client, and performs homomorphic calculation and blinding processing on the target Bloom filter and the target confused Bloom filter according to the query ciphertext, so as to obtain a blinded ciphertext of matching degree representing the matching degree between the query identifier and the identifier in the data set in the Bloom space, and a blinded ciphertext of confused response related to the query data corresponding to the query identifier, and sends them to the client; wherein, the target Bloom filter and the target confused Bloom filter are obtained by mapping the data set in advance based on the Bloom filter parameters by the server.
[0156] Second round of interaction: The client decrypts the blinded result, and sends the matching result ciphertext after homomorphic calculation based on the decrypted result; after the server confirms the match, it sends the blinded ciphertext. The specific process is as follows:
[0157] The client receives the matching degree blinded ciphertext and obfuscated response blinded ciphertext returned by the server and decrypts them. The client generates the matching result ciphertext based on the decrypted matching degree blinded plaintext homomorphically calculated and sends the matching result ciphertext to the server. The matching result ciphertext is used to determine whether there is an identifier matching the query identifier in the data set.
[0158] The server determines that there is an identifier matching the query identifier in the data set based on the matching result ciphertext sent by the client, and then sends the first blinded ciphertext used for blinding processing to obtain the obfuscated response blinded ciphertext to the client.
[0159] After the above two rounds of interactions, the client decrypts the blinded ciphertext and obtains the blinded value. Combined with the result of the first decryption, the data can be restored. The specific process is as follows:
[0160] The client receives the first blinded ciphertext returned by the server after determining that the query identifier matches, decrypts the first blinded ciphertext, and restores the obfuscated response blinded plaintext corresponding to the obfuscated response blinded ciphertext according to the plaintext corresponding to the first blinded ciphertext to obtain the query data.
[0161] The above interaction process is only a simple summary of the data anonymity query method in the embodiment of the present application. The specific implementation process will be described in detail below and will not be repeated here.
[0162] In an optional implementation, the terminal device 310 and the server 320 may communicate with each other via a communication network.
[0163] In an optional implementation, the communication network is a wired network or a wireless network.
[0164] It should be noted that Figure 3 The figure is only an example. In fact, the number of terminal devices and servers is not limited and is not specifically limited in the embodiments of the present application.
[0165] In the embodiment of the present application, when there are multiple servers, the multiple servers can form a blockchain, and the servers are nodes on the blockchain; as in the data anonymity query method disclosed in the embodiment of the present application, the relevant data involved in the data anonymity query process can be saved on the blockchain, for example, data sets, query identifiers, various ciphertexts involved in the data anonymity query process, public and private keys, etc.
[0166] In addition, the embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, etc. Specifically, it can be applied to marketing, identity verification, anti-fraud, financial risk control, medical and health information sharing, educational background verification, commodity popularity analysis in e-commerce, IoT device authentication, medical database retrieval, patent database retrieval and other business scenarios in these scenarios.
[0167] Here are a few business scenarios:
[0168] Taking the business scenario of financial risk control as an example, in the process of evaluating the user's credit rating, a company wants to query the user's credit information on a certain platform (depending on the actual scenario, it may be a record of default, multiple loans, etc.). If the platform's data is retrieved directly through the user ID, the platform's acquisition of the user ID may pose a risk of leakage (for example, reselling it to the company's competitors). Through the data anonymity query method proposed in this application, the company can conduct collaborative calculations with the platform, and the platform's user data will not be stored, and only the intermediate encryption parameters will be exchanged, thereby protecting the privacy data of non-checked users on the platform; at the same time, the platform cannot perceive the company's query list, protecting the privacy data of the company's user ID. Moreover, during the calculation process, the platform can synchronously perceive the company's actual data query volume and neither the company nor the platform can cheat, so as to meet the reconciliation needs in actual business production.
[0169] Take the business scenario of identity verification as an example. In the identity verification scenario, for example, banks or financial institutions need to verify whether the identity information provided by customers is authentic and valid. Usually, they need to query the relevant database or the citizen identity information system of the authority. Directly submitting sensitive information such as personal ID number for querying has the risk of leakage and may violate privacy protection regulations. Through the data anonymity query method proposed in this application, this process can be made safer.
[0170] Taking the business scenario of medical and health information sharing as an example, a hospital or research institution needs to count the distribution of patients with a specific disease, but cannot directly access the patient data of other institutions. Through the data anonymity query method proposed in this application, the number of cases that meet specific conditions can be queried without obtaining any personal health records.
[0171] Taking the business scenario of education background verification as an example, when recruiting, companies need to verify the authenticity of job seekers' academic qualifications, but directly querying the education department or school may expose the privacy of job seekers. The data anonymization query method proposed in this application can help companies verify academic information without revealing the identity of job seekers.
[0172] Taking the business scenario of commodity popularity analysis in e-commerce as an example, the e-commerce platform wants to know the sales of a certain commodity on the competing platform, but does not want to reveal its focus. Through the data anonymity query method proposed in this application, the e-commerce platform can obtain the approximate sales ranking of the target commodity without revealing the specific query intention.
[0173] Taking the IoT device authentication business scenario as an example, in the IoT environment, device manufacturers need to regularly verify the identity information of devices to prevent counterfeit devices from accessing the system. Through the data anonymity query method proposed in this application, manufacturers can verify the identity of devices without directly accessing sensitive information of the devices, reducing the risk of data leakage.
[0174] The several business scenarios listed above are just simple examples. Other business scenarios related to data privacy are also applicable to the embodiments of the present application and will not be described in detail here.
[0175] It should be emphasized that in the specific implementation of this application, the data related to the privacy of the object, such as the query identifier and query data listed above, are involved. When the above embodiments of this application are applied to specific products or technologies, the permission or consent of the object needs to be obtained, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions.
[0176] The following describes the data anonymity query method provided by the exemplary embodiment of the present application in combination with the application scenarios described above and with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of the present application, and the implementation methods of the present application are not limited in this regard.
[0177] In an embodiment of the present application, the client side has a query identifier, and the server side has a data set consisting of multiple identifiers and data corresponding to each identifier. The data hidden query method proposed in the present application is an efficient online hidden query method based on a Bloom filter. Only two rounds of interaction are required between the client and the server to ensure that when the query identifier matches the server's data set, the client obtains the query data corresponding to the query identifier, and the server obtains a query identifier match, and then charges the client; when the query identifier does not match, the client does not obtain any plaintext data, and the server obtains a query identifier mismatch.
[0178] In addition, the data anonymity query method proposed in this application, when the client and the server communicate, the computational complexity of the entire protocol is O(n), and the communication complexity is ,here It is a decimal ≤ 0.5, and n represents the size of the data set. It can be used in large-scale data scenarios.
[0179] In the embodiment of the present application, in order to protect the security of data communication between the client and the server and realize online hidden query, the client and the server communicate through ciphertext. Therefore, the client can pre-generate a public-private key pair for homomorphic encryption in the offline stage (before online hidden query), such as the private key is denoted as sk g , the public key is denoted as PK g Similarly, the server can also pre-generate a public and private key pair for homomorphic encryption in the offline phase, such as the private key is denoted as sk h , the public key is denoted as PK h .
[0180] Subsequently, the client can use the public key PK g Encrypt the data to be sent to the server according to the private key sk g Decrypt the data returned by the server. Similarly, the server can use the public key PK h The data to be sent to the client is encrypted according to the private key sk h Decrypt the data returned by the client.
[0181] In the embodiment of the present application, in order to simply distinguish the public and private key pairs of the client and the server, the client-side public key PK g It can be called the query party public key and the client side private key sk gIt can be called the query party's private key; the server-side public key PK h It can be called the public key of the server and the private key of the server side sk h It can be called the service provider's private key.
[0182] Of course, the above process can also be performed in the online stage (referring to online hidden query), that is, the client can also regenerate the public-private key pair for homomorphic encryption when it needs to communicate with the server. Similarly, the server can also regenerate the public-private key pair for homomorphic encryption when it needs to communicate with the client.
[0183] The following is a description of the data anonymity query method in the embodiment of the present application in conjunction with the accompanying drawings:
[0184] See also Figure 5 As shown, it is an implementation flow chart of a data anonymity query method in an embodiment of the present application. Taking the client as the execution subject as an example, the specific implementation process of the method is as follows S51~S54:
[0185] S51: The client maps the query identifier according to the preset Bloom filter parameters, and sends the generated query ciphertext to the server; the server stores a data set consisting of multiple identifiers and corresponding data.
[0186] In an embodiment of the present application, the client may map the query identifier into a bit array according to a preset Bloom filter parameter, and encrypt and generate a query ciphertext to send to the server.
[0187] Optionally, the Bloom filter parameters include: k hash functions, and the length m of the target Bloom filter and the target confusion Bloom filter; wherein k is less than m.
[0188] In an embodiment of the present application, the server may map the data set into a target Bloom filter and a target confused Bloom filter according to the above-mentioned preset Bloom filter parameters.
[0189] The target Bloom filter is generated by mapping all identifiers in the data set to a bit array, while the target confusion Bloom filter is generated by mapping all identifiers in the data set to a random array according to the data corresponding to each identifier in the data set.
[0190] Similarly, for each query identifier that the client needs to query, the client can also map it according to the above-mentioned preset Bloom filter parameters. On this basis, the client can generate the query ciphertext in the following manner. Thus, step S51 includes the following sub-steps S511 to S514 ( Figure 5 not shown):
[0191] S511: Map the query identifiers respectively through k hash functions to obtain k hash values;
[0192] Each hash function in this application can map an identifier to a hash value between 0 and m-1, that is, the mapped hash value hash=0, 1, ..., m-1. Of course, each hash function can map an identifier to a hash value between 1 and m, or other values, which are not specifically limited in this article. The following is an example of hash=0, 1, ..., m-1.
[0193] Assuming that the identifiers in the data set are all identifiers of variable length composed of 0 and 1, because different identifiers may have different lengths, k hash functions can be set: (where H represents the length of the uncertain identifier). i Represents the i-th hash function, i=1, 2, …, k, and is mapped to integers between 0 and m-1 based on such a hash function.
[0194] It should be noted that the hash functions listed here are just simple examples. In addition, other hash functions are also applicable to the embodiments of the present application and are not specifically limited here.
[0195] Taking k=3 and m=8 as an example, for a query identifier, the query identifier can be mapped to three different values between 0 and 7 through three different hash functions, such as hash1=0, hash1=3, and hash1=6.
[0196] S512: Generate an m-bit array based on the k hash values;
[0197] Among them, the k hash values obtained in the above steps represent 3 numerical values between 0 and m-1. When generating an m-bit bit array, the position corresponding to each hash value in the bit array can be set to 1, and the other positions can be set to 0 (or keep the initial state), and the m-bit bit array corresponding to the query identifier can be obtained.
[0198] For example, hash1=0, hash1=3, hash1=6, then the corresponding m-bit array is: 10010010.
[0199] S513: Perform homomorphic encryption on the m-bit array to obtain m query ciphertexts.
[0200] Specifically, the client queries the public key PK g , each bit in the m-bit array is homomorphically encrypted to obtain m query ciphertexts, which means that each bit value (0 or 1) is converted into a complex query ciphertext, but its encrypted form can still participate in the calculation.
[0201] S514: The m query ciphertexts (and the querying party's public key PK g) is sent to the server.
[0202] It should be noted that in step S51, in addition to sending the query ciphertext to the server, the client can also send the querying party's public key PK g In this way, the server can further process the ciphertext according to the public key of the querying party without knowing the actual content of the bit array, that is, to ensure that the server does not know the specific query identifier.
[0203] In the above implementation, the use of Bloom filters can efficiently determine whether an element is likely to belong to a set. Although there is a certain misjudgment rate, it has high space efficiency and is suitable for rapid screening of large-scale data sets. In addition, the calculated bit array is encrypted using a homomorphic encryption method to generate m query ciphertexts. Homomorphic encryption allows direct calculation of encrypted data without decryption first, thereby ensuring data privacy during the query process, and sensitive information is not leaked even during data transmission and processing. In addition, the client will also attach its own public key so that the server can perform necessary homomorphic operations.
[0204] The following is a brief introduction to the generation process of the target Bloom filter and the target confusion Bloom filter:
[0205] (a) Target Bloom filter.
[0206] Specifically, for each identifier in the data set, k hash functions can be used to map the identifier to obtain k hash values; then, based on the k hash values, an m-bit bit array is generated. The specific process is similar to the above steps S511~S512, and the repeated parts will not be repeated.
[0207] That is, for each identifier, the position corresponding to each hash value obtained by mapping the identifier in the target Bloom filter is set to 1, and the other positions are set to 0. If different identifiers have the same hash value, just repeatedly set the position corresponding to the hash value to 1.
[0208] like Figure 6 As shown, it is a schematic diagram of the generation process of a target Bloom filter in an embodiment of the present application. Still taking k=3, m=7 as an example, first, initialize the target Bloom filter, that is, create an 8-bit bit array (which can also be expressed in the form of an 8-dimensional bit vector) and initialize all its bits to 0. Then, start adding elements, that is, use k independent hash functions to map each identifier x in the data set to k positions in the bit array. Then, set all these k positions to 1.
[0209] For example, first, the identifier x0 in the data set is mapped to obtain hash1=0, hash2=3, hash3=6, and these three positions are all set to 1. At this time, the bit array corresponding to the target Bloom filter is: 10010010. Then, the identifier x1 in the data set is mapped to obtain hash1=2, hash2=3, hash3=7, and these three positions are all set to 1. At this time, the bit array corresponding to the target Bloom filter is: 10110011. And so on. After that, the identifier x2 in the data set is mapped to obtain hash1=0, hash2=2, hash3=4, and these three positions are all set to 1. At this time, the bit array corresponding to the target Bloom filter is: 10111011. And so on, after each identifier in the data set is mapped in the above manner, the final bit array obtained is the target Bloom filter in the embodiment of the present application.
[0210] (ii) Target confusion Bloom filter.
[0211] Specifically, for each identifier in the data set, k hash functions can be used to map the identifier to obtain k hash values; then, an m-dimensional random array is generated based on the k hash values.
[0212] Different from generating the target Bloom filter, when generating an m-dimensional random array based on k hash values, the position corresponding to each hash value mapped to the identifier is not set to 1, and the other positions are set to 0. Instead, the positions corresponding to these hash values are set to random numbers, and the sum of the random numbers is the data corresponding to the identifier.
[0213] Among them, if different identifiers have the same hash value, it is only necessary to retain the random number previously set at the position corresponding to the hash value, and then set other random numbers based on this.
[0214] like Figure 7 As shown, it is a schematic diagram of the generation process of a target obfuscated Bloom filter in an embodiment of the present application. Still taking k=3, m=7 as an example, first, initialize the target obfuscated Bloom filter, that is, create an 8-bit bit array (which can also be expressed in the form of an 8-dimensional bit vector) and initialize all its bits to 0. Then, start adding elements, that is, use k independent hash functions to map each identifier x in the data set to k positions in the bit array. Then, set these k positions to random numbers, and the sum of the random numbers is the data data corresponding to the identifier.
[0215] For example, first, map the identifier x0 in the data set to get hash1=0, hash2=3, hash3=6, and set these three positions to random numbers: s1, s2, s3, where s1+s2+s3=data0. At this time, the random array corresponding to the target obfuscated Bloom filter is: s1 0 0 s2 0 0 s3 0. Then, map the identifier x1 in the data set to get hash1=2, hash2=3, hash3=7. On the basis of keeping position 3 as s2, set the other two positions to random numbers: s4, s5, where s4+s2+s5=data1. At this time, the random array corresponding to the target obfuscated Bloom filter is: s1 0 s4 s2 0 0 s3 s5. And so on. After that, the identifier x2 in the data set is mapped to obtain hash1=0, hash2=2, hash3=3. On the basis of keeping position 0 as s1 and position 2 as s2, the remaining position 4 is set to a random number: s6, where s1+s4+s6=data2. At this time, the random array corresponding to the target obfuscated Bloom filter is: s1 0 s4 s2 s6 0 s3 s5. And so on. After each identifier in the data set is mapped in the above manner, the final random array is the target obfuscated Bloom filter in the embodiment of the present application.
[0216] Of course, as time goes by, if the data set changes, it is sufficient to reconstruct a new target Bloom filter and a target confusion Bloom filter, and no specific limitation is made here.
[0217] Based on the target Bloom filter and the target confused Bloom filter constructed on the server, after receiving the m query ciphertexts sent by the client, the server can perform homomorphic calculations on the group of query ciphertexts with the target Bloom filter and the target confused Bloom filter respectively to obtain the matching degree ciphertext and the confused response ciphertext.
[0218] In the embodiment of the present application, the matching degree ciphertext can be understood as a "matching degree index" or "similarity ciphertext". It physically represents the degree of matching between the query identifier and the elements in the data set in the Bloom space after being processed by the Bloom filter. If the query identifier does exist in the data set, theoretically all the output positions of the k hash functions should be marked as 1 (although there is a certain misjudgment rate), so the matching degree plaintext corresponding to the ciphertext after decryption should be close to k. If the query identifier is not in the set, the matching degree plaintext obtained by decryption will be less than k due to hash collision.
[0219] The obfuscated response ciphertext can be regarded as a "data-associated hidden value". It physically associates the query identifier with the data item that may correspond to it in the data set. If the query identifier does exist in the data set, theoretically, the sum of the random numbers assigned to the output positions of all k hash functions is the corresponding data item (although there is a certain misjudgment rate), so the obfuscated response plaintext corresponding to the ciphertext after decryption should be the data value corresponding to the query identifier. If the query identifier is not in the set, due to hash collision, the obfuscated response plaintext obtained by decryption is a random number.
[0220] In order to prevent the client from directly decrypting the data item, blinding processing is added in this article, that is, the matching degree ciphertext is blinded to obtain the matching degree blinded ciphertext, and the obfuscated response ciphertext is blinded to obtain the obfuscated response blinded ciphertext, wherein the ciphertext used to blind the matching degree ciphertext to the matching degree blinded ciphertext is recorded as the second blinded ciphertext. When the query identifier matches, the matching degree blinded ciphertext is the second blinded ciphertext, and the ciphertext used to blind the obfuscated response ciphertext to the obfuscated response blinded ciphertext is recorded as the first blinded ciphertext.
[0221] The blinded result is sent when the server is not sure whether the query identifier matches, so as to avoid the client directly decrypting the two ciphertext results. This ensures that direct decryption by the client cannot immediately reveal which specific data or its exact content.
[0222] It should be noted that in the embodiment of the present application, only when the match degree blinded ciphertext indicates that the query identifier is highly matched with an element in the data set, the obfuscated response blinded ciphertext has the potential significance of extracting relevant data. Through the subsequent protocol steps, this ciphertext can be correctly interpreted, thereby indirectly pointing to or revealing the actual data information related to the query identifier while ensuring privacy.
[0223] In summary, the server will return the matching degree blinded ciphertext and obfuscated response blinded ciphertext obtained after homomorphic calculation and blinding processing to the client, and then the client executes the following steps. Among them, the specific calculation method of the matching degree blinded ciphertext and the obfuscated response blinded ciphertext will be described in detail on the server side below, and will not be repeated here.
[0224] S52: The client receives the matching degree blinded ciphertext and the obfuscated response blinded ciphertext returned by the server; the matching degree blinded ciphertext is used to characterize: the matching degree between the query identifier and the identifier in the data set, and the obfuscated response blinded ciphertext is related to the query data corresponding to the query identifier; the matching degree blinded ciphertext and the obfuscated response blinded ciphertext are obtained by homomorphically calculating and blinding the target Bloom filter and the target obfuscated Bloom filter based on the query ciphertext; the target Bloom filter and the target obfuscated Bloom filter are obtained by mapping the data set based on the Bloom filter parameters.
[0225] Specifically, the generation process of the target Bloom filter and the target confused Bloom filter can refer to the above embodiment, and the repeated parts will not be repeated.
[0226] In the embodiment of the present application, since the server has blinded the matching degree ciphertext, the client cannot determine whether the query identifier matches by directly decrypting the matching degree blind ciphertext. On this basis, the server also constructs a target annihilation polynomial, and sets the value of the target annihilation polynomial at the plaintext corresponding to the second blinded ciphertext to a preset value, and encrypts the coefficients of the annihilation polynomial and sends them to the client.
[0227] Specifically, when the query identifier is matched in the embodiment of the present application, the matching degree blinded ciphertext is the second blinded ciphertext used for blinding processing to obtain the matching degree blinded ciphertext, and correspondingly, the matching degree blinded plaintext is the plaintext corresponding to the second blinded ciphertext. Therefore, in the present application, the value of the target annihilation polynomial at the plaintext corresponding to the second blinded ciphertext is set to a preset value, so that it can be ensured that only when the query identifier matches, the value of the target annihilation polynomial will be the preset value. Through such a design, the output of the target annihilation polynomial is the preset value, which becomes a verification mechanism for whether the query identifier matches. Among them, the construction process of the target annihilation polynomial and the encryption process of the target annihilation polynomial coefficients refer to the relevant instructions of the following server, and are not specifically limited here.
[0228] In an embodiment of the present application, in addition to sending the matching degree blinded ciphertext and the obfuscated response blinded ciphertext to the client, the server may also send multiple coefficient ciphertexts corresponding to the target annihilation polynomial, so that the client can safely use this polynomial in a homomorphic encryption environment, ensuring that the client can generate a matching result ciphertext for determining whether there is an identifier matching the query identifier in the data set (i.e., determining whether the query identifier matches) based on the matching degree blinded ciphertext and the encrypted polynomial coefficients.
[0229] An optional implementation is as follows: in step S52, in addition to receiving the matching degree blinded ciphertext and the obfuscated response blinded ciphertext returned by the server, the client also receives multiple coefficient ciphertexts returned by the server.
[0230] Specifically, these multiple coefficient ciphertexts are obtained by homomorphically encrypting the coefficients of the target annihilation polynomial and are used to generate the matching result ciphertext. The matching result ciphertext is used to determine whether the query identifier exists in the data set on the server side. If so, the query identifier matches; if not, the query identifier does not match.
[0231] In the embodiment of the present application, the matching degree blinded ciphertext is used to characterize: the matching degree between the query identifier and the identifier in the data set. Since the matching degree blinded ciphertext is obtained by blinding the matching degree ciphertext, in essence, the plaintext corresponding to the matching degree ciphertext (i.e., the matching degree plaintext) is used to characterize: the matching degree between the query identifier and the identifier in the data set. It should be noted that the matching degree ciphertext can be obtained by homomorphically calculating the query ciphertext and the target Bloom filter, and the matching degree blinded ciphertext can be obtained by blinding the matching degree ciphertext. For the specific calculation process, please refer to the relevant instructions of the server below, and no specific limitation is made here.
[0232] Among them, when the query identifier matches, the matching degree plaintext corresponding to the matching degree ciphertext is k; otherwise, the matching degree plaintext corresponding to the matching degree ciphertext is less than k. Therefore, when blinding the matching degree ciphertext to generate the matching degree blinded ciphertext, the present application further designs: when the query identifier matches, the matching degree plaintext corresponding to the matching degree ciphertext is k, and the matching degree blinded ciphertext is the second blinded ciphertext. The specific design process refers to the following server-related instructions, and no specific limitation is made here.
[0233] On this basis, in the embodiment of the present application, the value of the target annihilation polynomial at the plaintext corresponding to the second blinded ciphertext is set to a preset value. When the query identifier matches, the matching degree blinded ciphertext is the second blinded ciphertext, and the matching degree blinded plaintext is the plaintext corresponding to the second blinded ciphertext. That is, when the query identifier matches, the value of the target annihilation polynomial is a preset value. In this way, the output of the target annihilation polynomial is a preset value, which becomes a verification mechanism for whether the query identifier matches in the embodiment of the present application. Therefore, the client can generate a matching result ciphertext for verifying whether the query identifier matches according to the matching result blinded ciphertext and multiple coefficient ciphertexts. An optional implementation is as follows:
[0234] Before sending the matching result ciphertext generated based on the matching degree blinded ciphertext to the server, the client needs to decrypt the matching degree blinded ciphertext to obtain the matching degree blinded plaintext (in addition, the client can also decrypt the obfuscated response blinded ciphertext to obtain the obfuscated response blinded plaintext for the restoration process in step S54).
[0235] Specifically, the client can query the private key sk g , the matching degree blinded ciphertext and the obfuscated response blinded ciphertext are decrypted respectively to obtain two plaintext results, which are recorded as matching degree blinded plaintext and obfuscated response blinded plaintext.
[0236] Furthermore, a target annihilation polynomial after coefficient encryption is constructed according to multiple coefficient ciphertexts; then, the target annihilation polynomial after coefficient encryption is homomorphically calculated, and a first value is taken at the matching degree blinded plaintext; finally, the first value is used as a matching result ciphertext for verifying whether the query identifier matches.
[0237] Specifically, according to the received multiple coefficient ciphertexts and the characteristic that the annihilation polynomial takes a preset value at a certain specific point, a target annihilation polynomial for coefficient encryption can be constructed.
[0238] After the coefficients are encrypted, the polynomial evaluation algorithm is executed in the ciphertext domain to calculate the value of the target annihilation polynomial at X after the coefficients are encrypted. The final result is also a ciphertext, which represents the ciphertext corresponding to the value of the target annihilation polynomial at X when the coefficients are not encrypted.
[0239] When the query identifier matches, the matching degree blinded plaintext is the plaintext corresponding to the second blinded ciphertext, the value of the target annihilation polynomial at the plaintext corresponding to the second blinded ciphertext is a preset value, and the value of the target annihilation polynomial after coefficient encryption at the plaintext corresponding to the second blinded ciphertext is the ciphertext corresponding to the preset value.
[0240] Therefore, in the present application, the target zeroing polynomial after the coefficients are encrypted homomorphically calculates, and after the first value at the matching degree blinded plaintext is obtained, the first value is directly sent to the server as the matching result ciphertext. Among them, when the query identifier matches, the matching degree blinded ciphertext is the second blinded ciphertext, and the plaintext corresponding to the first value is the preset value. Therefore, when the first value is directly used as the matching result ciphertext, if the matching result plaintext obtained by the server decrypting the matching result ciphertext is the preset value, it means that the query identifier matches, and if the matching result plaintext obtained by the server decrypting the matching result ciphertext is not the preset value, it means that the query identifier does not match.
[0241] Optionally, according to the characteristics of homomorphic encryption, another optional implementation method for generating the matching result ciphertext is as follows:
[0242] The client decrypts the matching degree blinded ciphertext to obtain the matching degree blinded plaintext, decrypts multiple coefficient ciphertexts, and constructs the target annihilation polynomial; then, calculates the third value of the target annihilation polynomial at the matching degree blinded plaintext; finally, the third value is homomorphically encrypted and used as the matching result ciphertext for verifying whether the query identifier matches.
[0243] In this way, the coefficient ciphertext is first decrypted to construct the target annihilation polynomial, and then the third value of the target annihilation polynomial calculated in the plaintext domain at the matching blinded plaintext is a plaintext, which needs to be encrypted before being sent to the server.
[0244] For example: the plaintext matching degree is denoted as t, and the ciphertext matching degree is denoted as Enc g (t), the second blinded ciphertext can be recorded as Enc g (r1), the corresponding plaintext r1 is a random number, according to the second blinded ciphertext Enc g(r1), and other blinded ciphertexts Enc g (r0), for matching ciphertext Enc g (t) is blinded, which can be done by homomorphic addition. Enc g (r0) as the coefficient, the matching degree blinded ciphertext obtained is , the corresponding blinded plaintext of matching degree is recorded as ,but The coefficient ciphertext of the target annihilation polynomial in this paper can be written as , here z j represents the jth coefficient of the target annihilation polynomial Z(X), and the matching result ciphertext can be written as .
[0245] Among them, at t=k, Taking the preset value as 0 as an example, if the target annihilation polynomial is recorded as Z(X), then Z(r1)=0, and the corresponding ciphertext can be expressed as Enc g (0), correspondingly, That is, the value of the target annihilation polynomial of coefficient encryption at the plaintext r1 corresponding to the second blinded ciphertext is a ciphertext.
[0246] In the above implementation, this polynomial is designed to be able to zero out a specific result under specific conditions, so as to reveal the matching situation through homomorphic operations without exposing specific information. The target zeroing polynomial in this article cleverly constructs mathematical tools so that specific calculation results are meaningful only under specific conditions (query identifier matching), otherwise the information looks random, which provides an indication of whether the match is made without leaking specific information, protecting the security of the interactive content. In addition, the client homomorphically calculates the matching result ciphertext that can characterize whether the query identifier matches based on the polynomial coefficient ciphertext and sends it to the server, ensuring the privacy and security of the information processing process, so that data can be effectively queried and processed without exposing the plaintext, which not only strengthens data protection, but also promotes secure data sharing and collaboration.
[0247] In addition, the client retains the blinded plaintext of the obfuscated response for the restoration process in S54. Specifically, in the embodiment of the present application, the blinded ciphertext of the obfuscated response is related to the query data corresponding to the query identifier. Since the blinded ciphertext of the obfuscated response is obtained by blinding the obfuscated response ciphertext, in essence, the plaintext corresponding to the obfuscated response ciphertext (i.e., the obfuscated response plaintext) is related to the query data corresponding to the query identifier. It should be noted that the obfuscated response ciphertext can be obtained by homomorphically calculating the query ciphertext and the target obfuscated Bloom filter, and the blinded ciphertext of the obfuscated response can be obtained by blinding the obfuscated response ciphertext. For the specific calculation process, please refer to the relevant instructions of the server below, which are not specifically limited here.
[0248] Wherein, when the query identifier matches, the obfuscated response plaintext corresponding to the obfuscated response ciphertext is the query data corresponding to the query identifier; otherwise, the obfuscated response plaintext corresponding to the obfuscated response ciphertext is a random number.
[0249] On this basis, if the query identifier matches, the client can restore the obfuscated response blinded ciphertext to obtain the query data through the following execution process:
[0250] In this way, after the client generates a matching result ciphertext for verifying whether the query identifier is correct based on the matching result blinded ciphertext and multiple coefficient ciphertexts, the following process can be performed:
[0251] S53: The client sends the matching result ciphertext generated based on the matching degree blinded ciphertext to the server; the matching result ciphertext is used to determine whether there is an identifier matching the query identifier in the data set.
[0252] Specifically, the server will decrypt the matching result ciphertext and analyze whether the matching result plaintext is a preset value. If so, it can be determined that there is an identifier matching the query identifier in the data set, that is, the query identifier matches, and then the first blinded ciphertext used for blinding processing to obtain the obfuscated response blinded ciphertext is sent to the client, so that the client executes the following step S54, thereby ensuring that when the query identifier matches the server-side data set, the client obtains the query data corresponding to the query identifier, and the server obtains the query identifier match and then charges the client.
[0253] If the server decrypts the matching result ciphertext and analyzes that the matching result plaintext is not the preset value, it can be determined that there is no identifier matching the query identifier in the data set, that is, the query identifier does not match. There is no need to feedback any data to the client later, thereby ensuring that when the query identifier does not match the server-side data set, the client cannot obtain any plaintext data, and the server obtains a query identifier mismatch.
[0254] S54: The client restores the obfuscated response blinded ciphertext to obtain the query data according to the first blinded ciphertext returned by the server after determining that the query identifier matches.
[0255] In the embodiment of the present application, the first blinded ciphertext is used for blinding processing to obtain the obfuscated response blinded ciphertext. Through the first blinded ciphertext, the obfuscated response ciphertext can be blinded into the obfuscated response blinded ciphertext. An optional implementation is:
[0256] In step S52, after receiving the obfuscated response blinded ciphertext, the client will use the query party’s private key sk g , decrypt the obfuscated response blinded ciphertext to obtain the obfuscated response blinded plaintext, and retain it. In step S54, the client receives the first blinded ciphertext returned by the server, and then decrypts the obfuscated response blinded plaintext according to the querying party's private key skg , decrypt the first blinded ciphertext to obtain the plaintext corresponding to the first blinded ciphertext, which is a random number. Based on the random number, the obfuscated response blinded plaintext is deblinded to obtain the obfuscated affected plaintext.
[0257] Specifically, when the query identifier matches, the obfuscated response plaintext is the query data corresponding to the query identifier; otherwise, the obfuscated response plaintext is a random number. Therefore, when the query identifier matches, the obfuscated response blinded ciphertext can be restored based on the first blinded ciphertext to obtain the query data corresponding to the query identifier.
[0258] For example: the obfuscated response plaintext is denoted as v, and the obfuscated response ciphertext is denoted as Enc g (v), the first blinded ciphertext can be denoted as Enc g (r), the corresponding plaintext r is a random number, according to the first blinded ciphertext Enc g (r), the obfuscated response ciphertext Enc g (v) Blinding is performed, specifically, blinding can be performed by homomorphic addition, and the obtained obfuscated response blinded ciphertext is: , the corresponding obfuscated response blinded plaintext is denoted as ,but .
[0259] In the case of blinding by homomorphic addition, the obfuscated response blinded plaintext is unblinded based on the plaintext corresponding to the first blinded ciphertext, that is, subtraction is performed to obtain the obfuscated response plaintext v. Specifically, .
[0260] Similarly, according to the characteristics of homomorphic encryption, the ciphertext can be blinded first, the obfuscated response blinded ciphertext can be unblinded to obtain the obfuscated response ciphertext, and then the querying party private key sk g , decrypting the obfuscated response ciphertext can obtain the obfuscated response plaintext representing the query data. An optional implementation is as follows:
[0261] There is no need to decrypt the obfuscated response blinded ciphertext. Instead, the obfuscated response blinded ciphertext is directly deblinded according to the first blinded ciphertext returned by the server to obtain the obfuscated response ciphertext; then, the obfuscated response ciphertext is decrypted to obtain the obfuscated response plaintext representing the query data corresponding to the query identifier.
[0262] For example: First, according to the first blinded ciphertext Enc g (r), blinding the ciphertext to the obfuscated response For deblinding, still taking the above blinding by homomorphic addition as an example, deblinding here is subtraction, , that is, the obfuscated response ciphertext Enc g (v), and then according to the query party's private key sk gResponse to the obfuscated ciphertext Enc g (v) is decrypted to obtain the obfuscated response plaintext v representing the query data corresponding to the query identifier.
[0263] In the above implementation, through blinding and deblinding technology, a secure communication mechanism that protects privacy and ensures data integrity is built between the client and the server, enhancing privacy protection in data transmission and ensuring that only when the client query identifier matches can the real query data be obtained. This method promotes trust between the two parties, improves the flexibility and compatibility of the system, effectively controls the risk of information leakage, and is an efficient strategy for achieving a balance between privacy protection and functional requirements.
[0264] The following is a brief summary of the interaction process between the client and the server:
[0265] First, let me briefly introduce the public parameters:
[0266] (1) The Bloom filter parameters related to the target Bloom filter and the confusion Bloom filter are m and k;
[0267] (2) k hash functions: .
[0268] (3) In the offline phase, the client generates a public-private key pair, the private key sk g , public key PK g ; The server generates a public-private key pair, private key sk h , public key PK h .
[0269] (4) In the online stage, the client has a query id and the server has a database DB, which stores a data set, which can be specifically expressed as: DB = {(x0, data0), (x1, data1), (x2, data2), (x3, data3), …}.
[0270] Taking m=8, k=3 as an example, the following combination Figure 8 A brief summary of the first round of interaction between the client and the server:
[0271] like Figure 8 As shown, it is a logical schematic diagram of the first round of interaction between a client and a server in an embodiment of the present application.
[0272] In the first round of interaction between the query end and the server, first, the client maps the query identifier x into a bit array (such as Figure 8 00110001 in the query), and then according to the query party's public key PK g Encrypt the bit data, generate the query ciphertext and send it to the server (the query party's public key PK can be sent synchronouslyg , used for homomorphic computing on the server side), please refer to the relevant description of step S51 above, which will not be repeated here.
[0273] Among them, the server will pre-calculate the target Bloom filter and the target confusion Bloom filter based on the data set, such as Figure 8 The target Bloom filter can be represented as a bit array: 10111011, and the target confusion Bloom filter can be represented as a random array: s1 0 s4 s2 s6 0 s3 s5.
[0274] The server performs homomorphic calculations with the target Bloom filter and the target confusion Bloom filter based on the query ciphertext sent by the client, and performs blinding processing to obtain the matching degree blinded ciphertext and the confusion response blinded ciphertext;
[0275] In addition, the server needs to construct the target zeroing polynomial and use the server's public key PK h Encrypt its coefficients to generate multiple coefficient ciphertexts, and then feedback the matching degree blind ciphertext, obfuscated response blind ciphertext and multiple coefficient ciphertexts to the client (the service party’s public key PK can be sent synchronously). h , used for homomorphic computing on the client side), please refer to the relevant description of step S102 below, which will not be repeated here.
[0276] The client receives the matching degree blinded ciphertext, the obfuscated response blinded ciphertext, and the multiple coefficient ciphertexts corresponding to the target annihilation polynomial sent by the server.
[0277] The above is the first round of interaction between the client and the server.
[0278] Combine the following Fig. 9 The second round of interaction between the client and the server is briefly summarized as follows:
[0279] like Fig. 9 As shown, it is a logical diagram of the second round of interaction between a client and a server in an embodiment of the present application. Fig. 9 is Figure 8 The examples shown are further described.
[0280] Specifically, after the client receives the blinded ciphertext of the matching degree, the blinded ciphertext of the obfuscated response, and the ciphertext of multiple coefficients corresponding to the target zeroing polynomial sent by the server, it can use the querying party's private key sk g , the matching degree blinded ciphertext and the obfuscated response blinded ciphertext are decrypted respectively to obtain two plaintext results, which are recorded as matching degree blinded plaintext and obfuscated response blinded plaintext.
[0281] Among them, the matching degree blinded plaintext is used to homomorphically calculate the value of the target annihilation polynomial, and then encrypted to generate the matching result ciphertext, and sent to the server. The specific process refers to the above embodiment, and the repeated parts will not be repeated.
[0282] After the server receives the matching result ciphertext, it can use the server's private key sk h Decryption determines whether the query identifier matches. If so, the first blinded ciphertext previously used for blinding processing to obtain the obfuscated response blinded ciphertext is fed back to the client. For the specific process, see the relevant description of step S103 below, which will not be repeated here.
[0283] If it does not match ( Fig. 9 If the client receives the first blinded ciphertext (not shown), the termination protocol will be submitted, and the client will no longer receive the first blinded ciphertext, and will not be able to query any plaintext data.
[0284] The above is the second round of interaction process between the client and the server.
[0285] Then, the client can obtain the first blinded ciphertext and the querying party's private key sk g , restore the obfuscated response blind ciphertext to obtain the obfuscated response plaintext representing the query data (in Fig. 9 This step is also divided into the second round of interaction process). For the specific process, please refer to the relevant description of step S54 above, which will not be repeated here.
[0286] In an embodiment of the present application, after the client receives the first blinded ciphertext sent by the server, it can use it to remove the blinding effect of the previously obfuscated response ciphertext, thereby recovering the true data value, that is, the data item that matches the query identifier. If the protocol is not terminated early, this indicates that the client's query is successful, and the matching query identifier and its corresponding data value are found; otherwise, the client cannot obtain the plaintext data. In addition, in this process, the server can determine whether the query identifier matches by constructing a target zeroing polynomial and combining it with the matching result ciphertext fed back by the client, so as to correctly bill the client when the query identifier matches. Throughout the entire process, the client's query identifier is protected, that is, although the server knows whether the query identifier matches, it does not know which query identifier it is; the server's data is also protected, that is, when the query identifier matches, the client can only obtain the data corresponding to the query identifier, otherwise no other information can be obtained.
[0287] The entire protocol listed above uses advanced encryption methods such as homomorphic encryption, blinding technology, and polynomial cryptography to achieve secure data membership query without leaking non-query result data. This method has important application value in cloud storage, data sharing and other fields, because it can support effective query while protecting data privacy.
[0288] The above mainly describes the data anonymity query method in the embodiment of the present application from the client side. The following further describes the data anonymity query method in the embodiment of the present application from the server side:
[0289] See also Fig.10 As shown, it is an implementation flow chart of another data anonymity query method provided in an embodiment of the present application. Taking the server as the execution subject as an example, the specific implementation process of the method is as follows S101~S103:
[0290] S101: The server receives a query ciphertext sent by the client, where the query ciphertext is generated by mapping the query identifier according to a preset Bloom filter parameter.
[0291] In an embodiment of the present application, the client has a query identifier, such as denoted by x, and the server has a data set consisting of multiple identifiers and their corresponding data, such as denoted by {(x0, data0), (x1, data1), (x2, data2), (x3, data3), ...}, where xi represents the i-th identifier, datai represents the data corresponding to the i-th identifier, and assuming that the size of the data set is n, the value of i here is 0 to n-1, that is, i=0, 1, ..., n-1.
[0292] Specifically, the client can map the query identifier into a bit array according to the preset Bloom filter parameters, and encrypt and generate a query ciphertext to send to the server. For the specific implementation method, please refer to the above embodiment, and the repeated parts will not be repeated.
[0293] In addition, the server can map the data set into a target Bloom filter and a target confused Bloom filter according to the above-mentioned preset Bloom filter parameters, that is, the server constructs a target Bloom filter according to {x0, x1, x2, x3, ...}, and constructs a target confused Bloom filter according to {(x0, data0), (x1, data1), (x2, data2), (x3, data3), ...}. For the specific implementation method, please refer to the above embodiment, and the repeated parts will not be repeated here.
[0294] On this basis, the server can perform homomorphic calculations on the target Bloom filter and the target confusion Bloom filter based on the query ciphertext. The specific process is as follows:
[0295] S102: The server performs homomorphic calculation and blinding processing on the target Bloom filter and the target confused Bloom filter according to the query ciphertext, obtains a blinded ciphertext representing the degree of matching between the query identifier and the identifier in the data set in the Bloom space, and a blinded ciphertext of the confused response related to the query data corresponding to the query identifier, and sends them to the client; the target Bloom filter and the target confused Bloom filter are obtained by mapping the data set based on Bloom filtering parameters, and the data set consists of multiple identifiers and corresponding data.
[0296] It can be known from the client-side embodiment that the target Bloom filter in the embodiment of the present application can be regarded as an m-dimensional bit array, the target obfuscated Bloom filter can be regarded as an m-dimensional random array, and the query ciphertext sent by the client to the server is also m-dimensional, that is, m query ciphertexts. In this way, after the server receives the m query ciphertexts, when performing homomorphic calculations, it can specifically perform homomorphic inner product operations, which allow the calculation of the correlation between two vectors in an encrypted state. The two ciphertexts corresponding to the target Bloom filter and the target obfuscated Bloom filter are obtained through homomorphic inner product operations, namely, the matching degree ciphertext and the obfuscated response ciphertext. If the query identifier x is in the set {x0, x1, x2, x3, ...}, the plaintext corresponding to the matching degree ciphertext (i.e., matching degree plaintext) is k, and the plaintext corresponding to the obfuscated response ciphertext (i.e., obfuscated response plaintext) is the data value corresponding to x; otherwise, the matching degree plaintext is less than k, and the obfuscated response plaintext is a random number.
[0297] In order to prevent the client from directly decrypting the two ciphertext results, the server randomly blinds the two ciphertexts, which means that the client does not know whether the query identifier matches at this time, and therefore cannot directly send data. Therefore, a random number is added to the ciphertext so that directly decrypting the ciphertext cannot immediately reveal the actual query result, thereby increasing security.
[0298] Based on the above idea, an optional implementation is to generate a matching degree blinded ciphertext through the following steps S1021a to S1022a:
[0299] S1021a: After multiplying the plaintext corresponding to each query ciphertext in the m query ciphertexts with the element at the corresponding position in the target Bloom filter, the sum of the obtained products is encrypted to obtain the matching degree ciphertext.
[0300] Specifically, when the query ciphertext performs a homomorphic inner product operation with the element at the corresponding position in the target Bloom filter, the i-th query ciphertext can be regarded as the ciphertext Enc(u i ), the i-th element in the target Bloom filter can be regarded as the plaintext w in the homomorphic inner product operation algorithm i, at this time, the value of l is m. In general, the plaintext corresponding to each query ciphertext in the m query ciphertexts is multiplied by the element at the corresponding position in the target Bloom filter, and then the sum of the products is encrypted. The final result is the ciphertext, which is recorded as the matching degree ciphertext in this article.
[0301] Therefore, when the query identifier matches, the sum of the products obtained should be k, that is, the matching degree plaintext corresponding to the matching degree ciphertext is k; otherwise, the matching degree plaintext corresponding to the matching degree ciphertext is less than k.
[0302] like Fig.11 As shown, it is a schematic diagram of the calculation logic of a matching degree plaintext in an embodiment of the present application. Figure 6 Taking the target Bloom filter shown in the figure as an example, assuming that the final target Bloom filter can be expressed as: 10111011, the query identifier is x1, and the plaintext corresponding to the m query ciphertexts is obtained after mapping: 00110001, that is, multiplying each bit in 00110001 with each bit in 10111011, among which 3 bits are multiplied to 1, such as Fig.11 The bits 2, 3, and 7 in the multiplication result of the remaining bits are 0, and the final accumulated result is 3, which is k.
[0303] Assume that the query identifier is x111, and the plaintext corresponding to the m query ciphertexts is obtained after mapping, such as: 01010001. Multiply each bit in 01010001 with each bit in 10111011. Among them, there are 2 bits whose multiplication result is 1, such as Fig.11 The multiplication result of bits 3 and 7 in the summation is 0, and the final accumulated result is 2, which is less than k.
[0304] That is, when the query identifier matches, the plaintext matching degree is k, otherwise, the plaintext matching degree is less than k.
[0305] On the basis of the above, the matching ciphertext is blinded to further enhance privacy protection. The specific process is as follows:
[0306] S1022a: Based on the second blinded ciphertext, blind the matching degree ciphertext to obtain a matching degree blinded ciphertext.
[0307] In the embodiment of the present application, the second blinded ciphertext may be recorded as Enc g (r1), and its corresponding plaintext r1 is a random number. In addition to adding the random number r1, the blinding process can also add a random number r0, wherein the random number r0 is used as a coefficient related to the matching degree plaintext, and r1 is used to perform homomorphic addition, so that when the matching degree plaintext corresponding to the matching degree ciphertext is k, the matching degree blinded ciphertext is the second blinded ciphertext, that is, when the query identifier matches, the matching degree blinded ciphertext is the second blinded ciphertext.
[0308] According to the characteristics of homomorphic encryption, the process can also blind the matching degree plaintext according to the plaintext corresponding to the second blinded ciphertext to obtain the matching degree blinded plaintext, and then encrypt the matching degree blinded plaintext to obtain the matching degree blinded ciphertext.
[0309] Assume that the matching ciphertext is denoted as Enc g (t), the matching degree plaintext is t, and by adding random numbers r0 and r1 to the matching degree plaintext, the blinded matching degree plaintext is , and then according to the service party's public key PK h , encrypt the blinded plaintext to get the blinded ciphertext, which can be written as At t=k, According to the characteristics of homomorphic encryption, this process is based on the second blinded ciphertext Enc g (r1), and other blinded ciphertexts Enc g (r0), for matching ciphertext Enc g (t) Blind the ciphertext Enc to obtain the matching degree blinded ciphertext Enc g The process of (r0·(tk)+r1).
[0310] In the above implementation, the homomorphic inner product operation is used to verify whether the query identifier may exist in the data set, so that the server can directly perform calculations on the encrypted data without decryption, which not only meets the functional requirements but also maintains the confidentiality of the data. On this basis, random blinding is performed to further confuse the data, so that the client cannot directly infer the original data from the calculation results, thereby enhancing privacy protection.
[0311] Similarly, an optional implementation is to generate a blinded ciphertext of the obfuscated response through the following steps S1021b to S1022b:
[0312] S1021b: After multiplying the plaintext corresponding to each query ciphertext in the m query ciphertexts with the element at the corresponding position in the target obfuscated Bloom filter, the sum of the obtained products is encrypted to obtain the obfuscated response ciphertext.
[0313] Specifically, when the query ciphertext and the elements at the corresponding positions in the target confusion Bloom filter perform homomorphic inner product operations, the i-th query ciphertext can be regarded as the ciphertext Enc(u i ), the i-th element in the target obfuscated Bloom filter can be regarded as the plaintext w in the homomorphic inner product operation algorithm i, at this time, the value of l is m. In general, the plaintext corresponding to each query ciphertext in the m query ciphertexts is multiplied by the element at the corresponding position in the target confusion Bloom filter, and then the sum of the products is encrypted. The final result is the ciphertext, which is recorded as the confusion response ciphertext in this article.
[0314] Therefore, when the query identifier matches, the sum of the products obtained should be the data corresponding to the query identifier, that is, the obfuscated response plaintext corresponding to the obfuscated response ciphertext is the data; otherwise, the obfuscated response plaintext corresponding to the obfuscated response ciphertext is a random number.
[0315] like Fig.12 As shown, it is a schematic diagram of the calculation logic of a confused response plaintext in an embodiment of the present application. Figure 7 Taking the target obfuscated Bloom filter shown in FIG. 1 as an example, assuming that the final target obfuscated Bloom filter can be expressed as: s1 0 s4s2 s6 0 s3 s5, the query identifier is x1, and the plaintext corresponding to the m query ciphertexts is obtained after mapping: 00110001, that is, each bit in 00110001 is multiplied by each bit in s1 0 s4 s2 s6 0 s3 s5, among which 3 bits are multiplied to obtain the random number corresponding to the bit in the target obfuscated Bloom filter, as shown in FIG. Fig.12 The multiplication result of bits 2, 3, and 7 in the data is 0, and the final accumulated result is s4+s2+s5, which is data1.
[0316] Assume that the query identifier is x111, and the plaintext obtained after mapping is the corresponding plaintext of the m query ciphertexts, such as: 01010001. Multiply each bit in 01010001 with each bit in s1 0 s4 s2 s6 0 s3 s5. Among them, the multiplication result of 2 bits is the random number corresponding to the bit in the target confusion Bloom filter, such as Fig.12 The bits 3 and 7 in the , and the rest of the bits are multiplied to 0, and the final accumulated result is s2+s5, which is a random number.
[0317] That is, when the query identifier matches, the obfuscated response plaintext corresponding to the obfuscated response ciphertext is the query data, otherwise, the obfuscated response plaintext is a random number.
[0318] On the basis of the above, the obfuscated response ciphertext is blinded to further enhance privacy protection. The specific process is as follows:
[0319] S1022b: Based on the first blinded ciphertext, blind the obfuscated response ciphertext to obtain a blinded obfuscated response ciphertext.
[0320] According to the characteristics of homomorphic encryption, the process can also blind the obfuscated response plaintext according to the plaintext corresponding to the first blinded ciphertext to obtain the obfuscated response blinded plaintext, and then encrypt the obfuscated response blinded plaintext to obtain the obfuscated response blinded ciphertext.
[0321] In the embodiment of the present application, the first blinded ciphertext may be recorded as Enc g (r), the corresponding plaintext r is a random number. In the blinding process, the random number r is used to perform homomorphic addition.
[0322] Assume that the obfuscated response ciphertext is denoted as Enc g (v), the obfuscated response plaintext is v, and by adding a random number r to the obfuscated response plaintext, the obfuscated response blinded plaintext is , and then according to the service party's public key PK h , encrypt the obfuscated response blind plaintext to get the obfuscated response blind ciphertext, which can be written as According to the characteristics of homomorphic encryption, this process is based on the first blinded ciphertext Enc g (r), the obfuscated response ciphertext Enc g (v) Blind the response to obtain the obfuscated blinded ciphertext Enc g (v+r) process.
[0323] In the above implementation, the homomorphic inner product operation is to determine the query data or random number corresponding to the query identifier, so that the server can directly perform calculations on the encrypted data without decryption, which not only meets the functional requirements but also maintains the confidentiality of the data. On this basis, random blinding is performed to further confuse the data, so that the client cannot directly infer the original data from the calculation results, thereby enhancing privacy protection.
[0324] On the basis of the above, the server can further construct a target annihilation polynomial, wherein the value of the target annihilation polynomial at the plaintext corresponding to the second blinded ciphertext can be set to a preset value. When the query identifier matches, the matching degree blinded ciphertext is the second blinded ciphertext, and the matching degree blinded plaintext is the plaintext corresponding to the second blinded ciphertext. At this time, the value of the target annihilation polynomial is the preset value. This ensures that the value of the target annihilation polynomial will be the preset value only when the query identifier matches. This design further protects information through mathematical means and ensures that useful information can only be obtained under expected conditions.
[0325] An optional implementation is that in step S102 before step S103, the server needs to perform the following process:
[0326] First, construct a target annihilation polynomial, wherein the value of the target annihilation polynomial at the plaintext corresponding to the second blinded ciphertext is a preset value;
[0327] Then, each coefficient of the target annihilation polynomial is homomorphically encrypted to obtain multiple coefficient ciphertexts;
[0328] Finally, multiple coefficient ciphertexts are sent to the client so that the client can safely use the polynomial in a homomorphic encryption environment, and a matching result ciphertext is generated based on multiple coefficient ciphertexts and matching degree blinded ciphertexts to ensure that only when the query identifier matches, the value of the target zeroing polynomial is a preset value, and the matching result ciphertext determined based on this can be used to determine whether the query identifier exists in the data set. Among them, the specific implementation method of the client generating the matching result ciphertext based on multiple coefficient ciphertexts and matching degree blinded ciphertexts is referred to the above embodiment, and the repeated parts are not repeated.
[0329] The annihilation polynomial is often used to ensure that at a certain specific point X, the value of the polynomial is a preset value, such as 0. The target annihilation polynomial Z(X) constructed in the embodiment of the present application is to determine whether the query identifier matches. When the query identifier matches, the plaintext value corresponding to the matching degree ciphertext (i.e., the matching degree plaintext) is k. At this time, the matching degree blinded ciphertext is the second blinded ciphertext. Therefore, the value of the target annihilation polynomial at the plaintext corresponding to the second blinded ciphertext can be set to a preset value, thereby ensuring that the polynomial value is the preset value only when the query identifier matches. In this way, the design of Z(X) makes its output a preset value, which becomes a verification mechanism for whether the query identifier matches.
[0330] Assuming that the preset value is 0, when constructing the target annihilation polynomial, it is first necessary to determine at which points (such as the above r1) the target annihilation polynomial is expected to take the value of 0 in this application, and then based on these points, use Lagrange interpolation or Newton interpolation algorithms to construct a minimum degree polynomial, so that the polynomial has a value of 0 at all selected points. Specifically, in this article, Z(r1)=0.
[0331] Furthermore, in order to use this polynomial securely in a homomorphic encryption environment, it is also necessary to use the server's public key PK h , encrypt the coefficients of the target annihilation polynomial Z(X) (i.e., the coefficient values of the target annihilation polynomial at different powers), and obtain multiple coefficient ciphertexts, which can be recorded as Enc h (z j ), where z j Indicates the jth coefficient of Z(X). Then, the server encrypts the coefficients of the target annihilation polynomial Z(X) and sends them to the client. In this process, the server public key PK can be sent synchronously. h , used for homomorphic computing on the client side.
[0332] It should be noted that annihilation polynomials are often used to safely compare and verify whether certain conditions are met, or to determine whether two values are equal without directly exposing the specific values. In the embodiment of the present application, by constructing a target annihilation polynomial, it is possible to indirectly confirm whether the query identifier matches without directly revealing the query identifier or other data in the bucket.
[0333] That is, in step S102, the server needs to send the encrypted coefficient ciphertexts to the client. In addition, the server public key PK h The ciphertext is sent to the client so that the client can further process the ciphertext according to the public key of the service provider, so that only under the correct conditions (that is, when the query identifier matches) can a meaningful output be obtained by evaluating the polynomial through the specific ciphertext decryption result.
[0334] In this way, by constructing the target annihilation polynomial, the server can tell the client that it only needs to know that when the matching degree plaintext is k, the query identifier matches, otherwise the query identifier does not match.
[0335] In the above implementation, this polynomial is designed to be able to zero out a specific result under specific conditions, thereby revealing the match through homomorphic operations without exposing specific information. The target zeroing polynomial in this article cleverly designs a mathematical mechanism so that a specific calculation result is "meaningful" only when the query matches, which provides an indication of whether it matches or not without revealing specific information. In addition, the server encrypts the coefficients of the target zeroing polynomial with its own public key to further protect this information from unauthorized access and ensure the security of information exchange.
[0336] S103: The server determines that there is an identifier matching the query identifier in the data set based on the matching result ciphertext generated by the blinded ciphertext based on the matching degree sent by the client, and then sends the first blinded ciphertext used for blinding processing to obtain the obfuscated response blinded ciphertext to the client, so that the client can restore the obfuscated response blinded ciphertext to obtain the query data based on the first blinded ciphertext.
[0337] Specifically, after the server sends the matching degree blinded ciphertext, the obfuscated response blinded ciphertext, and multiple coefficient ciphertexts to the client, the client can query the query result based on the query result of the private key sk g , decrypt the blinded matching ciphertext to obtain the blinded matching plaintext. Then, construct the target annihilation polynomial after coefficient encryption according to multiple coefficient ciphertexts; then, homomorphically calculate the first value of the target annihilation polynomial after coefficient encryption at the matching blinded plaintext; finally, use the first value as the matching result ciphertext for verifying whether the query identifier matches.
[0338] If the query identifier matches, the matching degree plaintext is k, and the matching degree blinded plaintext is the plaintext corresponding to the second blinded ciphertext. In this case, the first value at the plaintext corresponding to the second blinded ciphertext, which is calculated homomorphically by the target annihilation polynomial after coefficient encryption, is the ciphertext, specifically the ciphertext of the preset value. In this way, the server decrypts the matching result ciphertext, and after obtaining the matching result plaintext, it can determine whether the query identifier matches according to whether the matching result plaintext is the preset value.
[0339] In an optional implementation, the server may determine whether there is an identifier matching the query identifier in the data set according to the following process:
[0340] First, the server decrypts the matching result ciphertext to obtain the matching result plaintext, and then analyzes whether the matching result plaintext is a preset value.
[0341] In the embodiment of the present application, the server can use the service party's private key sk h , decrypt the matching result ciphertext to obtain the matching result plaintext after homomorphic calculation. The server analyzes whether the matching result plaintext is the preset value, that is, determines whether the value of the target Bloom filter in the query identifier x (referring to the matching degree plaintext) is k.
[0342] If the plain text of the matching result is a preset value, it is determined that there is an identifier matching the query identifier in the data set, that is, the query identifier matches, and then the server sends the first blinded ciphertext used for blinding processing to obtain the obfuscated response blinded ciphertext to the client, so that the client executes step S54, thereby ensuring that when the query identifier matches the server-side data set, the client obtains the query data corresponding to the query identifier, and the server obtains the query identifier match and then charges the client.
[0343] For example: the matching result ciphertext is recorded as Enc h (Z(t * )),in , when the query identifier matches, t=k, t * =r1,Enc g (t * )=Enc g (r1). Taking the preset value as 0 as an example, Z(r1)=0, the corresponding ciphertext can be expressed as Enc g (0), correspondingly, Enc h (Z(t * ))=Enc h (Z(r1))=Enc g (0). The plain text of the matching result is Z(r1)=0.
[0344] If the plain text of the matching result is not the preset value, it is determined that there is no identifier matching the query identifier in the data set, that is, the query identifier does not match, and the protocol is terminated. There is no need to feedback any data to the client subsequently, thereby ensuring that when the query identifier does not match the server-side data set, the client cannot obtain any plain text data, and the server obtains a query identifier mismatch.
[0345] For example: when the query identifier matches, t<k, t * ≠r1, then Enc h (Z(t * ))≠Enc g (0), matching result plaintext Z(t * )≠0.
[0346] In the above implementation, the server determines the matching situation through the decryption result. This process still follows the privacy protection principle and will not leak non-matching information, thus protecting the security of the interaction.
[0347] In an embodiment of the present application, after the client receives the first blinded ciphertext sent by the server, it can use it to remove the blinding effect of the previously obfuscated response ciphertext, thereby recovering the true data value, that is, the data item that matches the query identifier. If the protocol is not terminated early, this indicates that the client's query is successful, and the matching query identifier and its corresponding data value are found; otherwise, the client cannot obtain the plaintext data. In addition, in this process, the server can determine whether the query identifier matches by constructing a target zeroing polynomial and combining it with the matching result ciphertext fed back by the client, so as to correctly bill the client when the query identifier matches. Throughout the entire process, the client's query identifier is protected, that is, although the server knows whether the query identifier matches, it does not know which query identifier it is; the server's data is also protected, that is, when the query identifier matches, the client can only obtain the data corresponding to the query identifier, otherwise no other information can be obtained.
[0348] The entire protocol listed above uses advanced encryption methods such as homomorphic encryption, blinding technology, and polynomial cryptography to achieve secure data membership query without leaking non-query result data. This method has important application value in cloud storage, data sharing and other fields, because it can support effective query while protecting data privacy.
[0349] In the embodiment of the present application, an online hidden query is performed based on a Bloom filter and a confused Bloom filter. Since the Bloom filter has the characteristics of high space efficiency and fast query speed, compared with the traditional method, the Bloom filter uses less space to represent the existence of a set, and the query operation only needs to access the bit array k times, which is very efficient. The online hidden query can be performed efficiently.
[0350] The following is an explanation of the selection of Bloom filter parameters in the embodiment of the present application:
[0351] Under normal circumstances, when searching for x, x is mapped through k hash functions. If these k positions in the array are all 1, it means that x is in the data set; otherwise, it means that x is not in the data set. However, Bloom filters have a false positive rate, that is, elements that do not belong to the data set are mistakenly judged to belong to the data set. Considering the possibility of false positives, in actual applications, when searching for x, if these k positions in the array are all 1, it can only mean that x may exist in the data set; otherwise, it means that x is not in the data set.
[0352] The length m of the Bloom filter will directly affect the false positive rate of the Bloom filter. If the Bloom filter is too small, all bits will be 1 soon, and any query value will return "may exist", which will not achieve the purpose of filtering. Therefore, the longer the Bloom filter, the lower its false positive rate.
[0353] In addition, the more hash functions there are, the faster the Bloom filter bit position is set to 1, and the lower the efficiency of the Bloom filter; but if there are too few, the misjudgment rate will become higher.
[0354] Specifically, the misjudgment rate of the Bloom filter is (1-e -kn / m ) k , here when When , the misjudgment rate reaches the optimum.
[0355] The obfuscated Bloom filter not only has a false positive rate, that is, when searching for x, x is not in the data set, but the recovered data is in the data set; but also has the situation of insertion failure, that is, there is an element (x, data) so that the k positions to be inserted have been filled with random numbers, and the sum of these k random numbers is not equal to data. Then the probability of failure in the construction of the obfuscated Bloom filter is no more than ,here .
[0356] In summary, the selection of k and m is important. In the embodiment of the present application, in order to reduce the misjudgment rate of the target Bloom filter and reduce the probability of the target confusing the Bloom filter to an acceptable level (i.e., ≤2 -20 ), requiring k ≥ 30 and m ≥ n*43.28. Accordingly, for the data anonymity query method proposed in this application, the communication overhead of the protocol during the interaction between the client and the server is ≥ 43.28*n. In order to reduce the communication complexity and parallelize the calculation, this application considers bucketing the data set on the server, that is, dividing the data set into multiple subsets to balance the data distribution and improve the query efficiency.
[0357] Specifically, there are many ways to bucket, including but not limited to the following:
[0358] Bucketing method 1: Bucketing according to the bucketing function.
[0359] In this method, you set the number of buckets and the bucket function, then map the identifiers in the data set according to the bucket function and bucket the data according to the mapping results.
[0360] For example, it is expected that the data set will be divided into b buckets, numbered as 0, 1, ..., b-1. Assuming that the identifiers in the data set are all unfixed length identifiers composed of 0 and 1, because different identifiers may have different lengths, a bucketing function H:{0,1}*→{0,1,2,...,b-1} (where * indicates the length of the uncertain identifier) can be set, and the bucketing function is mapped to integers between 0 and b-1, which means that the identifier and its corresponding data are divided into the buckets corresponding to the integer numbers, so that the amount of data in each bucket is almost uniform.
[0361] For example, mapping x1 to 2 means that the identifier and its corresponding data are divided into bucket numbered 2, and mapping x2 to 1 means that the identifier and its corresponding data are divided into bucket numbered 1.
[0362] It should be noted that the bucket functions listed here are just simple examples. In addition, other bucket functions are also applicable to the embodiments of the present application and are not specifically limited here.
[0363] Bucketing method 2: equidistant bucketing based on business rules.
[0364] In this method, the data set can be divided according to a fixed width, and the interval width of each bucket is the same. The interval width of the bucket can be defined according to specific business needs or domain knowledge. In this method, it is expected that the data set will be divided into b buckets, and each bucket can be bound to a certain identifier interval (i.e., the identifier value range), and then based on the identifier value, all identifiers within the identifier interval are divided into corresponding buckets.
[0365] For example, when the identifier includes age, when bucketing by age, the population may be divided into children, teenagers, adults, the elderly, etc. based on the life cycle theory.
[0366] Bucketing method three: cluster bucketing.
[0367] Use a clustering algorithm (such as K-means) to automatically group data based on the similarity of the identifiers, and each bucket formed represents an area around a cluster center.
[0368] Bucketing method 4: dynamic bucketing.
[0369] The number and boundaries of buckets are dynamically adjusted according to the actual distribution of data, and the data density change points are automatically identified to determine the bucket boundaries.
[0370] like Fig.13 As shown, it is a schematic diagram of a data set bucketing in an embodiment of the present application. Assuming that the number of buckets is 2, the data set {(x0, data0), (x1, data1), (x2, data2), (x3, data3)...} can be divided into two buckets, bucket 1 {(x0, data0), (x3, data3),...}, bucket 2 {(x1, data1), (x2, data2),...}.
[0371] Among them, without bucketing, the target Bloom filter and the target confused Bloom filter are constructed based on the entire data set, so the data set {(x0, data0), (x1, data1), (x2, data2), (x3, data3)...} corresponds to a target Bloom filter 0 and a target confused Bloom filter 0. Specifically, the server constructs the target Bloom filter 0 according to {x0, x1, x2, x3,...}, and constructs the target confused Bloom filter 0 according to {(x0, data0), (x1, data1), (x2, data2), (x3, data3),...}. The specific construction method can be found in the above embodiment, and the repeated parts will not be repeated.
[0372] In the case of bucketing, each bucket will correspond to a target Bloom filter and a target confusion Bloom filter. Each target Bloom filter and target confusion Bloom filter are constructed based on the corresponding bucket. For example, the target Bloom filter 1 corresponding to bucket 1 {(x0, data0), (x3, data3), ...} is constructed by the server based on {x0, x3, ...}, and the target confusion Bloom filter 1 corresponding to bucket 1 {(x0, data0), (x3, data3), ...} is constructed by the server based on {(x0, d ata0), (x3, data3), ...}; the target Bloom filter 2 server corresponding to bucket 2 {(x1, data1), (x2, data2), ...} is constructed according to {x1, x2, ...}, and the target confusion Bloom filter 2 server corresponding to bucket 2 {(x1, data1), (x2, data2), ...} is constructed according to {(x1, data1), (x2, data2), ...}. The specific construction method can be found in the above embodiment, and the repeated parts will not be repeated.
[0373] It should be noted that the bucketing methods listed above are just simple examples. In addition, other bucketing methods are also applicable to the embodiments of the present application and will not be described in detail here.
[0374] First, let's briefly introduce the public parameters in the bucketing case:
[0375] (1) Bucket function H: {0, 1}*→{0, 1, 2, …, b-1}.
[0376] (2) The Bloom filter parameters related to the target Bloom filter and the confusion Bloom filter are m and k;
[0377] (3) k hash functions: H i :{0, 1} * →{0, 1,…, m-1}.
[0378] (4) In the offline phase, the client generates a public-private key pair, the private key sk g , public key PK g ; The server generates a public-private key pair, private key sk h , public key PK h .
[0379] (5) In the online phase, the client has the query , the server has a database DB, which stores data sets, which can be specifically expressed as: DB={(x0, data0), (x1, data1), (x2, data2), (x3, data3), …}.
[0380] Let n = 10 6 , that is, the data size of the server is as high as one million, and the number of buckets is selected as b=512, then each bucket contains at most , choose k=32, then m=180415. Therefore, the client's communication volume is reduced by 4 times compared with n, and the computational complexity is m·b query ciphertext calculations. Therefore, bucketing can effectively reduce the communication volume and computational complexity.
[0381] When a data set is bucketed, the data set may contain multiple buckets, each bucket being used to store a portion of identifiers and corresponding data. Therefore, the client may calculate the bucket identifier in advance based on the bucketing function H, which may be denoted as τ. The bucket identifier is used to identify the bucket in which the query identifier is located when the query identifier exists in the data set.
[0382] In addition, the client needs to calculate the m-dimensional bit vector corresponding to the query identifier according to the Bloom filter parameters, encrypt the vector to obtain m query ciphertexts, and then attach the query party's public key PK g Sent to the server together.
[0383] When the data set is bucketed, each bucket will also have its own corresponding target Bloom filter and target confusion Bloom filter, which are obtained based on the data mapping in the corresponding bucket. In this way, in step S102, the server can perform homomorphic calculation and blinding processing on the target Bloom filter and target confusion Bloom filter corresponding to the bucket according to the query ciphertext for each bucket, and obtain the matching degree blinded ciphertext and confusion response blinded ciphertext corresponding to the bucket.
[0384] It should be noted that, for each bucket, the process of determining the blinded ciphertext of the matching degree corresponding to the bucket can refer to the above steps S1021a~S1022a, and the repeated parts will not be repeated. Similarly, the process of determining the blinded ciphertext of the obfuscated response corresponding to the bucket can refer to the above steps S1021b~S1022b, and the repeated parts will not be repeated.
[0385] For example, the server performs the following steps based on the received query ciphertext:
[0386] For each bucket, the server can query the public key PK sent by the client. g Homomorphically calculate the values of the target Bloom filter and the target confusion Bloom filter to obtain 2*b ciphertexts Enc g (t i ) and Enc g (v i ), where i=0, 1, ..., b-1. Among them, t i That is, the matching degree plaintext corresponding to the i-th bucket, v i That is, the obfuscated response plaintext corresponding to the i-th bucket; correspondingly, Enc g (t i ) is the matching ciphertext corresponding to the i-th bucket, Enc g (v i ) is the obfuscated response ciphertext corresponding to the i-th bucket.
[0387] Then, the server blinds the ciphertext Enc corresponding to each bucket g (t i ), that is, add a random number r 0,i and r 1,i , so that the blinded ciphertext is Enc g (r 0,i ·(t i -k)+r 1,i ), that is, the blinded ciphertext of the matching degree corresponding to the i-th bucket, where r 1,i That is, the plaintext of the second blinded ciphertext corresponding to the i-th bucket, Enc g (r 1,i ) is the second blinded ciphertext corresponding to the i-th bucket, where i=0, 1,…, b-1.
[0388] And, blind the ciphertext Enc corresponding to each bucket g (v i ), that is, add a random number r i , so that the blinded ciphertext is Enc g (v i +r i ), that is, the obfuscated response blinded ciphertext corresponding to the i-th bucket, where r i That is, the plaintext of the first blinded ciphertext corresponding to the i-th bucket, where i=0, 1,…, b-1.
[0389] It should be noted here that the specific algorithm of homomorphic encryption is not limited in the embodiments of the present application, and may be a fully homomorphic encryption algorithm, a semi-homomorphic encryption algorithm, a homomorphic encryption algorithm based on the elliptic curve ElGamal, etc. Among them, fully homomorphic encryption allows any form of calculation to be performed on encrypted data, including addition, multiplication, and their combinations, and even more complex mathematical operations and logical operations, without decrypting the data. Semi-homomorphic encryption supports limited types of calculations on encrypted data, which may be only addition operations, or only multiplication operations, or a specific combination of simple functions. Among them, if a semi-homomorphic encryption algorithm is used in the embodiments of the present application, it is limited to the relevant steps of addition operations, or multiplication operations, or a specific combination of simple functions.
[0390] Optionally, this application supports the use of a homomorphic encryption algorithm based on the Ring Learning With Errors (RLWE) assumption to generate ciphertext. The random numbers r0, r1, r, r 0,i 、r 1,i 、r i , s and other random numbers can be found in the integer ring Select from the above, where p is the plaintext modulus, which is generally a prime number of about 50 bits. Then, when calculating the matching plaintext or the obfuscated response plaintext, the b homomorphic inner product operations can be quickly implemented using homomorphic matrix multiplication operations, which can effectively increase the calculation speed, reduce the calculation complexity, and improve the communication efficiency.
[0391] Then, the server can 1,i Construct the target annihilation polynomial Z(X)=∏ i (Xr 1,i ), where i=0, 1, ..., b-1, and then use the server's public key PK h Encrypt the coefficients of the target zeroing polynomial to obtain multiple coefficient ciphertexts Enc h (z j ), where z jIndicates the jth coefficient of Z(X). In the case of bucketing, the target annihilation polynomial takes a preset value at the plaintext of the second blinded ciphertext corresponding to each bucket, such as the preset value 0 here.
[0392] The following is a brief explanation of the 1,i Construct the target annihilation polynomial Z(X)=∏ i (Xr 1,i ) process: First determine the target point set, that is, the points at which you want the polynomial to take the value of 0. In the above scenario, it is mainly all r 1,i For each bucket, when the query identifier matches, the matching degree blinded plaintext is the corresponding r 1,i ; Then, based on the above point set, use Lagrange interpolation or Newton interpolation to construct a polynomial of the lowest degree so that the value of this polynomial is 0 at all selected points, and the target annihilation polynomial Z(X)=∏ can be obtained. i (Xr 1,i ).
[0393] Then, the server sends b ciphertext pairs (Enc g (r 0,i ·(t i -k)+r 1,i ), Enc g (v i +r i )), and the b+1 coefficient ciphertext Enc corresponding to the target annihilation polynomial Z(X) h (z j ) and the server's public key PK h Sent to the client together.
[0394] Note: When t i = k, the matching degree blinded ciphertext Enc g (r 0,i ·(t i -k)+r 1,i )=Enc g (r 1,i ), then the client decrypts and obtains r 1,i After the target zeroing polynomial Z(X) is homomorphically evaluated, the corresponding plaintext is zero. At this point, the server can decrypt to determine whether the query identifier matches.
[0395] It should be noted here that if the homomorphic encryption algorithm based on ElGamal is used, the client and server cannot obtain the real plaintext value after decryption. In this case, the original protocol needs to be slightly modified when constructing the polynomial. The modifications are as follows:
[0396] When constructing the target zeroing polynomial, the server needs to convert the random number r 1,iMap it into an element on the elliptic curve group and use the same hash function H to turn it into a random integer x 1,i , based on a random integer x 1,i To construct the target annihilation polynomial.
[0397] Similarly, when constructing the target interpolation polynomial, the server needs to use the random number r 1,i 、r i Map it into an element on the elliptic curve group and use the same hash function H to turn it into a random integer x 1,i 、x i , based on a random integer x 1,i 、x i To construct the target interpolation polynomial.
[0398] In the above bucketing case, the server sends multiple ciphertext pairs to the client. An optional implementation is that each bucket corresponds to a ciphertext pair consisting of a matching degree blinded ciphertext and an obfuscated response blinded ciphertext; thus, in step S102, the server needs to return to the client the matching degree blinded ciphertext and the obfuscated response blinded ciphertext corresponding to each bucket. Similarly, in step S52, the client will receive multiple ciphertext pairs returned by the server, and each ciphertext pair represents the matching degree blinded ciphertext and the obfuscated response blinded ciphertext corresponding to a bucket.
[0399] In the embodiment of the present application, in order to reduce the amount of calculation on the client side, the client may only decrypt the blinded ciphertext of the matching degree and the blinded ciphertext of the obfuscated response corresponding to the bucket where the query identifier may exist. An optional implementation is as follows:
[0400] Since bucketing divides the data set according to the identifiers in the data set, the client can also determine the corresponding bucket identifier according to the query identifier, and the bucket identifier is used to identify the bucket where the query identifier is located when the query identifier exists in the data set. The client can determine the corresponding bucket identifier based on the above bucketing function, which will not be repeated here.
[0401] Furthermore, when the client decrypts the blinded matching degree ciphertext and the obfuscated response ciphertext, it can directly decrypt the ciphertext pair corresponding to the bucket identifier to obtain the blinded matching degree plaintext and the blinded obfuscated response plaintext corresponding to the bucket identifier.
[0402] For example, after the client receives b ciphertext pairs and b+1 coefficient ciphertexts, it uses the bucket identifier Select the 2τth and 2τ+1th ciphertexts from the first 2*b ciphertexts (i.e., select the τth ciphertext pair), and use the querying party's private key sk g Decrypt and get and ,here That is, the blinded plaintext of the matching degree corresponding to the bucket identifier. That is, the obfuscated response blinded plaintext corresponding to the bucket identifier (used for the subsequent restoration process of the obfuscated response blinded ciphertext). Here, the value of τ is one of 0, 1, ..., b-1.
[0403] Furthermore, after decrypting the τth ciphertext pair, the client can homomorphically calculate the matching result ciphertext used to verify whether the query identifier matches based on the b+1 coefficient ciphertext, that is, the coefficient ciphertext of the target annihilation polynomial. The specific calculation process is the same as the specific embodiment without bucketing mentioned above, and will not be repeated here. Then the client sends the matching result ciphertext to the server, so that the server can feedback the first blinded ciphertext corresponding to the bucket identifier when the query identifier matches, so as to restore the obfuscated response blinded ciphertext corresponding to the bucket identifier.
[0404] It should be noted here that if the homomorphic encryption algorithm based on ElGamal is used, the client and server cannot obtain the real plaintext value after decryption. In this case, when the client decrypts the ciphertext pair, the original protocol needs to be slightly modified. The modifications are as follows:
[0405] When the client decrypts the τth ciphertext pair, it obtains and is an element of the elliptic curve group, not an integer, because It is a random number, which can be converted into an integer through the hash function H , to perform subsequent homomorphic polynomial computations.
[0406] In the above implementation, by mapping the query identifier to a specific bucket, it is ensured that the query request can be directed to the bucket containing the corresponding identifier or a group of related buckets, which can limit the query scope, reduce unnecessary data access, and improve efficiency. At the same time, this method helps to disperse the query pressure and avoid the performance bottleneck caused by centralized access.
[0407] In the embodiment of the present application, in order to prevent the server from inferring the matching degree plaintext t or part of the bucket identifier τ by decrypting the value of Z(X), the client can further enhance privacy protection in the following manner. An optional implementation is as follows:
[0408] Before sending the matching result ciphertext generated based on the blinded ciphertext of the matching degree to the server, the client also performs blinding processing on the matching result ciphertext.
[0409] For example, based on the random number s, the client performs homomorphic multiplication on the plaintext of the matching result Blindness, get , then based on the query party's public key PK g right Encrypt to obtain the blinded matching result ciphertext Alternatively, the client uses the ciphertext Enc corresponding to the random number s h (s), directly match the result ciphertext through homomorphic multiplication Blind the matching result and generate the blinded ciphertext. .
[0410] It should be noted that when the preset value is 0, the matching result ciphertext is ciphered by homomorphic multiplication. Blind, if not blinded, the plaintext corresponding to the matching result ciphertext If it is 0, when blinding, the plaintext corresponding to the blinded matching result ciphertext is also 0, and the blinding process does not affect the determination of whether the query identifier matches.
[0411] In this way, the client sends the blinded matching result ciphertext to the server. After receiving the data, the server uses the server's private key sk h Decryption , if the corresponding plaintext If it is 0, it is determined that the query identifier matches. Otherwise, it is determined that the query identifier does not match.
[0412] In the above implementation, by further randomly blinding the matching result ciphertext, the server can avoid inferring part of the matching degree plaintext t or bucket identifier τ by decrypting the value of the target annihilation polynomial, which can further enhance privacy protection.
[0413] It should be noted here that if the ElGamal-based homomorphic encryption algorithm is used in the above process, then the server can only obtain whether the plaintext is zero (if non-zero, it is a random element on the elliptic curve group) by decrypting the matching result ciphertext (or the blinded matching result ciphertext).
[0414] Subsequently, in step S103, when the server determines that there is an identifier matching the query identifier in the data set based on the matching result ciphertext (or the blinded matching result ciphertext) sent by the client, it is necessary to send the first blinded ciphertext used for blinding processing to obtain the obfuscated response blinded ciphertext to the client, so that the client can restore the query data based on this.
[0415] When the data set is bucketed, each bucket corresponds to a set of matching degree blinded ciphertexts and obfuscation response blinded ciphertexts (referred to as a ciphertext pair for short). Each matching degree blinded ciphertext is obtained by blinding a second blinded ciphertext, and each obfuscation response blinded ciphertext is obtained by blinding a first blinded ciphertext. Therefore, each bucket corresponds to a set of first blinded ciphertexts and second blinded ciphertexts. The server needs to determine the first blinded ciphertext corresponding to the bucket identifier from multiple first blinded ciphertexts and send it to the client.
[0416] Since the server only needs to know whether the query identifier matches and does not need to know the bucket identifier, in order to further improve the privacy of the data, the client can perform the following operations so that the server can correctly feedback the first blinded ciphertext corresponding to the bucket identifier without knowing the bucket identifier. An optional implementation is as follows:
[0417] In addition to sending the matching result ciphertext generated based on the matching blinded ciphertext to the server, the client also needs to perform the following operations to send multiple power matching blinded ciphertexts to the server. The specific process is as follows:
[0418] First, multiple different powers of the matching degree blinded plaintext are homomorphically encrypted to obtain multiple corresponding power matching degree blinded ciphertexts; then, the multiple power matching degree blinded ciphertexts are sent to the server, so that the server determines the first blinded ciphertext corresponding to the bucket identifier based on the multiple power matching degree blinded ciphertexts. The multiple different powers are determined according to the number of buckets. In the case of buckets, the matching degree blinded plaintext is obtained by decrypting the matching degree blinded ciphertext in the ciphertext pair corresponding to the bucket identifier, and the details are shown in the above embodiment.
[0419] Referring to the calculation rules of homomorphic polynomials mentioned in the homomorphic encryption above, in the embodiment of the present application, the multiple different powers specifically refer to powers that can be determined according to the number of buckets. For example, if there are b buckets, the multiple different powers refer to powers from 0 to b, that is, the powers from 0 to b of the blinded plaintext of the matching degree corresponding to the bucket identifier are homomorphically encrypted to obtain b+1 power matching degree blinded ciphertexts. In this way, the client can send the matching result ciphertext (or the blinded matching result ciphertext) and the b+1 power matching degree blinded ciphertext to the server in step S53.
[0420] For example, the blinded plaintext of the matching degree is written as , client-side encryption The power of can be obtained , which is the power matching blinded ciphertext mentioned in this article, where j = 0, 1, ..., b, a total of b + 1; finally, the client will blind the matching result ciphertext and b+1 power matching blinded ciphertext Sent to the server, a total of 2+b ciphertexts.
[0421] In the above implementation, the client The power of is encrypted and sent to the server, providing the data required for verification without revealing the specific bucket index or identity information. This encryption operation ensures that even if the communication is intercepted, the attacker cannot directly parse out the sensitive information. In this process, the client not only participates in the matching verification, but also prepares for the subsequent determination of the first blinded ciphertext corresponding to the specific bucket identifier. This is a functional implementation without exposing the specific information in the bucket, maintaining the privacy of the data, and ensuring that the required information is gradually revealed only when necessary.
[0422] Correspondingly, before executing step S103, the server will also perform the following operations:
[0423] The server receives the matching result ciphertext sent by the client, as well as multiple power matching degree blinded ciphertexts; wherein the multiple power matching degree blinded ciphertexts are obtained by homomorphically encrypting multiple different powers of the matching degree blinded plaintext corresponding to the bucket identifier, and the multiple different powers are determined according to the number of buckets; the bucket identifier is used to identify: when the query identifier exists in the data set, the bucket where the query identifier is located, please refer to the above embodiment for details, and the repeated parts will not be repeated.
[0424] In an embodiment of the present application, after the server determines that the query identifier matches based on the matching result ciphertext (or the blinded matching result ciphertext), it can perform homomorphic polynomial calculation based on these multiple power matching degree blinded ciphertexts to determine the first blinded ciphertext corresponding to the bucket identifier.
[0425] Specifically, after receiving multiple power matching degree blinded ciphertexts sent by the client, the server can determine a first blinded ciphertext corresponding to the bucket identifier from a group of first blinded ciphertexts and second blinded ciphertexts corresponding to each bucket determined during the blinding process in the previous step S102, so as to send the first blinded ciphertext corresponding to the bucket identifier to the client, so that the client uses the first blinded ciphertext to restore the obfuscated response blinded ciphertext corresponding to the bucket identifier. The specific implementation method of restoration is the same as above and will not be repeated here; wherein, the first blinded ciphertext corresponding to the bucket identifier is determined in the following manner:
[0426] First, the server needs to construct a target interpolation polynomial so that the value of the target polynomial at each plaintext corresponding to the second blinded ciphertext is the plaintext corresponding to the first blinded ciphertext under the corresponding bucket identifier;
[0427] Furthermore, according to the multiple power matching degree blinded ciphertexts, the second value of the target interpolation polynomial at the matching degree blinded ciphertext corresponding to the bucket identifier is homomorphically calculated; finally, the second value is used as the first blinded ciphertext corresponding to the bucket identifier.
[0428] For example, the plaintext corresponding to the first blinded ciphertext is called the first blinded plaintext, that is, the random number r used to blind the matching plaintext 1,i , the plaintext corresponding to the second blinded ciphertext is called the second blinded plaintext, that is, the random number r used to blind the obfuscated response plaintext i The server can use the above-mentioned related methods of constructing the target zeroing polynomial, or other methods, to construct the target interpolation polynomial P(X), so that P(r 1,i )=r i Specifically, when constructing, we can first determine the target point set, that is, the points at which we want the polynomial to take the values. Then, based on the above point set, we use Lagrange interpolation or Newton interpolation to construct a polynomial of the lowest degree, so that this polynomial is valid at all selected points r. 1,i The upper value is the corresponding r i , we can get the target difference polynomial P(X).
[0429] Since the target interpolation polynomial P(X) is a polynomial in the plaintext domain, the client needs to The power of encryption can be used to homomorphically calculate P(X) The value at , when the query identifier matches, , .
[0430] Therefore, the server receives b+1 power matching blinded ciphertexts. Then, referring to the above homomorphic polynomial calculation rules, P(X) is homomorphically calculated in the ciphertext domain. The value obtained is the second value in this article, that is, the first blinded ciphertext corresponding to the bucket identifier, and the ciphertext is sent to the client; otherwise, the protocol is terminated.
[0431] In this way, when the server determines that the query identifier matches, in step S103, when the first blinded ciphertext used for blinding processing to obtain the obfuscated response blinded ciphertext is sent to the client, it specifically means that the server sends the first blinded ciphertext corresponding to the bucket identifier determined above to the client, so that the client can restore the obfuscated response ciphertext corresponding to the bucket identifier previously received according to the first blinded ciphertext. Specifically: in the above process, the client has decrypted the ciphertext pair corresponding to the bucket identifier and obtained the obfuscated response plaintext corresponding to the bucket identifier. On this basis, the obfuscated response plaintext corresponding to the bucket identifier is restored directly based on the plaintext of the first blinded ciphertext corresponding to the bucket identifier to obtain the query data corresponding to the query identifier.
[0432] For example, after receiving the first blinded ciphertext, the client uses the query party's private key sk g Decryption can be obtained , and then calculate v * -r τ , in this case, the result is the query data that matches the query identifier; otherwise, it means that the query identifier does not match and the protocol is terminated.
[0433] It should be noted here that if the homomorphic encryption algorithm based on ElGamal is used in the above process, then the client will obtain the point on the elliptic curve group instead of r after decryption in this step. τ , according to the previous The corresponding point and r τ The corresponding point r τ G, execute v * ·Gr τ ·G=(v * -r τ )·G, using brute force attack to determine the true value v * -r τ , where G is the base point on the elliptic curve group, and the corresponding relationship is , decryption requires x not to exceed 32 bits.
[0434] In the above implementation, the server receives and decrypts the matching result ciphertext to verify whether the query identifier matches. This process ensures that subsequent operations are continued only when the match is successful, effectively preventing unauthorized access. Even if the server is the verifier, it does not directly understand the specific details of the match unless the verification is successful.
[0435] When the verification is successful, the server constructs the target interpolation polynomial and uses the homomorphic computing feature to Calculate the corresponding first blinded ciphertext under the condition of r τ The secure transmission of data in the bucket maintains the privacy of other users' data.
[0436] In addition, if the verification fails, the server immediately terminates the protocol, avoiding unnecessary information leakage or further calculations, which is an effective privacy protection measure.
[0437] It should be noted that under the random oracle model, based on the semantic security of the homomorphic encryption algorithm, when the client and the server honestly abide by the protocol, the protocol is secure, that is, under the semi-honest model, the interactive content is a random number, and the decrypted content of each is also a random number. The client cannot obtain other information (including other identifiers and other data of the server) except the query data corresponding to the matching query identifier; the server cannot obtain the query identifier information of the client except whether the query identifier matches, which not only protects the query identifier from being leaked, but also allows the server to obtain whether the query identifier matches.
[0438] In summary, the solution proposed in this application not only makes the computational complexity linearly related to n, but also reduces the communication complexity to ,here It is related to the number of buckets b and the Bloom filter parameters m and k.
[0439] The following is a brief description of the interaction sequence between the client and the server in the bucketing case:
[0440] See also Fig.14 As shown in FIG. 1 , it is a sequence diagram of the interaction between the client and the server in a bucketing situation. The specific implementation process of this method is as follows:
[0441] S1401: The client calculates the bucket identifier corresponding to the query identifier according to the bucketing function.
[0442] S1402: The server maps each bucket to a target Bloom filter and a target confused Bloom filter according to preset Bloom filter parameters.
[0443] S1403: The client maps the query identifier into a bit array according to the preset Bloom filter parameters and encrypts it to obtain a corresponding query ciphertext.
[0444] S1404: The client sends the query ciphertext to the server.
[0445] S1405: For each bucket, the server performs homomorphic calculations on the target Bloom filter and the target confusion Bloom filter of the bucket according to the query ciphertext, generates a matching degree ciphertext and a confusion response ciphertext, and blinds the ciphertexts to obtain a matching degree blinded ciphertext and a confusion response blinded ciphertext.
[0446] S1406: The server constructs a target annihilation polynomial and encrypts its coefficients to obtain multiple coefficient ciphertexts;
[0447] S1407: The server sends the matching degree blinded ciphertext and obfuscated response blinded ciphertext corresponding to each bucket, as well as multiple coefficient ciphertexts to the client.
[0448] S1408: The client decrypts the matching degree blinded ciphertext and the obfuscated response blinded ciphertext of the selected bucket corresponding to the bucket identifier according to the bucket identifier, and obtains the matching degree blinded plaintext and the obfuscated response blinded plaintext of the selected bucket.
[0449] S1409: The client constructs a target annihilation polynomial after coefficient encryption according to multiple coefficient ciphertexts, homomorphically calculates a first value of the target annihilation polynomial after coefficient encryption at a matching degree blinded plaintext, and blinds the first value to obtain a blinded matching result ciphertext.
[0450] S1409: The client performs homomorphic encryption on multiple different powers of the matching degree blinded plaintext to obtain corresponding multiple power matching degree blinded ciphertexts.
[0451] S1410: The client sends the blinded matching result ciphertext and multiple power matching degree blinded ciphertexts to the server.
[0452] S1411: The server determines that the query identifier matches by decrypting the blinded matching result ciphertext.
[0453] S1412: The server constructs a target interpolation polynomial, and homomorphically calculates a second value of the target interpolation polynomial at the matching degree blinded ciphertext corresponding to the bucket identifier based on multiple power matching degree blinded ciphertexts, and uses the second value as the first blinded ciphertext of the obfuscated response ciphertext corresponding to the bucket identifier.
[0454] S1413: The server sends the determined first blinded ciphertext to the client.
[0455] S1414: The client decrypts and obtains a first blinded plaintext corresponding to the first blinded ciphertext, and deblinds the obfuscated response blinded plaintext according to the first blinded plaintext to obtain query data.
[0456] In S1411, if the server determines that the query identifier does not match by decrypting the blinded matching result ciphertext, the protocol can be terminated.
[0457] It should be noted that the interaction sequence listed above is just a simple example, and other interaction sequences are also applicable to the embodiments of the present application. For example, the client can also calculate the bucket identifier corresponding to the query identifier according to the bucketing function when blinding the matching degree ciphertext and the obfuscated response ciphertext, so as to decrypt the blinded matching degree ciphertext and the obfuscated response ciphertext of the selected bucket, etc. The specific implementation method of each step can be referred to the above embodiment, and the repeated parts will not be repeated.
[0458] In summary, each of the above steps in the online phase is designed to enhance privacy protection, ensure data security, and achieve effective query. This series of steps ensures that query matching is completed without directly revealing the query identifier or database content, and uses advanced encryption methods such as homomorphic encryption, blinding technology, and polynomial interpolation to enhance privacy protection. The design of the entire online phase is a carefully choreographed privacy protection process, and each step is committed to maximizing the privacy of user queries and database content without sacrificing efficiency. This design not only meets functional requirements, but also meets the high standards for privacy protection in modern data processing.
[0459] Based on the same inventive concept, the present application also provides a data anonymity query device. Fig.15As shown, it is a structural diagram of a data anonymity query device 1500, which may include:
[0460] The first communication unit 1501 is used to send the query ciphertext generated after mapping the query identifier according to the preset Bloom filter parameter to the server; the server stores a data set consisting of multiple identifiers and corresponding data;
[0461] The second communication unit 1502 is used to receive the matching degree blinded ciphertext and the obfuscated response blinded ciphertext returned by the server; the matching degree blinded ciphertext is used to characterize: the matching degree between the query identifier and the identifier in the data set, and the obfuscated response blinded ciphertext is related to the query data corresponding to the query identifier; the matching degree blinded ciphertext and the obfuscated response blinded ciphertext are obtained by performing homomorphic calculation and blinding processing on the target Bloom filter and the target obfuscated Bloom filter based on the query ciphertext; the target Bloom filter and the target obfuscated Bloom filter are obtained by mapping the data set based on the Bloom filter parameters;
[0462] The third communication unit 1503 is used to send the matching result ciphertext generated based on the matching degree blinded ciphertext to the server; the matching result ciphertext is used to determine whether there is an identifier matching the query identifier in the data set;
[0463] The fourth communication unit 1504 is used to restore the obfuscated response blinded ciphertext to obtain the query data according to the first blinded ciphertext returned by the server after determining that the query identifier matches.
[0464] Optionally, the second communication unit 1502 is further configured to:
[0465] Receive multiple coefficient ciphertexts returned by the server; wherein the multiple coefficient ciphertexts are obtained by homomorphically encrypting the coefficients of the target annihilation polynomial, the value of the target annihilation polynomial at the plaintext corresponding to the second blinded ciphertext is a preset value, and the second blinded ciphertext is used for blinding processing to obtain the matching degree blinded ciphertext; the multiple coefficient ciphertexts are used to generate the matching result ciphertext.
[0466] Optionally, the matching degree blinded ciphertext is a matching degree blinded ciphertext; before sending the matching result ciphertext generated based on the matching degree blinded ciphertext to the server, the third communication unit 1503 is further used to:
[0467] Decrypting the matching degree blinded ciphertext to obtain matching degree blinded plaintext;
[0468] Constructing a target annihilation polynomial after coefficient encryption according to the plurality of coefficient ciphertexts;
[0469] Homomorphically calculating the target annihilation polynomial after the coefficients are encrypted, and taking a first value at the matching degree blinded plaintext; wherein, when the query identifier matches, the matching degree blinded ciphertext is the second blinded ciphertext, and the plaintext corresponding to the first value is the preset value;
[0470] The first value is used as the matching result ciphertext.
[0471] Optionally, the plaintext corresponding to the first blinded ciphertext is: a random number used for blinding processing to obtain the obfuscated response blinded ciphertext;
[0472] Before the fourth communication unit 1504 restores the obfuscated response blinded ciphertext to obtain the query data according to the first blinded ciphertext returned by the server, the second communication unit 1502 is further used to:
[0473] Decrypting the obfuscated response blinded ciphertext to obtain the obfuscated response blinded plaintext;
[0474] The fourth communication unit 1504 is specifically used for:
[0475] Based on the plaintext corresponding to the first blinded ciphertext, the obfuscated response blinded plaintext is unblinded to obtain the query data.
[0476] Optionally, if the data set includes multiple buckets, each bucket is used to store a partial identifier and corresponding data, and the target Bloom filter and the target confusion Bloom filter corresponding to each bucket are obtained based on the corresponding bucket mapping, then each bucket corresponds to a ciphertext pair consisting of a matching degree blinded ciphertext and a confusion response blinded ciphertext;
[0477] The second communication unit 1502 is specifically configured to:
[0478] Receiving multiple ciphertext pairs returned by the server;
[0479] Decrypting the matching degree blinded ciphertext to obtain matching degree blinded plaintext includes:
[0480] The ciphertext pair corresponding to the bucket identifier is decrypted to obtain the matching degree blinded plaintext and the obfuscated response blinded plaintext; wherein the bucket identifier is used to identify: when the query identifier exists in the data set, the bucket where the query identifier is located; when the query identifier matches, the obfuscated response blinded plaintext is deblinded to obtain the query data.
[0481] Optionally, the third communication unit 1503 is further used for:
[0482] Homomorphically encrypt multiple different powers of the matching degree blinded plaintext to obtain corresponding multiple power matching degree blinded ciphertexts; the multiple different powers are determined according to the number of buckets;
[0483] The multiple power matching degree blinded ciphertexts are sent to the server, so that the server determines a first blinded ciphertext corresponding to the bucket identifier according to the multiple power matching degree blinded ciphertexts.
[0484] Optionally, before sending the matching result ciphertext generated based on the matching degree blinded ciphertext to the server, the third communication unit 1503 is further used to:
[0485] The matching result ciphertext is blinded.
[0486] Optionally, the Bloom filter parameters include: k hash functions, and the lengths m of the target Bloom filter and the target confused Bloom filter; the k is less than the m; and the first communication unit 1501 is further used to generate the query ciphertext in the following manner:
[0487] Mapping the query identifiers respectively through the k hash functions to obtain k hash values;
[0488] Based on the k hash values, generate an m-bit array;
[0489] The m query ciphertexts obtained by homomorphically encrypting the bit array are used as the query ciphertexts.
[0490] Based on the same inventive concept, the present application embodiment also provides another data anonymity query device. Fig.16 As shown, it is a schematic diagram of the structure of the data anonymity query device 1600, which may include:
[0491] The first transmission unit 1601 is used to receive a query ciphertext sent by a client, where the query ciphertext is generated by mapping the query identifier according to a preset Bloom filter parameter;
[0492] The second transmission unit 1602 is used to perform homomorphic calculation and blinding processing on the target Bloom filter and the target confused Bloom filter according to the query ciphertext, to obtain a blinded ciphertext of matching degree representing the matching degree between the query identifier and the identifier in the data set in the Bloom space, and a blinded ciphertext of confused response related to the query data corresponding to the query identifier, and send them to the client; the target Bloom filter and the target confused Bloom filter are obtained by mapping the data set based on the Bloom filtering parameters, and the data set consists of multiple identifiers and corresponding data;
[0493] The third transmission unit 1603 is used to determine that there is an identifier matching the query identifier in the data set according to the matching result ciphertext generated based on the matching degree blinded ciphertext sent by the client, and then send the first blinded ciphertext used for blinding processing to obtain the obfuscated response blinded ciphertext to the client, so that the client can restore the obfuscated response blinded ciphertext to obtain the query data according to the first blinded ciphertext.
[0494] Optionally, the Bloom filter parameters include: k hash functions, and the lengths m of the target Bloom filter and the target confusion Bloom filter, and correspondingly, there are m query ciphertexts;
[0495] The second transmission unit 1602 is specifically configured to:
[0496] After multiplying the plaintext corresponding to each query ciphertext in the m query ciphertexts with the element at the corresponding position in the target Bloom filter, encrypting the sum of the obtained products to obtain a matching degree ciphertext;
[0497] Based on the second blinded ciphertext, the matching degree ciphertext is blinded to obtain the matching degree blinded ciphertext; wherein, when the matching degree plaintext corresponding to the matching degree ciphertext is k, the matching degree blinded ciphertext is the second blinded ciphertext; when the query identifier matches, the matching degree plaintext is k, otherwise, the matching degree plaintext is less than k.
[0498] Optionally, the lengths of the target Bloom filter and the target confusion Bloom filter are m, and correspondingly, there are m query ciphertexts;
[0499] The second transmission unit 1602 is specifically configured to:
[0500] After multiplying the plaintext corresponding to each query ciphertext in the m query ciphertexts with the element at the corresponding position in the target obfuscated Bloom filter, the sum of the obtained products is encrypted to obtain an obfuscated response ciphertext;
[0501] Based on the first blinded ciphertext, the obfuscated response ciphertext is blinded to obtain the obfuscated response blinded ciphertext; wherein, when the query identifier matches, the obfuscated response plaintext corresponding to the obfuscated response ciphertext is the query data, otherwise, the obfuscated response plaintext is a random number.
[0502] Optionally, before the third transmission unit 1603 determines, according to the matching result ciphertext sent by the client and generated based on the matching degree blinded ciphertext, that there is an identifier matching the query identifier in the data set, the second transmission unit 1602 is further configured to:
[0503] Constructing a target annihilation polynomial, wherein a value of the target annihilation polynomial at the plaintext corresponding to the second blinded ciphertext is a preset value;
[0504] Performing homomorphic encryption on each coefficient of the target annihilation polynomial to obtain a plurality of coefficient ciphertexts;
[0505] The multiple coefficient ciphertexts are sent to the client, so that the client generates the matching result ciphertext according to the multiple coefficient ciphertexts and the matching degree blinded ciphertext.
[0506] Optionally, the third transmission unit 1603 is specifically configured to:
[0507] Decrypting the matching result ciphertext to obtain the matching result plaintext;
[0508] If the plain text of the matching result is a preset value, it is determined that there is an identifier matching the query identifier in the data set.
[0509] Optionally, if the data set includes multiple buckets, each bucket is used to store a partial identifier and corresponding data, and the target Bloom filter and the target confusion Bloom filter corresponding to each bucket are obtained based on the corresponding bucket mapping, then each bucket corresponds to a ciphertext pair consisting of a matching degree blinded ciphertext and a confusion response blinded ciphertext;
[0510] Before determining that there is an identifier matching the query identifier in the data set according to the matching result ciphertext generated based on the matching degree blinded ciphertext sent by the client, the third transmission unit 1603 is further used to:
[0511] Receive multiple power matching degree blinded ciphertexts sent by the client; wherein the multiple power matching degree blinded ciphertexts are obtained by homomorphically encrypting multiple different powers of the matching degree blinded plaintext, and the multiple different powers are determined according to the number of buckets; the matching degree blinded plaintext is obtained by decrypting the matching degree blinded ciphertext in the ciphertext pair corresponding to the bucket identifier; the bucket identifier is used to identify: when the query identifier exists in the data set, the bucket where the query identifier is located; the multiple power matching degree blinded ciphertexts are used to determine the first blinded ciphertext corresponding to the bucket identifier.
[0512] Optionally, each bucket corresponds to a group of first blinded ciphertexts and second blinded ciphertexts, and the second blinded ciphertexts are used for blinding processing to obtain the matching degree blinded ciphertexts; the third transmission unit 1603 is specifically used to:
[0513] Sending the first blinded ciphertext corresponding to the bucket identifier to the client; wherein the first blinded ciphertext corresponding to the bucket identifier is determined in the following manner:
[0514] Constructing a target interpolation polynomial, wherein the value of the target polynomial at each plaintext corresponding to the second blinded ciphertext is the plaintext corresponding to the first blinded ciphertext under the corresponding bucket identifier;
[0515] Homomorphically calculating a second value of the target interpolation polynomial at the matching degree blinded ciphertext corresponding to the bucket identifier according to the multiple power matching degree blinded ciphertexts;
[0516] The second value is used as the first blinded ciphertext corresponding to the bucket identifier.
[0517] The embodiment of the present application utilizes Bloom filters and obfuscated Bloom filters, combined with a homomorphic encryption algorithm, to construct an online hidden query method. Based on this method, the client and the server communicate via ciphertext, thereby ensuring the security of communication, protecting both the query identifier of the client and the database information of the server. At the same time, the client does not directly encrypt the query identifier and send it to the server, and the server does not directly encrypt the corresponding query data and send it to the client. Instead, the query identifier is mapped and then encrypted using Bloom filters and obfuscated Bloom filters. After receiving the query identifier, the server performs homomorphic calculations to obtain a blinded ciphertext representing the degree of match between the query identifier and the identifier in the data set stored by the server, as well as a blinded ciphertext of the obfuscated response related to the query data corresponding to the query identifier.
[0518] In the case of query identifier matching, the obfuscated response blinded ciphertext physically associates the query identifier with the data items that may correspond to the data set, but due to the addition of obfuscation steps and blinding processing, direct decryption cannot immediately reveal which specific data or its exact content. In this way, after the subsequent server determines that the query identifier matches based on the matching result ciphertext fed back by the client, it will then feed back to the client the first blinded ciphertext used for blinding processing to generate the obfuscated response blinded ciphertext. The client can restore the obfuscated response ciphertext based on the ciphertext to obtain the corresponding query data, solving the problem of the server knowing whether the query identifier matches without leaking it to the server, while reducing the computational / communication complexity. At this time, the client does not need to synchronize the information of whether the query identifier matches to the server, thereby avoiding the risk of the client doing evil and causing economic losses to the server. While maintaining the security of hidden queries, the hidden query of data is efficiently and accurately realized, improving the risk resistance of the server.
[0519] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing this application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.
[0520] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0521] After introducing the data anonymity query method and device according to an exemplary embodiment of the present application, next, an electronic device according to another exemplary embodiment of the present application is introduced.
[0522] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.
[0523] Based on the same inventive concept as the above method embodiment, an electronic device is also provided in the embodiment of the present application. In one embodiment, the electronic device may be a server, such as Figure 3 In this embodiment, the structure of the electronic device can be as follows: Fig.17 As shown, it includes a memory 1701 , a communication module 1703 and one or more processors 1702 .
[0524] The memory 1701 is used to store computer programs executed by the processor 1702. The memory 1701 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0525] The memory 1701 may be a volatile memory, such as a random-access memory (RAM); the memory 1701 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 1701 may be any other medium that can be used to carry or store a desired computer program in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 1701 may be a combination of the above memories.
[0526] The processor 1702 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 1702 is used to implement the above data anonymity query method when calling the computer program stored in the memory 1701 .
[0527] The communication module 1703 is used to communicate with terminal devices and other servers.
[0528] The specific connection medium between the memory 1701, the communication module 1703 and the processor 1702 is not limited in the embodiment of the present application. Fig.17 In the embodiment, the memory 1701 and the processor 1702 are connected via a bus 1704. The bus 1704 is connected to the processor 1702 via a bus 1704. Fig.17 The connections between the other components are described with bold lines, which are only for illustration and are not intended to be limiting. The bus 1704 can be divided into an address bus, a data bus, a control bus, etc. For ease of description, Fig.17 The diagram shows that only one thick line is used, but this does not mean that there is only one bus or only one type of bus.
[0529] The memory 1701 stores a computer storage medium, and the computer storage medium stores computer executable instructions, and the computer executable instructions are used to implement the data anonymity query method of the embodiment of the present application. The processor 1702 is used to execute the above-mentioned data anonymity query method, such as Fig.10 shown.
[0530] In another embodiment, the electronic device may also be other electronic devices, such as Figure 3 The terminal device 310 is shown in FIG. In this embodiment, the structure of the electronic device can be as follows: Fig.18As shown, it includes: a communication component 1810, a memory 1820, a display unit 1830, a camera 1840, a sensor 1850, an audio circuit 1860, a Bluetooth module 1870, a processor 1880 and other components.
[0531] The communication component 1810 is used to communicate with the server. In some embodiments, a wireless fidelity (WiFi) module may be included. The WiFi module belongs to a short-range wireless transmission technology. The electronic device can help the user to send and receive information through the WiFi module.
[0532] The memory 1820 can be used to store software programs and data. The processor 1880 executes various functions and data processing of the terminal device 310 by running the software programs or data stored in the memory 1820. The memory 1820 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. The memory 1820 stores an operating system that enables the terminal device 310 to run. In the present application, the memory 1820 can store an operating system and various application programs, and can also store a computer program for executing the data anonymity query method of the embodiment of the present application.
[0533] The display unit 1830 can also be used to display information input by the user or information provided to the user and a graphical user interface (GUI) of various menus of the terminal device 310. Specifically, the display unit 1830 may include a display screen 1832 disposed on the front of the terminal device 310. The display screen 1832 may be configured in the form of a liquid crystal display, a light emitting diode, etc. The display unit 1830 may be used to display the user interface of the hidden query related client in the embodiment of the present application, etc.
[0534] The display unit 1830 can also be used to receive input digital or character information and generate signal input related to user settings and function control of the terminal device 310. Specifically, the display unit 1830 may include a touch screen 1831 arranged on the front of the terminal device 310, which can collect user touch operations on or near it, such as clicking a button, dragging a scroll box, etc.
[0535] The touch screen 1831 can be covered on the display screen 1832, or the touch screen 1831 and the display screen 1832 can be integrated to realize the input and output functions of the terminal device 310, and the integrated touch screen can be referred to as a touch display screen. In this application, the display unit 1830 can display the application and the corresponding operation steps.
[0536] The camera 1840 can be used to capture still images, and the user can publish the images taken by the camera 1840 through the application. The camera 1840 can be one or more. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the processor 1880 to convert it into a digital image signal.
[0537] The terminal device may further include at least one sensor 1850, such as an acceleration sensor 1851, a distance sensor 1852, a fingerprint sensor 1853, and a temperature sensor 1854. The terminal device may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, and a motion sensor.
[0538] The audio circuit 1860, the speaker 1861, and the microphone 1862 can provide an audio interface between the user and the terminal device 310. The audio circuit 1860 can transmit the electrical signal converted from the received audio data to the speaker 1861, which is converted into a sound signal for output. The terminal device 310 can also be configured with a volume button for adjusting the volume of the sound signal. On the other hand, the microphone 1862 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1860 and converted into audio data, and then the audio data is output to the communication component 1810 to be sent to, for example, another terminal device 310, or the audio data is output to the memory 1820 for further processing.
[0539] The Bluetooth module 1870 is used to exchange information with other Bluetooth devices having Bluetooth modules through the Bluetooth protocol. For example, the terminal device can establish a Bluetooth connection with a wearable electronic device (such as a smart watch) that also has a Bluetooth module through the Bluetooth module 1870 to exchange data.
[0540] The processor 1880 is the control center of the terminal device. It uses various interfaces and lines to connect various parts of the entire terminal. It executes various functions of the terminal device and processes data by running or executing software programs stored in the memory 1820 and calling data stored in the memory 1820. In some embodiments, the processor 1880 may include one or more processing units; the processor 1880 may also integrate an application processor and a baseband processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the baseband processor mainly processes wireless communications. It is understandable that the above-mentioned baseband processor may not be integrated into the processor 1880. In the present application, the processor 1880 can run the operating system, application programs, user interface display and touch response, as well as the data anonymity query method of the embodiment of the present application. In addition, the processor 1880 is coupled to the display unit 1830.
[0541] In some possible implementations, various aspects of the data anonymity query method provided by the present application may also be implemented in the form of a program product, which includes a computer program. When the program product is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of the data anonymity query method according to various exemplary implementations of the present application described above in this specification. For example, the electronic device may execute the following steps: Figure 5 or Fig.10 Follow the steps shown in .
[0542] The program product may adopt any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable 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 thereof.
[0543] The program product of the embodiment of the present application may adopt a portable compact disk read-only memory (CD-ROM) and include a computer program, and can be run on an electronic device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which can be used by or in combination with a command execution system, apparatus, or device.
[0544] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with a command execution system, apparatus, or device.
[0545] The computer program embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0546] The computer program for performing the operation of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also conventional procedural programming languages such as "C" language or similar programming languages. The computer program can be executed entirely on the user electronic device, partially on the user electronic device, as an independent software package, partially on the user electronic device and partially on the remote electronic device, or completely on the remote electronic device or server. In the case of involving a remote electronic device, the remote electronic device can be connected to the user electronic device through any type of network including a local area network (LAN) or a wide area network (WAN), or can be connected to an external electronic device (e.g., using an Internet service provider to connect through the Internet).
[0547] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
[0548] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0549] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain a computer-usable computer program.
[0550] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program commands. These computer program commands can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the commands executed by the processor of the computer or other programmable data processing device generate commands for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0551] These computer program commands may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the commands stored in the computer readable memory produce an article of manufacture comprising a command device, the command device implementing the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0552] These computer program commands can also be loaded onto a computer or other programmable data processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the commands executed on the computer or other programmable device provide the instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0553] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0554] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A data anonymity query method, characterized in that: The method comprises: After mapping the query identifier according to the preset Bloom filter parameters, the generated query ciphertext is sent to the server; the server stores a data set consisting of multiple identifiers and corresponding data; Receive the blinded matching degree ciphertext and the blinded obfuscated response ciphertext returned by the server; the blinded matching degree ciphertext is obtained by blinding the matching degree ciphertext obtained by homomorphically calculating the target Bloom filter according to the query ciphertext; the blinded obfuscated response ciphertext is obtained by blinding the obfuscated response ciphertext obtained by homomorphically calculating the target obfuscated Bloom filter according to the query ciphertext; the target Bloom filter and the target obfuscated Bloom filter are obtained by mapping the data set based on the Bloom filter parameters; if there is an identifier matching the query identifier in the data set, the matching degree plaintext corresponding to the matching degree ciphertext is k, and the obfuscated response plaintext corresponding to the obfuscated response ciphertext is the query data corresponding to the query identifier; otherwise, the matching degree plaintext is less than k, and the obfuscated response plaintext is a random number; k is the number of hash functions in the Bloom filter parameters; Sending a matching result ciphertext generated based on the matching degree blinded ciphertext to the server; the matching result ciphertext is used to determine whether there is an identifier matching the query identifier in the data set; According to the first blinded ciphertext returned by the server after determining that the query identifier matches and used for blinding processing to obtain the obfuscated response blinded ciphertext, the obfuscated response blinded ciphertext is restored to obtain the query data.
2. The method according to claim 1, characterized in that The receiving of the matching degree blinded ciphertext and the obfuscated response blinded ciphertext returned by the server further includes: Receive multiple coefficient ciphertexts returned by the server; wherein the multiple coefficient ciphertexts are obtained by homomorphically encrypting the coefficients of the target annihilation polynomial, the value of the target annihilation polynomial at the plaintext corresponding to the second blinded ciphertext is a preset value, and the second blinded ciphertext is used for blinding processing to obtain the matching degree blinded ciphertext; the multiple coefficient ciphertexts are used to generate the matching result ciphertext.
3. The method according to claim 2, characterized in that Before sending the matching result ciphertext generated based on the matching degree blinded ciphertext to the server, the method further includes: Decrypting the matching degree blinded ciphertext to obtain matching degree blinded plaintext; Constructing a target annihilation polynomial after coefficient encryption according to the plurality of coefficient ciphertexts; Homomorphically calculating the target annihilation polynomial after the coefficients are encrypted, and taking a first value at the matching degree blinded plaintext; wherein, when the query identifier matches, the matching degree blinded ciphertext is the second blinded ciphertext, and the plaintext corresponding to the first value is the preset value; The first value is used as the matching result ciphertext.
4. The method according to claim 1, characterized in that The plaintext corresponding to the first blinded ciphertext is: a random number used for blinding processing to obtain the obfuscated response blinded ciphertext; Before restoring the obfuscated response blinded ciphertext to obtain the query data based on the first blinded ciphertext returned by the server after determining that the query identifier matches and used for blinding processing to obtain the obfuscated response blinded ciphertext, the method further includes: Decrypting the obfuscated response blinded ciphertext to obtain the obfuscated response blinded plaintext; The method of returning the first blinded ciphertext for blinding the obfuscated response blinded ciphertext after determining that the query identifier matches and restoring the obfuscated response blinded ciphertext to obtain the query data includes: Based on the plaintext corresponding to the first blinded ciphertext, the obfuscated response blinded plaintext is unblinded to obtain the query data.
5. The method according to claim 3, characterized in that If the data set includes multiple buckets, each bucket is used to store a partial identifier and corresponding data, and the target Bloom filter and the target confusion Bloom filter corresponding to each bucket are obtained based on the corresponding bucket mapping, then each bucket corresponds to a ciphertext pair consisting of a matching degree blinded ciphertext and a confusion response blinded ciphertext; The receiving the matching degree blinded ciphertext and the obfuscated response blinded ciphertext returned by the server includes: Receiving multiple ciphertext pairs returned by the server; Decrypting the matching degree blinded ciphertext to obtain matching degree blinded plaintext includes: The ciphertext pair corresponding to the bucket identifier is decrypted to obtain the matching degree blinded plaintext and the obfuscated response blinded plaintext; wherein the bucket identifier is used to identify: when the query identifier exists in the data set, the bucket where the query identifier is located; when the query identifier matches, the obfuscated response blinded plaintext is deblinded to obtain the query data.
6. The method according to claim 5, characterized in that The sending of the matching result ciphertext generated based on the matching degree blinded ciphertext to the server also includes: Homomorphically encrypt multiple different powers of the matching degree blinded plaintext to obtain corresponding multiple power matching degree blinded ciphertexts; the multiple different powers are determined according to the number of buckets; The multiple power matching degree blinded ciphertexts are sent to the server, so that the server determines a first blinded ciphertext corresponding to the bucket identifier according to the multiple power matching degree blinded ciphertexts.
7. The method according to any one of claims 1 to 6, characterized in that: Before sending the matching result ciphertext generated based on the matching degree blinded ciphertext to the server, the method further includes: The matching result ciphertext is blinded.
8. The method according to any one of claims 1 to 6, characterized in that: The Bloom filter parameters include: k hash functions, and the lengths m of the target Bloom filter and the target confused Bloom filter; k is less than m; and the query ciphertext is generated in the following manner: Mapping the query identifiers respectively through the k hash functions to obtain k hash values; Based on the k hash values, generate an m-bit array; The m-bit array is homomorphically encrypted to obtain m query ciphertexts.
9. A data anonymity query method, characterized in that: The method comprises: Receiving a query ciphertext sent by a client, wherein the query ciphertext is generated by mapping the query identifier according to a preset Bloom filter parameter; A matching degree ciphertext obtained by homomorphically calculating the target Bloom filter according to the query ciphertext is blinded to obtain a matching degree blinded ciphertext, and a confused response ciphertext obtained by homomorphically calculating the target confused Bloom filter according to the query ciphertext is blinded to obtain a confused response blinded ciphertext, and the matching degree blinded ciphertext and the confused response blinded ciphertext are sent to the client; the target Bloom filter and the target confused Bloom filter are obtained by mapping a data set based on the Bloom filter parameters, and the data set consists of multiple identifiers and corresponding data; if there is an identifier matching the query identifier in the data set, the matching degree plaintext corresponding to the matching degree ciphertext is k, and the confused response plaintext corresponding to the confused response ciphertext is the query data corresponding to the query identifier; otherwise, the matching degree plaintext is less than k, and the confused response plaintext is a random number; k is the number of hash functions in the Bloom filter parameters; According to the matching result ciphertext generated based on the matching degree blinded ciphertext sent by the client, it is determined that there is an identifier matching the query identifier in the data set, and then the first blinded ciphertext used for blinding processing to obtain the obfuscated response blinded ciphertext is sent to the client, so that the client restores the obfuscated response blinded ciphertext to obtain the query data based on the first blinded ciphertext.
10. The method according to claim 9, characterized in that The Bloom filter parameters include: k hash functions, and the lengths m of the target Bloom filter and the target confusion Bloom filter. Accordingly, there are m query ciphertexts. The matching degree ciphertext obtained by homomorphically calculating the target Bloom filter according to the query ciphertext and performing blinding processing to obtain the matching degree blinded ciphertext include: After multiplying the plaintext corresponding to each query ciphertext in the m query ciphertexts with the element at the corresponding position in the target Bloom filter, encrypting the sum of the obtained products to obtain the matching degree ciphertext; Based on the second blinded ciphertext, the matching degree ciphertext is blinded to obtain the matching degree blinded ciphertext; wherein, when the matching degree plaintext corresponding to the matching degree ciphertext is k, the matching degree blinded ciphertext is the second blinded ciphertext.
11. The method according to claim 9, characterized in that The length of the target Bloom filter and the target confusion Bloom filter is m, and accordingly, there are m query ciphertexts; The obfuscated response ciphertext obtained by homomorphically calculating the target obfuscated Bloom filter according to the query ciphertext and blinding the obfuscated response blinded ciphertext comprises: After multiplying the plaintext corresponding to each query ciphertext in the m query ciphertexts with the element at the corresponding position in the target obfuscated Bloom filter, encrypting the sum of the obtained products to obtain the obfuscated response ciphertext; Based on the first blinded ciphertext, the obfuscated response ciphertext is blinded to obtain the obfuscated response blinded ciphertext.
12. The method according to claim 10, characterized in that Before determining that there is an identifier matching the query identifier in the data set according to the matching result ciphertext generated based on the matching degree blinded ciphertext sent by the client, the method further includes: Constructing a target annihilation polynomial, wherein a value of the target annihilation polynomial at the plaintext corresponding to the second blinded ciphertext is a preset value; Performing homomorphic encryption on each coefficient of the target annihilation polynomial to obtain a plurality of coefficient ciphertexts; The multiple coefficient ciphertexts are sent to the client, so that the client generates the matching result ciphertext according to the multiple coefficient ciphertexts and the matching degree blinded ciphertext.
13. The method according to claim 12, characterized in that The determining, according to the matching result ciphertext generated based on the matching degree blinded ciphertext sent by the client, that there is an identifier matching the query identifier in the data set includes: Decrypting the matching result ciphertext to obtain the matching result plaintext; If the plain text of the matching result is a preset value, it is determined that there is an identifier matching the query identifier in the data set.
14. The method according to claim 9, characterized in that If the data set includes multiple buckets, each bucket is used to store a partial identifier and corresponding data, and the target Bloom filter and the target confusion Bloom filter corresponding to each bucket are obtained based on the corresponding bucket mapping, then each bucket corresponds to a ciphertext pair consisting of a matching degree blinded ciphertext and a confusion response blinded ciphertext; Before determining that there is an identifier matching the query identifier in the data set according to the matching result ciphertext generated based on the matching degree blinded ciphertext sent by the client, the method further includes: Receive multiple power matching degree blinded ciphertexts sent by the client; wherein the multiple power matching degree blinded ciphertexts are obtained by homomorphically encrypting multiple different powers of the matching degree blinded plaintext, and the multiple different powers are determined according to the number of buckets; the matching degree blinded plaintext is obtained by decrypting the matching degree blinded ciphertext in the ciphertext pair corresponding to the bucket identifier; the bucket identifier is used to identify: when the query identifier exists in the data set, the bucket where the query identifier is located; the multiple power matching degree blinded ciphertexts are used to determine the first blinded ciphertext corresponding to the bucket identifier.
15. The method according to claim 14, characterized in that Each bucket corresponds to a set of first blinded ciphertext and second blinded ciphertext, where the second blinded ciphertext is used for blinding processing to obtain the matching degree blinded ciphertext; The sending the first blinded ciphertext used for blinding processing to obtain the obfuscated response blinded ciphertext to the client includes: Sending the first blinded ciphertext corresponding to the bucket identifier to the client; wherein the first blinded ciphertext corresponding to the bucket identifier is determined in the following manner: Constructing a target interpolation polynomial, wherein the value of the target polynomial at each plaintext corresponding to the second blinded ciphertext is the plaintext corresponding to the first blinded ciphertext under the corresponding bucket identifier; Homomorphically calculating a second value of the target interpolation polynomial at the matching degree blinded ciphertext corresponding to the bucket identifier according to the multiple power matching degree blinded ciphertexts; The second value is used as the first blinded ciphertext corresponding to the bucket identifier.
16. A data anonymity query device, characterized in that: include: A first communication unit, configured to send a query ciphertext generated after mapping the query identifier according to a preset Bloom filter parameter to a server; The server stores a data set consisting of multiple identifiers and corresponding data; The second communication unit is used to receive the blinded ciphertext of matching degree and the blinded ciphertext of obfuscated response returned by the server; the blinded ciphertext of matching degree is obtained by blinding the ciphertext of matching degree obtained by homomorphically calculating the target Bloom filter according to the query ciphertext; The obfuscated response blinded ciphertext is obtained by blinding the obfuscated response ciphertext obtained by homomorphically calculating the target obfuscated Bloom filter according to the query ciphertext; The target Bloom filter and the target obfuscated Bloom filter are obtained by mapping the data set based on the Bloom filter parameters; if there is an identifier matching the query identifier in the data set, the matching degree plaintext corresponding to the matching degree ciphertext is k, and the obfuscated response plaintext corresponding to the obfuscated response ciphertext is the query data corresponding to the query identifier; otherwise, the matching degree plaintext is less than k, and the obfuscated response plaintext is a random number; k is the number of hash functions in the Bloom filter parameters; A third communication unit is used to send a matching result ciphertext generated based on the matching degree blinded ciphertext to the server; the matching result ciphertext is used to determine whether there is an identifier matching the query identifier in the data set; The fourth communication unit is used to restore the obfuscated response blinded ciphertext to obtain the query data according to the first blinded ciphertext returned by the server after determining that the query identifier matches and used for blinding processing to obtain the obfuscated response blinded ciphertext.
17. A data anonymity query device, characterized in that: include: A first communication unit, configured to receive a query ciphertext sent by a client, wherein the query ciphertext is generated by mapping the query identifier according to a preset Bloom filter parameter; The second communication unit is used to perform blinding processing on the matching degree ciphertext obtained by homomorphically calculating the target Bloom filter according to the query ciphertext, obtain the blinded matching degree ciphertext, and perform blinding processing on the obfuscated response ciphertext obtained by homomorphically calculating the target obfuscated Bloom filter according to the query ciphertext, obtain the blinded obfuscated response ciphertext, and send the blinded matching degree ciphertext and the blinded obfuscated response ciphertext to the client; the target Bloom filter and the target obfuscated Bloom filter are obtained by mapping the data set based on the Bloom filter parameters, and the data set consists of multiple identifiers and corresponding data; if there is an identifier matching the query identifier in the data set, the matching degree plaintext corresponding to the matching degree ciphertext is k, and the obfuscated response plaintext corresponding to the obfuscated response ciphertext is the query data corresponding to the query identifier; otherwise, the matching degree plaintext is less than k, and the obfuscated response plaintext is a random number; k is the number of hash functions in the Bloom filter parameters; The third communication unit is used to determine that there is an identifier matching the query identifier in the data set according to the matching result ciphertext generated based on the matching degree blinded ciphertext sent by the client, and then send the first blinded ciphertext used for blinding processing to obtain the obfuscated response blinded ciphertext to the client, so that the client can restore the obfuscated response blinded ciphertext to obtain the query data according to the first blinded ciphertext.
18. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any one of the methods of claims 1 to 15.
19. A computer-readable storage medium, characterized in that: It comprises a computer program. When the computer program is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of any method described in claims 1 to 15.
20. A computer program product, characterized in that The method comprises a computer program stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device executes the steps of any one of the methods described in claims 1 to 15.
