Keyword privacy information retrieval method and device oriented to any query domain and different message sizes
Through a keyword privacy information retrieval method for arbitrary query domains and different message sizes, encryption parameters and data encoding technology are used to generate hash functions for homomorphic encryption operations, which solves the problem of inconsistency between query domain and message size in the existing technology and achieves efficient privacy information protection and query.
Patent Information
- Application Number
- CN202510777483.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-09-23
AI Technical Summary
Existing keyword privacy information retrieval methods do not support scenarios with arbitrary query domains and different message sizes, resulting in an inability to effectively protect user privacy in practical applications.
A keyword privacy information retrieval method for arbitrary query domains and different message sizes is adopted. By determining the encryption parameters, data encoding, privacy set intersection and encryption processing in the privacy information retrieval stage, hash functions and hash tables are generated, homomorphic encryption operations are performed, and intersection labels are obtained to achieve secure queries.
It effectively reduces the computation and communication costs when data sizes are different, solves the query problem in arbitrary query domains, protects user privacy, and improves query efficiency.
Smart Images

Figure CN120687480A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a privacy computing method, and more particularly to a keyword privacy information retrieval method and device for arbitrary query domains and different message sizes. Background Art
[0002] With the explosive growth of internet information and data, the importance of personal privacy protection has become increasingly prominent. To guide and regulate data security and privacy protection, countries have enacted relevant laws and regulations, such as the Personal Information Protection Law, the Data Security Law, and the Cybersecurity Law. These regulations have placed new requirements on privacy-preserving algorithms.
[0003] When users access information on the internet, they may leak sensitive private data. For example, searching for travel information can reveal the browsing domain and itinerary information, while searching for medical information can reveal personal health information. To address this issue, private information retrieval (PIR) has been proposed as a privacy-preserving computing primitive. PIR requires that the client be able to correctly query data held by the server without revealing the specific query content to the server. In PIR protocols, users provide a query index, which corresponds to the location of the data in the server's database. However, in real-world applications, users often do not care about the location of the data and typically search for the corresponding data using a keyword. To address this scenario, keyword PIR has been proposed. Keyword PIR is a variant of PIR that allows users to perform queries using keywords while maintaining privacy. Existing keyword PIR generally does not support queries on arbitrary query domains. It assumes that the user knows the keyword range of the database. If the user searches for a keyword that does not exist in the database, the protocol may not properly notify the user of the query failure. Furthermore, existing keyword PIR does not support queries on messages of varying sizes. It assumes that all data in the database is of equal size, which is also unsuitable for real-world applications. Therefore, designing private information retrieval methods for arbitrary query domains and different message sizes has important practical significance. Summary of the Invention
[0004] The present invention aims to solve the problem that existing private information retrieval does not support arbitrary query domains and different message sizes, and provides a keyword private information retrieval method and device for arbitrary query domains and different message sizes.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] A keyword privacy information retrieval method for arbitrary query domains and different message sizes, used on the server side, includes:
[0007] Determine the encryption parameters for the private set intersection phase and the private information retrieval phase;
[0008] Determine the data held by the database and encode it to obtain input data;
[0009] Perform privacy set intersection preprocessing to generate a hash function and hash table based on the encryption parameters of the privacy set intersection phase and share them with the client. Set the server's sender keyword tag based on the input data to generate a keyword set.
[0010] Perform private set intersection so that the client uses the query keyword as the receiver set, performs homomorphic encryption, and sends it to the server. The server then performs private set intersection on the encrypted receiver set and the keyword set held by the server to obtain the label of the corresponding intersection;
[0011] If the intersection process of the privacy sets shows that the keyword does not exist, the query fails and ends; otherwise, the data length and index are obtained based on the label of the intersection, and the privacy information retrieval is performed according to the encryption parameters of the privacy information retrieval stage.
[0012] As a preferred solution, the encryption parameters for determining the privacy set intersection phase and the privacy information retrieval phase specifically include:
[0013] The encryption parameters in the privacy set intersection phase and the privacy information retrieval phase are determined through negotiation with the client; wherein the encryption parameters include: security parameter λ, homomorphic encryption plaintext modulus t, homomorphic encryption ciphertext modulus q and encryption coefficient N.
[0014] As a preferred solution, determining the data held by the database and encoding it to obtain input data specifically includes:
[0015] Identify the database on the server and the data held by the database;
[0016] Encode the data held by the database and encode the data into a plaintext polynomial ring to obtain input data; wherein, input data db={db1,db2,…db n}, n is the number of data in the database;
[0017] The encoded data structure is a data matrix, each polynomial coefficient is an element in the data matrix, the data is encoded non-continuously by column, and different parts of each data are stored in the same coefficient position of different plaintext polynomial rings. The arrangement of the data is determined by the data size.
[0018] As a preferred solution, encoding the data held by the database and encoding the data into a plaintext polynomial ring specifically includes:
[0019] Sorting all the data in the database, grouping the data that have the same number of coefficients of the homomorphic plaintext polynomial into a group, thereby obtaining several groups of data;
[0020] Arrange each group of data according to the polynomial matrix, and distribute the same group of data into the same homomorphically encrypted plaintext polynomial matrix. Then, all the remaining data are further assigned to the polynomial matrix in order of size, thereby encoding the data into the plaintext polynomial ring.
[0021] As a preferred solution, the privacy set intersection preprocessing is performed, thereby generating a hash function and hash table based on the encryption parameters of the privacy set intersection stage and sharing them with the client, and setting the sender keyword tag of the server based on the input data to generate a keyword set, which specifically includes:
[0022] Performing privacy set intersection preprocessing to generate a hash function based on the encryption parameters of the privacy set intersection phase, and sharing the hash function with the client;
[0023] Generate a hash table based on the hash function and preset keywords;
[0024] According to the preset keywords and input data, the sender keyword tag of the server is set to generate a keyword set; wherein the content of the sender keyword tag includes: the length and index of the data.
[0025] As a preferred solution, the private set intersection is performed so that the client uses the query keyword as the receiver set for homomorphic encryption and sends it to the server. The server then performs a private set intersection on the encrypted receiver set and the keyword set held by the server to obtain the label of the corresponding intersection, which specifically includes:
[0026] Perform private set intersection so that the client uses the query keyword as the receiver set, homomorphically encrypts the receiver set through a hash function, constructs a cuckoo hash table, and sends the cuckoo hash table to the server;
[0027] The cuckoo hash table and the server's hash table are operated in a homomorphically encrypted ciphertext state, and the operation results of each hash bucket in the hash table are sent to the client as the label of the intersection, so that the client can decrypt and parse the operation results of each hash bucket.
[0028] As a preferred solution, if the privacy set intersection process shows that the keyword does not exist, the query fails and ends; otherwise, the privacy information retrieval is performed based on the data length and index obtained from the intersection label and the encryption parameters of the privacy information retrieval phase, specifically including:
[0029] If the privacy set intersection process shows that the keyword does not exist, the query fails and ends;
[0030] Otherwise, the client performs private information retrieval based on the data length and index contained in the intersection tag and the encryption parameters in the private information retrieval phase.
[0031] Accordingly, the present invention also provides a keyword privacy information retrieval device for any query domain and different message sizes, comprising:
[0032] An encryption parameter module, used to determine the encryption parameters in the privacy set intersection phase and the privacy information retrieval phase;
[0033] The encoding module is used to determine the data held by the database and encode it to obtain input data;
[0034] A preprocessing module is used to perform privacy set intersection preprocessing, thereby generating a hash function and hash table based on the encryption parameters of the privacy set intersection phase and sharing them with the client, and setting the server-side sender keyword tag based on the input data to generate a keyword set;
[0035] The intersection module is used to perform private set intersection, so that the client uses the query keyword as the receiver set for homomorphic encryption and sends it to the server. The server then performs private set intersection on the encrypted receiver set and the keyword set held by the server to obtain the label of the corresponding intersection;
[0036] The query module is used to fail and end the query if the privacy set intersection process shows that the keyword does not exist; otherwise, the data length and index obtained based on the intersection label are used to perform privacy information retrieval based on the encryption parameters of the privacy information retrieval stage.
[0037] Accordingly, the present invention also provides a terminal device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the steps of a keyword privacy information retrieval method for any query domain and different message sizes as described above are implemented.
[0038] Accordingly, the present invention provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to perform the steps of a keyword privacy information retrieval method for any query domain and different message sizes as described above.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] 1. The encoding stage of the present invention arranges data according to its size, which effectively reduces the computational cost and communication cost when the data sizes are different.
[0041] 2. The present invention proposes to use privacy set intersection to map keywords to indexes, which solves the problem of querying arbitrary query domains. The protocol does not need to make assumptions about the information known by the user. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0043] Figure 1 This is a flowchart of the steps of the retrieval method of this embodiment;
[0044] Figure 2 This is a schematic diagram of the data encoding method of Example 1;
[0045] Figure 3 A timing flow chart of the method of the present invention;
[0046] Figure 4 A schematic flow chart of the method of the present invention is provided;
[0047] Figure 5 This is a structural diagram of the retrieval device of this embodiment. DETAILED DESCRIPTION
[0048] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.
[0049] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention as claimed, but rather merely represents selected embodiments of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without creative effort shall fall within the scope of protection of the present invention.
[0050] Example 1
[0051] See also Figure 1 , which is a keyword privacy information retrieval method for arbitrary query domains and different message sizes provided by the present invention, used on the server, including the following steps S101-S105:
[0052] S101: Determine encryption parameters for the privacy set intersection phase and the privacy information retrieval phase;
[0053] As a preferred solution, the encryption parameters for determining the privacy set intersection phase and the privacy information retrieval phase specifically include:
[0054] The encryption parameters in the privacy set intersection phase and the privacy information retrieval phase are determined through negotiation with the client; wherein the encryption parameters include: security parameter λ, homomorphic encryption plaintext modulus t, homomorphic encryption ciphertext modulus q and encryption coefficient N.
[0055] In this embodiment, the server and the client negotiate encryption parameters for the privacy set intersection phase and the privacy information retrieval phase, including the security parameter λ, the plaintext modulus t of homomorphic encryption, the ciphertext modulus q, and the coefficient N.
[0056] S102: Determine the data held by the database and encode it to obtain input data;
[0057] As a preferred solution, determining the data held by the database and encoding it to obtain input data specifically includes:
[0058] Identify the database on the server and the data held by the database;
[0059] Encode the data held by the database and encode the data into a plaintext polynomial ring to obtain input data; wherein, input data db={db1,db2,…db n}, n is the number of data in the database;
[0060] The encoded data structure is a data matrix, each polynomial coefficient is an element in the data matrix, the data is encoded non-continuously by column, and different parts of each data are stored in the same coefficient position of different plaintext polynomial rings. The arrangement of the data is determined by the data size.
[0061] As a preferred solution, encoding the data held by the database and encoding the data into a plaintext polynomial ring specifically includes:
[0062] Sorting all the data in the database, grouping the data that have the same number of coefficients of the homomorphic plaintext polynomial into a group, thereby obtaining several groups of data;
[0063] Arrange each group of data according to the polynomial matrix, and distribute the same group of data into the same homomorphically encrypted plaintext polynomial matrix. Then, all the remaining data are further assigned to the polynomial matrix in order of size, thereby encoding the data into the plaintext polynomial ring.
[0064] In this embodiment, the server encodes the data held by the database, and the input data db={db1, db2, ...db n}, where n is the number of data in the database, db is the data, and the data is encoded in a plaintext polynomial ring. The encoded structure is regarded as a data matrix. Each polynomial coefficient is an element in the matrix. The data is encoded non-continuously by column. Different parts of each data are stored in the same coefficient position of different polynomial rings. The arrangement of the data is determined by the data size.
[0065] In this embodiment, the protocol proposed by the present invention takes into account efficient query when the message sizes are different, and solves this problem through the improved data encoding method in step S102. In which, the server performs sorting on all the data in the database and groups the data with the same number of homomorphic plaintext polynomial coefficients into one group. Assuming there are k groups of data {a1, a2, ..., a k Arrange each group of data according to the polynomial matrix, and distribute the same group of data to the same homomorphically encrypted plaintext polynomial matrix. The number of polynomial groups occupied by each group of data is |a i | / N, where N is the total number of data. The remaining data in each group are sorted by size using the polynomial matrix.
[0066] In this embodiment, if Figure 2 As shown in FIG, it is a schematic diagram of data encoding for data of different sizes in actual scenarios. In the actual application scenarios oriented by the present invention, there are usually cases where the data sizes in the server database are different. In order to ensure the security in the actual query scenario, the present invention proposes an improved encoding method. Figure 2 In [1], the coefficient of the plaintext polynomial is 4, meaning that a polynomial matrix can contain up to 4 data items. First, the data is grouped according to difficulty. Data items of length 2, 3, and 4 can each occupy a polynomial matrix. The remaining data is then encoded into a polynomial matrix whose number of rows is determined by the longest data item. This improved data encoding method minimizes the impact of longer data on the encoding. Only one group of polynomials has 5 rows, leaving the remaining polynomial groups with no computational overhead or storage costs, effectively improving the protocol's query efficiency.
[0067] S103: Performing privacy set intersection preprocessing to generate a hash function and hash table based on the encryption parameters of the privacy set intersection phase, sharing them with the client, and setting the server's sender keyword tag based on the input data to generate a keyword set;
[0068] As a preferred solution, the privacy set intersection preprocessing is performed, thereby generating a hash function and hash table based on the encryption parameters of the privacy set intersection stage and sharing them with the client, and setting the sender keyword tag of the server based on the input data to generate a keyword set, which specifically includes:
[0069] Performing privacy set intersection preprocessing to generate a hash function based on the encryption parameters of the privacy set intersection phase, and sharing the hash function with the client;
[0070] Generate a hash table based on the hash function and preset keywords;
[0071] According to the preset keywords and input data, the sender keyword tag of the server is set to generate a keyword set; wherein the content of the sender keyword tag includes: the length and index of the data.
[0072] In this embodiment, the server performs privacy set intersection preprocessing to generate a hash function h = {h1, h2, h3} and makes the hash function public to the client. Then, a hash table h is generated based on the hash function and the keyword. fable ,All keywords need to set the sender keyword tag l on the server side. The tag content includes the length and index of the data.
[0073] In this embodiment, the protocol proposed by the present invention takes into account the situation where the query keyword does not exist when querying any query domain, and solves this problem by intersecting the privacy sets in step S103. The specific steps of step S103 are as follows:
[0074] Consider the client as the receiver and the server as the sender. The receiver owns a set Y of size |Y|. The sender owns a set S of size |S|, where |Y| << |S|. The length of the elements in the set is σ. Each element in the sender's set is associated with a label l. The content of the set element is the keyword, and the content of the label is the length and index of the data corresponding to the keyword.
[0075] S104: Performing private set intersection so that the client uses the query keyword as the receiver set for homomorphic encryption and sends it to the server. The server then performs private set intersection on the encrypted receiver set and the keyword set held by the server to obtain the label of the corresponding intersection.
[0076] As a preferred solution, the private set intersection is performed so that the client uses the query keyword as the receiver set for homomorphic encryption and sends it to the server. The server then performs a private set intersection on the encrypted receiver set and the keyword set held by the server to obtain the label of the corresponding intersection, which specifically includes:
[0077] Perform private set intersection so that the client uses the query keyword as the receiver set, homomorphically encrypts the receiver set through a hash function, constructs a cuckoo hash table, and sends the cuckoo hash table to the server;
[0078] The cuckoo hash table and the server's hash table are operated in a homomorphically encrypted ciphertext state, and the operation results of each hash bucket in the hash table are sent to the client as the label of the intersection, so that the client can decrypt and parse the operation results of each hash bucket.
[0079] In this embodiment, a private set intersection is performed. The client uses the query keyword as the recipient set, constructs a cuckoo hash table using the hash function h = {h1, h2, h3}, and sends it to the server after homomorphic encryption.
[0080] In this embodiment, the server executes the formula for each hash bucket: Where P(·) is the interpolation polynomial constructed by the sender; [y j ] is y j The ciphertext;
[0081] Among them B s [j] is the hash bucket for j constructed by the sender.
[0082] The formula is executed in the homomorphic encryption state, and the server calculates the result G(y i ) and F(y i ) is sent to the client.
[0083] Specifically, the receiver maps each y∈Y to a cuckoo hash table B with a bucket size of 1 R The sender also constructs a cuckoo hash table B S , the intersection of set S and set Y is the union of the intersection of each bucket of the hash table constructed by the sender and the receiver
[0084] S∩Y=U i B R [i]∩B S [i].
[0085] The receiver needs to set all hash buckets B R The encryption is sent to the sender, who needs to calculate a polynomial for each bucket using homomorphic encryption in the ciphertext state.
[0086] S105: If the privacy set intersection process shows that the keyword does not exist, the query fails and ends; otherwise, the data length and index are obtained based on the intersection label, and the privacy information retrieval is performed according to the encryption parameters of the privacy information retrieval stage.
[0087] As a preferred solution, if the privacy set intersection process shows that the keyword does not exist, the query fails and ends; otherwise, the privacy information retrieval is performed based on the data length and index obtained from the intersection label and the encryption parameters of the privacy information retrieval phase, specifically including:
[0088] If the privacy set intersection process shows that the keyword does not exist, the query fails and ends;
[0089] Otherwise, the client performs private information retrieval based on the data length and index contained in the intersection tag and the encryption parameters in the private information retrieval phase.
[0090] In this embodiment, the sender sends G(y) and F(y) to the receiver. After the receiver decrypts, when F(y) = 0, G(y) is the tag corresponding to the element. The client can perform subsequent queries based on the data length and index contained in the tag. Otherwise, G(y) is a random number, and the client knows that the keyword does not exist, and the query fails. Specifically, the client calculates the result G(y) for each bucket. i ) and F(y i ) decryption, if F(y i ) is 0, indicating that the element exists, then G(y i ) contains the index and length corresponding to the keyword, and the privacy information retrieval protocol can be executed based on this information. Otherwise, G(y i ) is meaningless, the keyword does not exist.
[0091] See also Figure 3 , which shows a schematic diagram of the logical structure of the present invention. The querying party and the server first perform the preprocessing for private set intersection and private information retrieval and exchange keys. Then, the querying party and the server execute the private set intersection protocol. If the result is empty, it means that the keyword does not exist on the server, and the protocol terminates. Otherwise, the querying party can analyze the data length and index and, based on this information, execute the index private information retrieval protocol to ultimately obtain the required data.
[0092] Example 2
[0093] See also Figure 5 , which is a keyword privacy information retrieval device for arbitrary query domains and different message sizes provided by the present invention, comprising:
[0094] Encryption parameter module 201, used to determine encryption parameters in the privacy set intersection phase and the privacy information retrieval phase;
[0095] The encoding module 202 is used to determine the data held by the database and encode it to obtain input data;
[0096] Preprocessing module 203 is used to perform privacy set intersection preprocessing, thereby generating a hash function and hash table based on the encryption parameters of the privacy set intersection phase and sharing them with the client, and setting the server-side sender keyword tag based on the input data to generate a keyword set;
[0097] The intersection module 204 is configured to perform private set intersection, so that the client homomorphically encrypts the query keyword as the receiver set and sends it to the server. The server then performs private set intersection on the encrypted receiver set and the keyword set held by the server to obtain the label of the corresponding intersection.
[0098] The query module 205 is configured to fail the query and terminate if the privacy set intersection process shows that the keyword does not exist; otherwise, perform the private information retrieval based on the data length and index obtained from the intersection label and the encryption parameters of the private information retrieval phase.
[0099] As a preferred solution, the encryption parameters for determining the privacy set intersection phase and the privacy information retrieval phase specifically include:
[0100] The encryption parameters in the privacy set intersection phase and the privacy information retrieval phase are determined through negotiation with the client; wherein the encryption parameters include: security parameter λ, homomorphic encryption plaintext modulus t, homomorphic encryption ciphertext modulus q and encryption coefficient N.
[0101] As a preferred solution, determining the data held by the database and encoding it to obtain input data specifically includes:
[0102] Identify the database on the server and the data held by the database;
[0103] Encode the data held by the database and encode the data into a plaintext polynomial ring to obtain input data; wherein, input data db={db1,db2,…db n}, n is the number of data in the database;
[0104] The encoded data structure is a data matrix, each polynomial coefficient is an element in the data matrix, the data is encoded non-continuously by column, and different parts of each data are stored in the same coefficient position of different plaintext polynomial rings. The arrangement of the data is determined by the data size.
[0105] As a preferred solution, encoding the data held by the database and encoding the data into a plaintext polynomial ring specifically includes:
[0106] Sorting all the data in the database, grouping the data that have the same number of coefficients of the homomorphic plaintext polynomial into a group, thereby obtaining several groups of data;
[0107] Arrange each group of data according to the polynomial matrix, and distribute the same group of data into the same homomorphically encrypted plaintext polynomial matrix. Then, all the remaining data are further assigned to the polynomial matrix in order of size, thereby encoding the data into the plaintext polynomial ring.
[0108] As a preferred solution, the privacy set intersection preprocessing is performed, thereby generating a hash function and hash table based on the encryption parameters of the privacy set intersection stage and sharing them with the client, and setting the sender keyword tag of the server based on the input data to generate a keyword set, which specifically includes:
[0109] Performing privacy set intersection preprocessing to generate a hash function based on the encryption parameters of the privacy set intersection phase, and sharing the hash function with the client;
[0110] Generate a hash table based on the hash function and preset keywords;
[0111] According to the preset keywords and input data, the sender keyword tag of the server is set to generate a keyword set; wherein the content of the sender keyword tag includes: the length and index of the data.
[0112] As a preferred solution, the private set intersection is performed so that the client uses the query keyword as the receiver set for homomorphic encryption and sends it to the server. The server then performs a private set intersection on the encrypted receiver set and the keyword set held by the server to obtain the label of the corresponding intersection, which specifically includes:
[0113] Perform private set intersection so that the client uses the query keyword as the receiver set, homomorphically encrypts the receiver set through a hash function, constructs a cuckoo hash table, and sends the cuckoo hash table to the server;
[0114] The cuckoo hash table and the server's hash table are operated in a homomorphically encrypted ciphertext state, and the operation results of each hash bucket in the hash table are sent to the client as the label of the intersection, so that the client can decrypt and parse the operation results of each hash bucket.
[0115] As a preferred solution, if the privacy set intersection process shows that the keyword does not exist, the query fails and ends; otherwise, the privacy information retrieval is performed based on the data length and index obtained from the intersection label and the encryption parameters of the privacy information retrieval phase, specifically including:
[0116] If the privacy set intersection process shows that the keyword does not exist, the query fails and ends;
[0117] Otherwise, the client performs private information retrieval based on the data length and index contained in the intersection tag and the encryption parameters in the private information retrieval phase.
[0118] Example 3
[0119] The present invention also provides a terminal device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, it implements a keyword privacy information retrieval method for any query domain and different message sizes as described above.
[0120] Example 4
[0121] The present invention provides a computer-readable storage medium, which includes a stored computer program. When the computer program is executed, the device containing the computer-readable storage medium is controlled to execute a keyword privacy information retrieval method for any query domain and different message sizes as described above.
Claims
1. A keyword privacy information retrieval method for arbitrary query domains and different message sizes, characterized by: For the server, including: Determine the encryption parameters for the private set intersection phase and the private information retrieval phase; Determine the data held by the database and encode it to obtain input data; Perform privacy set intersection preprocessing to generate a hash function and hash table based on the encryption parameters of the privacy set intersection phase and share them with the client. Set the server's sender keyword tag based on the input data to generate a keyword set. Perform private set intersection so that the client uses the query keyword as the receiver set, performs homomorphic encryption, and sends it to the server. The server then performs private set intersection on the encrypted receiver set and the keyword set held by the server to obtain the label of the corresponding intersection; If the intersection process of the privacy sets shows that the keyword does not exist, the query fails and ends; otherwise, the data length and index are obtained based on the label of the intersection, and the privacy information retrieval is performed according to the encryption parameters of the privacy information retrieval stage.
2. The keyword privacy information retrieval method for arbitrary query domains and different message sizes as claimed in claim 1 is characterized in that: The encryption parameters for determining the privacy set intersection phase and the privacy information retrieval phase specifically include: The encryption parameters in the privacy set intersection phase and the privacy information retrieval phase are determined through negotiation with the client; wherein the encryption parameters include: security parameter λ, homomorphic encryption plaintext modulus t, homomorphic encryption ciphertext modulus q and encryption coefficient N.
3. The keyword privacy information retrieval method for arbitrary query domains and different message sizes as claimed in claim 1 is characterized in that: Determining the data held by the database and encoding it to obtain input data specifically includes: Identify the database on the server and the data held by the database; Encode the data held by the database and encode the data into a plaintext polynomial ring to obtain input data; wherein, input data db={db1,db2,…db n }, n is the number of data in the database; The encoded data structure is a data matrix, each polynomial coefficient is an element in the data matrix, the data is encoded non-continuously by column, and different parts of each data are stored in the same coefficient position of different plaintext polynomial rings. The arrangement of the data is determined by the data size.
4. The keyword privacy information retrieval method for arbitrary query domains and different message sizes as claimed in claim 3 is characterized in that: The encoding of the data held by the database and encoding the data into a plaintext polynomial ring specifically includes: Sorting all the data in the database, grouping the data that have the same number of coefficients of the homomorphic plaintext polynomial into a group, thereby obtaining several groups of data; Arrange each group of data according to the polynomial matrix, and distribute the same group of data into the same homomorphically encrypted plaintext polynomial matrix. Then, all the remaining data are further assigned to the polynomial matrix in order of size, thereby encoding the data into the plaintext polynomial ring.
5. The keyword privacy information retrieval method for arbitrary query domains and different message sizes as claimed in claim 1 is characterized in that: The execution of the privacy set intersection preprocessing generates a hash function and hash table based on the encryption parameters of the privacy set intersection phase, shares them with the client, and sets the server's sender keyword tag based on the input data to generate a keyword set, specifically including: Performing privacy set intersection preprocessing to generate a hash function based on the encryption parameters of the privacy set intersection phase, and sharing the hash function with the client; Generate a hash table based on the hash function and preset keywords; According to the preset keywords and input data, the sender keyword tag of the server is set to generate a keyword set; wherein the content of the sender keyword tag includes: the length and index of the data.
6. The keyword privacy information retrieval method for arbitrary query domains and different message sizes as claimed in claim 1 is characterized in that: The execution of the private set intersection allows the client to homomorphically encrypt the query keyword as the receiver set and send it to the server. The server then performs a private set intersection on the encrypted receiver set and the keyword set held by the server to obtain the label of the corresponding intersection, specifically including: Perform private set intersection so that the client uses the query keyword as the receiver set, homomorphically encrypts the receiver set through a hash function, constructs a cuckoo hash table, and sends the cuckoo hash table to the server; The cuckoo hash table and the server's hash table are operated in a homomorphically encrypted ciphertext state, and the operation results of each hash bucket in the hash table are sent to the client as the label of the intersection, so that the client can decrypt and parse the operation results of each hash bucket.
7. The keyword privacy information retrieval method for arbitrary query domains and different message sizes as claimed in claim 6, characterized in that: If the privacy set intersection process shows that the keyword does not exist, the query fails and ends; Otherwise, the data length and index are obtained based on the intersection label, and the private information retrieval is performed according to the encryption parameters of the private information retrieval phase, including: If the privacy set intersection process shows that the keyword does not exist, the query fails and ends; Otherwise, the client performs private information retrieval based on the data length and index contained in the intersection tag and the encryption parameters in the private information retrieval phase.
8. A keyword privacy information retrieval device for arbitrary query domains and different message sizes, characterized by: include: An encryption parameter module, used to determine the encryption parameters in the privacy set intersection phase and the privacy information retrieval phase; The encoding module is used to determine the data held by the database and encode it to obtain input data; A preprocessing module is used to perform privacy set intersection preprocessing, thereby generating a hash function and hash table based on the encryption parameters of the privacy set intersection phase and sharing them with the client, and setting the server-side sender keyword tag based on the input data to generate a keyword set; The intersection module is used to perform private set intersection, so that the client uses the query keyword as the receiver set for homomorphic encryption and sends it to the server. The server then performs private set intersection on the encrypted receiver set and the keyword set held by the server to obtain the label of the corresponding intersection; The query module is used to fail and end the query if the privacy set intersection process shows that the keyword does not exist; otherwise, the data length and index obtained based on the intersection label are used to perform privacy information retrieval based on the encryption parameters of the privacy information retrieval stage.
9. A terminal device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method implements the steps of a keyword privacy information retrieval method for arbitrary query domains and different message sizes as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored computer program, wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to perform the steps of the keyword privacy information retrieval method for any query domain and different message sizes as described in any one of claims 1 to 7.