Anonymous search system suitable for large-scale multi-valued mapping database
By applying an anonymous search system on a large-scale multi-value mapping database, using Regev encryption algorithm and target matrix processing technology, the problem that the existing technology cannot be effectively applied to a multi-value mapping database is solved, and an efficient and privacy-protected anonymous search is achieved.
Patent Information
- Application Number
- CN202411542843.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-03-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing anonymous search technology cannot be effectively applied to multi-value mapping databases, resulting in incorrect query results.
An anonymous search system suitable for large-scale multi-value mapping databases is proposed. The database is preprocessed through the server, target matrix and grouping information are generated, and anonymous search is realized using the Regev encryption algorithm.
It realizes anonymous search on a multi-value mapping database, protects user privacy, and improves computing efficiency and response performance.
Smart Images

Figure CN119622787A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of encrypted search, and in particular to an anonymous search system suitable for large-scale multi-value mapping databases. Background Art
[0002] Private Information Retrieval (PIR) is a retrieval protocol that protects user privacy. In traditional information retrieval, users send query requests to the server, and the server returns relevant results. However, this method exposes the user's query content to the server, which poses a risk of privacy leakage. The anonymous search protocol uses encryption technology to allow the server to return the corresponding retrieval results without exposing the user's query content.
[0003] The existing keyword-based anonymous search can only be applied to one-to-one mapping databases (i.e., one keyword corresponds to one value in the database, and there are no duplicate key-value pairs), but cannot be applied to multi-value mapping databases (i.e., one keyword corresponds to one or more values). If the current keyword-based anonymous search solution is directly applied to a multi-value mapping database, it will produce incorrect query results. Summary of the invention
[0004] In view of this, the present application aims to propose an anonymous search system suitable for large-scale multi-value mapping databases, so as to realize keyword-based anonymous search for multi-value mapping databases.
[0005] To achieve the above purpose, the technical solution of this application is as follows: The first aspect of the embodiment of the present application provides an anonymous search system applicable to a large-scale multi-value mapping database, including: an original database, a server and a client; The original database is used to store a plurality of key-value pairs consisting of a keyword and a corresponding value; wherein the keywords of at least two key-value pairs are the same; The server is used to pre-process all key-value pairs in the original database to obtain a target matrix and generate grouping information; and send the grouping information to the client; The client is used to generate a query statement using the Regev encryption algorithm according to the query keyword submitted by the user and the grouping information, and send the query statement to the server; The server is further configured to calculate a response vector according to the query statement and the target matrix and send the response vector to the client; The client is also used to use the Regev decryption algorithm to calculate the query result according to the response vector; the query result is all the values corresponding to the query keyword in the original database.
[0006] Optionally, the server is used to pre-process all key-value pairs in the original database to obtain a target matrix , and generate grouping information I ,include: Based on all the keywords k and corresponding values v in the original database D, generate keyword codes and corresponding value codes, generate key-value codes based on all keyword codes and corresponding value codes, and obtain a formatted database based on all key-value codes. ; Formatting the database Group and rearrange to get the target matrix ; The target matrix In the , key-value codes with the same keyword code are in the same group; Based on the target matrix , generate group information I .
[0007] Optionally, the server is used to generate a keyword code and a corresponding value code based on all keywords k and corresponding values v in the original database D, generate a key-value code based on all keyword codes and corresponding value codes, and obtain a formatted database based on all key-value codes. ,include: Use constant weight code to encode each keyword k to get the keyword code : ; Each value v is encoded by the following expression to obtain the value encoding : ; Sort all keyword codes in ascending order to obtain a keyword database : ; in, m The length of the keyword encoding, w is the Hamming weight parameter, represents the domain of integers; The keyword database Each keyword code is multiplied by the corresponding value code to obtain the formatted database : .
[0008] Optionally, the server is used to format the database Group and rearrange to get the target matrix ,include: Based on the number of key-value pairs in the original database D n , calculate the initial number of groups: ; Determine whether the initial group number is an integer; if the initial group number is an integer, determine the initial group number as the group number a; if the initial group number is not an integer, determine the smallest integer greater than the initial group number as the group number a; wherein the number of key-value pairs with the same keyword k in the original database D is not greater than the group number a; According to the grouping number a and the formatting database , generate the target matrix ;in, m The length of the keyword encoding, represents the domain of integers; Adjust the target matrix The key-value pairs with the same keyword encoding are grouped together; For groups whose number of key-value codes is less than the group number a, invalid values are filled into the groups.
[0009] Optionally, the server is used to , generate group information I ,include: Based on the target matrix The value encoding corresponding to each keyword encoding generates a keyword matrix ; The keyword matrix The keyword encoding of each group in is represented as: ; Among them, g is the group number, For keyword database, represents the integer domain, a is the number of groups; Based on the keyword matrix The first keyword encoding of each group in generates group information I : .
[0010] Optionally, the client is used to generate a query statement using a Regev encryption algorithm according to a query keyword submitted by a user and the grouping information, including: Use constant weight code to query keywords Encode and get the first query code: ; in, m The length of the keyword encoding, w is the Hamming weight parameter; Encode the first query With the grouping information I Compare and determine the group number corresponding to the first query code ; Based on the group number , adjust the first query code , get the second query code ;in , The rest of the positions are 0; Using the Regev encryption algorithm, according to the second query code Generate query statements : ; ; in, is the encryption function; A is the public key, u Encode the ciphertext corresponding to the second query, d is the key dimension, s is the private key, is the ciphertext modulus, is the error, m The length of the keyword encoding, is the error distribution, Represents a domain of integers.
[0011] Optionally, the server is further configured to calculate a response vector according to the query statement and the target matrix, including: Based on the target matrix And the query statement qu , calculate the response vector r: ; Among them, a is the number of groups, is the ciphertext modulus, Represents a domain of integers.
[0012] Optionally, the server is further configured to generate a clue matrix based on the target matrix by using a Regev encryption algorithm, and send the clue matrix to the client, including: Generate public key based on Regev encryption algorithm A ; According to the target matrix With the public key A , calculate the clue matrix h : ; The clue matrixh Sent to the client.
[0013] Optionally, the client is further configured to use a Regev decryption algorithm to calculate a query result according to the response vector, including: Based on the response vector r And the clue matrix h , calculate the decryption result : ; in, The function represents the calculation of the closest distance to the input multiplier, r is the response vector, h is the clue matrix, s is the private key, represents the integer domain, a is the number of groups; For each non-zero component of the decryption result , to determine whether it can be Hamming weight parameter divisibility; In at least one non-zero component can be parameterized by the Hamming weight In the case of integer division, the non-zero component is decoded using the following expression to obtain the corresponding plaintext data : ;in, w is the Hamming weight parameter; All plaintext data As a result of the query; In the case that each non-zero component cannot be divided by the Hamming weight parameter, it is determined that the query keyword does not exist in the original database; and the query result is set to be empty.
[0014] Optionally, the anonymous search system applicable to a large-scale multi-valued mapping database further includes: An editing module, used to update the original database, including: editing the values in the original database, deleting the key-value pairs in the original database, and adding new key-value pairs to the original database; The server is further used to update at least one of the grouping information and the clue matrix according to the updated original database, and send the updated information to the client.
[0015] Using the anonymous search system for large-scale multi-value mapping databases provided by the present application, the server pre-processes the key-value pairs in the database, generates a target matrix and grouping information, and sends the grouping information to the client. The client generates a query statement based on the homomorphic encryption algorithm and the query keywords submitted by the user and the received grouping information, and sends it to the server. The server calculates the response vector based on the target matrix and the query statement and sends it to the client. The client receives the encrypted response vector and then uses the decryption algorithm to calculate the query result.
[0016] In this system, the data transmitted between the server and the client is encrypted data. The server receives the encrypted query statement and calculates the response vector of the search result and returns it to the client. During the search process, the server cannot know the user's query keyword and the plaintext data of the query result, protecting the user's privacy data. In addition, the client can obtain all the values corresponding to the query keyword in the original database based on the response vector returned by the server. Only one round of interaction between the server and the client is required to realize the anonymous search of all values of a query keyword, with high computational efficiency and low cost. In addition, the Regev encryption and decryption algorithm based on homomorphic encryption is adopted in this application. Since the algorithm has the characteristic of low ciphertext expansion rate, it has lower computational cost and higher efficiency than traditional anonymous search, which improves the response performance of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0018] Figure 1 It is a schematic diagram of an anonymous search system applicable to a large-scale multi-valued mapping database proposed in an embodiment of the present application; Figure 2 This is a flow chart of preprocessing of an original database by a server in one embodiment of the present application; Figure 3 This is a flowchart of a client generating a query statement in an embodiment of the present application; Figure 4 It is a schematic diagram of an anonymous search method proposed in an embodiment of the present application. DETAILED DESCRIPTION
[0019] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0020] It should be understood that the references to "one embodiment" or "an embodiment" throughout the specification mean that the specific features, structures, or characteristics associated with the embodiment are included in at least one embodiment of the present application. Therefore, the references to "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0021] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the following processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0022] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects as detailed in the present application.
[0023] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application may be combined with each other.
[0024] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments.
[0025] Figure 1 FIG. 1 is a schematic diagram of an anonymous search system 100 applicable to a large-scale multi-valued mapping database according to an embodiment of the present application. Figure 1 As shown, the system includes: an original database 101, a server 102 and a client 103; The original database 101 is used to store a plurality of key-value pairs consisting of a keyword and a corresponding value; wherein the keywords of at least two key-value pairs are the same; The server 102 is used to pre-process all key-value pairs in the original database to obtain a target matrix and generate grouping information; and send the grouping information to the client 103; The client 103 is used to generate a query statement using the Regev encryption algorithm according to the query keyword submitted by the user and the grouping information, and send the query statement to the server 102; The server 102 is further configured to calculate a response vector according to the query statement and the target matrix and send the response vector to the client 103; The client 103 is further configured to use a Regev decryption algorithm to calculate a query result according to the response vector; the query result is all values corresponding to the query keyword in the original database 101 .
[0026] In this embodiment, the original database is a multi-value mapping database that stores plaintext key-value pairs. Different key-value pairs (k, v) are stored in the database, where any keyword k may correspond to multiple different values v. For example, in financial transactions, a stock can have multiple transaction records. Since stock transaction records are usually updated regularly, this means that a keyword k may have multiple different values in the database. For example, the key-value pairs stored in the database are multiple "stock code-transaction record" key-value pairs. If a user wants to obtain the transaction record of a specific stock from the database, but does not want to disclose the information of the stock he is interested in (stock code), he needs to use keyword-type anonymous search.
[0027] In this embodiment, the server preprocesses the key-value pairs in the original database, generates a target matrix and grouping information, and sends the grouping information to the client. The client uses the same encoding method as the server to encode the query keyword (plaintext data), and generates a query statement based on the grouping information using the Regev encryption algorithm. The server performs an anonymous search based on the query statement and the target matrix sent by the client, obtains a response vector (encrypted data) and returns it to the client. The client uses the Regev decryption algorithm to decrypt the response vector, and further decodes it to obtain the query result (plaintext data of all values corresponding to the query keyword).
[0028] In the anonymous search system provided by this embodiment, during the search process, the server cannot obtain the user's query keywords and the plaintext data of the query results, thereby protecting the user's privacy data. By sorting the keyword codes in ascending order and then grouping them, the key-value pairs of the same keyword code are in the same group, so that multiple values are returned through one round of interaction between the server and the client. Compared with the method of performing a search and returning one value in a single-value mapping database, this solution has high computational efficiency and low computational cost. In this application, the Regev encryption and decryption algorithm based on homomorphic encryption is adopted, and the algorithm has the characteristic of low ciphertext expansion rate to achieve low computational cost and efficient ciphertext calculation, further improving the response performance of the system.
[0029] As an implementation mode of the present application, the server is used to pre-process all key-value pairs in the original database to obtain a target matrix , and generate grouping information I ,include: Based on all the keywords k and corresponding values v in the original database D, generate keyword codes and corresponding value codes, generate key-value codes based on all keyword codes and corresponding value codes, and obtain a formatted database based on all key-value codes. ; Formatting the database Group and rearrange to get the target matrix ; The target matrix In the , key-value codes with the same keyword code are in the same group; Based on the target matrix , generate grouping information I.
[0030] In one embodiment, the server preprocesses the original database D. First, all key-value pairs are encoded to generate keyword codes and corresponding value codes, and then key-value codes are formed to convert the original database D into a formatted database. . Further, the formatted database is grouped and rearranged, and the key-value codes with the same keyword are adjusted to the same group to obtain the target matrix In addition, grouping information I is generated based on the target matrix and sent to the client.
[0031] In this example, during the preprocessing process, the server binds all key-value pairs of the same keyword by grouping. In the subsequent anonymous search process, the server performs calculations (anonymous search) based on the query statement sent by the client and the target matrix. The generated response vector contains the encrypted data of the values in a group in the target matrix. Therefore, the server only needs to return the encrypted data of one group to the client, and the client can obtain all the values corresponding to the query keyword at one time, realizing a round of interactive multi-value mapping anonymous search.
[0032] As an implementation mode of the present application, the server is used to generate a keyword code and a corresponding value code based on all keywords k and corresponding values v in the original database D, generate a key-value code based on all keyword codes and corresponding value codes, and obtain a formatted database based on all key-value codes. ,include: Use constant weight code to encode each keyword k to get the keyword code : ; Each value v is encoded by the following expression to obtain the value encoding : ; Sort all keyword codes in ascending order to obtain a keyword database : ; in, m The length of the keyword encoding, w is the Hamming weight parameter, represents the domain of integers; The keyword database Each keyword code is multiplied by the corresponding value code to obtain the formatted database : .
[0033] In one embodiment, the original database is represented as: For keywords, constant weight codes are used for encoding. The length of the encoding to be used is determined in advance. and Hamming weight Parameters, yes x The encoding can be expressed as .in, For any and , the following relationship holds: when Sometimes, there is ; when Sometimes, there is .
[0034] This property ensures that we can use the matrix-vector inner product result to identify the specific location of the query keyword in the database. Based on this, the keywords in the original database k Encode and get the keyword encoding: . Further, all keyword codes are sorted in ascending order to obtain the keyword database . By sorting in ascending order, all keyword codes of the same keyword are arranged adjacently.
[0035] For the value v, this embodiment uses the following encoding rules for encoding: ; For each key-value pair in the original database, its keyword is encoded as , the value is encoded as By The key value encoding is multiplied by the encoding of its corresponding value to obtain the formatted database after key value encoding. : .
[0036] As an implementation mode of the present application, the server is used to format the database Group and rearrange to get the target matrix ,include: Based on the number of key-value pairs in the original database D n , calculate the initial number of groups: ; Determine whether the initial group number is an integer; if the initial group number is an integer, determine the initial group number as the group number a; if the initial group number is not an integer, determine the smallest integer greater than the initial group number as the group number a; wherein the number of key-value pairs with the same keyword k in the original database D is not greater than the group number a; According to the grouping number a and the formatting database , generate the target matrix ;in, m The length of the keyword encoding, represents the domain of integers; Adjust the target matrix The key-value pairs with the same keyword encoding are grouped together; For groups whose number of key-value codes is less than the group number a, invalid values are filled into the groups.
[0037] In this embodiment, since a homomorphic encryption scheme (Regev encryption and decryption calculation) is used in the anonymous search process, and Regev encryption and decryption calculations are matrix operations, in order to adapt to Regev encryption and decryption calculations, in this embodiment, the number of groups is determined based on the formatted database, all key-value codes are grouped based on the number of groups, and the formatted database is converted into a target matrix.
[0038] Specifically, the initial number of groups is calculated based on the number n of key-value pairs in the original database. Since n is not necessarily a perfect square number, in the case that n is not a perfect square number, it is necessary to format the database Add invalid key-value pairs to increase n to the nearest perfect square number. That is, the final number of groups a is not less than and closest to An integer.
[0039] Based on the actual number of groups a, determine the target matrix , that is, the actual size of the matrix is . Where m is the length of the keyword encoding, Indicates an integer field. According to the format database The arrangement order of each key-value code in the query is used to generate an initial target matrix. In this embodiment, in order to ensure that a group of data returned by the server to the client includes all values corresponding to the query keyword, after generating the initial target matrix, the key-value codes in each group need to be adjusted to ensure that all key-value codes corresponding to the same keyword are in one group, and the number of columns of the adjusted target matrix may increase. In addition, since each group can accommodate a data at most, it is also necessary to predetermine that the number of key-value pairs of the same keyword in the original database is not greater than a, to ensure that one group can accommodate all key-value pairs corresponding to one keyword.
[0040] After adjusting all key-value pairs corresponding to the same keyword in a group, some groups may have less than a data. Based on this, invalid data is filled into the group with less than a data, so that all groups have a data, which is convenient for subsequent matrix operations.
[0041] Due to formatting the database With keyword database The order of data in is consistent, that is, the generated target matrix With keyword matrix The following is an example of generating a keyword matrix based on a keyword database. , after sorting in ascending order, we get the keyword database (Actually expressed in binary.) Based on n=9, the number of groups a=3 is determined, and then the keyword matrix is generated. , the size is : ; Each column in the above matrix is a group. It can be seen that the two data corresponding to the keyword "13" are not in the same group. Therefore, the matrix is adjusted to adjust the two data corresponding to the keyword "13" to group 2, and the keyword database is adjusted. Add invalid data "00000" and get: ; Then, we get the adjusted keyword matrix, which is , the number of columns of the adjusted keyword matrix increases: .
[0042] Based on the keyword matrix, the target matrix can be obtained by multiplying the corresponding value code at the corresponding position of each keyword code For example, the value corresponding to the first keyword code "00111" in group 1 is 3, and the key value code of this position in the target matrix is "00333".
[0043] As an implementation manner of the present application, the server is used to , generate group information I ,include: Based on the target matrix The value encoding corresponding to each keyword encoding generates a keyword matrix ; The keyword matrix The keyword encoding of each group in is represented as: ; Among them, g is the group number, For keyword database, represents the integer domain, a is the number of groups; Based on the keyword matrix The first keyword encoding of each group in generates group information I : .
[0044] In one embodiment, the keyword matrix is updated according to the adjusted target matrix (or, the target matrix is updated according to the adjusted keyword matrix). Based on the final keyword matrix, the first keyword code in each group is determined. Specifically, based on the final keyword matrix, the keyword database after filling the invalid values is obtained. , get the group information I , including the first keyword encoding in each group.
[0045] .
[0046] As an implementation manner of the present application, the server is further used to generate a clue matrix based on the target matrix using a Regev encryption algorithm and send the clue matrix to the client, including: Generate public key based on Regev encryption algorithm A ; According to the target matrix With the public key A , calculate the clue matrix h : ; The clue matrix h Sent to the client.
[0047] In this embodiment, the server not only needs to send the grouping information to the client, but also needs to send the grouping information to the client according to the adjusted target matrix. Generate a clue matrix h Sent to client. Clue Matrix hParticipates in the calculation when the client uses the Regev decryption algorithm to decrypt the response vector.
[0048] Specifically, the server selects the relevant parameters required for the encryption algorithm according to the Regev encryption algorithm, including: random matrix (public key), key dimension d , private key s , ciphertext modulus ,error , error distribution In one embodiment, the key dimension is selected =1024; ciphertext modulus =32bit prime number; error distribution Using discrete Gaussian distribution; random matrix A from Random sampling; private key s from Random sampling; error From the error distribution Random sampling in .
[0049] Based on the generated random matrix (public key) A , calculate the clue matrix h And send to the client: .
[0050] Figure 2 This is a flow chart of the server preprocessing the original database in one embodiment of the present application. Figure 2 As shown, the server preprocesses the original database and encodes the values corresponding to the keywords in all key-value pairs. All keyword codes are arranged in ascending order to generate a keyword database (storing keyword codes) and a formatted database (storing key-value codes) with consistent data arrangement. The keyword database and the formatted database are grouped and rearranged to generate a keyword matrix and a target matrix in matrix form respectively. The public key is generated on the server side based on the Regev encryption algorithm. A , based on the target matrix and the public key A The clue matrix is calculated and sent to the client. Grouping information is generated based on the keyword matrix and sent to the client. The client uses the grouping information when encrypting the query keyword and uses the clue matrix when decrypting the response vector.
[0051] As an implementation mode of the present application, the client is used to generate a query statement using the Regev encryption algorithm according to the query keyword submitted by the user and the grouping information, including: Use constant weight code to query keywords Encode and get the first query code: ; Among them, m is the length of the keyword encoding, and w is the Hamming weight parameter; Encode the first query With the grouping information I Compare and determine the group number corresponding to the first query code ; Based on the group number , adjust the first query code , get the second query code ;in , The rest of the positions are 0; Using the Regev encryption algorithm, according to the second query code Generate query statements : ; ; in, is the encryption function; A is the public key, u Encode the ciphertext corresponding to the second query, d is the key dimension, s is the private key, is the ciphertext modulus, is the error, m The length of the keyword encoding, is the error distribution, Represents a domain of integers.
[0052] Figure 3 This is a flow chart of a client generating a query statement in an embodiment of the present application. Figure 3 As shown, in one embodiment, the client obtains the query keyword submitted by the user, and uses the same method as the server to encode the query keyword using a constant weight code to obtain a first query code . Encode the first query With group information I The first query code is compared with the first query code in the keyword matrix to determine the group number g. Adjust it and convert it into the second query code in matrix form Specifically, the conversion method is: make ;and, All other positions are set to 0. Among them, m is the length of the keyword encoding, which is consistent with the length of the keyword encoding in the original database by the server.
[0053] Based on the second query code, a query statement is generated and sent to the server. Specifically, based on the various parameters of the Regev encryption algorithm, the query statement is calculated. qu : ; ; in, is the encryption function; A is the public key, u Encode the ciphertext corresponding to the second query, d is the key dimension, s is the private key, is the ciphertext modulus, is the error, m The length of the keyword encoding, is the error distribution, Represents a domain of integers.
[0054] As an implementation manner of the present application, the server is further configured to calculate a response vector according to the query statement and the target matrix, including: Based on the target matrix And the query statement qu, calculate the response vector r: ; Among them, a is the number of groups, is the ciphertext modulus, Represents a domain of integers.
[0055] In this embodiment, the server receives the query statement sent by the client and calculates the response vector based on the target matrix and the query statement. r (perform anonymity search) and convert the response vector r Return to the client. Response vector r Contains the ciphertext information of all values of a group in the target matrix.
[0056] As an implementation manner of the present application, the client is further configured to use a Regev decryption algorithm to calculate a query result according to the response vector, including: Based on the response vector r And the clue matrix h , calculate the decryption result : ; in, The function represents the calculation of the closest distance to the input multiplier, r is the response vector, h is the clue matrix, s is the private key, represents the integer domain, a is the number of groups; For each non-zero component of the decryption result , to determine whether it can be Hamming weight parameter divisibility; In at least one non-zero component can be parameterized by the Hamming weight In the case of integer division, the non-zero component is decoded using the following expression to obtain the corresponding plaintext data : ;in, w is the Hamming weight parameter; All plaintext data As a result of the query; In the case that each non-zero component cannot be divided by the Hamming weight parameter, it is determined that the query keyword does not exist in the original database; and the query result is set to be empty.
[0057] In one embodiment, the client decrypts the received response vector. Specifically, the Regev decryption algorithm is used to decrypt the response vector. r Decrypt and get the decryption result : .
[0058] Decryption results It includes multiple components, and the client responds to each non-zero component A test is performed to determine whether the component is divisible by the Hamming weight parameter w. If it is divisible, it means that the component is the value corresponding to the query keyword; if it is not divisible by w, it means that it is not the value corresponding to the query keyword. Further, the client decodes all non-zero components that meet the "divisible by the Hamming weight parameter w" condition to obtain the corresponding plaintext data, that is, all values corresponding to the query keyword. The decoding method is shown in the following expression: .
[0059] For a non-zero component , the decoded value for: .
[0060] As an implementation of the present application, the anonymous search system applicable to a large-scale multi-valued mapping database further includes: An editing module, used to update the original database, including: editing the values in the original database, deleting the key-value pairs in the original database, and adding new key-value pairs to the original database; The server is further used to update at least one of the grouping information and the clue matrix according to the updated original database, and send the updated information to the client.
[0061] In one embodiment, the system also includes an editing module. The maintainer of the original database (e.g., a securities company) can update the original database through the editing module. The update includes three aspects: editing and modifying the values of the key-value pairs in the original database; deleting the key-value pairs in the original database; and adding new key-value pairs to the original database. In the case of an update to the original database, the server needs to regenerate the grouping information and clue matrix and send them to the client to ensure the correctness of the anonymous search. The following describes the operation steps of the three update methods: (1) Edit and modify the values of the key-value pairs in the original database.
[0062] Editing the values in the original database modifies the original values. The server updates the target matrix based on the changed key-value pairs. Then, recalculate the data of the relevant rows in the clue matrix ,in is the row where the key value code that has changed is located. Since editing the value does not change the grouping information of the target matrix, the server only and Sent to the client, which updates the clue matrix accordingly.
[0063] (2) Delete the key-value pairs in the original database.
[0064] Deleting a key-value pair specifically means setting the key-value pair to 0. The server updates the target matrix based on the changed key-value pair. The key-value code of the corresponding position in the clue matrix is also set to 0. Then, the data of the relevant row in the clue matrix is recalculated. ,in is the row where the key-value code that has changed is located. Since deleting the key-value pair does not change the grouping information of the target matrix, the server only and Sent to the client, which updates the clue matrix accordingly.
[0065] (3) Add new key-value pairs to the original database.
[0066] After adding a new key-value pair to the original database, the server first encodes the keyword and value of the key-value pair to obtain the keyword encoding and value encoding. I , determine the group number where the keyword code is located Then, in the target matrix The corresponding key-value coding is added in: . Based on the target matrix after the new key-value encoding , adjust all key-value codes of the same keyword into one group. The grouping may or may not change.
[0067] The server updates the data of the relevant rows in the clue matrix based on the changed rows in the target matrix. , where the public key A is fixed, so based on The changed rows in can infer the clue matrix h The data of the related rows that need to be updated .
[0068] For example, after adjustment, the target matrix increases by one row and becomes , then the clue matrix also needs to add one row, and the size becomes In case of group changes (for example, adding groups), the server will and Sent to the client, and also the updated group information Sent to the client for corresponding update.
[0069] Based on the same inventive concept, an embodiment of the present application provides an anonymous search method. Figure 4 , Figure 4 FIG. 1 is a schematic diagram of an anonymous search method proposed in an embodiment of the present application. Figure 4 As shown, the method is applied to the anonymous search system applicable to a large-scale multi-value mapping database provided in the above embodiment, including: S1: preprocessing all key-value pairs in the original database through the server to obtain a target matrix and generate grouping information; and sending the grouping information to the client; S2: Generate a query statement through the client using the Regev encryption algorithm according to the query keyword submitted by the user and the grouping information, and send it to the server; S3: calculating a response vector through the server according to the query statement and the target matrix and sending the response vector to the client; S4: Calculate the query result according to the response vector by using the Regev decryption algorithm through the client; the query result is all the values corresponding to the query keyword in the original database.
[0070] Regarding the method in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the system, and will not be elaborated here.
[0071] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
[0072] For the method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and components involved are not necessarily required by the present application.
[0073] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the embodiments of the present application may adopt 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.) containing computer-usable program codes.
[0074] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal 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 the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions 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.
[0075] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0076] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement 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.
[0077] 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 are aware of the basic creative concepts. Therefore, the present application is interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0078] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0079] The above is a detailed introduction to the anonymous search system suitable for large-scale multi-value mapping databases provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A system for searching anonymous data on a large-scale multi-valued mapping database, characterized in that: include: Original database, server and client; The original database is used to store a plurality of key-value pairs consisting of a keyword and a corresponding value; wherein the keywords of at least two key-value pairs are the same; The server is used to pre-process all key-value pairs in the original database to obtain a target matrix and generate grouping information; and send the grouping information to the client; The client is used to generate a query statement using the Regev encryption algorithm according to the query keyword submitted by the user and the grouping information, and send the query statement to the server; The server is further configured to calculate a response vector according to the query statement and the target matrix and send the response vector to the client; The client is also used to use the Regev decryption algorithm to calculate the query result according to the response vector; the query result is all the values corresponding to the query keyword in the original database.
2. The anonymous search system applicable to a large-scale multi-valued mapping database according to claim 1, characterized in that: The server is used to pre-process all key-value pairs in the original database to obtain a target matrix , and generate grouping information I ,include: Based on all the keywords k and corresponding values v in the original database D, generate keyword codes and corresponding value codes, generate key-value codes based on all keyword codes and corresponding value codes, and obtain a formatted database based on all key-value codes. ; Formatting the database Group and rearrange to get the target matrix ; The target matrix In the , key-value codes with the same keyword code are in the same group; Based on the target matrix , generate group information I .
3. The anonymous search system applicable to a large-scale multi-valued mapping database according to claim 2, characterized in that: The server is used to generate keyword codes and corresponding value codes based on all keywords k and corresponding values v in the original database D, generate key-value codes based on all keyword codes and corresponding value codes, and obtain a formatted database based on all key-value codes. ,include: Use constant weight code to encode each keyword k to get the keyword code : ; Each value v is encoded by the following expression to obtain the value encoding : ; Sort all keyword codes in ascending order to obtain a keyword database : ; in, m The length of the keyword encoding, w is the Hamming weight parameter, represents the domain of integers; The keyword database Each keyword code is multiplied by the corresponding value code to obtain the formatted database : 。 4. The anonymous search system applicable to a large-scale multi-valued mapping database according to claim 2, characterized in that: The server is used to format the database Group and rearrange to get the target matrix ,include: Based on the number of key-value pairs in the original database D n , calculate the initial number of groups: ; Determine whether the initial group number is an integer; if the initial group number is an integer, determine the initial group number as the group number a; if the initial group number is not an integer, determine the smallest integer greater than the initial group number as the group number a; wherein the number of key-value pairs with the same keyword k in the original database D is not greater than the group number a; According to the grouping number a and the formatting database , generate the target matrix ;in, m The length of the keyword encoding, represents the domain of integers; Adjust the target matrix The key-value pairs with the same keyword encoding are grouped together; For groups whose number of key-value codes is less than the group number a, invalid values are filled into the groups.
5. The anonymous search system applicable to a large-scale multi-valued mapping database according to claim 2, characterized in that: The server is configured to: , generate group information I ,include: Based on the target matrix The value encoding corresponding to each keyword encoding generates a keyword matrix ; The keyword matrix The keyword encoding of each group in is represented as: ; Among them, g is the group number, For keyword database, represents the integer domain, a is the number of groups; Based on the keyword matrix The first keyword encoding of each group in generates group information I : 。 6. The anonymous search system applicable to a large-scale multi-valued mapping database according to claim 1, characterized in that: The client is used to generate a query statement using the Regev encryption algorithm according to the query keyword submitted by the user and the grouping information, including: Use constant weight code to query keywords Encode and get the first query code: ; in, m The length of the keyword encoding, w is the Hamming weight parameter; Encode the first query With the grouping information I Compare and determine the group number corresponding to the first query code ; Based on the group number , adjust the first query code , get the second query code ;in , The rest of the positions are 0; Using the Regev encryption algorithm, according to the second query code Generate query statements : ; ; in, is the encryption function; A is the public key, u Encode the ciphertext corresponding to the second query, d is the key dimension, s is the private key, is the ciphertext modulus, is the error, m The length of the keyword encoding, is the error distribution, Represents a domain of integers.
7. The anonymous search system applicable to a large-scale multi-valued mapping database according to claim 1, characterized in that: The server is further configured to calculate a response vector according to the query statement and the target matrix, including: Based on the target matrix And the query statement qu , calculate the response vector r: ; Among them, a is the number of groups, is the ciphertext modulus, Represents a domain of integers.
8. The anonymous search system applicable to a large-scale multi-valued mapping database according to claim 1, characterized in that: The server is further used to generate a clue matrix based on the target matrix using a Regev encryption algorithm and send the clue matrix to the client, including: Generate public key based on Regev encryption algorithm A ; According to the target matrix With the public key A , calculate the clue matrix h : ; The clue matrix h Sent to the client.
9. The anonymous search system applicable to a large-scale multi-valued mapping database according to claim 8, characterized in that: The client is further used to calculate the query result according to the response vector using the Regev decryption algorithm, including: Based on the response vector r And the clue matrix h , calculate the decryption result : ; in, The function represents the calculation of the closest distance to the input multiplier, r is the response vector, h is the clue matrix, s is the private key, represents the integer domain, a is the number of groups; For each non-zero component of the decryption result , to determine whether it can be Hamming weight parameter divisibility; In at least one non-zero component can be parameterized by the Hamming weight In the case of integer division, the non-zero component is decoded using the following expression to obtain the corresponding plaintext data : ;in, w is the Hamming weight parameter; All plaintext data As a result of the query; In the case that each non-zero component cannot be divided by the Hamming weight parameter, it is determined that the query keyword does not exist in the original database; and the query result is set to be empty.
10. The anonymous search system applicable to a large-scale multi-valued mapping database according to claim 8, characterized in that: Also includes: An editing module, used to update the original database, including: editing the values in the original database, deleting the key-value pairs in the original database, and adding new key-value pairs to the original database; The server is further used to update at least one of the grouping information and the clue matrix according to the updated original database, and send the updated information to the client.
Citation Information
Cited By
Keyword private information retrieval method and device based on layered dynamic constant weight code
CN120277104A
Keyword Private Information Retrieval Method and Device Based on Hierarchical Dynamic Constant Weight Codes
CN120277104B