Homomorphic encryption-based data trace query method, device and equipment and medium

By using a specified function algorithm and private key to homomorphically encrypt the reference data in the stealth query process, and splitting and calculating the difference or product between the target ciphertext and the reference ciphertext, the problem of high computation and communication overhead in the prior art is solved, and efficient and secure stealth query is achieved.

CN119884149BActive Publication Date: 2025-12-12BEIJING HAITAI FANGYUAN HIGH TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411968479.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-12-12
Estimated Expiration
2044-12-30

AI Technical Summary

Technical Problem

Existing stealth query processes based on homomorphic encryption algorithms have high computational and communication overhead, resulting in high costs and low efficiency.

Method used

The data querying party obtains the reference ciphertext obtained by the data provider through homomorphic encryption of the reference data based on a specified function algorithm and private key. The querying party calculates the target fingerprint code of the data to be queried using the specified function algorithm, and splits it into multiple fragment fingerprint codes based on a preset splitting algorithm. These fragment fingerprint codes are then sent to the data provider for homomorphic encryption. The difference or product between the target ciphertext and the reference ciphertext is calculated using the homomorphic encryption properties to determine whether there is identical reference data.

Benefits of technology

It significantly reduces the computational and communication overhead of the anonymous query process, protects the privacy of the data queryer, and reduces the possibility of the data provider speculating on the data to be queried.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119884149B_ABST
    Figure CN119884149B_ABST
Patent Text Reader

Abstract

The application provides a homomorphic encryption-based data anonymous query method, device, equipment and medium. In the method, a data query party can calculate target fingerprint codes by using a specified function algorithm on to-be-queried data having the same data structure as reference data. The target fingerprint codes are split into multiple piece fingerprint codes based on a preset splitting algorithm to obtain multiple piece ciphertexts obtained by homomorphic encryption of the multiple piece fingerprint codes by a data provider using a private key. Thus, by using the characteristics of homomorphic encryption, whether there is reference data having the same content as the to-be-queried data is determined based on the difference or product of the target ciphertext calculated based on the multiple piece ciphertexts and multiple reference ciphertexts, the reference ciphertexts being obtained by encrypting the reference data by the data provider based on the specified function algorithm and the private key. The above process does not need to set a public-private key pair for the data query party, and only the private key of the data provider is used for homomorphic operation, thereby saving the calculation and communication overheads of the anonymous query.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the technical field of data security, and specifically discloses a data private information retrieval (PIR) query method and device based on homomorphic encryption, equipment and a medium. BACKGROUND

[0002] Private information retrieval (PIR), also known as privacy information retrieval, is a very practical technology and application in secure multi-party computation, which can be used to protect the query privacy of users and further protect the query results of users. In a traditional information retrieval task, the query party usually needs to send a query request in plaintext to the server, which may expose the identity and sensitive information of the user. The private information retrieval refers to hiding the queried information by the query party, and the data provider can provide the matching query result, but cannot know the query content of the query party.

[0003] The homomorphic encryption algorithm is one of the mainstream algorithms in the private information retrieval scenario, which allows specific operation on the ciphertext, and the decrypted result is the same as the result of the same operation on the plaintext, and has the characteristic of "calculable but invisible".

[0004] At present, the private information retrieval process based on the homomorphic encryption algorithm is that the query party and the data provider each configure a public-private key pair, and the data provider and the query party need to perform multiple homomorphic encryption and decryption operations and interaction based on the public key and the private key of the other party, which has a large burden in terms of calculation and communication. SUMMARY

[0005] The application embodiment provides a data private information retrieval query method, device, equipment and medium based on homomorphic encryption, which is used to reduce the calculation and communication overhead of the private information retrieval process.

[0006] To achieve the above purpose, the technical scheme of the application embodiment is as follows:

[0007] In a first aspect, the application embodiment provides a data query method, comprising:

[0008] sending a private information retrieval request to a data provider to obtain a plurality of reference ciphertexts; the plurality of reference ciphertexts are obtained by homomorphic encryption of reference data by the data provider based on a specified function algorithm and a private key;

[0009] calculating a target fingerprint code from the to-be-queried data by using the specified function algorithm, and splitting the target fingerprint code into a plurality of split fingerprint codes based on a preset splitting algorithm; the data structure of the to-be-queried data is the same as that of the reference data;

[0010] sending a ciphertext generation request carrying the plurality of piece fingerprint codes to the data provider to obtain a plurality of piece ciphertexts; the plurality of piece ciphertexts are obtained by homomorphic encryption of the plurality of piece fingerprint codes by the data provider using a private key;

[0011] determining the query answer of the to-be-queried data based on a difference or a product of the plurality of piece ciphertexts and the plurality of reference ciphertexts; the query answer represents whether there is reference data with the same content as the to-be-queried data.

[0012] In the embodiments of the present application, the data querying party can calculate the target fingerprint code by using a specified function algorithm on the to-be-queried data with the same data structure as the reference data. Then, the target fingerprint code is split into a plurality of piece fingerprint codes based on a preset splitting algorithm to obtain a plurality of piece ciphertexts obtained by homomorphic encryption of the plurality of piece fingerprint codes by the data provider using a private key. Thus, the existence of reference data with the same content as the to-be-queried data can be determined based on a difference or a product of the target ciphertext calculated based on the plurality of piece ciphertexts and the plurality of reference ciphertexts, wherein the reference data is obtained by encryption of the reference data by the data provider based on the specified function algorithm and the private key. The above process does not need to set a public-private key pair for the data querying party, and only the private key of the data provider is involved in the homomorphic operation, which greatly reduces the operation amount of data homomorphic encryption and decryption, and saves the calculation and communication overheads of the anonymous query process.

[0013] In some embodiments, the determining the query answer of the to-be-queried data based on the difference or the product of the plurality of piece ciphertexts and the plurality of reference ciphertexts comprises:

[0014] splicing the plurality of piece ciphertexts based on the preset splitting algorithm to obtain a target ciphertext;

[0015] obtaining an associated ciphertext of each reference ciphertext based on a difference or a product of the target ciphertext and each reference ciphertext;

[0016] sending a ciphertext decryption request carrying the associated ciphertext to the data provider to obtain an associated plaintext; the associated plaintext is obtained by homomorphic decryption of the associated ciphertext by the data provider using a private key;

[0017] determining the query answer based on the associated plaintext and a preset threshold.

[0018] In the embodiments of the present application, the data querying party obtains target ciphertext by splicing the plurality of piecewise ciphertexts based on the preset splitting algorithm, and obtains the associated ciphertext corresponding to each reference ciphertext based on the difference or product of the target ciphertext and each reference ciphertext. Since the querying party does not hold the private key for homomorphic encryption and decryption operation, the associated ciphertext needs to be handed over to the data provider to perform homomorphic decryption by using the private key to obtain the corresponding associated plaintext. According to the homomorphic property, if the associated plaintext corresponding to the associated ciphertext is equal to the preset threshold value, it indicates that the data provider has reference data with the same content as the to-be-queried data, so that whether the data provider has reference data with the same content as the to-be-queried data can be known by using the homomorphic property without the data provider knowing the to-be-queried data.

[0019] In some embodiments, the obtaining the associated ciphertext of each reference ciphertext based on the difference or product of the target ciphertext and each reference ciphertext comprises:

[0020] generating a weight factor same as the number of reference ciphertexts; each weight factor is mutually exclusive with a preset modulus in the homomorphic encryption and the homomorphic decryption, and each weight factor corresponds to a reference ciphertext;

[0021] for each reference ciphertext, determining a first product of the weight factor corresponding to the reference ciphertext and the reference ciphertext, and a second product of the weight factor corresponding to the reference ciphertext and the target ciphertext; and taking the difference between the first product and the second product as the associated ciphertext corresponding to the reference ciphertext; or

[0022] for each reference ciphertext, determining a first power operation result of the weight factor corresponding to the reference ciphertext and the reference ciphertext, and a second power operation result of the weight factor corresponding to the reference ciphertext and the target ciphertext; and taking the product of the first power operation result and the second power operation result as the associated ciphertext.

[0023] In the embodiments of the present application, when calculating the associated ciphertext between the reference ciphertext and the target ciphertext, the reference ciphertext is not simply subtracted from the target ciphertext, but a corresponding weight factor is set for each reference ciphertext, so that when the associated ciphertext is calculated, the weight factor is introduced to perform product operation on the reference ciphertext and the target ciphertext to further change the ciphertext form, thereby improving security and reducing the possibility of the data provider restoring the target fingerprint code based on the reference associated ciphertext.

[0024] In some embodiments, the to-be-queried data represents an answer prediction result of a target question; the query answer represents whether the answer prediction result is correct; and the determining the query answer based on the associated plaintext and the preset threshold value comprises:

[0025] If the associated plaintext is the same as the preset threshold, it is determined that the answer prediction result of the to-be-queried data to the target question is correct.

[0026] If the associated plaintext is different from the preset threshold, it is determined that the answer prediction result of the to-be-queried data to the target question is incorrect.

[0027] In the embodiments of the present application, the to-be-queried data is set as the answer prediction result to the target question. Since the to-be-queried data and the reference data held by the data provider have the same data structure, when the associated plaintext between the reference ciphertext calculated based on the reference data and the target ciphertext calculated based on the to-be-queried data is the same as the preset threshold, the homomorphic property can be used to know that the data provider holds the reference data with the same content as the to-be-queried data, that is, the answer prediction result of the to-be-queried data to the target question is correct. Thus, the to-be-queried data can be protected from being exposed in communication, and the risk of the data provider guessing the to-be-queried data can be effectively reduced.

[0028] In some embodiments, the sending of the ciphertext decryption request carrying the associated ciphertext to the data provider comprises:

[0029] After obtaining the associated ciphertext corresponding to each reference ciphertext, the order of the associated ciphertext is adjusted so that the first order is different from the second order; the first order is the order of the plurality of reference ciphertexts sent by the data provider; and the second order is the order of the reference ciphertext corresponding to the adjusted associated ciphertext.

[0030] Based on the adjusted associated ciphertext, the ciphertext decryption request is generated and sent to the data provider.

[0031] In the embodiments of the present application, the data querying party renumbers and reorders the associated ciphertext corresponding to each reference ciphertext and sends it to the data provider. The reordering sequence should be different from the ordering sequence of the plurality of reference ciphertexts. Thus, the data provider cannot know the current query object of the data querying party based on the ordering sequence of the associated ciphertext, and the risk of information leakage is reduced.

[0032] In some embodiments, the plurality of reference ciphertexts are obtained by homomorphic encryption of reference fingerprint codes by the data provider using a private key; the reference fingerprint codes are calculated by the data provider using the specified function algorithm on the reference data; each reference ciphertext corresponds to a unique reference fingerprint code, and each reference fingerprint code corresponds to a unique reference data.

[0033] In the embodiments of the present application, the data provider calculates a reference fingerprint code by using a specified function algorithm on reference data in a specific format, and performs homomorphic encryption on the reference fingerprint code by using a private key to obtain reference ciphertext, thereby establishing an association between each reference ciphertext and the corresponding reference data. Since the specified function algorithm is shared with the data query party, and the reference data and the query data of the data query party have the same data structure, the reference ciphertext and the target ciphertext have the same data structure through the above process, and then the data query party can use the homomorphic property to obtain the query result of whether there is reference data with the same content as the query data from the data provider.

[0034] In some embodiments, the specified function algorithm is any one of a message authentication algorithm, a hash function algorithm, and a compression function algorithm.

[0035] In the embodiments of the present application, the data query party agrees with the data provider on a set of specified function algorithms to operate on the original data, so that the query party and the data provider obtain target fingerprint codes and reference fingerprint codes with the same data structure, respectively. The original data is the query data of the data query party and the reference data of the data provider, thereby ensuring that the same fingerprint code structure can enable the data query party to use the homomorphic property to obtain the query result of whether there is reference data with the same content as the query data from the data provider.

[0036] In a second aspect, the embodiments of the present application also provide a data anonymous trace query device based on homomorphic encryption, which comprises:

[0037] The data acquisition unit is configured to perform: sending an anonymous trace query request to the data provider, and acquiring a plurality of reference ciphertexts; the plurality of reference ciphertexts are obtained by the data provider performing homomorphic encryption on reference data based on a specified function algorithm and a private key;

[0038] The fragmentation processing unit is configured to perform: calculating a target fingerprint code by using the specified function algorithm on query data, and splitting the target fingerprint code into a plurality of fragmented fingerprint codes based on a preset splitting algorithm; the query data and the reference data have the same data structure;

[0039] The fragmented encryption unit is configured to perform: sending a ciphertext generation request carrying the plurality of fragmented fingerprint codes to the data provider, and acquiring a plurality of fragmented ciphertexts; the plurality of fragmented ciphertexts are obtained by the data provider performing homomorphic encryption on the plurality of fragmented fingerprint codes by using a private key;

[0040] The anonymous trace query unit is configured to perform: determining a query answer of the query data based on the difference or product of the plurality of fragmented ciphertexts and the plurality of reference ciphertexts; the query answer represents whether there is reference data with the same content as the query data.

[0041] In some embodiments, the determining the query answer of the data to be queried based on the difference or product of the plurality of piece of ciphertext and the plurality of reference ciphertext, the anonymous query unit is specifically configured to:

[0042] obtaining a target ciphertext based on the plurality of piece of ciphertext spliced by the preset splitting algorithm;

[0043] obtaining an associated ciphertext of each reference ciphertext based on the difference or product of the target ciphertext and each reference ciphertext;

[0044] sending a ciphertext decryption request carrying the associated ciphertext to a data provider to obtain an associated plaintext; the associated plaintext is obtained by the data provider homomorphically decrypting the associated ciphertext by using a private key;

[0045] determining the query answer based on the associated plaintext and a preset threshold.

[0046] In some embodiments, the obtaining the associated ciphertext of each reference ciphertext based on the difference or product of the target ciphertext and each reference ciphertext, the anonymous query unit is specifically configured to:

[0047] generating a same number of weight factors as the reference ciphertexts; each weight factor is mutually exclusive with a preset modulus in the homomorphic encryption and the homomorphic decryption, and each weight factor corresponds to a reference ciphertext;

[0048] for each reference ciphertext, determining a first product of the reference ciphertext corresponding weight factor and the reference ciphertext, and a second product of the reference ciphertext corresponding weight factor and the target ciphertext; and taking the difference between the first product and the second product as the associated ciphertext corresponding to the reference ciphertext; or,

[0049] for each reference ciphertext, determining a first power operation result of the reference ciphertext corresponding weight factor and the reference ciphertext, and a second power operation result of the reference ciphertext corresponding weight factor and the target ciphertext; and taking the product of the first power operation result and the second power operation result as the associated ciphertext.

[0050] In some embodiments, the data to be queried represents an answer prediction result of a target problem; the query answer represents whether the answer prediction result is correct; the determining the query answer based on the associated plaintext and a preset threshold, the anonymous query unit is specifically configured to:

[0051] if the associated plaintext is the same as the preset threshold, it is determined that the answer prediction result of the target problem by the data to be queried is correct;

[0052] If the associated plaintext is different from the preset threshold value, it is determined that the answer prediction result of the to-be-queried data to the target question is wrong.

[0053] In some embodiments, the sending, to the data provider, of the ciphertext decryption request carrying the associated ciphertext is performed, and the sharding encryption unit is specifically configured to:

[0054] After obtaining the associated ciphertext corresponding to each reference ciphertext, the order of the associated ciphertext is adjusted, so that the first order is different from the second order; the first order is the order of the plurality of reference ciphertexts sent by the data provider; and the second order is the order of the reference ciphertext corresponding to the associated ciphertext after the order adjustment.

[0055] Based on the associated ciphertext after the order adjustment, the ciphertext decryption request is generated and sent to the data provider.

[0056] In some embodiments, the plurality of reference ciphertexts are obtained by homomorphic encryption of reference fingerprint codes by the data provider using a private key; the reference fingerprint codes are calculated by the data provider using the specified function algorithm on the reference data; each reference ciphertext corresponds to a unique reference fingerprint code, and each reference fingerprint code corresponds to unique reference data.

[0057] In some embodiments, the specified function algorithm is any one of a message authentication algorithm, a hash function algorithm, and a compression function algorithm.

[0058] In a third aspect, an embodiment of the present application provides an electronic device, comprising:

[0059] a memory configured to store program instructions;

[0060] a processor configured to invoke the program instructions stored in the memory and perform the steps included in the method of any one of the first aspect according to the obtained program instructions.

[0061] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, the computer program comprising program instructions, the program instructions causing a computer to execute the method of any one of the first aspect when executed by the computer.

[0062] In a fifth aspect, an embodiment of the present application provides a computer program product, which comprises computer program code, and when the computer program code is run on a computer, causes the computer to execute the method of any one of the first aspect.

[0063] Other features and advantages of the present application will be set forth in the description that follows, and in part will be apparent from the description, or can be learned by practice of the application. The purposes and other advantages of the present application will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings. BRIEF DESCRIPTION OF DRAWINGS

[0064] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and all other drawings obtained by those of ordinary skill in the art without creative effort based on these drawings are within the protection scope of the present application.

[0065] Figure 1 An application scenario schematic diagram provided for the embodiments of the present application is shown in the figure.

[0066] Figure 2 An execution timing diagram of a data anonymous trace query method based on homomorphic encryption provided for the embodiments of the present application is shown in the figure.

[0067] Figure 3 An associated ciphertext acquisition process schematic diagram provided for the embodiments of the present application is shown in the figure.

[0068] Figure 4 A data anonymous trace query process provided for the embodiments of the present application is shown in the figure. Figure 2 A process schematic diagram of the data anonymous trace query process based on homomorphic encryption is shown in the figure.

[0069] Figure 5 A process schematic diagram of the data anonymous trace query process based on homomorphic encryption provided for the embodiments of the present application is shown in the figure.

[0070] Figure 6 A structure schematic diagram of a data anonymous trace query device based on homomorphic encryption provided for the embodiments of the present application is shown in the figure.

[0071] Figure 7 A structure schematic diagram of an electronic device provided for the embodiments of the present application is shown in the figure. DETAILED DESCRIPTION

[0072] In order to make the purposes, technical solutions and advantages of the present application more clear, the present application will be further described in detail below with the drawings. Obviously, the described embodiments are only some embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present application.

[0073] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and in the above drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the present application, as detailed in the appended claims.

[0074] To facilitate understanding of the technical solutions provided by the present application, the technical background of the present application is described in detail as follows:

[0075] Anonymity query refers to hiding the queried information by the querying party, and the data providing party can provide matching query results, but cannot know the query content of the querying party. It is widely used in information verification scenarios. Information verification refers to that the data querying party has at least one answer guess or answer prediction result for a certain target problem, but if the data querying party directly inquires the data providing party, the answer guess or answer prediction result of the data querying party will be directly exposed in the inquiry stage.

[0076] For example, public security personnel need to investigate whether Zhang San purchased a large amount of stock funds in a certain transaction institution. If the name of the queried person is directly given to the transaction institution to help query whether Zhang San holds a large amount of stock funds, although an accurate reply from the transaction institution can be obtained quickly, whether Zhang San holds a large amount of stock funds or not, the information that Zhang San is being investigated will be directly exposed when inquiring the transaction institution, that is, at least the transaction institution knows.

[0077] If anonymity query is used, the above information exposure problem can be effectively avoided. At present, the anonymity query process based on the homomorphic encryption algorithm is to pre-configure a public-private key pair for the data querying party. The data querying party needs to perform multiple homomorphic encryption and decryption operations and interactions based on the public key shared with the data providing party and the private key owned by the data querying party, so as to obtain the final query result.

[0078] Taking the anonymity query process based on the Paillier homomorphic encryption algorithm commonly used in the industry as an example, it is assumed that the data querying party wants to query whether there is a to-be-queried data satisfying a specified condition from N reference data of the data providing party. At this time, the data querying party needs to generate confusion data containing the to-be-queried data. The confusion data requires the same number of reference data (that is, N pieces of confusion data are generated, including 1 piece of to-be-queried data and N-1 pieces of virtual data).

[0079] The data query party encrypts the to-be-queried data by using a private key, and encrypts the virtual data by using a public key shared with the data provider. Then, the data provider performs inner product operation on the N pieces of obfuscated data and the N pieces of reference data stored by the data provider based on the shared public key, and then sends the inner product operation result to the data query party for decryption by using the private key, so that the query answer corresponding to the to-be-queried data is obtained. As can be seen, the current homomorphic encryption algorithm-based anonymous query process has a large burden in terms of calculation overhead and communication overhead, and has the problems of high cost and low efficiency.

[0080] To solve the above problems, the application concept is: obtaining reference ciphertext obtained by the data provider performing homomorphic encryption on the reference data based on a specified function algorithm and a private key, calculating the to-be-queried data with the same data structure as the reference data by using the specified function algorithm to obtain a target fingerprint code. The target fingerprint code is split into a plurality of piece fingerprint codes based on a preset splitting algorithm and sent to the data provider, so as to obtain a plurality of piece ciphertexts obtained by the data provider performing homomorphic encryption on the plurality of piece fingerprint codes by using the private key. Finally, based on the homomorphic property of the homomorphic encryption algorithm, a plurality of overall ciphertexts are synthesized based on the plurality of piece ciphertexts to form a target ciphertext, and the difference or product of the target ciphertext and the plurality of reference ciphertexts is calculated to determine whether there is reference data with the same content as the to-be-queried data. The above anonymous query process does not need to set a public-private key pair for the data query party, and only the private key of the data provider participates in the homomorphic operation, which greatly reduces the operation amount of data homomorphic encryption and decryption, and saves the calculation overhead and communication overhead of the anonymous query process.

[0081] The scheme provided by the embodiments of the present application can be applied to the interaction scenario of a terminal device and a server. As shown in FIG. 1, it is a kind of application scenario schematic diagram provided by the embodiments of the present application, in which, the scenario can include a terminal device 101, a server 102, and a network 103. Figure 1

[0082] The terminal device 101 can be a mobile phone, a tablet computer (PAD), a notebook computer, a desktop computer, a smart television, a smart vehicle device, and a smart wearable device, etc.

[0083] The server 102 can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks (CDN), and big data and artificial intelligence platforms, etc. basic cloud computing services, but is not limited thereto. The server 102 can deploy multiple processors 103 for providing processing resources.

[0084] ​In the embodiments of the present application, the terminal device 101 and the server 102 can be directly or indirectly connected through one or more networks 103. The network 103 can be a wired network or a wireless network, for example, the wireless network can be a mobile cellular network or a wireless fidelity (WIFI) network, and of course, other possible networks are also possible, which are not limited in the embodiments of the present application.

[0085] In some embodiments, the terminal device 101 and the server 102 agree on a specified function algorithm for the anonymous query in advance. The data query party can send an anonymous query request to the server 102 of the data provider through the terminal device 101. The server 102 can respond to the request and issue reference ciphertext obtained by homomorphic encryption of reference data based on the specified function algorithm and a private key to the terminal device 101.

[0086] In some embodiments, the terminal device 101 can use the specified function algorithm to calculate the to-be-queried data with the same data structure as the reference data to obtain a target fingerprint code. Then, the target fingerprint code is split into multiple piece fingerprint codes based on a preset splitting algorithm.

[0087] In some embodiments, the terminal device 101 can send a ciphertext generation request carrying the multiple piece fingerprint codes to the server 102. The server 102 responds to the request and uses the private key to homomorphically encrypt the multiple piece fingerprint codes to obtain multiple piece ciphertexts, and issues the multiple piece ciphertexts to the terminal device 101.

[0088] In some embodiments, the terminal device 101 can use the homomorphic encryption characteristics to synthesize the multiple piece ciphertexts to obtain the corresponding target ciphertext based on the splitting rule for forming the piece fingerprint codes based on the multiple piece ciphertexts issued by the server 102. Then, the associated ciphertexts of the target ciphertext and the multiple reference ciphertexts are calculated, the corresponding associated plaintexts are obtained by decrypting each associated ciphertext, and then whether the target fingerprint code is the same as a certain reference fingerprint code is determined according to the comparison result of the associated plaintext and the preset threshold, so as to determine whether the to-be-queried data exists in the data of the data provider.

[0089] The application example embodiment provides a data anonymous query method based on homomorphic encryption. The application example embodiment will be described in detail below with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown for the purpose of facilitating the understanding of the present application, and the embodiments of the present application are not limited in this respect.

[0090] Figure 2 The timing flow of the data query party and the data provider in executing the data anonymous query method based on homomorphic encryption provided by the embodiments of the present application is shown as follows. Figure 2 The timing flow of the data query party and the data provider in executing the data anonymous query method based on homomorphic encryption provided by the embodiments of the present application is shown as follows.

[0091] Step 201: the data query direction data provider sends an anonymous query request;

[0092] Step 202: the data provider uses a specified function algorithm to calculate the reference fingerprint code corresponding to each reference data from the plurality of reference data;

[0093] The reference fingerprint code is homomorphically encrypted with a private key to obtain the reference ciphertext corresponding to each reference fingerprint code;

[0094] For the sake of illustration, steps 201-210 are illustrated by the aforementioned example of investigating whether Zhang San purchased a large amount of stock funds in a certain trading institution. It should be understood that the example is only for the purpose of facilitating the description of the technical solutions of the present application, and is not a limitation of the solutions themselves.

[0095] In the example of investigating whether Zhang San purchased a large amount of stock funds in a certain trading institution, the public security-related personnel are the data query party, and the trading institution is the data provider. The user's account data in the trading institution usually includes name, ID number, contact number, address, account opening time, last transaction time, stock fund holding market value, password verification value, and other data information.

[0096] The data query party can require the data provider to provide only part of the items, for example, only the name, ID number, and stock fund holding market value. That is,

name, ID number, stock fund holding market value

[0097] In some embodiments, in order to improve communication security and save data transmission volume, the "stock fund holding market value" can be represented by a single English letter, such as A for less than 100,000 yuan, B for reaching 100,000 yuan and less than 1,000,000 yuan, C for reaching 1,000,000 yuan and less than 5,000,000 yuan, and D for more than or equal to 5,000,000 yuan. The data query party can, under the premise of authorization, generate the corresponding reference data by sending the anonymous query request of step 201 to the data provider, requiring the data provider to generate the account information of all users in the data structure of

name, ID number, stock fund holding market value

Li Si, 123***598, B

Wang Wu, 123****386, C

[0098] When step 202 is performed, the data provider can calculate each piece of reference data by using a designated function algorithm agreed with the data query party in advance to obtain a reference fingerprint code corresponding to each piece of reference data. The designated function algorithm is any one of a message authentication algorithm, a hash function algorithm, and a compression function algorithm. For example, the reference data is subjected to hash function operation to convert the reference data to obtain a corresponding hash value, which is the reference fingerprint code corresponding to the reference data.

[0099] Step 203: The data provider performs homomorphic encryption on the reference fingerprint code by using a private key to obtain reference ciphertext corresponding to each piece of reference fingerprint code.

[0100] After obtaining the reference fingerprint code corresponding to each piece of reference data through the foregoing step 202, the data provider can perform homomorphic encryption on the reference fingerprint code by using a private key to obtain corresponding reference ciphertext. The application embodiment does not limit the type of homomorphic encryption algorithm selected, which can be set according to actual needs.

[0101] Step 204: The data provider sends the reference ciphertext to the data query party.

[0102] Step 205: The data query party calculates a target fingerprint code by using a designated function algorithm on the data to be queried.

[0103] The data query party and the data provider of the application embodiment agree on the data structure of the data to be queried and the reference data in advance, that is, the aforementioned

name, ID number, and market value of stock fund held

[0104] The reference data has been explained and described in step 202, which will not be repeated here. The data to be queried refers to the answer prediction result of the target question of the data query party. In the example of "investigating whether Zhang San purchased a large amount of stock fund in a certain trading institution", "whether Zhang San holds a large amount of stock fund" is the target question, and the answer prediction result can be set according to actual needs. Assuming that the criterion for judging whether a large amount of stock fund is purchased is that the market value of the purchased stock fund is 5 million yuan or more, then the market value of the stock fund purchased by Zhang San that is 5 million yuan or more is taken as the answer prediction result. Thus, the data query party can generate the data to be queried

Zhang San, 123****456, D

[0105] When step 205 is performed, the data query party can calculate the corresponding target fingerprint code by using the designated function algorithm (for example, the hash algorithm in the foregoing step 202) agreed with the data provider in advance. Since the designated function algorithm is the same, and the data structure of the data to be queried is the same as that of the reference data, the data structure of the target fingerprint code is also the same as that of the reference fingerprint code.

[0106] Step 206: The data queryer splits the target fingerprint code into multiple fragmented fingerprint codes based on a preset splitting algorithm;

[0107] As shown in steps 206-208, the split multiple fragmented fingerprint codes need to be handed over to the data provider for homomorphic encryption using a private key. Therefore, the requirement for splitting the target fingerprint code here is that the data provider cannot reconstruct the target fingerprint code based on the split multiple fragmented fingerprint codes, thereby improving communication security.

[0108] To facilitate understanding, the following example is used to explain the process of splitting the target fingerprint code. It should be understood that there are many algorithms in the field of cryptography that can meet the above splitting requirements. The following example is only for the purpose of introducing the solution and is not intended to limit the splitting algorithm used here.

[0109] Considering that most current homomorphic encryption algorithms treat ciphertext as integers between 0 and P-1, and plaintext as integers between 0 and Q-1, ciphertext computation involves addition, multiplication, and modulo operations with respect to the modulus P, where P and Q are fixed values ​​related to the algorithm. Based on this, the target fingerprint can be viewed as an addition or multiplication that can be divided into several data segments. Assuming the target fingerprint is A, the calculation satisfies the preset splitting algorithm: A = k1B1 + k2B2 + ... + k t B t mod Q, where k1~k t It is a secret constant array randomly selected based on the value of A, t∈[0, Q-1], B1~B t This is a segmented fingerprint code.

[0110] Step 207: The data query party sends a request to the data provider to generate ciphertext carrying multiple fragmented fingerprint codes;

[0111] Step 208: The data provider uses the private key to verify the multiple fragmented fingerprint codes B1 to B2. t Homomorphic encryption yields multiple fragmented ciphertexts;

[0112] This step is the same as the concept in step 202 above, where the data provider uses a private key to perform homomorphic encryption on the reference fingerprint code, and will not be repeated here.

[0113] Step 209: The data provider sends multiple fragmented encrypted messages to the data queryer;

[0114] Step 210: The data queryer concatenates multiple fragmented ciphertexts based on a preset splitting algorithm to obtain the target ciphertext;

[0115] That is, it consists of fragmented ciphertext and k1~k t Together they calculate the ciphertext of the target fingerprint code A.

[0116] Step 211: based on the difference or product of the target ciphertext and each reference ciphertext, obtain the associated ciphertext corresponding to each reference ciphertext;

[0117] It has been mentioned in the foregoing step 208 that assuming the target fingerprint code is A, the data querying party can calculate to satisfy the preset splitting algorithm: A = k1B1 + k2B2 + … + k t B t mod Q, where B1~B t are the split fingerprint codes.

[0118] For example, the target fingerprint code A = 48, which satisfies A = k1B1 + k2B2 + … + k t B t mod Q can be in the form of: A = 11x2 + 7x3 + 5. Wherein, 2, 3, 5 are the split fingerprint codes, and assuming that the split ciphertexts of the split fingerprint codes 2, 3, 5 homomorphically encrypted by the data provider are 57, 43, 89 respectively, then according to the additive homomorphism property, the ciphertext of the target fingerprint code A can be calculated as 11x57 + 7x43 + 89 = 1017.

[0119] As can be seen, according to the additive homomorphism property, the split ciphertext corresponding to the split fingerprint code can be substituted into the preset splitting algorithm to be reversed and restored to obtain the target ciphertext, which is equivalent to the result of the data provider directly homomorphically encrypting the target fingerprint code with the private key.

[0120] Next, based on the difference or product of the target ciphertext and each reference ciphertext, the associated ciphertext corresponding to each reference ciphertext can be obtained. As shown in Figure 3 , the same number of weight factors as the reference ciphertexts are generated. For example, the reference ciphertexts include X1~X n , that is, N random numbers r1~r n are generated as weight factors. Wherein, each weight factor is mutually exclusive with the modulus preset in the homomorphic encryption and decryption algorithm adopted by the data provider; each weight factor corresponds to a reference ciphertext, that is, r1 corresponds to X1, r2 corresponds to X2, …, r n corresponds to X n .

[0121] For each reference ciphertext, the first product of the weight factor r corresponding to the reference ciphertext X and the reference ciphertext Y, and the second product of the weight factor r corresponding to the reference ciphertext X and the target ciphertext Y are determined; the difference between the first product and the second product is taken as the associated ciphertext corresponding to the reference ciphertext. As shown in Figure 3 , taking the reference ciphertext X1 as an example, the associated ciphertext D1 corresponding to X1 is X1r1-Yr1. Thus, based on the difference between the target ciphertext and each reference ciphertext, the associated ciphertext corresponding to each reference ciphertext can be obtained.

[0122] Further, the associated ciphertext can also be obtained in the following manner: for each reference ciphertext, determining a first power operation result of a weight factor corresponding to the reference ciphertext and the reference ciphertext, and a second power operation result of the weight factor corresponding to the reference ciphertext and the target ciphertext; and taking the product of the first power operation result and the second power operation result as the associated ciphertext. Taking the reference ciphertext X1 as an example, as shown in FIG. 8, the first power operation result is (X1) Figure 3 r1 , and the second power operation result is (Y) -r1 . Here, the weight factor is used to perform power operation on the reference ciphertext and the target ciphertext respectively in the first power operation and the second power operation, and the weight factors are inverse to each other, and then the associated ciphertext D1 = (X1) r1 (Y) -r1 is obtained. Thus, the associated ciphertext corresponding to each reference ciphertext can be obtained based on the product of the target ciphertext and each reference ciphertext.

[0123] The above process introduces the weight factor to perform product operation on the reference ciphertext and the target ciphertext to further change the ciphertext form when the associated ciphertext is obtained, thereby improving the security and reducing the possibility of the data provider restoring the target fingerprint code ciphertext based on the reference ciphertext.

[0124] Step 212: The data query side sends a ciphertext decryption request carrying the associated ciphertext to the data provider;

[0125] Step 213: The data provider performs homomorphic decryption on the associated ciphertext using the private key to obtain associated plaintext;

[0126] This step is similar to the concept that the data provider performs homomorphic encryption on the reference fingerprint code using the private key in the aforementioned step 202, and will not be described here.

[0127] Step 214: The data provider sends the associated plaintext to the data query side;

[0128] Step 215: The data query side determines the query answer corresponding to the to-be-queried data based on the associated plaintext and a preset threshold.

[0129] As described in the aforementioned step 210, the associated ciphertext is the difference or product between the reference ciphertext obtained by homomorphic encryption on the reference fingerprint code and the target ciphertext obtained by homomorphic encryption on the target fingerprint code. If it is a normal encryption algorithm, as long as the reference ciphertext and the target ciphertext are compared, as long as the ciphertexts are the same, it means that the plaintext contents corresponding to the reference ciphertext and the target ciphertext are the same. However, the characteristic of homomorphic encryption causes different ciphertexts to be output after the same plaintext is encrypted multiple times, and thus it is difficult to determine whether two ciphertexts correspond to the same plaintext without decryption. Therefore, the assistance of the data provider holding the homomorphic algorithm decryption key is needed.

[0130] ​The homomorphism property can be used for discrimination. If the decryption result of the associated ciphertext (i.e., the associated plaintext) is a preset threshold value (0), it means that the plaintext corresponding to the reference ciphertext and the plaintext corresponding to the target ciphertext are the same. The plaintext corresponding to the reference ciphertext is the aforementioned reference data, and the plaintext corresponding to the target ciphertext is the data to be queried.

[0131] The foregoing steps 202 and 205 have been described. In the example of "investigating whether Zhang San purchased a large amount of stock funds in a certain transaction institution", the data provider can generate corresponding reference data in the data structure of

name, ID number, stock fund holding market value

Li Si, 123***598, B

Wang Wu, 123****386, C

Zhang San, 123****456, D

[0132] If the decryption result of the associated ciphertext (i.e., the associated plaintext) is 0, it means that there is a reference data

Zhang San, 123****456, D

[0133] Based on this, the data provider should send all the decrypted associated plaintexts to the data query party. Since the data query party only knows the question to be queried, as long as there is an associated plaintext with a value of 0, it means that the answer prediction result of the data to be queried to the target question is correct, otherwise it is incorrect. However, since the associated plaintext is decrypted by the data provider, and the result of the plaintext not equal to 0 is not needed, the data provider can directly inform whether there is an associated plaintext with a value of 0. That is, the data provider does not need to send all the associated plaintexts to the data query party, but only needs to inform whether there is an associated plaintext with a value of 0.

[0134] In some embodiments, the data query party can sort and adjust the associated ciphertext corresponding to each reference ciphertext before performing step 212, so that the first sorting is different from the second sorting; wherein the first sorting is the sorting of the plurality of reference ciphertexts sent by the data provider; and the second sorting is the sorting of the reference ciphertext corresponding to the sorted and adjusted associated ciphertext. Then the data query party generates the ciphertext decryption request in step 212 based on the sorted and adjusted associated ciphertext and sends it to the data provider.

[0135] The order of the plurality of reference ciphertexts sent by the data provider to the data query party in step 202 is known to the data provider. It is assumed that the sorting of the plurality of reference ciphertexts X1~X n is T1~T nIf the associated ciphertexts corresponding to each reference ciphertext are sent to the data provider for decryption in the same sorted order, the data provider may be able to guess or obtain the target fingerprint of the data query party based on the many associated plaintexts that appear in sequence, and thus determine the current query object, which poses a risk of information leakage.

[0136] Based on this, a randomized data segment numbering method can be used to renumber and sort the associated ciphertexts, making the sorting order different from T1 to T2. n The reordered associated ciphertext is then sent to the data provider, who is required to decrypt it into plaintext. This ensures that the data provider cannot determine the current query target based on the order of the associated ciphertext, reducing the risk of information leakage.

[0137] Figure 4 for Figure 2 The diagram shown illustrates the data anonymity query process based on homomorphic encryption, as follows: Figure 4 As shown in the embodiments of this application, the data provider can use a specified function algorithm to calculate the reference fingerprint code corresponding to each reference data, and use a private key to homomorphically encrypt the reference fingerprint code to obtain the reference ciphertext corresponding to each reference fingerprint code. Then, the multiple reference ciphertexts are sent to the data querying party.

[0138] The data querying party uses a specified function algorithm to calculate the target fingerprint code from the data to be queried. Based on a preset splitting algorithm, the target fingerprint code is split into multiple fragment fingerprint codes and sent to the data provider. The data provider uses its private key to homomorphically encrypt the multiple fragment fingerprint codes to obtain multiple fragment ciphertexts and sends them to the data querying party. The data querying party uses the preset splitting algorithm to concatenate the multiple fragment ciphertexts to obtain the target ciphertext. Based on the difference or product between the target ciphertext and each reference ciphertext, the associated ciphertext corresponding to each reference ciphertext is obtained. Then, the associated ciphertexts are reordered and sent to the data provider.

[0139] In some embodiments, considering that the data querying party may provide tens of thousands of data entries for querying in real-world scenarios, it can be agreed in advance with the data provider that after decrypting the associated ciphertext to obtain the associated plaintext, only the data number with an associated plaintext of 0 will be sent to the data querying party, thereby significantly reducing the amount of data transmitted and improving communication efficiency.

[0140] Specifically, the data provider uses its private key to homomorphically decrypt the associated ciphertext to obtain the associated plaintext, and checks if there is any associated plaintext with a value of 0. If so, it sends the data number to the querying party. The querying party uses the data number to determine which target fingerprint is in the data provider's fingerprint, and thus obtains the query result. In the above process, there is no need to set up a public-private key pair for the data querying party; only the data provider's private key participates in the homomorphic operation, saving the computational and communication overhead of stealth querying.

[0141] Furthermore, to further reduce the computational load on the data querying party, embodiments of this application may... Figure 4 Based on the illustrated process, a public-key encryption algorithm is introduced to omit the step of the data query party splitting the target fingerprint code. Specifically, as follows... Figure 5 As shown, the data provider holds a public-private key pair, and the public key is shared with the data queryer.

[0142] When executing the aforementioned data anonymity query process based on homomorphic encryption, the data provider can use a specified function algorithm to calculate the reference fingerprint code corresponding to each reference data point, and then use a shared public key to homomorphically encrypt the reference fingerprint code to obtain the reference ciphertext corresponding to each reference fingerprint code. The multiple reference ciphertexts are then sent to the data querying party.

[0143] The data querying party uses a specified function algorithm to calculate the target fingerprint code from the data to be queried, and then encrypts the target fingerprint code using a shared public key to obtain the target ciphertext. The data querying party calculates the associated ciphertext between each reference ciphertext and the target ciphertext, and then reorders the associated ciphertext before sending it to the data provider.

[0144] The data provider uses its private key to homomorphically decrypt the associated ciphertext to obtain the associated plaintext. It then filters results where the associated plaintext is 0. If such a result exists, the data provider sends the data ID with associated plaintext 0 to the querying party. This allows the querying party to determine which target fingerprint is present in the data provider's fingerprint database based on the data ID with associated plaintext 0, thus obtaining the query result. Compared to... Figure 4 The stealth query process is shown below. Figure 5 The data querying party uses a shared public key to encrypt the target fingerprint code to obtain the target ciphertext. This eliminates the need to split the target fingerprint code and transfer it to the data provider for encryption, as well as the need for the data querying party to restore the encrypted result of the fragmented fingerprint code to the target ciphertext. In scenarios with a large amount of reference target fingerprint code data, this can effectively reduce the computational load for both parties.

[0145] Based on the same inventive concept, this application also provides a data anonymity query device based on homomorphic encryption, specifically as follows: Figure 6 As shown, the device includes:

[0146] The data acquisition unit 601 is configured to perform: sending an anonymous query request to a data provider, and acquiring a plurality of reference ciphertexts; the plurality of reference ciphertexts are obtained by homomorphic encryption of reference data by the data provider based on a specified function algorithm and a private key;

[0147] The fragmentation processing unit 602 is configured to perform: calculating a target fingerprint code from the to-be-queried data by using the specified function algorithm, and splitting the target fingerprint code into a plurality of fragmented fingerprint codes based on a preset splitting algorithm; the data structure of the to-be-queried data is the same as that of the reference data;

[0148] The fragmented encryption unit 603 is configured to perform: sending a ciphertext generation request carrying the plurality of fragmented fingerprint codes to the data provider, and acquiring a plurality of fragmented ciphertexts; the plurality of fragmented ciphertexts are obtained by homomorphic encryption of the plurality of fragmented fingerprint codes by the data provider using a private key;

[0149] The anonymous query unit 604 is configured to perform: determining a query answer of the to-be-queried data based on a difference or a product of the plurality of fragmented ciphertexts and the plurality of reference ciphertexts; the query answer represents whether there is reference data with the same content as the to-be-queried data.

[0150] In some embodiments, the anonymous query unit 604 is specifically configured to perform the determining of the query answer of the to-be-queried data based on the difference or the product of the plurality of fragmented ciphertexts and the plurality of reference ciphertexts, as follows:

[0151] splicing the plurality of fragmented ciphertexts to obtain a target ciphertext based on the preset splitting algorithm;

[0152] obtaining an associated ciphertext of each reference ciphertext based on a difference or a product of the target ciphertext and each reference ciphertext;

[0153] sending a ciphertext decryption request carrying the associated ciphertext to the data provider, and acquiring an associated plaintext; the associated plaintext is obtained by homomorphic decryption of the associated ciphertext by the data provider using a private key;

[0154] determining the query answer based on the associated plaintext and a preset threshold.

[0155] In some embodiments, the anonymous query unit 604 is specifically configured to perform the obtaining of the associated ciphertext of each reference ciphertext based on the difference or the product of the target ciphertext and each reference ciphertext, as follows:

[0156] generating a weight factor same in number as the reference ciphertexts; each weight factor is mutually exclusive with a preset modulus in the homomorphic encryption and the homomorphic decryption, and each weight factor corresponds to a reference ciphertext;

[0157] For each reference ciphertext, a first product of the weight factor corresponding to the reference ciphertext and the reference ciphertext is determined, and a second product of the weight factor corresponding to the reference ciphertext and the target ciphertext is determined; a difference between the first product and the second product is taken as the associated ciphertext corresponding to the reference ciphertext; or,

[0158] For each reference ciphertext, a first power operation result of the weight factor corresponding to the reference ciphertext and the reference ciphertext is determined, and a second power operation result of the weight factor corresponding to the reference ciphertext and the target ciphertext is determined; a product of the first power operation result and the second power operation result is taken as the associated ciphertext.

[0159] In some embodiments, the data to be queried represents an answer prediction result of a target question; the query answer represents whether the answer prediction result is correct; and the determination of the query answer based on the associated plaintext and the preset threshold is performed by the anonymous query unit 604, which is specifically configured to:

[0160] If the associated plaintext is the same as the preset threshold, it is determined that the answer prediction result of the target question by the data to be queried is correct.

[0161] If the associated plaintext is different from the preset threshold, it is determined that the answer prediction result of the target question by the data to be queried is incorrect.

[0162] In some embodiments, the sending of the ciphertext decryption request carrying the associated ciphertext to the data provider is performed by the sharding encryption unit 603, which is specifically configured to:

[0163] After obtaining the associated ciphertext corresponding to each reference ciphertext, the order of the associated ciphertext is adjusted so that the first order is different from the second order; the first order is the order of the plurality of reference ciphertexts sent by the data provider; and the second order is the order of the associated ciphertext after the order adjustment.

[0164] Based on the associated ciphertext after the order adjustment, the ciphertext decryption request is generated and sent to the data provider.

[0165] In some embodiments, the plurality of reference ciphertexts are obtained by homomorphic encryption of reference fingerprint codes by the data provider using a private key; the reference fingerprint codes are calculated by the data provider using the specified function algorithm on the reference data; each reference ciphertext corresponds to a unique reference fingerprint code, and each reference fingerprint code corresponds to unique reference data.

[0166] In some embodiments, the specified function algorithm is any one of a message authentication algorithm, a hash function algorithm, and a compression function algorithm.

[0167] Reference will be made to the following description Figure 7The electronic device 730 according to this embodiment of the present application will be described. Figure 7 The electronic device 730 shown is merely one example and should not be taken as limiting the scope of the present application.

[0168] As shown in Figure 7 The electronic device 730 is shown in the form of a general electronic device. The components of electronic device 730 can include, but are not limited to, at least one processor 731 as described above, at least one memory 732 as described above, a bus 733 that connects different system components, including the memory 732 and the processor 731.

[0169] The bus 733 represents one or more of any of several bus structures, including a memory bus or memory controller, a peripheral bus, a processor or local bus, using any of a variety of bus architectures.

[0170] The memory 732 can include read-only memory (ROM) 7323 in the form of flash memory or other nonvolatile memory. The memory 732 can also include random access memory (RAM) 7321 in the form of a volatile memory, and / or cache memory 7322.

[0171] The memory 732 can also include a program / utility 7325 having a set of programs / modules 7324, including an operating system, one or more application programs, other program modules, and program data, each of which can be executed by the processor(s) 731 using the operating system. Each of the aforementioned examples, or some combination thereof, can include implementation that is stored in the memory 732.

[0172] The electronic device 730 can also communicate with one or more external devices 734 such as a keyboard or a pointing device, which can be a device that enables a user to interact with the electronic device 730, and / or another device or devices (e.g., a router, a modem, a printer, etc.) that enables the electronic device 730 to communicate with one or more other electronic devices. Such communication can occur via an input / output (I / O) interface 735. Still yet, the electronic device 730 can communicate with one or more networks, such as one or more local area networks (LANs), one or more wide area networks (WANs), and / or the Internet, through a network adapter 736. As depicted, the network adapter 736 communicates with the other components of the electronic device 730 via the bus 733. It should be appreciated that the network adapter 736 and / or the other hardware and / or software components depicted in FIG. 7 can be utilized in conjunction with the electronic device 730, but are not necessarily part of the electronic device 730.

[0173] In an exemplary embodiment, a computer readable storage medium including instructions, such as the memory 732 including instructions, is also provided, which can be executed by the processor 731 of the above-mentioned apparatus to complete the above-mentioned method. Optionally, the computer readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disc, and an optical data storage device, etc.

[0174] In an exemplary embodiment, a computer program product including computer programs / instructions is also provided, which, when executed by the processor 731, implements any one of the homomorphic encryption based data trace query methods provided by the present application.

[0175] In an exemplary embodiment, various aspects of the homomorphic encryption based data trace query method provided by the present application can also be implemented in the form of a program product, which includes program codes, when the program product is run on a computer device, the program codes are used to make the computer device execute the steps of the homomorphic encryption based data trace query method according to various exemplary embodiments of the present application described above in the specification.

[0176] The program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include an electrical connection having one or more wires, a portable disc, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0177] The program product for homomorphic encryption based data trace query of the embodiments of the present application can adopt a portable compact disc read-only memory (CD-ROM) and include program codes, and can be run on an electronic device. However, the program product of the present application is not limited thereto, and in this document, the readable storage medium can be any tangible medium containing or storing a program, which can be used by or in conjunction with an instruction execution system, device or apparatus.

[0178] A readable signal medium can be any available medium or media that can be accessed by a general purpose or special purpose electronic computer or other machine to retrieve instructions, code or data to execute a program of instructions to implement an embodiment of the application. By way of example, and not limitation, such computer-program products can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a general purpose or special purpose electronic computer, or other machine to execute the instructions or data structures. The general purpose or special purpose electronic computer or other machine can be coupled to the readable signal medium, such as the system bus shown in FIG. 1, through the use of any suitable data link, whether wired or wireless.

[0179] Program code embodied on a readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0180] Program code, or instructions, to implement an embodiment of the application can be stored in one or more of the associated memory devices, such as the memory 110, and executed by the general purpose or special purpose electronic computer or other machine to modify the function performed by the electronic computer or other machine. For instance, the electronic computer or other machine can be caused to perform some or all of a method in accordance with the application, or some other method when the program code, or instructions, stored in the memory devices implementing the method are read and executed by the electronic computer or other machine.

[0181] It should be noted that although various units or sub-units of the apparatus are mentioned in the above detailed description, such division is merely exemplary and not mandatory. In practice, features and functions of two or more units described above can be embodied in one unit according to the embodiments of the present application. Conversely, a unit described above can be further divided into a plurality of units to embody the features and functions.

[0182] In addition, although the operations of the method according to the present application are described in a particular order in the drawings, this is not required or implied in any particular order or that all of the described operations be performed to achieve desirable results. Additionally or alternatively, certain steps can be omitted, combined with another step, performed in a different order, and / or split into multiple steps.

[0183] Those skilled in the art will appreciate that embodiments of the application can be devised for a method, a system, or a computer program product. Accordingly, the present application can be embodied in the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) embodying computer readable program code.

[0184] The present application is described in reference to the flowchart illustrations and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processing system or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams.

[0185] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams.

[0186] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams.

[0187] While preferred embodiments of the application have been described, modifications and variations can be apparent to those skilled in the art once aware of the general underlying concepts. Accordingly, the appended claims are intended to embrace all such modifications and variations as fall within the scope of the application.

[0188] Obviously, many modifications and variations of the present application are possible in light of the above teachings. It is, therefore, to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.

Claims

1. A homomorphic encryption based data anonymized query method, characterized in that, The method comprises: sending an anonymous query request to a data provider to obtain a plurality of reference ciphertexts; the plurality of reference ciphertexts are obtained by homomorphic encryption of reference data by the data provider based on a specified function algorithm and a private key; calculating a target fingerprint code for to-be-queried data using the specified function algorithm and splitting the target fingerprint code into a plurality of fragmented fingerprint codes based on a preset splitting algorithm; the to-be-queried data has the same data structure as the reference data; sending a ciphertext generation request carrying the plurality of fragmented fingerprint codes to the data provider to obtain a plurality of fragmented ciphertexts; the plurality of fragmented ciphertexts are obtained by homomorphic encryption of the plurality of fragmented fingerprint codes by the data provider using a private key; splicing the plurality of fragmented ciphertexts based on the preset splitting algorithm to obtain a target ciphertext; obtaining an associated ciphertext for each reference ciphertext based on a difference or product of the target ciphertext and each reference ciphertext; sending a ciphertext decryption request carrying the associated ciphertext to the data provider to obtain an associated plaintext, and determining a query answer for the to-be-queried data based on the associated plaintext and a preset threshold; the associated plaintext is obtained by homomorphic decryption of the associated ciphertext by the data provider using a private key; the query answer indicates whether there is reference data with the same content as the to-be-queried data; in the anonymous query method, no public and private key pair is set for a data querying party, and only the private key of the data provider is used for homomorphic operation.

2. The method of claim 1, wherein, The method comprises: generating a weight factor identical in number to the reference ciphertexts; each weight factor is mutually exclusive with a preset modulus in the homomorphic encryption and the homomorphic decryption, and each weight factor corresponds to a reference ciphertext; for each reference ciphertext, determining a first product of the reference ciphertext corresponding weight factor and the reference ciphertext, and a second product of the reference ciphertext corresponding weight factor and the target ciphertext; the difference between the first product and the second product is taken as the associated ciphertext corresponding to the reference ciphertext; or for each reference ciphertext, determining a first power operation result of the reference ciphertext corresponding weight factor and the reference ciphertext, and a second power operation result of the reference ciphertext corresponding weight factor and the target ciphertext; the product of the first power operation result and the second power operation result is taken as the associated ciphertext.

3. The method of claim 1, wherein, The to-be-queried data represents an answer prediction result of a target problem; The query answer indicates whether the answer prediction result is correct; the determination of the query answer based on the associated plaintext and the preset threshold comprises: if the associated plaintext is identical to the preset threshold, it is determined that the answer prediction result of the to-be-queried data for the target problem is correct; if the associated plaintext is different from the preset threshold, it is determined that the answer prediction result of the to-be-queried data for the target problem is incorrect.

4. The method according to any one of claims 1 to 3, characterized in that, The sending of the ciphertext decryption request carrying the associated ciphertext to the data provider comprises: After obtaining the associated ciphertext corresponding to each reference ciphertext, the order of the associated ciphertext is adjusted, so that the first order is different from the second order; the first order is the order of the plurality of reference ciphertexts sent by the data provider; the second order is the order of the reference ciphertext corresponding to the associated ciphertext after the order is adjusted; Based on the associated ciphertext after the order is adjusted, the ciphertext decryption request is generated and sent to the data provider.

5. The method according to any one of claims 1 to 3, characterized in that, The plurality of reference ciphertexts are obtained by homomorphic encryption of the reference fingerprint code by the private key of the data provider; the reference fingerprint code is calculated by the specified function algorithm on the reference data by the data provider; Each reference ciphertext corresponds to a unique reference fingerprint code, and each reference fingerprint code corresponds to unique reference data.

6. The method of any one of claims 1-3, wherein, The specified function algorithm is any one of a message authentication algorithm, a hash function algorithm, and a compression function algorithm.

7. A data anonymity query device based on homomorphic encryption, characterized in that, The device comprises: The data acquisition unit is configured to perform: sending an anonymous query request to the data provider, and obtaining a plurality of reference ciphertexts; the plurality of reference ciphertexts are obtained by homomorphic encryption of the reference data by the data provider based on a specified function algorithm and a private key; The fragmentation processing unit is configured to perform: calculating a target fingerprint code from the to-be-queried data by using the specified function algorithm, and splitting the target fingerprint code into a plurality of fragmented fingerprint codes based on a preset splitting algorithm; the to-be-queried data has the same data structure as the reference data; The fragmented encryption unit is configured to perform: sending a ciphertext generation request carrying the plurality of fragmented fingerprint codes to the data provider, and obtaining a plurality of fragmented ciphertexts; the plurality of fragmented ciphertexts are obtained by homomorphic encryption of the plurality of fragmented fingerprint codes by the data provider using a private key; The anonymous query unit is configured to perform: splicing the plurality of fragmented ciphertexts to obtain a target ciphertext based on the preset splitting algorithm; Based on the difference or product of the target ciphertext and each reference ciphertext, an associated ciphertext of each reference ciphertext is obtained; The ciphertext decryption request carrying the associated ciphertext is sent to the data provider to obtain an associated plaintext, and the query answer of the to-be-queried data is determined based on the associated plaintext and a preset threshold; wherein the associated plaintext is obtained by homomorphic decryption of the associated ciphertext by the data provider using a private key; the query answer represents whether there is reference data with the same content as the to-be-queried data; in the anonymous query method, no public and private key pair is set for the data query party, and only the private key of the data provider participates in the homomorphic operation.

8. The apparatus of claim 7, wherein, The anonymous query unit is configured to perform: A weight factor is generated, and each weight factor is mutually exclusive with a preset modulus in the homomorphic encryption and the homomorphic decryption, and each weight factor corresponds to a reference ciphertext; For each reference ciphertext, a first product of the reference ciphertext corresponding weight factor and the reference ciphertext is determined, and a second product of the reference ciphertext corresponding weight factor and the target ciphertext is determined. a difference between the first product and the second product as the associated ciphertext corresponding to the reference ciphertext; or, for each reference ciphertext, determining a first power operation result of a weight factor corresponding to the reference ciphertext and the reference ciphertext, and a second power operation result of the weight factor corresponding to the reference ciphertext and the target ciphertext; a product of the first power operation result and the second power operation result as the associated ciphertext.

9. The apparatus of claim 7, wherein, The to-be-queried data represents an answer prediction result of a target question; the query answer represents whether the answer prediction result is correct; the anonymous query unit is specifically configured to: if the associated plaintext is the same as the preset threshold, it is determined that the answer prediction result of the to-be-queried data for the target question is correct; if the associated plaintext is different from the preset threshold, it is determined that the answer prediction result of the to-be-queried data for the target question is incorrect.

10. The apparatus of any one of claims 7-9, wherein, The fragment encryption unit is specifically configured to: After obtaining the associated ciphertext corresponding to each reference ciphertext, adjust the order of the associated ciphertext, so that the first order is different from the second order; the first order is the order of the plurality of reference ciphertexts sent by the data provider; the second order is the order of the reference ciphertext corresponding to the associated ciphertext after the order adjustment; based on the associated ciphertext after the order adjustment, generate the ciphertext decryption request and send it to the data provider.

11. The apparatus of any one of claims 7-9, wherein, The plurality of reference ciphertexts are obtained by homomorphic encryption of reference fingerprint codes by the data provider using a private key; the reference fingerprint codes are calculated by the data provider using the specified function algorithm on the reference data; Each reference ciphertext corresponds to a unique reference fingerprint code, and each reference fingerprint code corresponds to unique reference data.

12. The apparatus of any one of claims 7-9, wherein, The specified function algorithm is any one of a message authentication algorithm, a hash function algorithm, and a compression function algorithm.

13. An electronic device, comprising: It includes: a memory for storing program instructions; a processor for calling the program instructions stored in the memory and executing the steps included in the method of any one of claims 1-6 according to the obtained program instructions.

14. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program includes program instructions, which, when executed by a computer, cause the computer to execute the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Hidden trace data verification method and system based on homomorphic encryption

    CN114756895A

  • Data processing device

    US20120207299A1