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

By generating public-private key pairs for homomorphic encryption algorithms and an unintentional pseudo-random function protocol, secure summation queries from multiple data sources are achieved, solving the problem of privacy leakage at the data source level and improving the security of data queries.

CN119323053BActive Publication Date: 2025-10-24CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In scenarios involving multiple data sources, privacy breaches at the data source providers can lead to low data query security.

Method used

Generate a public-private key pair for a homomorphic encryption algorithm, send the public key to the data source, generate a pseudo-random value using an unintentional pseudo-random function protocol, and achieve secure querying through a secure summation process involving multiple data sources.

Benefits of technology

By innovating the encoding methods of the data source and using unintentional pseudo-random function technology, the security of the query process is ensured, the privacy of the data source is prevented, and the security of data query is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119323053B_ABST
    Figure CN119323053B_ABST
Patent Text Reader

Abstract

The application discloses a data query method and device, equipment, storage medium and program product, relate to computer technical field, the method comprises: generating homomorphic encryption algorithm public key private key pair, and sending the public key to at least two data sources, and the data source generates the homomorphic ciphertext of the encoding value of data set according to the public key;Respectively with each data source executes the oblivious pseudo-random function protocol, generates the pseudo-random value of the query value corresponding to each data source;The pseudo-random value is sent to the corresponding data source in turn, and the data source obtains local homomorphic ciphertext based on the pseudo-random value, and sends the sum of local homomorphic ciphertext and the homomorphic ciphertext of other data sources received to the next data source, until the next data source is the last data source;The sum of homomorphic ciphertext returned by the last data source is obtained, the homomorphic ciphertext is decrypted through the private key, and the query result corresponding to the query value is generated according to the sum of homomorphic ciphertext.The application improves the security of data query.
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, and particularly relates to a data query method and device, equipment, storage medium and program product. BACKGROUND

[0002] In the scene of multi-data source facing anonymous query, a query party simultaneously queries multiple data sources, and uses OLE (Oblivious Linear Evaluation) and other technologies to enable the query party to simultaneously broadcast the query content of ciphertext to multiple data sources and obtain the corresponding ciphertext result. Meanwhile, the data source party uses zero polynomial technology to realize batch query. Although the above scheme ensures that the query party can simultaneously initiate queries to multiple data sources, the query result of each data source is ultimately known to the query party, which also causes the problem of privacy leakage of the data source party, and the data query security of the data source party is low. SUMMARY

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

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

[0005] Generating a public key and private key pair of a homomorphic encryption algorithm, and sending the public key to at least two data sources, and the data sources generating homomorphic ciphertexts of encoding values of data sets according to the public key;

[0006] Respectively performing an oblivious pseudo-random function protocol with each data source to generate a pseudo-random value corresponding to a query value of each data source;

[0007] Sending the pseudo-random value to the corresponding data source in turn, the data source obtaining local homomorphic ciphertext based on the pseudo-random value, and sending the sum of the local homomorphic ciphertext and the homomorphic ciphertext of other data sources received to the next data source until the next data source is the last data source;

[0008] Obtaining the sum of homomorphic ciphertexts returned by the last data source, decrypting the sum of homomorphic ciphertexts by the private key, and generating a query result corresponding to the query value according to the sum of homomorphic ciphertexts.

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

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

[0011] generating the corresponding pseudo-random value for the data source according to the pseudo-random key and a query value.

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

[0013] sending the pseudo-random key to the corresponding data source, which generates a corresponding pseudo-random value set for the data set according to the pseudo-random key.

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

[0015] if bit values of the first preset bits of the sum of the homomorphic ciphertexts are not all 0, determining that the query value is in a blacklist;

[0016] if bit values of the first preset bits of the sum of the homomorphic ciphertexts are all 0, determining that the query value is not in a blacklist, and the query result comprises whether the query value is in the blacklist.

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

[0018] determining a total number of mobile phone numbers corresponding to the query value in the query result according to bit values of the last preset bits of the sum of the homomorphic ciphertexts.

[0019] To achieve the above object, the present application provides a data query method, which comprises:

[0020] receiving a public key of homomorphic ciphertext sent by a query party, and generating homomorphic ciphertext of an encoded value of a data set according to the public key;

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

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

[0023] In addition, to achieve the above object, the present application further provides a data query device, which comprises:

[0024] The generating module is 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, so that the data sources generate homomorphic ciphertexts of encoded values of a data set according to the public key;

[0025] The executing module is configured to perform an oblivious pseudo-random function protocol with each data source respectively, and generate a pseudo-random value of a query value corresponding to each data source;

[0026] The sending module is configured to send the pseudo-random value to the corresponding data source in sequence, so that the data source obtains local homomorphic ciphertexts based on the pseudo-random value, and sends a sum of the local homomorphic ciphertexts and homomorphic ciphertexts of other data sources received to a next data source, until the next data source is the last data source.

[0027] The querying module is configured to obtain the sum of the homomorphic ciphertexts returned by the last data source, decrypt the sum of the homomorphic ciphertexts by using the private key, and generate a query result corresponding to the query value according to the sum of the homomorphic ciphertexts.

[0028] In addition, to achieve the above object, the present application further provides a data query device, which comprises:

[0029] The receiving module is configured to receive a public key of homomorphic ciphertexts sent by a querying party, and generate homomorphic ciphertexts of encoded values of a data set according to the public key.

[0030] The obtaining module is configured to obtain a pseudo-random key sent by the querying party, and generate a set of pseudo-random values according to the pseudo-random key and the data set.

[0031] The checking module is configured to receive a pseudo-random value sent by the querying party, obtain local homomorphic ciphertexts based on a comparison result of the pseudo-random value and the set of pseudo-random values, and send a sum of the local homomorphic ciphertexts and homomorphic ciphertexts of other data sources received to a next data source, until the next data source is the last data source.

[0032] In addition, to achieve the above object, the present application further provides a data query device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the data query method described above.

[0033] In addition, to achieve the above object, the present application further provides a storage medium, which is a computer readable storage medium, and the storage medium stores a computer program, and the computer program is executable on a processor to implement the steps of the data query method described above.

[0034] In addition, to achieve the above object, the application further provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the data query method as described above.

[0035] The one or more technical solutions provided in the application have at least the following technical effects:

[0036] The data source side data coding mode is innovated to adapt to the secure query process, the query side and the data source side use the careless pseudo-random function technology for secure comparison, secure query is realized, the secure summation is ensured through the secure summation query process of multiple data sources participating, and the security of data query is improved. BRIEF DESCRIPTION OF DRAWINGS

[0037] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the application and, together with the specification, serve to explain the principles of the application.

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, for those skilled in the art, other drawings can also be obtained based on these drawings without creative labor.

[0039] Figure 1 The flowchart is provided for the data query method embodiment one of the application;

[0040] Figure 2 The detailed flowchart is provided for the data query method embodiment one of the application;

[0041] Figure 3 The flowchart is provided for the data query method embodiment one of the application;

[0042] Figure 4 The flowchart is provided for the data query method embodiment two of the application;

[0043] Figure 5 The flowchart is provided for the data query method embodiment three of the application;

[0044] Figure 6 The module structure diagram of the data query device of the embodiment of the application is provided;

[0045] Figure 7 The device structure diagram of the hardware running environment involved in the data query method in the embodiment of the application is provided.

[0046] The object implementation, functional features and advantages of the application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION

[0047] It should be understood that the specific embodiments described herein are merely exemplary of the application and do not limit the application.

[0048] In order to better understand the technical solutions of the present application, the following will be described in detail in conjunction with the drawings and specific embodiments.

[0049] The main solution of the embodiment of the present application is 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. The data sources generate homomorphic ciphertexts of the encoding values of the data sets according to the public key. An oblivious pseudo-random function protocol is executed with each data source respectively to generate a pseudo-random value corresponding to the query value of each data source. The pseudo-random values are sent to the corresponding data sources in turn, and the data sources obtain local homomorphic ciphertexts based on the pseudo-random values, and send the sum of the local homomorphic ciphertexts and the homomorphic ciphertexts 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 ciphertexts returned by the last data source is obtained, the sum of the homomorphic ciphertexts is decrypted by the private key, and the query result corresponding to the query value is generated according to the sum of the homomorphic ciphertexts.

[0050] In the embodiment, for the convenience of description, the following describes the data query device as the execution subject.

[0051] Although the prior art ensures that the query party can simultaneously initiate queries to multiple data sources, the query results of each data source are ultimately known to the query party, which also causes the problem of 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 innovates the encoding method of the data source party data to adapt to the secure query process, and the query party and the data source party use the oblivious pseudo-random function technology for secure comparison to realize secure query, and through the secure summation query process participated by multiple data sources, the secure summation is ensured, and the security of the data query is improved.

[0053] It should be noted that the execution subject of the 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, a data query device, etc. capable of realizing the above functions. The following describes the embodiment and each of the following embodiments by taking the data query device as an example.

[0054] Based on this, the embodiment of the present application provides a data query method, which refers to Figure 1 , Figure 1 The flowchart 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, which generate homomorphic ciphertext of the encoded value of the data set based on 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 operation. The correctness of its homomorphic addition is reflected in the fact that for two ciphertexts c0 and c1 and their corresponding plaintexts m0 and m1, the following formula holds true

[0058]

[0059] in, Represents homomorphic addition of ciphertext, m0 and m1 represent plaintext, where Enc pk () indicates that the plaintext is homomorphically encrypted 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, identification number) of a specific user. Data source A has m A Database D A , including user ID, 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, while ensuring 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 process also 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 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 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. For example, 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 the information based on the number of mobile phone numbers in the query party's database and whether it is on the blacklist, and then the query party decodes according to the conditions, the effect of obtaining two types of information through a single query is achieved, which greatly improves the communication efficiency.

[0064] Finally, data sources A, B, and C respectively obtain data sets S A : S B : and S C : Among them S A Represents the dataset 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 applies to a querying party Q, which can be a terminal device, server, or other entity. The querying party Q generates a public-private key pair (pk, sk) for a homomorphic encryption algorithm and broadcasts the public key pk to data sources A, B, and C, while storing the private key sk locally. Optionally, the homomorphic encryption algorithm used can be additively homomorphic. The widely used and highly efficient Paillier algorithm will be used as an example for this description.

[0066] Data sources A, B, and C each calculate the homomorphic ciphertext of the encoded value v, that is, A calculates Homomorphic ciphertext B computes homomorphic ciphertext C computes homomorphic ciphertext wherein, denotes the Paillier homomorphic encryption of plaintext with public key pk, and so on.

[0067] In step S20, an oblivious pseudo-random function protocol is performed with each data source to generate a pseudo-random value of the query value corresponding to each data source.

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

[0069] The oblivious pseudo-random function is a two-party protocol widely used in cryptographic protocols and privacy protection technologies, in which one party (the sender) holds a pseudo-random function key k, and the other party (the receiver) holds an input x. The goal of the protocol is for the receiver to obtain a pseudo-random value F k (x) on k and x, while the sender does not obtain any information. The security requirements of OPRF include 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 value of the query party and the data source B is The pseudo-random value of the query party and the data source C is

[0071] In step S30, the pseudo-random values are sequentially sent to the corresponding data sources, and the data sources obtain local homomorphic ciphertexts based on the pseudo-random values and send the sum of the local homomorphic ciphertexts and the homomorphic ciphertexts received from other data sources to the next data source until the next data source is the last data source.

[0072] During the interaction of the parties, the security of the interaction process between the query party and a single data source is guaranteed by the security of the oblivious pseudo-random function, and the security of the data between the 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 query party is completed by the next data source, the possibility of the query party obtaining the query result of a certain data source is also eliminated. Therefore, the data is guaranteed to flow safely during the entire interaction process.

[0073] For example, the pseudo-random value of the query party and data source A is and the pseudo-random value is sent to data source A; the pseudo-random value of the query party and data source B is F kB (x Q ), and the pseudo-random value is sent to data source B; the pseudo-random value of the query party and data source C is and the pseudo-random value is sent to data source C.

[0074] After receiving the pseudo-random value sent by the query party, the data source compares the pseudo-random value of the query 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 of other data sources, and sends the sum of the homomorphic ciphertexts to the next data source until the next data source is the last data source. The other data source refers to a data source other than the current data source.

[0075] Optionally, taking three data sources as an example, as shown in Figure 2 , the query party Q sends to data source B. Data source A sends and the corresponding homomorphic ciphertext to data source B. Data source B compares the same row in and and records the corresponding homomorphic ciphertext The query party Q sends to data source C. Data source B sends and the corresponding homomorphic ciphertext and the comparison record of the homomorphic ciphertext to data source C. Data source C compares the same row in and and records the corresponding homomorphic ciphertext Data source C homomorphically calculates wherein represents the addition operation in the paillier homomorphic ciphertext calculation. The query party Q sends to data source A. Data source C sends and the corresponding homomorphic ciphertext and the comparison record of the homomorphic ciphertext to data source A. Data source A compares the same row in and and records the corresponding homomorphic ciphertext Data source A homomorphically calculates Finally, data source A sends the sum of the homomorphic ciphertexts to the query party Q.

[0076] By proposing to participate in multiple data sources, different data sources assist in comparing the previous data source and the ciphertext result of the query party, until the comparison of all data sources is completed, the secure comparison query is completed under the premise of ensuring that the privacy information of the query party and each data source party is not leaked, the secure summation query and blacklist judgment for multiple data sources are realized.

[0077] Step S40, obtaining the homomorphic ciphertext sum returned by the last data source, decrypting the homomorphic ciphertext sum by the private key, and generating the query result corresponding to the query value according to the homomorphic ciphertext sum.

[0078] It should be noted that the query party Q decrypts That is, the calculation Get the result Where Dec sk (c) represents decrypting the ciphertext c by the private key sk.

[0079] Optionally, if the first preset bit value of the homomorphic ciphertext sum is not all 0, it is determined that the query value is in the blacklist; if the first preset bit value of the homomorphic ciphertext sum 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. For example, if the first 2 bits of v are not all 0, the user of the query is in the blacklist, otherwise, the user is not in the blacklist.

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

[0081] In an embodiment, as shown in Figure 2 and 3 Steps 1 to 5 are the first stage, which completes the overall initialization, including encoding the data by each data source party, calculating the homomorphic ciphertext corresponding to the encoded value, and executing the OPRF protocol by the query party and each data source party. Steps 6 to 19 are the second stage, in which the query party interacts with each data source, each data source party compares the query party result and the previous data source result, and obtains the corresponding homomorphic ciphertext, and homomorphically sums up, and finally the query party decrypts to obtain the result. The correctness of step 19 is as follows: if the user is not in the blacklist of any data source, i.e. all 0, the sum result is also 0, i.e. the first t of v is all 0. At the same time, the property 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 the parties, the security of the interaction process between the query party and a single data source is guaranteed by the security of the oblivious pseudo-random function, and the security of the data between the data sources is guaranteed by the security of the homomorphic encryption ciphertext. At the same time, since the ciphertext comparison process between the data source and the query party is completed by the next data source, the query party is also prevented from learning the query result of a certain data source. Therefore, the data is guaranteed to flow safely in the entire interaction process.

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

[0084] Specifically, if the computing power of a certain data source is weak, and the bandwidth between it and the query party is large, an OPRF algorithm based on Oblivious Transfer extension (OTe) suitable for high bandwidth can be used. If the computing power of a certain data source is strong, but the bandwidth between it and the query party is low, an ECC-OPRF algorithm based on DH (Diffie-Hellman) key exchange on 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 the embodiment, a public key and a private key pair of a homomorphic encryption algorithm are generated, and the public key is sent to at least two data sources. The data sources generate homomorphic ciphertexts of the encoding values of the data sets according to the public key. An oblivious pseudo-random function protocol is executed with each data source respectively to generate a pseudo-random value corresponding to the query value of each data source. The pseudo-random values are sent to the corresponding data sources in turn, and the data sources obtain local homomorphic ciphertexts based on the pseudo-random values and send the sum of the local homomorphic ciphertexts and the homomorphic ciphertexts of other data sources received to the next data source until the next data source is the last data source. The sum of the homomorphic ciphertexts returned by the last data source is obtained, the sum of the homomorphic ciphertexts is decrypted by the private key, and a query result corresponding to the query value is generated according to the sum of the homomorphic ciphertexts. The encoding method of the data source side is innovated to adapt to the secure query process. The query party and the data source side use the oblivious pseudo-random function technology for secure comparison to realize secure query. Through the secure summation query process participated by multiple data sources, secure summation is guaranteed, and the security of data query is improved.

[0086] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as the above embodiments can be referred to the above introduction, and will not be described in detail. On this basis, please refer to Figure 4 , step S20 comprises:

[0087] Step S21, respectively with each of the data source performs oblivious pseudo-random function protocol, generate each of the data source corresponding pseudo-random key;

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

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

[0090] The query party Q based on each data source corresponding pseudo-random key, respectively calculate the pseudo-random value corresponding to the query value. Exemplarily, the query party and the pseudo-random value of data source A is The query party and the pseudo-random value of data source B is The query party and the pseudo-random value of data source C is

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

[0092] Optionally, after the query party Q and the data source A perform OPRF protocol, the query party Q gets pseudo-random key k A , and the data source A inputs the set to get the corresponding pseudo-random value set Similarly, the query party Q and the data source B perform OPRF protocol, get pseudo-random key k B , and the data source B inputs the set to get the corresponding pseudo-random value set The query party Q and the data source C perform OPRF protocol, get pseudo-random key k C , and the data source C inputs the set to get the corresponding pseudo-random value set Wherein, F k (x) represents the pseudo-random value of plaintext x calculated by using the pseudo-random key k.

[0093] In the technical scheme of the embodiment, the query party and the data source party use the oblivious pseudo-random function technology for safe comparison, and realize safe query.

[0094] In the third embodiment of the present application, the same or similar contents as the above embodiments can be referred to the above introduction, and will not be described hereinafter. On this basis, please refer to Figure 5 , the method comprises:

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

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

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

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

[0099] For example, data sources A, B and C uniformly encode the number of mobile phone numbers and whether in blacklist of each user in their respective databases, that is, v represents the encoding value of the number of mobile phone numbers and whether in blacklist to be queried, with a length of l bytes, the first t bits are whether in blacklist, and t is n is the number of data sources. The value of l is where max is the maximum number of bits of the query value, and 8l-t bits are used to represent the query information to be summed. In this example, l = 1, t = 2, and the last 6 bits are query information, that is, the number of mobile phone numbers. For example, a user has 3 mobile phone numbers at data source A, and is in the blacklist, then A can represent the value v of the user in binary as 01000011, and in decimal as 67. Finally, 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, represents the id of the i-th user owned by data source A, represents the encoding value of the i-th user owned by data source A, [m A ] represents {1...mA} for data source B, C. Wherein, represents rounding up.

[0100] After receiving the public key pk sent by the query party Q, the data source A, B, C respectively calculates the homomorphic ciphertext of the encoding value v, that is, A calculates the homomorphic ciphertext of B calculates the homomorphic ciphertext of C calculates the homomorphic ciphertext of Wherein, represents that the plaintext is paillier homomorphic encryption by using the public key pk, and the same is true for the following.

[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 inputs the set to obtain the corresponding pseudo-random value set Similarly, Q and data source B execute the OPRF protocol to obtain the pseudo-random key k B , B inputs the set to obtain the corresponding pseudo-random value set Q and data source C execute the OPRF protocol to obtain the pseudo-random key k C , C inputs the set to obtain the corresponding pseudo-random value set Wherein, F k (x) represents the pseudo-random value of the plaintext x calculated by using the pseudo-random key k.

[0102] Optionally, taking three data sources as an example, as shown in Figure 2 , the query party Q sends to the data source B. The data source A sends and the corresponding homomorphic ciphertext to the data source B. The data source B compares the same row in with and records the corresponding homomorphic ciphertext The query party Q sends to the data source C. The data source B sends and the corresponding homomorphic ciphertext to the data source C, and compares the recorded homomorphic ciphertext The data source C compares the same row in with and records the corresponding homomorphic ciphertext The data source C homomorphically calculates Wherein, Indicates the addition operation in the Paillier homomorphic ciphertext calculation. The query party Q sends to the data source A. The data source C sends and the corresponding homomorphic ciphertext to the data source A. The data source A compares and records the corresponding homomorphic ciphertext The data source A compares with the same row in and records the corresponding homomorphic ciphertext The data source A homomorphically calculates The data source A sends the sum of the homomorphic ciphertexts

[0103] In the technical solution of the embodiment, the encoding mode of the data source party data is innovated to adapt to the secure query process, the query party and the data source party use the careless pseudo-random function technology for secure comparison, secure query is realized, the secure summation is ensured through the secure summation query process of multiple data sources, and the security of data query is improved.

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

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

[0106] The generating module 10 is used for generating a public key and a private key pair of a homomorphic encryption algorithm, and sending the public key to at least two data sources. The data sources generate homomorphic ciphertexts of encoding values of data sets according to the public key.

[0107] The executing module 20 is used for respectively executing a careless pseudo-random function protocol with each data source to generate a pseudo-random value of a query value corresponding to each data source.

[0108] The sending module 30 is used for sequentially sending the pseudo-random values to the corresponding data sources. The data sources obtain local homomorphic ciphertexts based on the pseudo-random values, and send the sum of the local homomorphic ciphertexts and the homomorphic ciphertexts of other data sources received to the next data source until the next data source is the last data source.

[0109] The query module 40 is used for 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.

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

[0111] performing 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] generating the pseudo-random value corresponding to the data source according to the pseudo-random key and the query value.

[0113] Optionally, after the step of performing 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 method further comprises:

[0114] sending the pseudo-random key to the corresponding data source, and the data source generates a set of pseudo-random values corresponding to the data set according to the pseudo-random key.

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

[0116] if bit values of the first preset bits of the sum of the homomorphic ciphertexts are not all 0, determining that the query value is in a blacklist;

[0117] if bit values of the first preset bits of the sum of the homomorphic ciphertexts are all 0, determining that the query value is not in the blacklist, and the query result comprises whether the query value is in the blacklist.

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

[0119] determining the total number of mobile phone numbers corresponding to the query value in the query result according to bit values of the last preset bits of the sum of the homomorphic ciphertexts.

[0120] The application also provides a data query device, which comprises:

[0121] a receiving module configured to receive a public key of homomorphic ciphertext sent by a querying party, and generate homomorphic ciphertext of an encoded value of a data set according to the public key;

[0122] an obtaining module configured to obtain a pseudo-random key sent by the querying party, and generate a set of pseudo-random values according to the pseudo-random key and the data set;

[0123] The collation module is configured to receive a pseudo-random value sent by a query party, obtain a local homomorphic ciphertext based on a comparison result of the pseudo-random value and the set of pseudo-random values, and send a sum of the local homomorphic ciphertext and homomorphic ciphertexts of other data sources received to a next data source until the next data source is the last data source.

[0124] The data query device provided in the present application adopts the data query method in the above embodiments, and can solve the technical problem of low data query security of the data source party due to privacy leakage of the data source party. Compared with the prior art, the data query device provided in the present application has the same beneficial effects as the data query method provided in the above embodiments, and other technical features in the data query device are the same as the features disclosed in the above embodiments, which will not be repeated here.

[0125] The present application provides a data query device, comprising: at least one processor; and a memory in communication connection with 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 to enable the at least one processor to execute the data query method in Embodiment I.

[0126] Reference will now be made to the drawings, in which Figure 7 which shows a structural schematic diagram of a data query device suitable for implementing the embodiments of the present application. The data query device in the embodiments of the present application can include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistant), PADs (Portable Application Description), PMPs (Portable Media Player), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. Figure 7 The data query device shown is only an example, and should not bring any limitation to the functions and use range of the embodiments of the present application.

[0127] As Figure 7As shown, the data query device can include a processing apparatus 1001 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 1002 or loaded from a storage apparatus 1003 into a random access memory (RAM) 1004. Various programs and data required for operation of the data query device are also stored in the RAM 1004. The processing apparatus 1001, the ROM 1002, and the RAM 1004 are connected to each other by 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: input apparatus 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output apparatus 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; the storage apparatus 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication apparatus 1009. The communication apparatus 1009 can allow the data query device to communicate with other devices wirelessly or by wire to exchange data. Although the data query device having various systems is shown in the figure, it should be understood that all the shown systems are not required to be implemented or possessed. More or less systems can be alternatively implemented or possessed.

[0128] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by the communication apparatus, or installed from the storage apparatus 1003, or installed from the ROM 1002. When the computer program is executed by the processing apparatus 1001, the above-mentioned functions defined in the methods of embodiments of the present disclosure are performed.

[0129] The data query device provided by the present disclosure adopts the data query method in the above-mentioned embodiments, and can solve the technical problem of low data query security of the data source party due to privacy leakage of the data source party. Compared with the prior art, the data query device provided by the present disclosure has the same beneficial effects as the data query method provided by the above-mentioned embodiments, and other technical features in the data query device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.

[0130] It should be understood that various aspects of the disclosure can be implemented in 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 appropriate manner in any one or more embodiments or examples.

[0131] The above description is merely illustrative of the application and is not intended to limit the scope of the application. Any variations and modifications that can be made by any person skilled in the art within the spirit and scope of the application are intended to be encompassed by the application. The scope of the application is defined by the appended claims.

[0132] The application provides a computer readable storage medium having stored thereon computer readable program instructions (i.e., a computer program) for performing the data query method in the above embodiments.

[0133] The computer readable storage medium provided by the application may, for example, be a U disk, but is not limited to an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system, system, or device, or any combination thereof. More specific examples of the computer readable storage medium can include, but are not limited to, an electric connection with one or more conductive 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 appropriate combination thereof. In the present embodiment, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer readable storage medium can be transmitted by any appropriate medium, including but not limited to an electric wire, an optical cable, an RF (Radio Frequency), etc., or any appropriate combination thereof.

[0134] The above computer readable storage medium can be contained in the data query device; or can exist separately without being assembled into the data query device.

[0135] The computer readable storage medium carries one or more programs, when the one or more programs are executed by the data query device, the data query device is caused to: adapt the coding mode of the data source side data to adapt to the secure query process, the query side and the data source side use the careless pseudo-random function technology to perform the secure comparison, and the secure query is realized, the secure summation is ensured through the secure summation query process of the multiple data sources, and the security of the data query is improved.

[0136] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0137] The flow diagrams and the block diagrams in the drawings are illustrations of architectures, functionalities, and operations of possible implementations of systems, methods, and computer program products according to various embodiments of present application. In this regard, each block in the flow diagrams or block diagrams can represent a module, a procedure, or a part of code, which comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in a different order than that noted in the figures. For example, two blocks noted in succession can in fact be executed substantially concurrently or in the opposite order, depending on the functionality involved. It is also noted that each block in the block diagrams and / or flow diagrams, and combinations of blocks in the block diagrams and / or flow diagrams, can be implemented by dedicated hardware-based systems that perform the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0138] The modules involved in the embodiments of the present application can be implemented in a software manner or in a hardware manner. In some cases, the name of the module does not constitute a limitation on the unit itself.

[0139] The readable storage medium provided by the 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 of privacy leakage of the data source party, resulting in low data query security of the data source party. Compared with the prior art, the beneficial effects of the computer readable storage medium provided by the application are the same as those of the data query method provided by the above-mentioned embodiments, and will not be repeated here.

[0140] The application also provides a computer program product comprising a computer program, which, when executed by a processor, implements the steps of the data query method as described above.

[0141] The computer program product provided by the application can solve the technical problem of privacy leakage of the data source party, resulting in low data query security of the data source party. Compared with the prior art, the beneficial effects of the computer program product provided by the application are the same as those of the data query method provided by the above-mentioned embodiments, and will not be repeated here.

[0142] The above-mentioned is only part of the embodiments of the application, and does not limit the patent scope of the application, and any equivalent structural transformation, direct / indirect application in other related technical fields made by using the content of the application specification and drawings within the technical concept of the application are included in the patent protection scope of the application.

Claims

1. A data query method, characterized by, The method applied to a query party comprises: generating a public key and a private key of a homomorphic encryption algorithm, and sending the public key to at least two data sources, wherein the data sources generate homomorphic ciphertexts of encoded values of data sets according to the public key; respectively performing 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; sending the pseudo-random values to the corresponding data sources in sequence, wherein the data sources obtain local homomorphic ciphertexts based on the pseudo-random values, and send a sum of the local homomorphic ciphertexts and homomorphic ciphertexts of other data sources received to a next data source until the next data source is the last data source; obtaining the sum of the homomorphic ciphertexts returned by the last data source, decrypting the sum of the homomorphic ciphertexts by using the private key, and generating a query result corresponding to the query value according to the sum of the homomorphic ciphertexts.

2. The method of claim 1, wherein, The step of respectively performing the oblivious pseudo-random function protocol with each of the data sources to generate the pseudo-random value of the query value corresponding to each of the data sources comprises: respectively performing 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; generating the pseudo-random value corresponding to the data source according to the pseudo-random key and the query value.

3. The method of claim 2, wherein, After the step of respectively performing the oblivious pseudo-random function protocol with each of the data sources to generate the pseudo-random key corresponding to each of the data sources, the method further comprises: sending the pseudo-random key to the corresponding data source, wherein the data source generates a pseudo-random value set corresponding to the data set according to the pseudo-random key.

4. The method of claim 1, wherein, The step of generating the query result corresponding to the query value according to the sum of the homomorphic ciphertexts comprises: if bit values of the first preset bits of the sum of the homomorphic ciphertexts are not all 0, determining that the query value is in a blacklist; if the bit values of the first preset bits of the sum of the homomorphic ciphertexts are all 0, determining that the query value is not in the blacklist, and the query result comprises whether the query value is in the blacklist.

5. The method of claim 1, wherein, The step of generating the query result corresponding to the query value according to the sum of the homomorphic ciphertexts comprises: determining a total number of mobile phone numbers corresponding to the query value in the query result according to bit values of the second preset bits of the sum of the homomorphic ciphertexts.

6. A data query method characterized by, The method applied to a data source comprises: receiving a public key of homomorphic ciphertexts sent by a query party, and generating homomorphic ciphertexts of encoded values of data sets according to the public key; obtaining a pseudo-random key sent by the query party, and generating a pseudo-random value set according to the pseudo-random key and the data set; receiving a pseudo-random value sent by the query party, obtaining local homomorphic ciphertexts based on a comparison result of the pseudo-random value and the pseudo-random value set, and sending a sum of the local homomorphic ciphertexts and homomorphic ciphertexts of other data sources received to a next data source until the next data source is the last data source.

7. A data query apparatus, characterized by comprising: The device comprises: a generating module configured to generate a public key and a private key of a homomorphic encryption algorithm, and send the public key to at least two data sources, wherein the data sources generate homomorphic ciphertexts of encoded values of data sets according to the public key; The execution module is configured to perform an oblivious pseudo-random function protocol with each data source respectively to generate a pseudo-random value of a query value corresponding to each data source; The sending module is configured 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 a sum of the local homomorphic ciphertext and homomorphic ciphertexts of other data sources to a next data source until the next data source is the last data source; The query module is configured to obtain the sum of homomorphic ciphertexts returned by the last data source, decrypt the sum of homomorphic ciphertexts by using the private key, and generate a query result corresponding to the query value according to the sum of homomorphic ciphertexts.

8. A data query device, characterized by The device comprises a memory, a processor, and a computer program stored on the memory and executable on the processor, and 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 by The storage medium is a computer readable storage medium, and the storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the data query method according to any one of claims 1 to 6.

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

Citation Information

Patent Citations

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

    CN113157778A

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

    CN116680324A