An anonymous query system, method and device, electronic equipment and storage medium

By combining key pair encryption and partitioning algorithms in the anonymous query system, the problem of the data end being able to deduce the query content from the query end is solved, improving the security of privacy information retrieval and ensuring that neither the data end nor the query end can know the other's calculation process.

CN115905710BActive Publication Date: 2025-11-04HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211687531.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-27
Publication Date
2025-11-04
Estimated Expiration
2042-12-27

AI Technical Summary

Technical Problem

In existing technologies, the bucketing method allows the data end to infer the query content from the query end, which reduces the security of privacy information retrieval.

Method used

An anonymous query system is adopted. Through the encryption and decryption process of key pairs between the data end and the query end, the public key and private key are used to encrypt and decrypt the query keywords. Combined with the preset number of partitions and partitioning algorithm, the partition number ciphertext and the query result ciphertext are calculated to ensure that the data end cannot know the query range of the query end.

Benefits of technology

This ensures that the data source cannot deduce the query scope from the query source, improves the security of privacy information retrieval, and ensures that neither the data source nor the query source can know the other's calculation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115905710B_ABST
    Figure CN115905710B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a traceable query system, method and device, electronic equipment and storage medium. The query end obtains a key pair and a to-be-queried keyword, encrypts the to-be-queried keyword by using the public key to obtain keyword ciphertext; the data end calculates a first calculation result according to the keyword ciphertext, the public key and a preset partition number; the query end decrypts the first calculation result by using the private key and calculates a second calculation result according to the decryption result; the data end calculates partition number ciphertext according to the second calculation result, the keyword ciphertext, the public key and the preset partition number; the query end decrypts the partition number ciphertext by using the private key to obtain partition number plaintext; the data end determines the query result ciphertext of each partition according to the public key and the keyword ciphertext; the query end obtains the query result ciphertext of the partition corresponding to the partition number plaintext and decrypts the query result plaintext by using the private key. The security of private information retrieval is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to an anonymous query system, method and device, electronic equipment and storage medium. BACKGROUND

[0002] In the related art, a bucketing method is usually used, that is, the data of a backend database is divided into different buckets using a bucketing rule, when a query end wants to query keyword information, the network address of a target bucket is calculated using the bucketing rule, and then a traditional inadvertent transmission protocol is used between the data in the target bucket to hide the query intention.

[0003] Although the bucketing method reduces the overall calculation amount, the data end knows which buckets the query target of the query end is distributed in, so the data end can obtain the content of the data queried by the query end through reverse deduction, thereby reducing the security of private information retrieval. SUMMARY

[0004] The purpose of the embodiments of the present application is to provide an anonymous query system, method, device, electronic equipment and storage medium to improve the security of private information retrieval. The specific technical solutions are as follows:

[0005] According to a first aspect of the embodiments of the present application, an anonymous query system is provided, the system comprising:

[0006] a data end and a query end;

[0007] the query end is configured to obtain a key pair and a to-be-queried keyword, the key pair comprising a public key and a private key; encrypt the to-be-queried keyword using the public key to obtain keyword ciphertext; and send the keyword ciphertext and the public key to the data end;

[0008] the data end is configured to obtain the keyword ciphertext and the public key sent by the query end; calculate a first calculation result according to the keyword ciphertext, the public key and a preset number of partitions; send the first calculation result to the query end; wherein the database of the data end is divided into a plurality of partitions, and the data stored in each partition is different;

[0009] the query end is further configured to obtain the first calculation result sent by the data end, decrypt the first calculation result using the private key, and calculate a second calculation result according to the decryption result; and send the second calculation result to the data end;

[0010] The data end is further configured to obtain the second calculation result sent by the query end, and calculate a partition number ciphertext according to the second calculation result, the keyword ciphertext, the public key, and the preset partition number; and send the partition number ciphertext to the query end.

[0011] The query end is further configured to obtain the partition number ciphertext sent by the data end, decrypt the partition number ciphertext using the private key, and obtain a partition number plaintext.

[0012] The data end is further configured to, for each partition, determine a query result ciphertext of the partition according to the public key and the keyword ciphertext; and send the query result ciphertexts of the partitions to the query end.

[0013] The query end is further configured to obtain the query result ciphertext of the partition corresponding to the partition number plaintext, and decrypt the query result ciphertext using the private key to obtain a query result plaintext.

[0014] According to a second aspect of the embodiment of the present application, a traceless query method is provided, applied to a data end, and including:

[0015] Obtaining a keyword ciphertext and a public key sent by a query end, wherein the keyword ciphertext is obtained by encrypting a keyword to be queried using the public key by the query end;

[0016] Calculating a first calculation result according to the keyword ciphertext, the public key, and a preset partition number; sending the first calculation result to the query end, so that the query end decrypts the first calculation result using a private key, and calculates a second calculation result according to a decryption result; wherein a database of the data end is divided into multiple partitions, data stored in each partition is different, and the public key and the private key belong to a same key pair of the query end;

[0017] Obtaining a second calculation result sent by the query end, and calculating a partition number ciphertext according to the second calculation result, the keyword ciphertext, the public key, and the preset partition number;

[0018] Sending the partition number ciphertext to the query end, so that the query end decrypts the partition number ciphertext using the private key to obtain a partition number plaintext;

[0019] For each partition, determining a query result ciphertext of the partition according to the public key and the keyword ciphertext;

[0020] Sending the query result ciphertexts of the partitions to the query end, so that the query end obtains the query result ciphertexts of the corresponding partitions according to the partition number plaintext, and decrypts the query result ciphertexts using the private key to obtain query result plaintexts.

[0021] Optionally, the method further comprises:

[0022] According to the preset partition number, a partition to which each keyword belongs is calculated by a preset partition algorithm;

[0023] For each keyword, the result data of the keyword is divided into the partition to which the keyword belongs;

[0024] For each partition, a polynomial function with the keyword as the independent variable and the result data as the dependent variable in the partition is established.

[0025] Optionally, the first calculation result is calculated according to the keyword ciphertext, the public key and the preset partition number, comprising:

[0026] The public key is used to encrypt the preset partition number to obtain first data;

[0027] The first data and the keyword ciphertext are operated by a preset first four arithmetic operations to obtain the first calculation result;

[0028] The partition number ciphertext is calculated according to the second calculation result, the keyword ciphertext, the public key and the preset partition number, comprising:

[0029] The second calculation result, the first data and the keyword ciphertext are operated by a preset second four arithmetic operations to obtain the partition number ciphertext; wherein the preset first four arithmetic operations and the second four arithmetic operations are obtained by splitting the preset partition algorithm.

[0030] Optionally, the preset partition algorithm is a remainder method, and the partition to which each keyword belongs is calculated according to the preset partition number by the preset partition algorithm, comprising:

[0031] For each keyword, the remainder of the keyword is calculated by the remainder method with the preset partition number as the divisor; wherein the partition corresponding to the remainder of the keyword is the partition indicated by the keyword, and the partition and the remainder one-to-one correspond;

[0032] The first calculation result is obtained by operating the first data and the keyword ciphertext by a preset first four arithmetic operations, comprising:

[0033] The keyword ciphertext and the first data are operated by division to obtain the first calculation result;

[0034] The partition number ciphertext is obtained by operating the second calculation result, the first data and the keyword ciphertext by a preset second four arithmetic operations, comprising:

[0035] performing multiplication operation on the first data and the second calculation result to obtain second data;

[0036] performing subtraction operation on the keyword ciphertext and the second data to obtain partition number ciphertext.

[0037] Optionally, the determining, for each partition, the query result ciphertext of the partition according to the public key and the keyword ciphertext comprises:

[0038] performing homomorphic operation on the keyword ciphertext, the public key and the polynomial function of the partition to obtain the query result ciphertext of the partition.

[0039] According to a third aspect of the embodiment of the present application, a traceless query method is provided, applied to a query end, comprising:

[0040] obtaining a key pair and a keyword to be queried, the key pair comprising a public key and a private key; encrypting the keyword to be queried by using the public key to obtain keyword ciphertext;

[0041] sending the keyword ciphertext and the public key to a data end, so that the data end calculates first calculation result according to the keyword ciphertext, the public key and a preset partition number;

[0042] obtaining the first calculation result sent by the data end, decrypting the first calculation result by using the private key, and calculating second calculation result according to the decryption result;

[0043] sending the second calculation result to the data end, so that the data end calculates partition number ciphertext according to the second calculation result, the keyword ciphertext, the public key and the preset partition number, the data end determines, for each partition, query result ciphertext of the partition according to the public key and the keyword ciphertext, and sends the query result ciphertext of each partition to the query end;

[0044] obtaining the partition number ciphertext sent by the data end, decrypting the partition number ciphertext by using the private key to obtain partition number plaintext;

[0045] obtaining the query result ciphertext of the partition corresponding to the partition number plaintext, and decrypting to obtain query result plaintext by using the private key.

[0046] Optionally, the decrypting the first calculation result by using the private key and calculating the second calculation result according to the decryption result comprises:

[0047] decrypting the first calculation result by using the private key to obtain third data;

[0048] The third data is operated by a preset data algorithm to obtain a second calculation result; wherein the preset data algorithm is obtained by a preset partition algorithm, and the preset partition algorithm is an algorithm used by the data end to calculate a partition to which each keyword belongs.

[0049] Optionally, the preset partition algorithm is a remainder-elimination method, and the operation of the third data by the preset data algorithm to obtain the second calculation result comprises:

[0050] The third data is operated by a preset data algorithm to obtain a second calculation result; wherein the preset data algorithm is obtained by a preset partition algorithm, and the preset partition algorithm is an algorithm used by the data end to calculate a partition to which each keyword belongs.

[0051] According to a fourth aspect of the embodiments of the present application, a traceable query device is provided, applied to a data end, and comprising:

[0052] A first obtaining module is configured to obtain keyword ciphertext and a public key sent by a query end, wherein the keyword ciphertext is obtained by encrypting a keyword to be queried by the query end using the public key;

[0053] A first calculation result obtaining module is configured to calculate a first calculation result according to the keyword ciphertext, the public key, and a preset partition number; wherein a database of the data end is divided into a plurality of partitions, and data stored in each partition is different;

[0054] A first sending module is configured to send the first calculation result to the query end, so that the query end decrypts the first calculation result using a private key and calculates a second calculation result according to a decryption result; the public key and the private key belong to a same key pair of the query end;

[0055] A second obtaining module is configured to obtain a second calculation result sent by the query end;

[0056] A partition number ciphertext obtaining module is configured to calculate partition number ciphertext according to the second calculation result, the keyword ciphertext, the public key, and the preset partition number;

[0057] A second sending module is configured to send the partition number ciphertext to the query end, so that the query end decrypts the partition number ciphertext using the private key to obtain partition number plaintext;

[0058] A determining module is configured to determine, for each partition, keyword ciphertext of the partition according to the public key and the keyword ciphertext;

[0059] A third sending module is configured to send the keyword ciphertext of each partition to the query end, so that the query end obtains keyword ciphertext of a corresponding partition according to the partition number plaintext and decrypts the keyword ciphertext using the private key to obtain keyword plaintext.

[0060] Optionally, the apparatus further comprises:

[0061] a keyword-division-zone calculating module configured to calculate, according to the preset number of divisions, a division zone to which each keyword belongs by using a preset division algorithm;

[0062] a division module configured to divide, for each keyword, result data of the keyword into the division zone to which the keyword belongs;

[0063] a polynomial function establishing module configured to establish, for each division zone, a polynomial function with the keyword as an independent variable and the result data as a dependent variable.

[0064] Optionally, the first calculation result obtaining module comprises:

[0065] a first data obtaining sub-module configured to encrypt the preset number of divisions by using the public key to obtain first data;

[0066] a first calculation result obtaining sub-module configured to perform a preset first four arithmetic operations on the first data and the keyword ciphertext to obtain a first calculation result;

[0067] the division zone number ciphertext obtaining module comprises:

[0068] a division zone number ciphertext obtaining sub-module configured to perform a preset second four arithmetic operations on the second calculation result, the first data and the keyword ciphertext to obtain a division zone number ciphertext; wherein the preset first four arithmetic operations and the preset second four arithmetic operations are obtained by splitting the preset division algorithm.

[0069] Optionally, the preset division algorithm is a remainder method, and the keyword-division-zone calculating module comprises:

[0070] a remainder calculating sub-module configured to calculate, for each keyword, a remainder of the keyword by using the preset number of divisions as a divisor by using the remainder method; wherein the division zone corresponding to the remainder of the keyword is the division zone to which the keyword belongs, and the division zone and the remainder are in one-to-one correspondence;

[0071] the first calculation result obtaining sub-module is specifically configured to:

[0072] perform a division operation on the keyword ciphertext and the first data to obtain the first calculation result;

[0073] the division zone number ciphertext obtaining sub-module is specifically configured to:

[0074] perform a multiplication operation on the first data and the second calculation result to obtain second data;

[0075] Subtracting the keyword ciphertext and the second data, a partition number ciphertext is obtained.

[0076] Optionally, the determining module comprises:

[0077] The query result ciphertext obtaining sub-module is configured to perform homomorphic operation on the keyword ciphertext, the public key and the polynomial function of each partition to obtain a query result ciphertext of the partition.

[0078] According to a fifth aspect of the embodiments of the present application, a traceable query device is provided, which is applied to a query end and comprises:

[0079] The first obtaining module is configured to obtain a key pair and a keyword to be queried, the key pair comprising a public key and a private key.

[0080] The keyword ciphertext obtaining module is configured to encrypt the keyword to be queried by using the public key to obtain a keyword ciphertext.

[0081] The first sending module is configured to send the keyword ciphertext and the public key to a data end, so that the data end calculates a first calculation result according to the keyword ciphertext, the public key and a preset partition number.

[0082] The second obtaining module is configured to obtain the first calculation result sent by the data end.

[0083] The second calculation result obtaining module is configured to decrypt the first calculation result by using the private key and calculate a second calculation result according to the decrypted result.

[0084] The second sending module is configured to send the second calculation result to the data end, so that the data end calculates a partition number ciphertext according to the second calculation result, the keyword ciphertext, the public key and the preset partition number, and the data end determines a query result ciphertext of each partition according to the public key and the keyword ciphertext, and sends the query result ciphertexts of the partitions to the query end.

[0085] The third obtaining module is configured to obtain the partition number ciphertext sent by the data end.

[0086] The partition number plaintext obtaining module is configured to decrypt the partition number ciphertext by using the private key to obtain a partition number plaintext.

[0087] The fourth obtaining module is configured to obtain the query result ciphertext of the partition corresponding to the partition number plaintext.

[0088] The query result plaintext obtaining module is configured to decrypt the query result ciphertext by using the private key to obtain a query result plaintext.

[0089] Optionally, the second calculation result obtaining module comprises:

[0090] a third data obtaining sub-module, configured to decrypt the first calculation result by using the private key to obtain third data;

[0091] a second calculation result obtaining sub-module, configured to operate the third data by using a preset data algorithm to obtain a second calculation result, wherein the preset data algorithm is obtained by using a preset partition algorithm, and the preset partition algorithm is an algorithm used by the data end to calculate a partition to which each keyword belongs.

[0092] Optionally, the preset partition algorithm is a remainder exclusion method, and the second calculation result obtaining sub-module is specifically configured to:

[0093] perform a down-round operation on the third data to obtain a second calculation result.

[0094] According to a sixth aspect of the embodiments of the present application, an electronic device is provided, comprising:

[0095] a memory, configured to store a computer program;

[0096] a processor, configured to execute the program stored on the memory to implement the method in any of the second aspect or the third aspect.

[0097] According to a seventh aspect of the embodiments of the present application, a computer readable storage medium is provided, the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method in any of the second aspect or the third aspect.

[0098] The embodiments of the present application have the following beneficial effects:

[0099] The application embodiment provides an anonymous query system, method and device, electronic equipment and a storage medium. The system comprises a data end and a query end. The query end is configured to obtain a key pair and a to-be-queried keyword, the key pair comprises a public key and a private key, encrypt the to-be-queried keyword by using the public key to obtain keyword ciphertext, and send the keyword ciphertext and the public key to the data end. The data end is configured to obtain the keyword ciphertext and the public key sent by the query end, calculate a first calculation result according to the keyword ciphertext, the public key and a preset partition number, and send the first calculation result to the query end. Each partition of the database of the data end stores different data. The query end is further configured to obtain the first calculation result sent by the data end, decrypt the first calculation result by using the private key, calculate a second calculation result according to the decrypted result, and send the second calculation result to the data end. The data end is further configured to obtain the second calculation result sent by the query end, calculate partition number ciphertext according to the second calculation result, the keyword ciphertext, the public key and the preset partition number, and send the partition number ciphertext to the query end. The query end is further configured to obtain the partition number ciphertext sent by the data end, decrypt the partition number ciphertext by using the private key to obtain partition number plaintext, and obtain the query result ciphertext of the partition corresponding to the partition number plaintext. The data end is further configured to determine the query result ciphertext of each partition according to the public key and the keyword ciphertext, and send the query result ciphertext of each partition to the query end. The query end is further configured to obtain the query result ciphertext of the partition corresponding to the partition number plaintext, and decrypt the query result ciphertext by using the private key to obtain query result plaintext. In the system, the data end needs to perform data query in each partition and return the query result ciphertext of each partition. The query end finds the query result ciphertext of the corresponding partition according to the partition number plaintext, and decrypts the query result ciphertext by using the private key to obtain the query result plaintext, thereby realizing anonymous query of data, and the data end cannot know which partition data is actually decrypted by the query end, the query range of the query end is difficult to be deduced by the data end, and the security of privacy information retrieval is improved.

[0100] Of course, implementing any product or method of the present application does not necessarily require all the advantages described above. BRIEF DESCRIPTION OF DRAWINGS

[0101] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiment or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other embodiments can also be obtained by those skilled in the art based on these drawings.

[0102] Figure 1a The first flowchart of the anonymous query method applied to the data end provided by the application embodiment;

[0103] Figure 1b The schematic diagram of the full homomorphic encryption and decryption process;

[0104] Figure 2 A second flowchart of the anonymous query method applied to the data end according to an embodiment of the present application is provided.

[0105] Figure 3 A third flowchart of the anonymous query method applied to the data end according to an embodiment of the present application is provided.

[0106] Figure 4 A fourth flowchart of the anonymous query method applied to the data end according to an embodiment of the present application is provided.

[0107] Figure 5 A fifth flowchart of the anonymous query method applied to the data end according to an embodiment of the present application is provided.

[0108] Figure 6 A first flowchart of the anonymous query method applied to the query end according to an embodiment of the present application is provided.

[0109] Figure 7a A first structure diagram of the anonymous query system according to an embodiment of the present application is provided.

[0110] Figure 7b A second structure diagram of the anonymous query system according to an embodiment of the present application is provided.

[0111] Figure 8 A first structure diagram of the anonymous query device applied to the data end according to an embodiment of the present application is provided.

[0112] Figure 9 A first structure diagram of the anonymous query device applied to the query end according to an embodiment of the present application is provided.

[0113] Figure 10 A first structure diagram of the electronic device applied to the data end according to an embodiment of the present application is provided.

[0114] Figure 11 A first structure diagram of the electronic device applied to the query end according to an embodiment of the present application is provided. DETAILED DESCRIPTION

[0115] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art based on the present application belong to the scope of protection of the present application.

[0116] In order to improve the security of privacy information retrieval, the embodiments of the present application provide a privacy-preserving query system, method, device, electronic equipment and storage medium.

[0117] Firstly, a privacy-preserving query method applied to a data end is described in detail, as shown in Figure 1a The method comprises the following steps:

[0118] In step S101, a keyword ciphertext and a public key sent by a query end are acquired, wherein the keyword ciphertext is obtained by encrypting a to-be-queried keyword by the query end using the public key.

[0119] The data end comprises a plurality of partitions, and each partition stores a query result of a keyword. In an example, the keyword and the query result can be key-value pair data, that is, data composed of the keyword as a key and the query result as a value. Privacy-preserving query refers to that the query end hides the keyword of a to-be-queried object, and the data end provides a matching query result for the query end but cannot know which to-be-queried object corresponds to the specific to-be-queried object.

[0120] The query end acquires a public key and a private key of a homomorphic encryption key pair, then encrypts a to-be-queried keyword using the public key to obtain a keyword ciphertext, and sends the keyword ciphertext and the public key to the data end. When the to-be-queried keyword exists in a database of the data end, the data end can query a correct result, otherwise the data end cannot query the correct result, and can return a message that the query result is empty to the query end.

[0121] Homomorphic encryption is a cryptographic technique based on the computational complexity theory of mathematical problems. Processing homomorphically encrypted data yields an output; decrypting this output produces the same result as processing the unencrypted plaintext data. Homomorphic encryption ensures that the decryptor only knows the final result, not every detail of the ciphertext, thus improving information security and protecting data privacy. Essentially, homomorphic encryption refers to an encryption function where performing ring-based addition and multiplication operations on plaintext before encryption results in an equivalent outcome to performing the corresponding operations on the encrypted ciphertext. The following examples illustrate this. A homomorphic encryption function is one that satisfies the following condition for two plaintexts a and b: Dec(Enc(a)⊙Enc(b))=a⊕b. Here, Enc is the encryption operation, Dec is the decryption operation, and ⊙ and ⊕ correspond to operations on the plaintext and ciphertext fields, respectively. When ⊕ represents addition, the encryption is called additive homomorphic encryption; when ⊕ represents multiplication, it is called multiplicative homomorphic encryption. Fully homomorphic encryption, on the other hand, satisfies both additive and multiplicative homomorphic properties, allowing for any number of addition and multiplication operations. Specifically, Dec(Enc(x1)+Enc(x2))=x1+x2; Dec(Enc(x1)*Enc(x2))=x1*x2, is called fully homomorphic encryption. Fully homomorphic encryption has various implementations, each with different details, but they can generally be divided into four parts: key generation, homomorphic operations, ciphertext operations, and decryption operations. In one example, the Gentry solution is used to illustrate the process, such as... Figure 1b As shown:

[0122] 1. Key Generation: Generate a public key pk and a private key sk using the KeyGen(λ) key generation algorithm, where λ is a security parameter; 2. Encryption Operation: Encrypt the plaintext using the Encrypt(pk,m) encryption algorithm, where pk is the public key and m is the plaintext, outputting ciphertext c (ciphertext data). Note that the encryption algorithm encrypts bit by bit, so m needs to be decomposed into a binary array [m1, m2, ... m...]. t ], 1≤i≤t, and m i ∈{0,1}, for each m i The encryption calculation yields the ciphertext c = [c1, c2, ..., c]. t 3. Homomorphic operation: Perform a homomorphic operation Evaluate(c,pk,f) on the ciphertext c, public key pk, and computation function f. For any two ciphertexts, the computation is decomposed into ciphertext addition and ciphertext multiplication operations, and the result is organized into c' (ciphertext result); 4. Decryption operation: Decrypt the computation result c' using Decrypt(sk,c').

[0123] The key pair includes a public key and a private key, which are a key pair obtained through an algorithm, one of which is disclosed to the outside world and is called a public key, and the other is kept by oneself and is called a private key. The public key and the private key are paired, and they can decrypt each other (the key refers to the public key or the private key, and the key pair refers to the public key plus the private key). Both the public key and the private key can encrypt and decrypt. When using this key pair, if one of the keys is used to encrypt a piece of data, the other key must be used to decrypt it. For example, if the data is encrypted using the public key, it must be decrypted using the private key, and if it is encrypted using the private key, it must be decrypted using the public key, otherwise the decryption will not be successful. The public key is usually used to encrypt the session key, verify the digital signature, or encrypt data that can be decrypted using the corresponding private key. In one example, the sender uses the private key to encrypt the digest of the text to be transmitted, and the obtained ciphertext is the signature of this transmission process. The receiving end obtains the transmitted text and needs to confirm whether the text is the content sent by the sender and whether it has been tampered with in the middle. Therefore, the public key held by the receiving end is used to decrypt the signature, and the digest of the transmitted text is obtained. Then, the same algorithm (the same calculation function) as the sender is used to calculate the digest of the transmitted text, and the calculated digest is compared with the decrypted digest. If they are completely identical (equal), it means that the text has not been tampered with.

[0124] In step S102, a first calculation result is calculated according to the keyword ciphertext, the public key, and a preset partition number.

[0125] The preset partition number is the number of partitions used by the data end when partitioning its own database, which can be denoted as n, and n is an integer greater than 2. The first calculation result is an intermediate data result for calculating the partition to which the keyword to be queried belongs.

[0126] In step S103, the first calculation result is sent to the query end, so that the query end decrypts the first calculation result using a private key and calculates a second calculation result according to the decryption result; wherein the database of the data end is divided into multiple partitions, the data stored in each partition is different, and the public key and the private key belong to the same key pair of the query end.

[0127] The second calculation result is an intermediate data result for calculating the partition to which the keyword to be queried belongs. The query end decrypts the first calculation result using a private key, calculates a second calculation result according to the decryption result, and sends it to the data end. The private key and the public key are paired and belong to the same key pair of the query end, and in one example, they belong to the same homomorphic encryption key pair.

[0128] In step S104, the second calculation result sent by the query end is obtained, and a partition number ciphertext is calculated according to the second calculation result, the keyword ciphertext, the public key, and the preset partition number.

[0129] In the embodiment of the present application, the calculation process of the partition to which the keyword to be queried belongs is divided into three parts. The data end calculates a first calculation result according to the keyword ciphertext, the public key and the preset number of partitions, and sends the first calculation result to the query end. The query end decrypts the first calculation result by using the private key, calculates a second calculation result according to the decrypted data, and sends the second calculation result to the data end. Then, the data end calculates a partition number ciphertext according to the second calculation result, the keyword ciphertext, the public key and the preset number of partitions. The query end and the data end are only responsible for a part of the calculation process (the data end cannot obtain the private key, so it cannot reverse the process of the query end calculating the second calculation result), so that the query end and the data end cannot master the entire processing process, and neither of them can reverse the processing process of the other end by relying on the data they master, thereby improving the security of private information retrieval.

[0130] The partition number refers to the number corresponding to the preset partition, and each partition corresponds to a unique partition number. In an example, the partition number of the first partition can be 1, the partition number of the second partition can be 2, and so on. In an example, in order to improve the privacy of the partition, a partition number can be randomly generated for each partition, as long as the partition numbers of the partitions are different.

[0131] In step S105, the partition number ciphertext is sent to the query end, so that the query end decrypts the partition number ciphertext by using the private key to obtain the partition number plaintext.

[0132] After the query end obtains the partition number ciphertext sent by the data end, the partition number ciphertext is decrypted by using the private key to obtain the partition number plaintext of the partition to which the keyword to be queried belongs. The partition number plaintext here refers to the unencrypted partition number (the partition number corresponding to the partition to which the keyword to be queried belongs).

[0133] In step S106, for each partition, the query result ciphertext of the partition is determined according to the public key and the keyword ciphertext.

[0134] Since the data end does not know which preset partition the keyword to be queried belongs to, the query result ciphertext of each preset partition needs to be determined based on the keyword ciphertext and the public key.

[0135] In step S107, the query result ciphertexts of the partitions are sent to the query end, so that the query end obtains the query result ciphertexts of the corresponding partitions according to the partition number plaintext, and decrypts the query result ciphertexts by using the private key to obtain the query result plaintext.

[0136] According to step S105, the query end has obtained the partition number plaintext corresponding to the partition to which the to-be-queried keyword belongs, and thus, after receiving the query result ciphertext of each partition sent by the data end, the query end can obtain the query result ciphertext of the corresponding partition according to the known partition number plaintext (the partition number corresponding to the partition to which the to-be-queried keyword belongs), and then decrypt the query result ciphertext by using the private key to obtain the query result plaintext, that is, the query result corresponding to the to-be-queried keyword.

[0137] In the embodiment of the present application, the calculation process of the partition to which the to-be-queried keyword belongs is divided into three parts, and the query end and the data end are only responsible for one part of the calculation process, so that the query end and the data end cannot master the entire processing process, and neither of them can infer the processing process of the other end only by the data they master. The data end needs to perform data query in each partition and return the query result ciphertext of each partition, the query end finds the query result ciphertext of the corresponding partition according to the partition number plaintext, and decrypts the query result ciphertext by using the private key to obtain the query result plaintext, which realizes the anonymous query of data, and the data end does not know which partition data the query end actually decrypts, and it is difficult for the data end to infer the query range of the query end, thereby improving the security of the private information retrieval. In addition, the query end also cannot master the overall calculation process of the data end, and thus cannot know the partition rule of the data end, thereby improving the security of the private information retrieval.

[0138] Referring to Figure 2 The second flowchart of the anonymous query method applied to the data end provided in the embodiment of the present application includes the following steps:

[0139] Step S201: According to the preset number of partitions, the partition to which each keyword belongs is calculated by using a preset partition algorithm.

[0140] The preset number of partitions can be set according to actual conditions, and can be set according to the size of the total data amount in the database and the calculation ability of the calculation resource, which is not limited in the present application. The preset partition algorithm can use an algorithm corresponding to the distribution characteristics of the data, for example, the database can be partitioned based on the hash value of the keyword, and the partition to which each keyword belongs is calculated. Specifically, the partition of the keyword can be realized by using algorithms such as the remainder method, direct addressing method, random method or folding method based on the hash value.

[0141] Step S202: For each keyword, the result data of the keyword is divided into the partition to which the keyword belongs.

[0142] For each keyword, according to its hash value, the result data corresponding to the keyword is divided into the partition to which the keyword belongs. For a given keyword, the result data corresponding to the keyword can be divided into different partitions according to hash values. For example, the data end has key-value pair data <k1, v1>, <k2, v2>… <kn, vn>, after using a preset partition algorithm, the key-value pair data is divided into n different partitions. n n n n Step S203, for each partition, a polynomial function with the keyword as the independent variable and the result data as the dependent variable in the partition is established.

[0143] Step S203, for each partition, a polynomial function with the keyword as the independent variable and the result data as the dependent variable in the partition is established.

[0144] The data end generates a polynomial function relationship between the keyword and the result data for each partition, where the polynomial function has the keyword as the independent variable and the result data as the dependent variable. In an example, if the keyword is x, the corresponding result data is F(x).

[0145] It can be understood that the data end does not need to perform the partitioning process every time before querying, and the above partitioning process is only performed when the database of the data end is constructed or the preset partition algorithm needs to be changed.

[0146] In the embodiments of the present application, the data end calculates the partition to which each keyword belongs by using a preset partition algorithm, divides the result data of each keyword into the partition to which the keyword belongs, and establishes a polynomial function with the keyword as the independent variable and the result data as the dependent variable in each partition. The data end uses the data partition preprocessing method, which can effectively reduce the computational overhead. For example, the data end can construct multiple partitions simultaneously when constructing the polynomial function relationship, improving the computational efficiency, and when the database is updated, only the polynomial function relationship of the partition needs to be recalculated, without needing to be based on all polynomial functions, effectively reducing the computational amount when the data is updated.

[0147] Referring to Figure 3 FIG. 3 is a third flow diagram of an anonymous query method applied to a data end according to an embodiment of the present application, which is based on the steps S102 and S104 in FIG. 2 and is refined as follows. Figure 1a

[0148] Step S301, encrypting the preset partition number using the public key to obtain first data.

[0149] The first data is the encrypted preset partition number, denoted as Enc(n), which is obtained by encrypting the preset partition number using the public key by the data end.

[0150] Step S302: Perform calculations on the first data and the keyword ciphertext using preset first arithmetic operations to obtain a first calculation result.

[0151] Let k represent the keyword to be queried. The query end uses the public key pk to encrypt the keyword k. The ciphertext of the keyword is Enc(k). The ciphertext of the keyword Enc(k) and the public key pk are sent to the data end. The data end performs calculations on the first data Enc(n) and the ciphertext of the keyword Enc(k) according to the preset first four arithmetic operations to obtain the first calculation result.

[0152] Step S303: Perform operations on the second calculation result, the first data, and the keyword ciphertext using a preset second arithmetic operation to obtain the partition number ciphertext; wherein the preset first arithmetic operation and the second arithmetic operation are obtained by splitting through the preset partitioning algorithm.

[0153] After the data terminal sends the first calculation result Enc(k / n) to the query terminal, the query terminal decrypts the first calculation result Enc(k / n) using its private key, calculates the second calculation result based on the decryption result, denoted as d, and sends the second calculation result d to the data terminal. The data terminal performs operations on the second calculation result d, the first data Enc(n), and the keyword ciphertext Enc(k) according to the preset second arithmetic operations to obtain the partition number ciphertext.

[0154] The first and second preset arithmetic operations are both related to the preset partitioning algorithm and can be obtained by splitting the operations using the preset partitioning algorithm. The calculation process of the preset partitioning algorithm can be reconstructed through the first and second preset arithmetic operations and the operations performed by the query end.

[0155] In this embodiment of the application, after the data terminal obtains the first calculation result through the preset first four arithmetic operations, it transmits the intermediate calculation result to the query terminal. Finally, the partition number ciphertext is obtained through the preset second four arithmetic operations, thereby realizing the acquisition of the partition number ciphertext.

[0156] The following example uses the division-remainder method as the default partitioning algorithm. (See also...) Figure 4 This is a schematic diagram of the fourth process of the anonymous query method applied to the data end provided in the embodiments of this application, based on... Figure 2 Step S201 in Figure 3 Steps S302 and S303 in the document have been further refined, including the following steps:

[0157] Step S401: For each keyword, the remainder of the keyword is calculated by using the preset number of partitions as the divisor and the remainder method. The partition corresponding to the remainder of the keyword is the partition shown by the keyword, and the partition and the remainder correspond one-to-one.

[0158] The remainder method is a hash algorithm, which takes the hash value of the keyword as the dividend, takes the preset partition number as the divisor, and performs division operation to obtain the remainder of the keyword. In an example, when the preset partition algorithm is the remainder method, the preset partition algorithm can be represented as g(x) = k' mod n, where k' represents the keyword, n is the preset partition number, and k'-d*n=p can be obtained, and the remainder p is the partition number corresponding to the keyword k'.

[0159] In step S402, division operation is performed on the keyword ciphertext and the first data to obtain the first calculation result.

[0160] The data end performs division operation on the first data Enc(n) and the keyword ciphertext Enc(k), Enc(k) / Enc(n) = Enc(k / n), that is, obtains the first calculation result Enc(k / n).

[0161] In step S403, multiplication operation is performed on the first data and the second calculation result to obtain the second data.

[0162] The first data Enc(n) is multiplied by the second calculation result d, that is, the second data Enc(n)*d is obtained, which can also be Enc(d*n).

[0163] In step S404, subtraction operation is performed on the keyword ciphertext and the second data to obtain the partition number ciphertext.

[0164] The keyword ciphertext Enc(k) is subtracted from the second data Enc(d*n), Enc(k)-Enc(d*n) = Enc(k)-Enc(n)*d = Enc(p), that is, the partition number ciphertext Enc(p) is obtained.

[0165] The data end sends the partition number ciphertext Enc(p) to the query end, and the query end decrypts Enc(p) using the private key sk to obtain the partition number p corresponding to the keyword to be queried.

[0166] In the embodiments of the present application, the data end calculates the remainder of each keyword by the remainder method, and the remainder of the keyword is the partition number corresponding to the keyword; the keyword ciphertext and the second data are operated to obtain the partition number ciphertext, the partition number ciphertext is sent to the query end, and the query end is decrypted using the private key to obtain the partition number corresponding to the keyword to be queried.

[0167] Referring to Figure 5 The fifth flowchart of the anonymous query method applied to the data end provided by the embodiments of the present application is based on the step S106 in FIG. 1 and is refined, and includes the following steps:

[0168] Step S501, for each partition, homomorphic operation is performed on the keyword ciphertext, the public key and the polynomial function of the partition to obtain the query result ciphertext of the partition.

[0169] The polynomial function of the partition is pre-calculated according to the data in the partition. In one example, the data end has key-value pair data <k1, v1>, <k2, v2>…<k n ,v n > and after using the partition algorithm g(x), the key-value pair data is divided into n different partitions. For the i-th partition, assuming that the partition has m data, the function value of the given polynomial function F(x) on k i1 ,k i2 …k im is F(k i1 ) = v i1 , F(k i2 ) = v i2 …F(k im ) = v im , the value of i ranges from 1 to n, and the interpolation method is used to calculate F(x) = a0+a1x+a2x 2 +…+a m x m polynomial. The interpolation method refers to supplementing a continuous function on the basis of discrete data so that the continuous curve passes through all the given discrete data points.

[0170] For each partition, the keyword ciphertext and the public key are substituted into the polynomial function of the partition to obtain the query result ciphertext of the partition. In one example, the query end encrypts the to-be-queried keyword k using the public key pk to obtain the keyword ciphertext Enc(k), and k ∈ {k1, k2, k3…k n}, substitutes Enc(k) and the public key pk into each partition F(x) for calculation, and converts the calculation into the addition and multiplication of ciphertexts, for example, F(x) = a0+a1x, which can be converted into F(k) = v = a0+a1k = Dec(Enc(a0)+Enc(a1k)) = Dec(Enc(a0)+Enc(k)*a1), and Enc(a0)+Enc(k)*a1 needs to be calculated, denoted as query result ciphertext Enc(v).

[0171] Each partition performs homomorphic operation, and the obtained query result ciphertext Enc(v) and the partition number q of the partition are sent to the query end in the form of key-value pair information, for example, <q1, Enc(v1)>, <q2, Enc(v2)>…<q n ,Enc(v n )>.

[0172] The query uses the previously calculated partition numbers p and q. i Compare, if p = q i Then, using the private key sk, we can decrypt Enc(v) i ) Get the query result v i Conversely, if no match can be found, the query will return no results.

[0173] In this embodiment, for each partition, the data end performs a homomorphic operation on the keyword ciphertext, public key, and polynomial function of that partition to obtain the query result ciphertext for that partition. The query result ciphertext of each partition and the corresponding partition number are combined into a key-value pair and sent to the query end. The query end uses the known partition number of the partition to which the query keyword belongs to find the query result ciphertext of the corresponding partition and decrypts it, thus realizing the acquisition of the query result corresponding to the query keyword.

[0174] See Figure 6 This is a schematic diagram of the first flowchart of the anonymous query method applied to the query end provided in the embodiments of this application, which includes the following steps:

[0175] Step S601: Obtain a key pair and a keyword to be queried, wherein the key pair includes a public key and a private key; encrypt the keyword to be queried using the public key to obtain the keyword ciphertext;

[0176] The specific analysis process is the same as described above, and will not be repeated here.

[0177] Step S602: Send the ciphertext of the keyword and the public key to the data terminal, so that the data terminal can calculate the first calculation result based on the ciphertext of the keyword, the public key and the preset number of partitions;

[0178] The specific analysis process is the same as described above, and will not be repeated here.

[0179] Step S603: Obtain the first calculation result sent by the data terminal, decrypt the first calculation result using the private key, and calculate the second calculation result based on the decryption result;

[0180] The specific analysis process is the same as described above, and will not be repeated here.

[0181] Step S604: The second calculation result is sent to the data terminal so that the data terminal calculates the partition number ciphertext based on the second calculation result, the keyword ciphertext, the public key and the preset number of partitions. For each partition, the data terminal determines the query result ciphertext of the partition based on the public key and the keyword ciphertext, and sends the query result ciphertext of each partition to the query terminal.

[0182] The specific analysis process is the same as the above, and will not be described here again.

[0183] In step S605, the partition number ciphertext sent by the data end is obtained, and the partition number ciphertext is decrypted by using the private key to obtain the partition number plaintext.

[0184] The specific analysis process is the same as the above, and will not be described here again.

[0185] In step S606, the query result ciphertext of the partition corresponding to the partition number plaintext is obtained, and the query result plaintext is obtained by using the private key.

[0186] The specific analysis process is the same as the above, and will not be described here again.

[0187] In the embodiment of the application, the calculation process of the partition to which the to-be-queried keyword belongs is divided into three parts, and the query end and the data end are only responsible for one part of the calculation process, so that the query end and the data end cannot master the entire processing process, and both of them cannot infer the processing process of the other end only by the data mastered by themselves. The data end needs to perform data query in each partition and return the query result ciphertext of each partition, and the query end finds the query result ciphertext of the corresponding partition according to the partition number plaintext, and decrypts the query result ciphertext by using the private key to obtain the query result plaintext, thereby realizing the anonymous query of data, and the data end does not know which partition data the query end actually decrypts, the data end is difficult to infer the query range of the query end, and the security of the private information retrieval is improved. In addition, the query end also cannot master the entire calculation process of the data end, and thus cannot know the partition rule of the data end, thereby improving the security of the private information retrieval.

[0188] In a possible implementation, the decrypting the first calculation result by using the private key and calculating a second calculation result according to the decrypted result comprises:

[0189] The first calculation result is decrypted by using the private key to obtain third data.

[0190] The query end decrypts the first calculation result Enc(k / n) by using the private key to obtain third data Dec(Enc(k / n)).

[0191] The third data is operated by using a preset data algorithm to obtain the second calculation result, wherein the preset data algorithm is obtained by splitting a preset partition algorithm, and the preset partition algorithm is an algorithm used when the data end calculates the partition to which each keyword belongs.

[0192] The query end operates the third data Dec(Enc(k / n)) to obtain the second calculation result d, and sends the second calculation result d to the data end.

[0193] In the embodiment of the present application, the query end decrypts the first calculation result by using the private key to obtain third data; performs operation on the third data by using a preset data algorithm to obtain a second calculation result, and sends the second calculation result to the data end, so as to facilitate the data end to obtain the partition number ciphertext.

[0194] In a possible implementation, the preset partition algorithm is a remainder exclusion method, and the operation on the third data by using the preset data algorithm to obtain the second calculation result includes:

[0195] performing down-round operation on the third data to obtain the second calculation result.

[0196] The query end performs down-round operation on the third data Dec(Enc(k / n)) to obtain the second calculation result d.

[0197] In the embodiment of the present application, the query end performs down-round operation on the third data to obtain the second calculation result.

[0198] Referring to Figure 7a , a structural schematic diagram of an anonymous query system provided by the embodiment of the present application includes:

[0199] the data end 710 and the query end 720;

[0200] The query end 720 is configured to obtain a key pair and a to-be-queried keyword, the key pair including a public key and a private key; encrypt the to-be-queried keyword by using the public key to obtain keyword ciphertext; and send the keyword ciphertext and the public key to the data end 710.

[0201] The data end 710 is configured to obtain the keyword ciphertext and the public key sent by the query end 720; calculate a first calculation result according to the keyword ciphertext, the public key, and a preset partition number; and send the first calculation result to the query end 720; wherein a database of the data end is divided into a plurality of partitions, and the data stored in each partition is different.

[0202] The query end 720 is further configured to obtain the first calculation result sent by the data end 710, decrypt the first calculation result by using the private key, and calculate a second calculation result according to the decryption result; and send the second calculation result to the data end 710.

[0203] The data end 710 is further configured to obtain the second calculation result sent by the query end 720, calculate partition number ciphertext according to the second calculation result, the keyword ciphertext, the public key, and the preset partition number; and send the partition number ciphertext to the query end 720.

[0204] The query end 720 is also configured to obtain the partition number ciphertext sent by the data end 710, decrypt the partition number ciphertext using the private key, and obtain partition number plaintext;

[0205] The data end 710 is also configured to determine, for each partition, the query result ciphertext of the partition according to the public key and the keyword ciphertext, and send the query result ciphertext of each partition to the query end 720;

[0206] The query end 720 is also configured to obtain the query result ciphertext of the partition corresponding to the partition number plaintext, and decrypt the query result ciphertext using the private key to obtain query result plaintext.

[0207] Specifically, the interaction between the data end and the query end is shown in the schematic diagram as Figure 7b .

[0208] 1. The data end partitions data according to keywords using a partition algorithm g(x), the number of partitions is n, and a polynomial function relationship formula F1(x), F2(x) … Fn(x) of keywords and query results is constructed for each partition. n .

[0209] 2. The query end generates a homomorphic encryption key pair (pk, sk).

[0210] 3. The query end encrypts the keyword to be queried k using the public key pk to obtain keyword ciphertext Enc(k), and sends the keyword ciphertext Enc(k) and the public key pk to the data end.

[0211] 4. The data end calculates a first calculation result Enc(k / n) by Enc(k), the public key pk, and the number of partitions n, and sends the first calculation result Enc(k / n) to the query end.

[0212] 5. The query end decrypts the first calculation result using the private key sk and calculates to obtain a second calculation result d, and sends the second calculation result d to the data end.

[0213] 6. The data end substitutes the second calculation result d, Enc(k), the public key pk, and the number of partitions n into g(x) to calculate partition number ciphertext Enc(p), and sends the partition number ciphertext Enc(p) to the query end.

[0214] 7. The query end decrypts the partition number ciphertext Enc(p) using the private key sk and calculates to obtain partition number p.

[0215] 8. The data end calculates query result ciphertext Enc(v1), Enc(v2) … Enc(vn) of each partition using the public key pk and Enc(k), and sends the query result ciphertext to the query end.n ), the query end sends the query result ciphertext and the corresponding partition number of each partition to the query end <q1, Enc(v1)>, <q2, Enc(v2)>... <q n , Enc(v n )>;

[0216] 9. Query end: when p=q i , the private key sk is used to decrypt Enc(v i ) to obtain v i , v i is the query result corresponding to the query keyword k, otherwise the query has no result.

[0217] In the embodiment of the application, the calculation process of the partition to which the query keyword belongs is divided into three parts, and the query end and the data end are only responsible for one part of the calculation process, so that the query end and the data end cannot master the entire processing process, and both of them cannot infer the processing process of the other end by relying on the data they master. The data end needs to perform data query in each partition and return the query result ciphertext of each partition, and the query end finds the query result ciphertext of the corresponding partition according to the partition number plaintext, and obtains the query result plaintext by decryption through the private key, realizes the anonymous query of data, and the data end does not know which partition data the query end actually decrypts, and the data end is difficult to infer the query range of the query end, thereby improving the security of the privacy information retrieval; in addition, the query end also cannot master the overall calculation process of the data end, so it cannot know the partition rule of the data end, thereby improving the security of the privacy information retrieval.

[0218] In a possible implementation, the data end is further configured to calculate the partition to which each keyword belongs respectively according to the preset number of partitions through a preset partition algorithm; for each keyword, the result data of the keyword is divided into the partition to which the keyword belongs; for each partition, a polynomial function with the keyword as the independent variable and the result data as the dependent variable is established in the partition.

[0219] In the embodiment of the application, the data end calculates the partition to which each keyword belongs respectively through a preset partition algorithm, for each keyword, the result data of the keyword is divided into the partition to which the keyword belongs, and for each partition, a polynomial function with the keyword as the independent variable and the result data as the dependent variable is established in the partition. The data end uses the data partition preprocessing method, which can effectively reduce the computational overhead. For example, when constructing the polynomial function relationship, multiple partitions can be constructed at the same time to improve the calculation efficiency, and when the database is updated, only the polynomial function relationship of the partition needs to be recalculated, without needing to be calculated according to all the polynomial functions, thereby effectively reducing the computational amount when the data is updated.

[0220] In a possible implementation, the data end is specifically configured to calculate, for each keyword, a remainder of the keyword by using the preset number of partitions as a divisor through a remainder calculation method; the partition corresponding to the remainder of the keyword is the partition indicated by the keyword, and the partition and the remainder correspond to each other.

[0221] In the embodiment of the application, the data end calculates the remainder of each keyword through the remainder calculation method, and the remainder of the keyword is the partition number corresponding to the keyword, thereby achieving acquisition of the partition number corresponding to the keyword.

[0222] In a possible implementation, the data end is specifically configured to encrypt the preset number of partitions by using the public key to obtain first data; and perform division operation on the first data and the keyword ciphertext through a preset first four arithmetic operations to obtain a first calculation result.

[0223] The query end is specifically configured to decrypt the first calculation result by using the private key to obtain third data; and perform down-round operation on the third data through a preset data algorithm to obtain a second calculation result; the preset data algorithm is obtained through a preset partition algorithm, and the preset partition algorithm is the remainder calculation method.

[0224] The data end is further specifically configured to perform multiplication operation on the first data and the second calculation result through a preset second four arithmetic operations to obtain second data; and perform subtraction operation on the keyword ciphertext and the second data to obtain partition number ciphertext; the preset first four arithmetic operations and the second four arithmetic operations are obtained through the preset partition algorithm.

[0225] In the embodiment of the application, after the data end obtains the first calculation result through the preset first four arithmetic operations, the data end and the query end transmit intermediate calculation results to each other, and finally obtain the partition number ciphertext through the preset second four arithmetic operations, thereby achieving acquisition of the partition number ciphertext.

[0226] In a possible implementation, the data end is specifically configured to perform homomorphic operation on the keyword ciphertext, the public key, and a polynomial function of each partition to obtain query result ciphertext of the partition.

[0227] In the embodiment of the application, for each partition, the data end performs homomorphic operation on the keyword ciphertext, the public key, and a polynomial function of the partition to obtain query result ciphertext of the partition, sends the query result ciphertext of each partition and the corresponding partition number to the query end in a key-value pair, and the query end finds the query result ciphertext of the corresponding partition by using the partition number of the partition to which the keyword to be queried belongs, and decrypts the query result ciphertext, thereby achieving acquisition of the query result corresponding to the keyword to be queried.

[0228] Referring to Figure 8 A structural schematic diagram of an anonymous query device for a data end provided by an embodiment of the present application comprises:

[0229] A first obtaining module 810 is configured to obtain a keyword ciphertext and a public key sent by a query end, wherein the keyword ciphertext is obtained by encrypting a keyword to be queried by the query end using the public key;

[0230] A first calculation result obtaining module 820 is configured to calculate a first calculation result according to the keyword ciphertext, the public key, and a preset partition number; wherein a database of the data end is divided into a plurality of partitions, and data stored in each partition is different;

[0231] A first sending module 830 is configured to send the first calculation result to the query end, so that the query end decrypts the first calculation result using a private key and calculates a second calculation result according to a decryption result; the public key and the private key belong to a same key pair of the query end;

[0232] A second obtaining module 840 is configured to obtain a second calculation result sent by the query end;

[0233] A partition number ciphertext obtaining module 850 is configured to calculate a partition number ciphertext according to the second calculation result, the keyword ciphertext, the public key, and the preset partition number;

[0234] A second sending module 860 is configured to send the partition number ciphertext to the query end, so that the query end decrypts the partition number ciphertext using the private key to obtain a partition number plaintext;

[0235] A determining module 870 is configured to determine, for each partition, a query result ciphertext of the partition according to the public key and the keyword ciphertext;

[0236] A third sending module 880 is configured to send the query result ciphertexts of the partitions to the query end, so that the query end obtains the query result ciphertexts of the corresponding partitions according to the partition number plaintext and decrypts to obtain query result plaintexts using the private key.

[0237] In the embodiment of the present application, the calculation process of the partition to which the to-be-queried keyword belongs is divided into three parts, and the query end and the data end are only responsible for one part of the calculation process, so that the query end and the data end cannot master the entire processing process, and neither of them can infer the processing process of the other end by means of the data they master. The data end needs to perform data query in each partition and return the query result ciphertext of each partition, and the query end finds the query result ciphertext of the corresponding partition according to the partition number plaintext, and decrypts to obtain the query result plaintext through the private key, thereby realizing the anonymous query of data, and the data end does not know which partition data the query end actually decrypts, and the data end is difficult to infer the query range of the query end, thereby improving the security of the private information retrieval. In addition, the query end also cannot master the overall calculation process of the data end, and thus cannot know the partition rule of the data end, thereby improving the security of the private information retrieval.

[0238] In a possible implementation, the apparatus further includes:

[0239] The keyword partition calculation module is configured to calculate the partition to which each keyword belongs by using a preset partition algorithm according to the preset number of partitions.

[0240] The division module is configured to divide, for each keyword, the result data of the keyword into the partition to which the keyword belongs.

[0241] The polynomial function establishment module is configured to establish, for each partition, a polynomial function in which the keyword is the independent variable and the result data is the dependent variable.

[0242] In the embodiment of the present application, the data end calculates the partition to which each keyword belongs by using a preset partition algorithm, divides, for each keyword, the result data of the keyword into the partition to which the keyword belongs, and establishes, for each partition, a polynomial function in which the keyword is the independent variable and the result data is the dependent variable. The data end uses the data partition preprocessing manner, which can effectively reduce the computational cost. For example, when constructing the polynomial function relationship, the data end can simultaneously construct multiple partitions to improve the calculation efficiency, and when the database is updated, only the polynomial function relationship of the partition needs to be recalculated, without the need to use all the polynomial functions, thereby effectively reducing the calculation amount when the data is updated.

[0243] In a possible implementation, the first calculation result acquisition module 820 includes:

[0244] The first data acquisition submodule is configured to encrypt the preset number of partitions by using the public key to obtain first data.

[0245] The first calculation result obtaining submodule is configured to obtain a first calculation result by performing a preset first four arithmetic operations on the first data and the keyword ciphertext.

[0246] The partition number ciphertext obtaining module 850 includes:

[0247] The partition number ciphertext obtaining submodule is configured to obtain a partition number ciphertext by performing a preset second four arithmetic operations on the second calculation result, the first data and the keyword ciphertext.

[0248] In the embodiment, the data end obtains a first calculation result by performing a preset first four arithmetic operations, and then transmits an intermediate calculation result to the query end, and finally obtains a partition number ciphertext by performing a preset second four arithmetic operations, so that the partition number ciphertext is obtained.

[0249] In a possible implementation, the preset partition algorithm is a remainder division method, and the partition number calculation module includes:

[0250] The remainder calculation submodule is configured to calculate, for each keyword, a remainder of the keyword by taking the preset partition number as a divisor by using the remainder division method, wherein the partition corresponding to the remainder of the keyword is the partition indicated by the keyword, and the partition and the remainder are in one-to-one correspondence.

[0251] The first calculation result obtaining submodule is specifically configured to:

[0252] perform a division operation on the keyword ciphertext and the first data to obtain the first calculation result.

[0253] The partition number ciphertext obtaining submodule is specifically configured to:

[0254] perform a multiplication operation on the first data and the second calculation result to obtain second data.

[0255] perform a subtraction operation on the keyword ciphertext and the second data to obtain a partition number ciphertext.

[0256] In the embodiment, the data end calculates a remainder of each keyword by using the remainder division method, and the remainder of the keyword is the partition number corresponding to the keyword; and the partition number ciphertext is obtained by performing an operation on the keyword ciphertext and the second data, and is sent to the query end, so that the partition number corresponding to the keyword to be queried is obtained by using a private key for decryption by the query end.

[0257] In a possible implementation, the determining module 870 includes:

[0258] The query result ciphertext obtaining submodule is configured to, for each partition, perform homomorphic operation on the keyword ciphertext, the public key, and the polynomial function of the partition to obtain the query result ciphertext of the partition.

[0259] In the embodiment of the application, for each partition, the data end performs homomorphic operation on the keyword ciphertext, the public key, and the polynomial function of the partition to obtain the query result ciphertext of the partition, and sends the query result ciphertext of each partition and the corresponding partition number to the query end. The query end finds the query result ciphertext of the corresponding partition by using the partition number of the partition to which the keyword to be queried belongs, and decrypts the query result ciphertext, thereby realizing the acquisition of the query result corresponding to the keyword to be queried.

[0260] Referring to Figure 9 A structural schematic diagram of an anonymous query device for a query end provided in the embodiment of the application includes:

[0261] The first obtaining module 9010 is configured to obtain a key pair and a keyword to be queried, wherein the key pair includes a public key and a private key.

[0262] The keyword ciphertext obtaining module 9020 is configured to encrypt the keyword to be queried by using the public key to obtain a keyword ciphertext.

[0263] The first sending module 9030 is configured to send the keyword ciphertext and the public key to a data end, so that the data end calculates a first calculation result according to the keyword ciphertext, the public key, and a preset number of partitions.

[0264] The second obtaining module 9040 is configured to obtain the first calculation result sent by the data end.

[0265] The second calculation result obtaining module 9050 is configured to decrypt the first calculation result by using the private key and calculate a second calculation result according to the decryption result.

[0266] The second sending module 9060 is configured to send the second calculation result to the data end, so that the data end calculates a partition number ciphertext according to the second calculation result, the keyword ciphertext, the public key, and the preset number of partitions. The data end determines, for each partition, a query result ciphertext of the partition according to the public key and the keyword ciphertext, and sends the query result ciphertext of each partition to the query end.

[0267] The third obtaining module 9070 is configured to obtain the partition number ciphertext sent by the data end.

[0268] The partition number plaintext obtaining module 9080 is configured to decrypt the partition number ciphertext by using the private key to obtain a partition number plaintext.

[0269] The fourth obtaining module 9090 is configured to obtain query result ciphertext of a partition corresponding to the partition number plaintext.

[0270] The query result plaintext obtaining module 9100 is configured to decrypt the query result ciphertext by using the private key to obtain query result plaintext.

[0271] In the embodiment of the application, the calculation process of the partition to which the to-be-queried keyword belongs is divided into three parts, and the query end and the data end are only responsible for one part of the calculation process, so that the query end and the data end cannot master the entire processing process, and neither of them can infer the processing process of the other end by only relying on the data mastered by itself. The data end needs to perform data query in each partition and return query result ciphertext of each partition, the query end finds query result ciphertext of the corresponding partition according to the partition number plaintext, and decrypts the query result ciphertext by using the private key to obtain query result plaintext, thereby achieving anonymous query of data, and the data end does not know which partition data the query end actually decrypts, the data end is difficult to infer the query range of the query end, and the security of private information retrieval is improved. In addition, the query end also cannot master the entire calculation process of the data end, and thus cannot know the partition rule of the data end, thereby improving the security of private information retrieval.

[0272] In a possible implementation, the second calculation result obtaining module 9050 includes:

[0273] The third data obtaining sub-module is configured to decrypt the first calculation result by using the private key to obtain third data.

[0274] The second calculation result obtaining sub-module is configured to operate the third data by using a preset data algorithm to obtain second calculation result, wherein the preset data algorithm is obtained by splitting a preset partition algorithm, and the preset partition algorithm is an algorithm used when the data end calculates the partition to which each keyword belongs.

[0275] In the embodiment of the application, the query end decrypts the first calculation result by using the private key to obtain third data, operates the third data by using a preset data algorithm to obtain second calculation result, and sends the second calculation result to the data end, thereby facilitating the data end to obtain the partition number ciphertext.

[0276] In a possible implementation, the preset partition algorithm is a remainder-excluding method, and the second calculation result obtaining sub-module is specifically configured to:

[0277] Perform down-round operation on the third data to obtain the second calculation result.

[0278] In the embodiment of the present application, the query end performs down-round operation on the third data, and the second calculation result is obtained.

[0279] The embodiment of the present application also provides an electronic device, as shown in Figure 10 The embodiment of the present application also provides an electronic device, as shown in

[0280] The memory 1001 is used for storing computer programs;

[0281] The processor 1002 is used for executing the programs stored in the memory 1001, and the following steps are implemented:

[0282] The processor 1002 is used for executing the programs stored in the memory 1001, and the following steps are implemented:

[0283] According to the keyword ciphertext, the public key and the preset partition number, a first calculation result is calculated; the first calculation result is sent to the query end, so that the query end decrypts the first calculation result by using a private key, and a second calculation result is calculated according to the decrypted result; wherein the database of the data end is divided into multiple partitions, the data stored in each partition is different, and the public key and the private key belong to the same key pair of the query end;

[0284] The processor 1002 is used for executing the programs stored in the memory 1001, and the following steps are implemented:

[0285] The processor 1002 is used for executing the programs stored in the memory 1001, and the following steps are implemented:

[0286] For each partition, the public key and the keyword ciphertext are used to determine the query result ciphertext of the partition;

[0287] The processor 1002 is used for executing the programs stored in the memory 1001, and the following steps are implemented:

[0288] The embodiment of the present application also provides an electronic device, as shown in Figure 11 The embodiment of the present application also provides an electronic device, as shown in

[0289] The memory 1101 is used for storing computer programs;

[0290] The processor 1102 is used for executing the programs stored in the memory 1101, and the following steps are implemented:

[0291] Obtain a key pair and a keyword to be queried, the key pair comprising a public key and a private key; encrypt the keyword to be queried by using the public key to obtain keyword ciphertext;

[0292] Send the keyword ciphertext and the public key to a data terminal, so that the data terminal calculates a first calculation result according to the keyword ciphertext, the public key and a preset partition number;

[0293] Obtain the first calculation result sent by the data terminal, decrypt the first calculation result by using the private key, and calculate a second calculation result according to the decrypted result;

[0294] Send the second calculation result to the data terminal, so that the data terminal calculates partition number ciphertext according to the second calculation result, the keyword ciphertext, the public key and the preset partition number, and the data terminal determines the query result ciphertext of each partition according to the public key and the keyword ciphertext, and sends the query result ciphertext of each partition to the query terminal;

[0295] Obtain the partition number ciphertext sent by the data terminal, decrypt the partition number ciphertext by using the private key to obtain partition number plaintext;

[0296] Obtain the query result ciphertext of the partition corresponding to the partition number plaintext, and decrypt the query result plaintext by using the private key.

[0297] And the electronic device can further include a communication bus and / or a communication interface, and the processor, the communication interface and the memory can communicate with each other through the communication bus.

[0298] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.

[0299] The communication interface is used for communication between the electronic device and other devices.

[0300] The memory can include a random access memory (RAM) and can also include a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory can also be at least one storage device located remotely from the aforementioned processor.

[0301] The processor described above can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0302] In yet another embodiment provided in the present application, a computer readable storage medium is also provided, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the steps of any of the above-mentioned anonymous query methods.

[0303] In yet another embodiment provided in the present application, a computer program product containing instructions, which, when run on a computer, causes the computer to execute any of the anonymous query methods in the above-mentioned embodiments.

[0304] In the embodiments described above, all or some of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or some of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded into and executed by a computer, all or some of the processes or functions according to the embodiments described in the specification are generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium accessible by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be a magnetic medium (for example, floppy disk, hard disk, magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, solid state disk (SSD)) and the like.

[0305] It should be noted that, in this document, the terms such as first and second 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 the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0306] Each of the embodiments in the specification is described in a related manner, and the same or similar parts between each of the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. In particular, for system, device, electronic device, storage medium embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the related parts can refer to the part of the method embodiment.

[0307] The above merely provides the preferred embodiment of the present application, and not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. An anonymous tracking system, characterized in that, The system includes: Data processing and querying; The query terminal is used to obtain a key pair and a keyword to be queried, wherein the key pair includes a public key and a private key; to encrypt the keyword to be queried using the public key to obtain keyword ciphertext; and to send the keyword ciphertext and the public key to the data terminal. The data terminal is used to obtain the encrypted keyword and the public key sent by the query terminal; calculate a first calculation result based on the encrypted keyword, the public key, and a preset number of partitions; and send the first calculation result to the query terminal; wherein the database of the data terminal is divided into multiple partitions, and the data stored in each partition is different; The query terminal is also used to obtain the first calculation result sent by the data terminal, decrypt the first calculation result using the private key, calculate the second calculation result based on the decryption result, and send the second calculation result to the data terminal. The data terminal is also used to obtain the second calculation result sent by the query terminal, calculate the partition number ciphertext based on the second calculation result, the keyword ciphertext, the public key and the preset number of partitions, and send the partition number ciphertext to the query terminal. The query terminal is also used to obtain the ciphertext of the partition number sent by the data terminal, and to decrypt the ciphertext of the partition number using the private key to obtain the plaintext of the partition number; The data terminal is also used to determine the ciphertext of the query result for each partition based on the public key and the ciphertext of the keyword; and to send the ciphertext of the query result for each partition to the query terminal. The query terminal is also used to obtain the ciphertext of the query result of the partition corresponding to the plaintext partition number, and to decrypt it using the private key to obtain the plaintext query result.

2. A method for anonymous querying, characterized in that, Applied to the data end, the method includes: Obtain the encrypted keyword and public key sent by the query client, wherein the encrypted keyword is obtained by the query client encrypting the keyword to be queried using the public key; Based on the encrypted keyword, the public key, and the preset number of partitions, a first calculation result is calculated; the first calculation result is sent to the query terminal so that the query terminal can decrypt the first calculation result using the private key and calculate a second calculation result based on the decryption result; wherein, the database of the data terminal is divided into multiple partitions, and the data stored in each partition is different, and the public key and the private key belong to the same key pair of the query terminal; Obtain the second calculation result sent by the query terminal, and calculate the partition number ciphertext based on the second calculation result, the keyword ciphertext, the public key, and the preset number of partitions; The partition number ciphertext is sent to the query terminal so that the query terminal can decrypt the partition number ciphertext using the private key to obtain the partition number plaintext. For each partition, the ciphertext of the query results for that partition is determined based on the public key and the ciphertext of the keywords. The ciphertext of the query results for each partition is sent to the query terminal so that the query terminal can obtain the ciphertext of the query results for the corresponding partition according to the plaintext of the partition number, and decrypt it using the private key to obtain the plaintext of the query results.

3. The method according to claim 2, characterized in that, The method further includes: Based on the preset number of partitions, the partition to which each keyword belongs is calculated using a preset partitioning algorithm; For each keyword, the results data for that keyword are divided into the partition to which that keyword belongs; For each partition, construct a polynomial function for that partition, with keywords as independent variables and result data as dependent variables.

4. The method according to claim 3, characterized in that, The step of calculating the first calculation result based on the keyword ciphertext, the public key, and the preset number of partitions includes: The preset number of partitions is encrypted using the public key to obtain the first data; By performing preset first four arithmetic operations on the first data and the keyword ciphertext, a first calculation result is obtained; The step of calculating the partition number ciphertext based on the second calculation result, the keyword ciphertext, the public key, and the preset partition number includes: By performing a second set of four arithmetic operations, the second calculation result, the first data, and the keyword ciphertext are processed to obtain the partition number ciphertext; wherein, the first set of four arithmetic operations and the second set of four arithmetic operations are obtained by splitting through the preset partitioning algorithm.

5. The method according to claim 4, characterized in that, The preset partitioning algorithm is the division remainder method. The step of calculating the partition to which each keyword belongs based on the preset number of partitions using the preset partitioning algorithm includes: For each keyword, the remainder of the keyword is calculated by dividing by the preset number of partitions; wherein, the partition corresponding to the remainder of the keyword is the partition shown by the keyword, and the partition and the remainder correspond one-to-one. The step of performing calculations on the first data and the keyword ciphertext through preset first four arithmetic operations to obtain a first calculation result includes: The first calculation result is obtained by performing a division operation on the encrypted keyword text and the first data; The step involves performing calculations on the second calculation result, the first data, and the keyword ciphertext using a preset second arithmetic operation to obtain the partition number ciphertext, including: Multiply the first data and the second calculation result to obtain the second data; Subtract the keyword ciphertext and the second data to obtain the partition number ciphertext.

6. The method according to claim 3, characterized in that, For each partition, the query result ciphertext for that partition is determined based on the public key and the keyword ciphertext, including: For each partition, the keyword ciphertext, the public key, and the polynomial function of that partition are subjected to homomorphic operations to obtain the query result ciphertext for that partition.

7. A method for anonymous querying, characterized in that, Applied to the query end, the method includes: Obtain a key pair and a keyword to be queried, wherein the key pair includes a public key and a private key; encrypt the keyword to be queried using the public key to obtain the keyword ciphertext; The encrypted keyword and the public key are sent to the data terminal so that the data terminal can calculate the first calculation result based on the encrypted keyword, the public key and the preset number of partitions. Obtain the first calculation result sent by the data terminal, decrypt the first calculation result using the private key, and calculate the second calculation result based on the decryption result; The second calculation result is sent to the data terminal so that the data terminal calculates the partition number ciphertext based on the second calculation result, the keyword ciphertext, the public key and the preset number of partitions. For each partition, the data terminal determines the query result ciphertext of the partition based on the public key and the keyword ciphertext, and sends the query result ciphertext of each partition to the query terminal. Obtain the ciphertext of the partition number sent by the data terminal, and decrypt the ciphertext of the partition number using the private key to obtain the plaintext of the partition number; Obtain the ciphertext of the query result corresponding to the plaintext partition number, and decrypt it using the private key to obtain the plaintext query result.

8. The method according to claim 7, characterized in that, The step of decrypting the first calculation result using the private key and calculating the second calculation result based on the decryption result includes: The first calculation result is decrypted using the private key to obtain the third data; The third data is processed by a preset data algorithm to obtain a second calculation result; wherein the preset data algorithm is obtained by splitting the data through a preset partitioning algorithm, and the preset partitioning algorithm is the algorithm used by the data end to calculate the partition to which each keyword belongs.

9. The method according to claim 8, characterized in that, The preset partitioning algorithm is the division remainder method. The step of performing calculations on the third data using a preset data algorithm to obtain a second calculation result includes: The third data is rounded down to obtain the second calculation result.

10. A stealth detection device, characterized in that, The device, applied to a data terminal, includes: The first acquisition module is used to acquire the keyword ciphertext and public key sent by the query terminal, wherein the keyword ciphertext is obtained by the query terminal encrypting the keyword to be queried using the public key; The first calculation result acquisition module is used to calculate a first calculation result based on the keyword ciphertext, the public key, and the preset number of partitions; wherein, the database of the data terminal is divided into multiple partitions, and the data stored in each partition is different; A first sending module is configured to send the first calculation result to the query terminal, so that the query terminal can decrypt the first calculation result using a private key and calculate a second calculation result based on the decryption result; the public key and the private key belong to the same key pair of the query terminal; The second acquisition module is used to acquire the second calculation result sent by the query terminal; The partition number ciphertext acquisition module is used to calculate the partition number ciphertext based on the second calculation result, the keyword ciphertext, the public key, and the preset number of partitions; The second sending module is used to send the partition number ciphertext to the query terminal, so that the query terminal can use the private key to decrypt the partition number ciphertext to obtain the partition number plaintext. The determination module is used to determine the ciphertext of the query results for each partition based on the public key and the ciphertext of the keywords. The third sending module is used to send the encrypted query results of each partition to the query terminal, so that the query terminal can obtain the encrypted query results of the corresponding partition according to the plaintext of the partition number, and decrypt the query results in plaintext using the private key.

11. The apparatus according to claim 10, characterized in that, The device further includes: The keyword partition calculation module is used to calculate the partition to which each keyword belongs based on the preset number of partitions and a preset partitioning algorithm. The partitioning module is used to divide the result data of each keyword into the partition to which that keyword belongs; The polynomial function creation module is used to create a polynomial function for each partition, with keywords as independent variables and result data as dependent variables. The first calculation result acquisition module includes: The first data acquisition submodule is used to encrypt the preset number of partitions using the public key to obtain the first data; The first calculation result acquisition submodule is used to perform calculations on the first data and the keyword ciphertext through preset first arithmetic operations to obtain the first calculation result; The partition number ciphertext acquisition module includes: The partition number ciphertext acquisition submodule is used to perform operations on the second calculation result, the first data, and the keyword ciphertext through a preset second arithmetic operation to obtain the partition number ciphertext; wherein, the preset first arithmetic operation and the second arithmetic operation are obtained by splitting through the preset partitioning algorithm; The preset partitioning algorithm is the division remainder method, and the partitioning calculation module for the keyword includes: The remainder calculation submodule is used to calculate the remainder of each keyword by using the preset number of partitions as the divisor and the remainder method; wherein, the partition corresponding to the remainder of the keyword is the partition shown by the keyword, and the partition and the remainder are in one-to-one correspondence. The first calculation result acquisition submodule is specifically used for: The first calculation result is obtained by performing a division operation on the encrypted keyword text and the first data; The partition number ciphertext acquisition submodule is specifically used for: Multiply the first data and the second calculation result to obtain the second data; Subtract the keyword ciphertext and the second data to obtain the partition number ciphertext; The determining module includes: The query result ciphertext acquisition submodule is used to perform homomorphic operations on the keyword ciphertext, the public key, and the polynomial function of the partition for each partition to obtain the query result ciphertext of that partition.

12. An anonymous tracking device, characterized in that, The device, used in the query terminal, includes: The first acquisition module is used to acquire a key pair and a keyword to be queried, wherein the key pair includes a public key and a private key; The keyword ciphertext acquisition module is used to encrypt the keyword to be queried using the public key to obtain the keyword ciphertext; The first sending module is used to send the keyword ciphertext and the public key to the data terminal, so that the data terminal can calculate the first calculation result based on the keyword ciphertext, the public key and the preset number of partitions; The second acquisition module is used to acquire the first calculation result sent by the data terminal; The second calculation result acquisition module is used to decrypt the first calculation result using the private key, and calculate the second calculation result based on the decryption result; The second sending module is used to send the second calculation result to the data terminal, so that the data terminal calculates the partition number ciphertext based on the second calculation result, the keyword ciphertext, the public key and the preset number of partitions. For each partition, the data terminal determines the query result ciphertext of the partition based on the public key and the keyword ciphertext, and sends the query result ciphertext of each partition to the query terminal. The third acquisition module is used to acquire the partition number ciphertext sent by the data terminal; The partition number plaintext acquisition module is used to decrypt the partition number ciphertext using the private key to obtain the partition number plaintext; The fourth acquisition module is used to acquire the ciphertext of the query result of the partition corresponding to the plaintext partition number; The query result plaintext acquisition module is used to decrypt the query result plaintext using the private key.

13. The apparatus according to claim 12, characterized in that, The second calculation result acquisition module includes: The third data acquisition submodule is used to decrypt the first calculation result using the private key to obtain the third data; The second calculation result acquisition submodule is used to perform calculations on the third data using a preset data algorithm to obtain a second calculation result; wherein, the preset data algorithm is obtained by splitting the data using a preset partitioning algorithm, and the preset partitioning algorithm is the algorithm used by the data end to calculate the partition to which each keyword belongs; The preset partitioning algorithm is the division remainder method. The second calculation result acquisition submodule is specifically used to: perform a floor operation on the third data to obtain the second calculation result.

14. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 2-9.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 2-9.

Citation Information

Patent Citations

  • Hidden query method and system based on secure multi-party computing technology and storage medium

    CN114969128A

  • Keyword hiding and tracing query method and system based on homomorphic encryption and related device

    CN115269938A