Data query method and device, equipment, storage medium and program product

Through homomorphic encryption and inadvertent pseudo-random function protocols, the problem of privacy leakage of data source parties in multi-data source queries is solved, secure query and result transmission are realized, and the security of data query is improved.

CN119323053AActive Publication Date: 2025-01-17CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411434937.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-14
Publication Date
2025-01-17
Estimated Expiration
2044-10-14

AI Technical Summary

Technical Problem

In an anonymous query scenario for multiple data sources, the prior art leads to privacy leakage of data source parties, resulting in low security of data query.

Method used

By generating public-key private key pairs of homomorphic encryption algorithms and performing inadvertent pseudo-random function protocols with the data source, generating pseudo-random values, performing secure comparison and ciphertext summing, ensuring the secure transmission of query results.

Benefits of technology

It improves the security of data queries, prevents privacy leakage from the data source, and ensures the security and privacy of query results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119323053A_ABST
    Figure CN119323053A_ABST
Patent Text Reader

Abstract

The invention discloses a data query method and device, equipment, a storage medium and a program product, and relates to the technical field of computers, and the method comprises the steps: generating a public key and private key pair of a homomorphic encryption algorithm, sending a public key to at least two data sources, and enabling the data sources to generate a homomorphic ciphertext of a coding value of a data set according to the public key; respectively executing an oblivious pseudo-random function protocol with each data source to generate a pseudo-random value of the query value corresponding to each data source; the pseudo-random values are sequentially sent to the corresponding data sources, the data sources obtain local homomorphic ciphertexts based on the pseudo-random values, and the sum of the local homomorphic ciphertexts and the received homomorphic ciphertexts of other data sources is sent to the next data source until the next data source is the last data source; and obtaining the sum of the homomorphic ciphertexts returned by the last data source, decrypting the sum of the homomorphic ciphertexts through the private key, and generating a query result corresponding to the query value according to the sum of the homomorphic ciphertexts. According to the invention, the security of data query is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data query method, device, equipment, storage medium and program product. Background Art

[0002] In the scenario of anonymous query for multiple data sources, the query party queries multiple data sources at the same time, and uses technologies such as OLE (Oblivious Linear Evaluation) to broadcast the ciphertext query content to multiple data sources at the same time and obtain the corresponding ciphertext results. At the same time, the data source uses the zeroing polynomial technology to implement batch query. Although the above scheme ensures that the query party can initiate queries to multiple data sources at the same time, the query results of each data source are eventually known to the query party, which will also cause the privacy leakage of the data source party, and the data query security of the data source party is low. Summary of the invention

[0003] The main purpose of this application is to provide a data query method, device, equipment, storage medium and program product, aiming to solve the technical problem of privacy leakage of the data source, resulting in low security of data query of the data source.

[0004] To achieve the above purpose, the present application proposes a data query method, which includes:

[0005] Generate a public key and private key pair of a homomorphic encryption algorithm, and send the public key to at least two data sources, where the data sources generate homomorphic ciphertext of the encoded value of the data set according to the public key;

[0006] Execute an oblivious pseudo-random function protocol with each of the data sources respectively to generate a pseudo-random value of a query value corresponding to each of the data sources;

[0007] The pseudo-random values ​​are sent to the corresponding data sources in sequence, and the data source obtains a local homomorphic ciphertext based on the pseudo-random values, and sends the sum of the local homomorphic ciphertext and the homomorphic ciphertexts received from other data sources to the next data source, until the next data source is the last data source;

[0008] Obtain the sum of the homomorphic ciphertexts returned by the last data source, decrypt the sum of the homomorphic ciphertexts using the private key, and generate a query result corresponding to the query value based on the sum of the homomorphic ciphertexts.

[0009] In one embodiment, the step of executing an oblivious pseudo-random function protocol with each of the data sources to generate a pseudo-random value of a query value corresponding to each of the data sources comprises:

[0010] Execute an oblivious pseudo-random function protocol with each of the data sources respectively to generate a pseudo-random key corresponding to each of the data sources;

[0011] The pseudo-random value corresponding to the data source is generated according to the pseudo-random key and the query value.

[0012] In one embodiment, after the step of respectively executing an oblivious pseudo-random function protocol with each of the data sources to generate a pseudo-random key corresponding to each of the data sources, the step further includes:

[0013] The pseudo-random key is sent to the corresponding data source, and the data source generates a pseudo-random value set corresponding to the data set according to the pseudo-random key.

[0014] In one embodiment, the step of generating a query result corresponding to the query value according to the sum of the homomorphic ciphertexts includes:

[0015] If the bit values ​​of the previously preset positions of the sum of the homomorphic ciphertexts are not all 0, determining that the query value is in the blacklist;

[0016] If the previously preset bit values ​​of the sum of the homomorphic ciphertexts are all 0, it is determined that the query value is not in the blacklist, and the query result includes whether the query value is in the blacklist.

[0017] In one embodiment, the step of generating a query result corresponding to the query value according to the sum of the homomorphic ciphertexts includes:

[0018] The total number of mobile phone numbers corresponding to the query value in the query result is determined according to the post-preset bit value of the sum of the homomorphic ciphertexts.

[0019] To achieve the above purpose, the present application proposes a data query method, which includes:

[0020] Receive the public key of the homomorphic ciphertext sent by the querying party, and generate the homomorphic ciphertext of the encoded value of the data set according to the public key;

[0021] Obtaining a pseudo-random key sent by the querying party, and generating a pseudo-random value set according to the pseudo-random key and the data set;

[0022] Receive a pseudo-random value sent by the querying party, obtain a local homomorphic ciphertext based on a comparison result of the pseudo-random value and the pseudo-random value set, and send the sum of the local homomorphic ciphertext and the homomorphic ciphertexts received from other data sources to the next data source, until the next data source is the last data source.

[0023] In addition, to achieve the above purpose, the present application also proposes a data query device, the data query device comprising:

[0024] A generation module, used to generate a public key and private key pair of a homomorphic encryption algorithm, and send the public key to at least two data sources, and the data source generates a homomorphic ciphertext of the encoded value of the data set according to the public key;

[0025] An execution module, used to execute an oblivious pseudo-random function protocol with each of the data sources respectively, to generate a pseudo-random value of a query value corresponding to each of the data sources;

[0026] A sending module, used for sending the pseudo-random value to the corresponding data source in sequence, the data source obtains a local homomorphic ciphertext based on the pseudo-random value, and sends the sum of the local homomorphic ciphertext and the homomorphic ciphertext received from other data sources to the next data source, until the next data source is the last data source;

[0027] A query module is used to obtain the sum of the homomorphic ciphertexts returned by the last data source, decrypt the sum of the homomorphic ciphertexts using the private key, and generate a query result corresponding to the query value based on the sum of the homomorphic ciphertexts.

[0028] In addition, to achieve the above purpose, the present application also proposes a data query device, the data query device comprising:

[0029] A receiving module, used to receive the public key of the homomorphic ciphertext sent by the querying party, and generate the homomorphic ciphertext of the encoding value of the data set according to the public key;

[0030] An acquisition module, used for acquiring a pseudo-random key sent by a querying party, and generating a pseudo-random value set according to the pseudo-random key and the data set;

[0031] A verification module is used to receive a pseudo-random value sent by a querying party, obtain a local homomorphic ciphertext based on a comparison result of the pseudo-random value and the pseudo-random value set, and send the sum of the local homomorphic ciphertext and the homomorphic ciphertext received from other data sources to the next data source until the next data source is the last data source.

[0032] In addition, to achieve the above objectives, the present application also proposes a data query device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the data query method described above.

[0033] In addition, to achieve the above objectives, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the data query method described above are implemented.

[0034] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the data query method described above are implemented.

[0035] One or more technical solutions proposed in this application have at least the following technical effects:

[0036] By innovating the encoding method of the data source's data to adapt to the security query process, the query party and the data source use inadvertent pseudo-random function technology to perform security comparison to achieve secure query. Through the secure summation query process involving multiple data sources, secure summation is guaranteed, thereby improving the security of data query. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0039] Figure 1 A flowchart of the first embodiment of the data query method of this application is provided;

[0040] Figure 2 A detailed flowchart provided for the first embodiment of the data query method of this application;

[0041] Figure 3 A flowchart of the first embodiment of the data query method of this application is provided;

[0042] Figure 4 A flowchart of the second embodiment of the data query method of this application is provided;

[0043] Figure 5 A flowchart of the third embodiment of the data query method of this application is provided;

[0044] Figure 6 This is a schematic diagram of the module structure of the data query device according to an embodiment of the present application;

[0045] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the data query method in the embodiment of the present application.

[0046] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0047] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0048] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0049] The main solution of the embodiment of the present application is: generate a public key and private key pair of a homomorphic encryption algorithm, and send the public key to at least two data sources, the data source generates a homomorphic ciphertext of the encoded value of the data set based on the public key; execute an oblivious pseudo-random function protocol with each data source respectively to generate a pseudo-random value of the query value corresponding to each data source; send the pseudo-random value to the corresponding data source in sequence, the data source obtains a local homomorphic ciphertext based on the pseudo-random value, and sends the sum of the local homomorphic ciphertext and the homomorphic ciphertext received from other data sources to the next data source until the next data source is the last data source; obtain the sum of the homomorphic ciphertext returned by the last data source, decrypt the sum of the homomorphic ciphertext by using the private key, and generate a query result corresponding to the query value based on the sum of the homomorphic ciphertext.

[0050] In this embodiment, for the convenience of description, the following description is made with the data query device as the execution subject.

[0051] Although the existing technology ensures that the query party can initiate queries to multiple data sources at the same time, the query results of each data source are eventually known to the query party, which will also cause the privacy leakage of the data source party, and the data query security of the data source party is low.

[0052] The present application provides a solution, which adapts to the security query process by innovating the encoding method of the data source, and the query party and the data source use inadvertent pseudo-random function technology to perform security comparison to achieve secure query, and through the secure summation query process involving multiple data sources, ensures secure summation and improves the security of data query.

[0053] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a data query device, etc. The following takes a data query device as an example to illustrate this embodiment and the following embodiments.

[0054] Based on this, the present application embodiment provides a data query method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the data query method of the present application.

[0055] In this embodiment, the data query method includes steps S10 to S40:

[0056] Step S10, generate a public key and private key pair of a homomorphic encryption algorithm, and send the public key to at least two data sources, and the data sources generate a homomorphic ciphertext of the encoded value of the data set according to the public key.

[0057] It should be noted that homomorphic encryption algorithms refer to encryption algorithms that satisfy the homomorphic operation property. Semi-homomorphic encryption algorithms represented by additive homomorphic encryption (such as the Paillier encryption algorithm) only support the addition operation of ciphertext. The algorithm includes key generation, encryption, decryption, re-randomization, and ciphertext operations. The correctness of its homomorphic addition is reflected in that for two ciphertexts c0 and c1 and their corresponding plaintexts m0 and m1, the following formula holds true

[0058]

[0059] in, represents the homomorphic addition of ciphertext, m0 and m1 represent plaintext, where Enc pk () indicates homomorphic encryption of plaintext using the public key pk.

[0060] Optionally, the number of data sources may be any number greater than 1.

[0061] In this embodiment, three data sources are used as an example for description, but the invention is not limited to three data sources. Q , the query value is the ID (Identification) of a specific user. Data source A has m A Database D A , including the user ID, the number of mobile phone numbers, and whether it is in the blacklist, for example, 0 means no, 1 means yes. Similarly, data source B has m B Database D B , data source C has m C Database D C The query party Q obtains x by querying data sources A, B, and C. Q Corresponding to D A , D B , D C The sum of the number of mobile phone numbers in the query value x Q Is it a blacklist user? In order to achieve the security goal, that is, to ensure that only the query party Q can obtain the final query result, the query result is x Q The sum of the number of mobile phone numbers at data sources A, B, and C and whether they are in the blacklist. At the same time, it must be ensured that data sources A, B, and C cannot obtain the query value x Q And raw data information from other data sources.

[0062] Before step S10, the method further includes: the data sources uniformly encode the number of mobile phone numbers of each user in their respective databases and whether the user is in the blacklist.

[0063] Optionally, data sources A, B, and C respectively encode the number of mobile phone numbers of each user in their respective databases and whether they are in the blacklist, that is, v represents the encoded value of the number of mobile phone numbers to be queried and whether they are in the blacklist, with a length of l bytes, the first t bits representing whether they are in the blacklist, and the value of t is n is the number of data sources. The value of l is Where max is the maximum possible number of bits of the query value, and 8l-tbit is used to represent the query information to be summed. In this example, l=1, t=2, and the last 6 bits are the query information, that is, the number of mobile phone numbers. Exemplarily, the number of mobile phone numbers of a user in the data source A is 3, and it is on the blacklist. Then A can represent the value v of the user as 01000011 in binary, which is 67 in decimal. By proposing to package and encode according to the number of mobile phone numbers in the query party's database and whether it is on the blacklist, the subsequent query party decodes according to the conditions, and the effect of obtaining two types of information through a single inquiry is achieved, which greatly improves the communication efficiency.

[0064] Finally, data sources A, B, and C obtain data sets S A : S B : and S C : Where S A Represents the data set of data source A, Indicates the id of the i-th user owned by data source A, Indicates the encoding value of the i-th user owned by data source A, [m A ] means {1...m A The same is true for data sources B and C. Indicates rounding up.

[0065] It should be noted that this embodiment is applied to the querying party Q, which can be a terminal device, a server, etc. The querying party Q generates a public key and a private key pair (pk, sk) of the homomorphic encryption algorithm, and broadcasts the public key pk to the data sources A, B, and C, and saves the private key sk locally. Optionally, the homomorphic encryption algorithm used can satisfy the additive homomorphism. The following text takes the widely used and efficient Paillier algorithm as an example for description.

[0066] Data sources A, B, and C calculate the homomorphic ciphertext of the encoded value v respectively, that is, A calculates Homomorphic ciphertext B Calculation Homomorphic ciphertext C calculation Homomorphic ciphertext in, Indicates the use of public key pk to clear text Perform Paillier homomorphic encryption, and so on.

[0067] Step S20, executing an oblivious pseudo-random function protocol with each of the data sources respectively to generate a pseudo-random value of the query value corresponding to each of the data sources.

[0068] It should be noted that the query party Q executes the OPRF (Oblivious Pseudorandom Function) protocol with the data sources A, B and C respectively. The query party obtains the pseudo-random key k, and the data source inputs the ID information to obtain the corresponding pseudo-random value F k (x).

[0069] Oblivious pseudorandom function is a two-party protocol widely used in cryptographic protocols and privacy protection technologies, in which one party (the sender) holds a pseudorandom function key k and the other party (the receiver) holds an input x. The goal of the protocol is to allow the receiver to obtain a pseudorandom value F on k and x. k (x), and the sender does not get any information. The security requirements of OPRF must meet the properties of correctness, unidirectionality, privacy, and verifiability.

[0070] The query party Q calculates the pseudo-random value corresponding to the query value based on the pseudo-random key corresponding to each data source. For example, the pseudo-random value of the query party and the data source A is The pseudo-random values ​​of the query party and data source B are The pseudo-random values ​​of the query party and the data source C are

[0071] Step S30, sending the pseudo-random value to the corresponding data source in sequence, the data source obtains a local homomorphic ciphertext based on the pseudo-random value, and sends the sum of the local homomorphic ciphertext and the homomorphic ciphertext received from other data sources to the next data source, until the next data source is the last data source.

[0072] In the process of interaction between all parties, the security of the interaction between the querying party and a single data source is guaranteed by the security of the inadvertent pseudo-random function, and the security of the data between data sources is guaranteed by the security of the homomorphic encryption ciphertext. At the same time, since the ciphertext comparison process between each data source and the querying party is completed by the next data source, it also eliminates the possibility of the querying party knowing the query result of a certain data source. Therefore, data is guaranteed to flow securely throughout the interaction process.

[0073] For example, the pseudo-random values ​​of the query party and the data source A are And the pseudo-random value Sent to data source A; the pseudo-random value between the query party and data source B is F kB (x Q ), and the pseudo-random value Sent to data source B; the pseudo-random values ​​of the query party and data source C are And the pseudo-random value Send to data source C;

[0074] After receiving the pseudo-random value sent by the querying party, the data source compares the pseudo-random value of the querying party with the local pseudo-random value set, obtains the corresponding local homomorphic ciphertext according to the comparison result, determines the sum of the local homomorphic ciphertext and the homomorphic ciphertext received from other data sources, and sends the sum of the homomorphic ciphertext to the next data source until the next data source is the last data source. Among them, other data sources refer to a data source other than the current data source.

[0075] Optionally, take the data source as 3 examples, such as Figure 2 As shown, the query party Q will to data source B. Data source A will and the corresponding homomorphic ciphertext Sent to data source B. Data source B compares Zhongyu The same row, and record the corresponding homomorphic ciphertext The query party Q will to data source C. Data source B will and the corresponding homomorphic ciphertext And the homomorphic ciphertext of the comparison record Sent to data source C. Data source C compares Zhongyu The same row, and record the corresponding homomorphic ciphertext Data source C computes homomorphically in, represents the addition operation in the Paillier homomorphic ciphertext calculation. The querying party Q will to data source A. Data source C will and the corresponding homomorphic ciphertext And the homomorphic ciphertext of the comparison record Sent to data source A. Data source A compares Zhongyu The same row, and record the corresponding homomorphic ciphertext Data source A computes homomorphically Finally, data source A adds the sum of the homomorphic ciphertext Sent to the inquiring party Q.

[0076] By proposing the participation of multiple data sources, different data sources assist in comparing the ciphertext results of the previous data source with the querying party until the comparison of all data sources is completed. This ensures that the secure comparison query is completed without leaking the privacy information of the querying party and each data source, and realizes secure sum query and blacklist determination for multiple data sources.

[0077] Step S40, obtaining the sum of the homomorphic ciphertexts returned by the last data source, decrypting the sum of the homomorphic ciphertexts using the private key, and generating a query result corresponding to the query value based on the sum of the homomorphic ciphertexts.

[0078] It should be noted that the querying party Q uses the paillier private key sk to decrypt Calculate Get the result Among them, Dec sk (c) indicates decrypting the ciphertext c using the private key sk.

[0079] Optionally, if the first preset bit value of the sum of the homomorphic ciphertext is not all 0, it is determined that the query value is in the blacklist; if the first preset bit value of the sum of the homomorphic ciphertext is all 0, it is determined that the query value is not in the blacklist, and the query result includes whether the query value is in the blacklist. Exemplarily, if the query party Q verifies that the first 2 bits of v are not all 0, the queried user is in the blacklist, otherwise not in the blacklist.

[0080] Optionally, the total number of mobile phone numbers corresponding to the query value in the query result is determined according to the last preset bit value of the sum of the homomorphic ciphertexts. Exemplarily, the value of the last 6 bits is the total number of mobile phone numbers of the user.

[0081] In one embodiment, if Figure 2 and 3 As shown, steps 1 to 5 are the first stage, which completes the overall initialization, including encoding the data by each data source, calculating the homomorphic ciphertext corresponding to the encoded value, and the querying party executing the OPRF protocol with each data source. Steps 6 to 19 are the second stage, in which the querying party interacts with each data source. Each data source compares the querying party's result with the result of the previous data source, and obtains the corresponding homomorphic ciphertext, sums them homomorphically, and finally the querying party decrypts the result. The correctness of step 19 is explained as follows: in the process of summing the encoded value v of each data source, if the user is not on the blacklist of any data source, that is, all are 0, then the sum result is also 0, that is, the first t of v are all 0. At the same time, the nature of homomorphic encryption ensures that the result of the last 6 bits is the sum of the number of mobile phone numbers of each data source.

[0082] In the process of interaction between all parties, the security of the interaction between the querying party and a single data source is guaranteed by the security of the inadvertent pseudo-random function, and the security of the data between data sources is guaranteed by the security of the homomorphic encryption ciphertext. At the same time, since the ciphertext comparison process between each data source and the querying party is completed by the next data source, it also eliminates the possibility of the querying party knowing the query result of a certain data source. Therefore, data is guaranteed to flow securely throughout the interaction process.

[0083] The querying party performs OPRF operations with each data source respectively, and the ciphertext results obtained by both parties are used as the basis for comparison with the next data source. Since the OPRF algorithm has multiple implementation methods, the OPRF operation here can also be selected according to the computing power, bandwidth, etc. of each party, and the OPRF between the querying party and different data sources can use different OPRF algorithms.

[0084] Specifically, if a data source has weak computing power and the bandwidth between it and the querying party is large, the OPRF algorithm based on Oblivious Transfer extention (OTe) suitable for high bandwidth can be used. If a data source has strong computing power but the bandwidth between it and the querying party is low, the ECC-OPRF algorithm based on DH (Diffie-Hellman) key exchange on the elliptic curve suitable for low bandwidth and high computing power can be used. This flexible setting can greatly improve the overall query efficiency.

[0085] In the technical solution of this embodiment, a public key and private key pair of a homomorphic encryption algorithm is generated, and the public key is sent to at least two data sources. The data source generates a homomorphic ciphertext of the encoded value of the data set according to the public key; an oblivious pseudo-random function protocol is executed with each data source respectively to generate a pseudo-random value of the query value corresponding to each data source; the pseudo-random value is sent to the corresponding data source in sequence, and the data source obtains the local homomorphic ciphertext based on the pseudo-random value, and sends the sum of the local homomorphic ciphertext and the homomorphic ciphertext received from other data sources to the next data source until the next data source is the last data source; the sum of the homomorphic ciphertext returned by the last data source is obtained, the sum of the homomorphic ciphertext is decrypted by the private key, and the query result corresponding to the query value is generated according to the sum of the homomorphic ciphertext. The encoding method of the data source is innovated to adapt to the secure query process, and the query party and the data source adopt the oblivious pseudo-random function technology to perform a secure comparison to achieve secure query. Through the secure summation query process involving multiple data sources, secure summation is guaranteed, thereby improving the security of data query.

[0086] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment can refer to the above introduction, and will not be repeated later. Figure 4 , step S20 comprises:

[0087] Step S21, executing an oblivious pseudo-random function protocol with each of the data sources respectively to generate a pseudo-random key corresponding to each of the data sources;

[0088] Step S22: Generate the pseudo-random value corresponding to the data source according to the pseudo-random key and the query value.

[0089] It should be noted that the query party Q executes the OPRF protocol with the data sources A, B and C respectively, the query party obtains the pseudo-random key k, the data source inputs the ID information, and obtains the corresponding pseudo-random value F k (x).

[0090] The query party Q calculates the pseudo-random value corresponding to the query value based on the pseudo-random key corresponding to each data source. For example, the pseudo-random value of the query party and the data source A is The pseudo-random values ​​of the query party and data source B are The pseudo-random values ​​of the query party and the data source C are

[0091] Optionally, after step S21, the method further includes: sending the pseudo-random key to the corresponding data source, and the data source generates a pseudo-random value set corresponding to the data set according to the pseudo-random key.

[0092] Optionally, after the querying party Q and the data source A execute the OPRF protocol, the querying party Q obtains the pseudo-random key k A , data source A input collection Get the corresponding pseudo-random value set Similarly, the query party Q and the data source B execute the OPRF protocol to obtain the pseudo-random key k B , data source B input collection Get the corresponding pseudo-random value set The query party Q and the data source C execute the OPRF protocol to obtain the pseudo-random key k C , data source C input collection Get the corresponding pseudo-random value set Among them, F k (x) represents the pseudo-random value of the plaintext x calculated using the pseudo-random key k.

[0093] In the technical solution of this embodiment, a secure query is achieved by the querying party and the data source using an inadvertent pseudo-random function technology to perform a secure comparison.

[0094] In the third embodiment of the present application, the same or similar contents as those in the above embodiment can be referred to the above description, and will not be described in detail later. Figure 5 , the method comprising:

[0095] Step S50, receiving the public key of the homomorphic ciphertext sent by the querying party, and generating the homomorphic ciphertext of the encoded value of the data set according to the public key;

[0096] Step S60, obtaining a pseudo-random key sent by the querying party, and generating a pseudo-random value set according to the pseudo-random key and the data set;

[0097] Step S70, receiving the pseudo-random value sent by the querying party, obtaining the local homomorphic ciphertext based on the comparison result of the pseudo-random value and the pseudo-random value set, and sending the sum of the local homomorphic ciphertext and the homomorphic ciphertext received from other data sources to the next data source, until the next data source is the last data source.

[0098] In this embodiment, the data source is applied to different data sources, and different data sources store different data sets. For example, data source A has m A Database D A , including the user ID, the number of mobile phone numbers, and whether it is in the blacklist, for example, 0 means no, 1 means yes. Similarly, data source B has m B Database D B , data source C has m C Database D C .

[0099] For example, data sources A, B, and C respectively encode the number of mobile phone numbers of each user in their respective databases and whether they are in the blacklist, that is, v represents the encoded value of the number of mobile phone numbers to be queried and whether they are in the blacklist, with a length of 1 byte, the first tbit represents whether they are in the blacklist, and the value of t is n is the number of data sources. The value of l is Where max is the maximum number of bits that the query value can have, and 8l-tbit is used to represent the query information to be summed. In this example, l=1, t=2, and the last 6 bits are the query information, that is, the number of mobile phone numbers. For example: the number of mobile phone numbers of a user in data source A is 3, and it is in the blacklist. Then A can represent the value v of the user as 01000011 in binary, which is 67 in decimal. Finally, A, B, and C get data sets S respectively. A : S B : and S C : Where S A Represents the data set of data source A, Indicates the id of the i-th user owned by data source A, Indicates the encoding value of the i-th user owned by data source A, [m A ] means {1...mA The same is true for data sources B and C. Indicates rounding up.

[0100] After receiving the public key pk sent by the query party Q, the data sources A, B, and C respectively calculate the homomorphic ciphertext of the encoded value v, that is, A calculates Homomorphic ciphertext B Calculation Homomorphic ciphertext C calculation Homomorphic ciphertext in, Indicates the use of public key pk to clear text Perform Paillier homomorphic encryption, and so on.

[0101] Optionally, after the query party Q and the data source A execute the OPRF protocol, Q obtains the pseudo-random key k A , A input set Get the corresponding pseudo-random value set Similarly, Q executes the OPRF protocol with the data source B to obtain the pseudo-random key k B , B input set Get the corresponding pseudo-random value set Q executes the OPRF protocol with the data source C to obtain the pseudo-random key k C , C input set Get the corresponding pseudo-random value set Among them, F k (x) represents the pseudo-random value of the plaintext x calculated using the pseudo-random key k.

[0102] Optionally, take the data source as 3 examples, such as Figure 2 As shown, the query party Q will to data source B. Data source A will and the corresponding homomorphic ciphertext Sent to data source B. Data source B compares Zhongyu The same row, and record the corresponding homomorphic ciphertext The query party Q will to data source C. Data source B will and the corresponding homomorphic ciphertext And the homomorphic ciphertext of the comparison record Sent to data source C. Data source C compares Zhongyu The same row, and record the corresponding homomorphic ciphertext Data source C computes homomorphically in, represents the addition operation in the Paillier homomorphic ciphertext calculation. The querying party Q will to data source A. Data source C will and the corresponding homomorphic ciphertext And the homomorphic ciphertext of the comparison record Sent to data source A. Data source A compares Zhongyu The same row, and record the corresponding homomorphic ciphertext Data source A computes homomorphically Data source A adds the sum of homomorphic ciphertexts Sent to the inquiring party Q.

[0103] In the technical solution of this embodiment, the encoding method of the data source's data is innovated to adapt to the security query process. The query party and the data source use inadvertent pseudo-random function technology to perform security comparison to achieve secure query. Through the secure summation query process involving multiple data sources, secure summation is guaranteed, thereby improving the security of data query.

[0104] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the data query method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0105] This application also provides a data query device, please refer to Figure 6 , the data query device comprises:

[0106] A generating module 10, configured to generate a public key and a private key pair of a homomorphic encryption algorithm, and send the public key to at least two data sources, wherein the data sources generate homomorphic ciphertext of the encoded value of the data set according to the public key;

[0107] An execution module 20, configured to execute an inadvertent pseudo-random function protocol with each of the data sources, respectively, to generate a pseudo-random value of a query value corresponding to each of the data sources;

[0108] A sending module 30 is used to send the pseudo-random value to the corresponding data source in sequence, and the data source obtains a local homomorphic ciphertext based on the pseudo-random value, and sends the sum of the local homomorphic ciphertext and the homomorphic ciphertext received from other data sources to the next data source, until the next data source is the last data source;

[0109] The query module 40 is used to obtain the sum of the homomorphic ciphertexts returned by the last data source, decrypt the sum of the homomorphic ciphertexts using the private key, and generate a query result corresponding to the query value based on the sum of the homomorphic ciphertexts.

[0110] Optionally, the step of respectively executing an inadvertent pseudo-random function protocol with each of the data sources to generate a pseudo-random value of a query value corresponding to each of the data sources includes:

[0111] Execute an oblivious pseudo-random function protocol with each of the data sources respectively to generate a pseudo-random key corresponding to each of the data sources;

[0112] The pseudo-random value corresponding to the data source is generated according to the pseudo-random key and the query value.

[0113] Optionally, after the step of respectively executing an oblivious pseudo-random function protocol with each of the data sources to generate a pseudo-random key corresponding to each of the data sources, the step further includes:

[0114] The pseudo-random key is sent to the corresponding data source, and the data source generates a pseudo-random value set corresponding to the data set according to the pseudo-random key.

[0115] Optionally, the step of generating a query result corresponding to the query value according to the sum of the homomorphic ciphertexts includes:

[0116] If the bit values ​​of the previously preset positions of the sum of the homomorphic ciphertexts are not all 0, determining that the query value is in the blacklist;

[0117] If the previously preset bit values ​​of the sum of the homomorphic ciphertexts are all 0, it is determined that the query value is not in the blacklist, and the query result includes whether the query value is in the blacklist.

[0118] Optionally, the step of generating a query result corresponding to the query value according to the sum of the homomorphic ciphertexts includes:

[0119] The total number of mobile phone numbers corresponding to the query value in the query result is determined according to the post-preset bit value of the sum of the homomorphic ciphertexts.

[0120] The present application also provides a data query device, the data query device comprising:

[0121] A receiving module, used to receive the public key of the homomorphic ciphertext sent by the querying party, and generate the homomorphic ciphertext of the encoding value of the data set according to the public key;

[0122] An acquisition module, used for acquiring a pseudo-random key sent by a querying party, and generating a pseudo-random value set according to the pseudo-random key and the data set;

[0123] A verification module is used to receive a pseudo-random value sent by a querying party, obtain a local homomorphic ciphertext based on a comparison result of the pseudo-random value and the pseudo-random value set, and send the sum of the local homomorphic ciphertext and the homomorphic ciphertext received from other data sources to the next data source until the next data source is the last data source.

[0124] The data query device provided by the present application adopts the data query method in the above embodiment, which can solve the technical problem that the privacy of the data source is leaked, resulting in low security of the data query of the data source. Compared with the prior art, the beneficial effects of the data query device provided by the present application are the same as the beneficial effects of the data query method provided by the above embodiment, and the other technical features in the data query device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0125] The present application provides a data query device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the data query method in the above-mentioned embodiment 1.

[0126] Reference below Figure 7 , which shows a schematic diagram of the structure of a data query device suitable for implementing the embodiment of the present application. The data query device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The data query device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0127] like Figure 7As shown, the data query device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the data query device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the data query device to communicate with other devices wirelessly or by wire to exchange data. Although the data query device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0128] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0129] The data query device provided by the present application adopts the data query method in the above embodiment, which can solve the technical problem that the privacy of the data source is leaked, resulting in low security of the data query of the data source. Compared with the prior art, the beneficial effects of the data query device provided by the present application are the same as the beneficial effects of the data query method provided by the above embodiment, and the other technical features in the data query device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0130] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0131] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0132] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the data query method in the above-mentioned embodiment.

[0133] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0134] The computer-readable storage medium may be included in the data query device; or may exist independently without being assembled into the data query device.

[0135] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the data query device, the data query device: innovates the encoding method of the data source data to adapt to the security query process, the query party and the data source use inadvertent pseudo-random function technology to perform security comparison to achieve security query, and ensures security summation through a security summation query process involving multiple data sources, thereby improving the security of data query.

[0136] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0137] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0138] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0139] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned data query method, and can solve the technical problem that the privacy of the data source is leaked, resulting in low security of the data query of the data source. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the data query method provided in the above-mentioned embodiment, and will not be repeated here.

[0140] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned data query method when executed by a processor.

[0141] The computer program product provided by the present application can solve the technical problem that the privacy of the data source is leaked, resulting in low security of data query by the data source. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as those of the data query method provided by the above embodiment, and will not be elaborated here.

[0142] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A data query method, characterized in that: Applied to the querying party, the method comprises: Generate a public key and private key pair of a homomorphic encryption algorithm, and send the public key to at least two data sources, where the data sources generate homomorphic ciphertext of the encoded value of the data set according to the public key; Execute an oblivious pseudo-random function protocol with each of the data sources respectively to generate a pseudo-random value of a query value corresponding to each of the data sources; The pseudo-random values ​​are sent to the corresponding data sources in sequence, and the data source obtains a local homomorphic ciphertext based on the pseudo-random values, and sends the sum of the local homomorphic ciphertext and the homomorphic ciphertexts received from other data sources to the next data source, until the next data source is the last data source; Obtain the sum of the homomorphic ciphertexts returned by the last data source, decrypt the sum of the homomorphic ciphertexts using the private key, and generate a query result corresponding to the query value based on the sum of the homomorphic ciphertexts.

2. The method according to claim 1, characterized in that The step of respectively executing an inadvertent pseudo-random function protocol with each of the data sources to generate a pseudo-random value of a query value corresponding to each of the data sources comprises: Execute an oblivious pseudo-random function protocol with each of the data sources respectively to generate a pseudo-random key corresponding to each of the data sources; The pseudo-random value corresponding to the data source is generated according to the pseudo-random key and the query value.

3. The method according to claim 2, characterized in that After the step of respectively executing the oblivious pseudo-random function protocol with each of the data sources to generate a pseudo-random key corresponding to each of the data sources, the method further includes: The pseudo-random key is sent to the corresponding data source, and the data source generates a pseudo-random value set corresponding to the data set according to the pseudo-random key.

4. The method according to claim 1, characterized in that The step of generating a query result corresponding to the query value according to the sum of the homomorphic ciphertexts comprises: If the bit values ​​of the previously preset positions of the sum of the homomorphic ciphertexts are not all 0, determining that the query value is in the blacklist; If the previously preset bit values ​​of the sum of the homomorphic ciphertexts are all 0, it is determined that the query value is not in the blacklist, and the query result includes whether the query value is in the blacklist.

5. The method according to claim 1, characterized in that The step of generating a query result corresponding to the query value according to the sum of the homomorphic ciphertexts comprises: The total number of mobile phone numbers corresponding to the query value in the query result is determined according to the post-preset bit value of the sum of the homomorphic ciphertexts.

6. A data query method, characterized in that: Applied to a data source, the method comprises: Receive the public key of the homomorphic ciphertext sent by the querying party, and generate the homomorphic ciphertext of the encoded value of the data set according to the public key; Obtaining a pseudo-random key sent by the querying party, and generating a pseudo-random value set according to the pseudo-random key and the data set; Receive a pseudo-random value sent by the querying party, obtain a local homomorphic ciphertext based on a comparison result of the pseudo-random value and the pseudo-random value set, and send the sum of the local homomorphic ciphertext and the homomorphic ciphertexts received from other data sources to the next data source, until the next data source is the last data source.

7. A data query device, characterized in that: The device comprises: A generation module, used to generate a public key and private key pair of a homomorphic encryption algorithm, and send the public key to at least two data sources, and the data source generates a homomorphic ciphertext of the encoded value of the data set according to the public key; An execution module, used to execute an oblivious pseudo-random function protocol with each of the data sources respectively, to generate a pseudo-random value of a query value corresponding to each of the data sources; A sending module, used for sending the pseudo-random value to the corresponding data source in sequence, the data source obtains a local homomorphic ciphertext based on the pseudo-random value, and sends the sum of the local homomorphic ciphertext and the homomorphic ciphertext received from other data sources to the next data source, until the next data source is the last data source; A query module is used to obtain the sum of the homomorphic ciphertexts returned by the last data source, decrypt the sum of the homomorphic ciphertexts using the private key, and generate a query result corresponding to the query value based on the sum of the homomorphic ciphertexts.

8. A data query device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the data query method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the data query method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the data query method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Proxy query method and system for distributed data warehouse, equipment and medium

    CN113157778A

  • Hidden query method and system

    CN113987583A

  • Data anonymous trace query method and device, storage medium and electronic equipment

    CN116680324A

  • Vulnerability retrieval method based on homomorphic encryption and casual transmission

    CN117892342A

  • Cryptography device having secure provision of random number sequences

    US20200374100A1