Data anonymous trace query method and device based on homomorphic encryption, equipment and medium
By using specified function algorithms and splitting algorithms in the anonymous query process, the query data is homomorphically encrypted and split, and combined with the private key of the data provider for encryption, the problem of large computing and communication overhead in the existing technology is solved, and more efficient anonymous query is achieved.
Patent Information
- Application Number
- CN202411968479.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-12-30
AI Technical Summary
The existing anonymous query process based on homomorphic encryption algorithms has a great burden on both calculation overhead and communication overhead, and there are problems of high cost and low efficiency.
By obtaining the reference ciphertext obtained by obtaining homomorphic encryption of the reference data based on the specified function algorithm and the private key, the specified function algorithm is used to calculate the target fingerprint code for the query data, and the target fingerprint code is split into multiple shard fingerprint codes based on the preset split algorithm. Then, a ciphertext generation request carrying multiple shard fingerprint codes is sent to the data provider to obtain multiple sharded ciphertexts. Finally, based on the difference or product of multiple sharded ciphertexts and multiple reference ciphertexts, the query answer of the data to be queried is determined.
There is no need to set up a public and private key pair for the data query party. Only the private key of the data provider participates in homomorphic operations, which greatly reduces the amount of data homomorphic encryption and decryption operations, and saves the calculation overhead and communication overhead of the anonymous query process.
Smart Images

Figure CN119884149A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data security technology, and specifically discloses a data anonymous query method, device, equipment and medium based on homomorphic encryption. Background Art
[0002] Private Information Retrieval (PIR), also known as "private information retrieval", is a very practical technology and application in secure multi-party computing. It can be used to protect the user's query privacy and thus protect the user's query results. In traditional information retrieval tasks, the query party usually needs to send a plaintext query request to the server, which is likely to expose the user's identity and sensitive information. Anonymous query means that the query party hides the queried information, and the data provider can provide matching query results, but cannot know the query content of the query party.
[0003] Homomorphic Encryption is one of the mainstream algorithms used in anonymous query scenarios. It allows specific operations to be performed on ciphertext. The decrypted result is the same as the result of the same operation on the plaintext, and has the characteristic of "computable but invisible" data.
[0004] At present, the anonymous query process based on homomorphic encryption algorithm is mostly that the query party and the data provider each configure a public-private key pair. Both the data provider and the query party need to perform multiple homomorphic encryption and decryption operations and interactions on the data based on the other party's public key and private key, which has a heavy burden on both computing and communication overhead. Summary of the invention
[0005] The embodiments of the present application provide a data anonymous query method, apparatus, device and medium based on homomorphic encryption, which are used to reduce the computational overhead and communication overhead of the anonymous query process.
[0006] To achieve the above purpose, the technical solution of the embodiment of the present application is implemented as follows:
[0007] In a first aspect, an embodiment of the present application provides a data query method, including:
[0008] Send an anonymous query request to the data provider to obtain multiple reference ciphertexts; the multiple reference ciphertexts are obtained by the data provider performing homomorphic encryption on the reference data based on a specified function algorithm and a private key;
[0009] The target fingerprint code is calculated by using the specified function algorithm for the query data, and the target fingerprint code is split into multiple fragmented fingerprint codes based on a preset splitting algorithm; the query data has the same data structure as the reference data;
[0010] Sending a ciphertext generation request carrying the multiple shard fingerprint codes to the data provider to obtain multiple shard ciphertexts; the multiple shard ciphertexts are obtained by the data provider using a private key to homomorphically encrypt the multiple shard fingerprint codes;
[0011] Based on the difference or product between the multiple shard ciphertexts and the multiple reference ciphertexts, a query answer for the data to be queried is determined; the query answer indicates whether there is reference data with the same content as the data to be queried.
[0012] In an embodiment of the present application, the data querying party may use a specified function algorithm to calculate the data to be queried that has the same data structure as the reference data to obtain a target fingerprint code. Then, based on a preset splitting algorithm, the target fingerprint code is split into multiple shard fingerprint codes to obtain multiple shard ciphertexts obtained by homomorphically encrypting the multiple shard fingerprint codes using a private key by the data provider. Therefore, the characteristics of homomorphic encryption can be used to determine whether there is reference data with the same content as the data to be queried based on the difference or product between the target ciphertext calculated based on the multiple shard ciphertexts and the multiple reference ciphertexts. The reference data is 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 querying party. Only the private key of the data provider participates in the homomorphic operation, which greatly reduces the amount of computation of data homomorphic encryption and decryption, and saves the computational overhead and communication overhead of the anonymous query process.
[0013] In some embodiments, determining the query answer for the to-be-queried data based on the difference or product between the multiple shard ciphertexts and the multiple reference ciphertexts includes:
[0014] Based on the preset splitting algorithm, the plurality of fragmented ciphertexts are concatenated to obtain a target ciphertext;
[0015] Based on the difference or product between the target ciphertext and each reference ciphertext, obtaining the associated ciphertext of 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 the data provider using a private key to homomorphically decrypt the associated ciphertext;
[0017] The query answer is determined based on the associated plaintext and a preset threshold.
[0018] In an embodiment of the present application, the data querying party obtains the target ciphertext by splicing the multiple fragmented ciphertexts based on the preset splitting algorithm, and obtains the associated ciphertext corresponding to each reference ciphertext based on the difference or product between the target ciphertext and each reference ciphertext. Since the querying party does not hold the private key used for homomorphic encryption and decryption operations, the associated ciphertext needs to be handed over to the data provider for homomorphic decryption using the private key to obtain the corresponding associated plaintext. According to the homomorphic characteristics, if the associated plaintext corresponding to the associated ciphertext is equal to the preset threshold, it means that the data provider has reference data with the same content as the data to be queried. Therefore, when the data provider cannot know the data to be queried, the homomorphic characteristics can be used to know whether the data provider has reference data with the same content as the data to be queried.
[0019] In some embodiments, obtaining the associated ciphertext of each reference ciphertext based on the difference or product between the target ciphertext and each reference ciphertext includes:
[0020] Generate a weight factor equal to the number of reference ciphertexts; each weight factor is mutually exclusive with a modulus preset in the homomorphic encryption and the homomorphic decryption, and each weight factor corresponds to a reference ciphertext;
[0021] For each reference ciphertext, determine a first product of a weight factor corresponding to the reference ciphertext and the reference ciphertext, and a second product of a weight factor corresponding to the reference ciphertext and the target ciphertext; and use a difference between the first product and the second product as an associated ciphertext corresponding to the reference ciphertext; or,
[0022] For each reference ciphertext, determine 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 a weight factor corresponding to the reference ciphertext and the target ciphertext; and use the product of the first power operation result and the second power operation result as the associated ciphertext.
[0023] In an embodiment of the present application, when calculating the associated ciphertext between the reference ciphertext and the target ciphertext, the data query party does not simply subtract the reference ciphertext from the target ciphertext, but sets a corresponding weight factor for each reference ciphertext. In this way, when obtaining the associated ciphertext, the weight factor can be introduced to perform a 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 a predicted answer result of a target question; the query answer represents whether the predicted answer result is correct; and determining the query answer based on the associated plaintext and a preset threshold comprises:
[0025] If the associated plaintext is the same as the preset threshold, it is determined that the prediction result of the answer to the target question of the query data is correct;
[0026] If the associated plaintext is different from the preset threshold, it is determined that the prediction result of the answer to the target question of the data to be queried is wrong.
[0027] In an embodiment of the present application, the data to be queried is set as a predicted result of an answer to a target question. Since the data to be queried has the same data structure as the reference data held by the data provider, when the reference ciphertext calculated based on the reference data and the associated plaintext between the target ciphertext calculated based on the data to be queried are the same as a preset threshold, it can be known based on the homomorphic characteristic that the data provider holds reference data with the same content as the data to be queried, which means that the predicted result of the answer to the target question of the data to be queried is correct. This ensures that the data to be queried will not be exposed in communication, and can effectively reduce the risk of the data provider inferring the data to be queried.
[0028] In some embodiments, sending a ciphertext decryption request carrying the associated ciphertext to the data provider includes:
[0029] After obtaining the associated ciphertext corresponding to each reference ciphertext, adjusting the order of the associated ciphertexts so that the first order is different from the second order; the first order is the order of the multiple reference ciphertexts sent by the data provider; the second order is the order of the reference ciphertexts corresponding to the associated ciphertexts after the order adjustment;
[0030] Based on the adjusted and sorted associated ciphertexts, the ciphertext decryption request is generated and sent to a data provider.
[0031] In an embodiment of the present application, the data query party renumbers and sorts the associated ciphertexts corresponding to each reference ciphertext and sends them to the data provider. The reordering order should be different from the sorting order of the multiple reference ciphertexts. This ensures that the data provider cannot learn the current query object of the data query party based on the sorting order of the associated ciphertexts, thereby reducing the risk of information leakage.
[0032] In some embodiments, the multiple reference ciphertexts are obtained by the data provider using a private key to homomorphically encrypt a reference fingerprint code; the reference fingerprint code is obtained by the data provider calculating the reference data using the specified function algorithm; each reference ciphertext corresponds to a unique reference fingerprint code, and each reference fingerprint code corresponds to unique reference data.
[0033] In the embodiment of the present application, the data provider calculates the reference fingerprint code for the reference data in a specific format by using a specified function algorithm, and uses a private key to homomorphically encrypt the reference fingerprint code to obtain a 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 above process can ensure that the reference ciphertext and the target ciphertext have the same data structure, and then the data query party can use the homomorphic characteristics to obtain the query result from the data provider whether there is reference data with the same content as the data to be queried.
[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 embodiment of the present application, the data query party and the data provider agree on a set of specified function algorithms to operate on the original data, so that the query party and the data provider can obtain the target fingerprint code and reference fingerprint code with the same data structure respectively. The original data is the data to be queried by the data query party and the reference data of the data provider. Therefore, it can be ensured that the same fingerprint code structure enables the data query party to use the homomorphic characteristics to learn from the data provider whether there is reference data with the same content as the data to be queried.
[0036] In a second aspect, an embodiment of the present application further provides a data anonymization query device based on homomorphic encryption, the device comprising:
[0037] The data acquisition unit is configured to execute: sending an anonymous query request to a data provider to obtain a plurality of reference ciphertexts; the plurality of reference ciphertexts are obtained by the data provider performing homomorphic encryption on the reference data based on a specified function algorithm and a private key;
[0038] The sharding processing unit is configured to execute: using the specified function algorithm to calculate the target fingerprint code for the query data, and splitting the target fingerprint code into multiple sharding fingerprint codes based on a preset splitting algorithm; the query data has the same data structure as the reference data;
[0039] The shard encryption unit is configured to execute: sending a ciphertext generation request carrying the multiple shard fingerprint codes to a data provider to obtain multiple shard ciphertexts; the multiple shard ciphertexts are obtained by the data provider using a private key to homomorphically encrypt the multiple shard fingerprint codes;
[0040] The anonymous query unit is configured to execute: determining a query answer for the data to be queried based on a difference or product between the multiple fragmented ciphertexts and the multiple reference ciphertexts; the query answer indicates whether there is reference data with the same content as the data to be queried.
[0041] In some embodiments, the step of determining the query answer for the to-be-queried data based on the difference or product between the plurality of shard ciphertexts and the plurality of reference ciphertexts is performed, and the anonymous query unit is specifically configured as follows:
[0042] Based on the preset splitting algorithm, the plurality of fragmented ciphertexts are concatenated to obtain a target ciphertext;
[0043] Based on the difference or product between the target ciphertext and each reference ciphertext, obtaining the associated ciphertext of each reference ciphertext;
[0044] Sending a ciphertext decryption request carrying the associated ciphertext to the data provider to obtain an associated plaintext; the associated plaintext is obtained by the data provider using a private key to homomorphically decrypt the associated ciphertext;
[0045] The query answer is determined based on the associated plaintext and a preset threshold.
[0046] In some embodiments, the step of performing the step of obtaining the associated ciphertext of each reference ciphertext based on the difference or product between the target ciphertext and each reference ciphertext is performed, and the anonymous query unit is specifically configured as follows:
[0047] Generate a weight factor equal to the number of reference ciphertexts; each weight factor is mutually exclusive with a modulus preset in the homomorphic encryption and the homomorphic decryption, and each weight factor corresponds to a reference ciphertext;
[0048] For each reference ciphertext, determine a first product of a weight factor corresponding to the reference ciphertext and the reference ciphertext, and a second product of a weight factor corresponding to the reference ciphertext and the target ciphertext; and use a difference between the first product and the second product as an associated ciphertext corresponding to the reference ciphertext; or,
[0049] For each reference ciphertext, determine 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 a weight factor corresponding to the reference ciphertext and the target ciphertext; and use the product of the first power operation result and the second power operation result as the associated ciphertext.
[0050] In some embodiments, the to-be-queried data represents a predicted answer result of a target question; the query answer represents whether the predicted answer result is correct; and 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 prediction result of the answer to the target question of the query data is correct;
[0052] If the associated plaintext is different from the preset threshold, it is determined that the prediction result of the answer to the target question of the data to be queried is wrong.
[0053] In some embodiments, the sending of the ciphertext decryption request carrying the associated ciphertext to the data provider is performed, and the shard encryption unit is specifically configured to:
[0054] After obtaining the associated ciphertext corresponding to each reference ciphertext, adjusting the order of the associated ciphertexts so that the first order is different from the second order; the first order is the order of the multiple reference ciphertexts sent by the data provider; the second order is the order of the reference ciphertexts corresponding to the associated ciphertexts after the order adjustment;
[0055] Based on the adjusted and sorted associated ciphertexts, the ciphertext decryption request is generated and sent to a data provider.
[0056] In some embodiments, the multiple reference ciphertexts are obtained by the data provider using a private key to homomorphically encrypt a reference fingerprint code; the reference fingerprint code is obtained by the data provider calculating the reference data using the specified function algorithm; 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, including:
[0059] A memory for storing program instructions;
[0060] The processor is used to call the program instructions stored in the memory, and execute the steps included in any one of the methods in 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, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes any one of the methods described in the first aspect.
[0062] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising: a computer program code, when the computer program code is run on a computer, the computer executes any one of the methods described in the first aspect.
[0063] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0065] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0066] Figure 2 An execution sequence diagram of a data anonymization query method based on homomorphic encryption provided in an embodiment of the present application;
[0067] Figure 3 A schematic diagram of the associated ciphertext acquisition process provided in an embodiment of the present application;
[0068] Figure 4 Provided for the embodiments of this application Figure 2 The flowchart of the data anonymization query process based on homomorphic encryption is shown;
[0069] Figure 5 A flowchart of a data anonymization query process based on homomorphic encryption provided in an embodiment of the present application;
[0070] Figure 6 A schematic diagram of the structure of a data anonymity query device based on homomorphic encryption provided in an embodiment of the present application;
[0071] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0072] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection 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 the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0074] To facilitate understanding of the technical solution provided by this application, the technical background of this application is described in detail below:
[0075] Anonymous query means that the query party hides the queried information. The data provider can provide matching query results, but cannot know the query content of the query party. It is widely used in information verification scenarios. The so-called information verification means that the data query party has at least one guess or predicted answer to a target question, but if it directly inquires the data provider, it will directly expose its own guess or predicted answer during the inquiry stage.
[0076] For example, public security and judicial personnel need to investigate whether Zhang San has purchased a large number of stock funds in a certain trading institution. If the name of the person being investigated is directly handed over to the trading institution, and the trading institution is asked to help investigate whether Zhang San holds a large number of stock funds, although an accurate answer can be obtained quickly from the trading institution, regardless of whether Zhang San holds a large number of stock funds, the information that Zhang San is being investigated will be directly exposed when inquiring with the trading institution, that is, at least known by the trading institution.
[0077] If anonymous query can effectively avoid the above-mentioned information exposure problem, the current anonymous query process based on homomorphic encryption algorithm mostly pre-configures public-private key pairs for the data query party. The data query party needs to perform multiple homomorphic encryption and decryption operations and interactions on the data based on the public key shared with the data provider and its own private key to obtain the final query result.
[0078] Taking the common anonymous query process based on the Paillier homomorphic encryption algorithm as an example, suppose the data query party wants to query whether there is a piece of data to be queried that meets the specified conditions from the N reference data of the data provider. At this time, the data query party needs to generate obfuscated data containing the data to be queried, and the obfuscated data must be the same as the reference data (that is, generate N obfuscated data, including 1 piece of data to be queried and N-1 virtual data).
[0079] The data query party uses a private key to encrypt the data to be queried, and uses a public key shared with the data provider to encrypt the virtual data. The data provider then performs an inner product operation on the N obfuscated data and the N reference data stored by itself based on the shared public key, and then gives the inner product operation result to the data query party to decrypt using the private key, thereby obtaining the query answer corresponding to the data to be queried. It can be seen that the current anonymous query process based on the homomorphic encryption algorithm has a heavy burden on computational and communication overheads, and has the problems of high cost and low efficiency.
[0080] To solve the above problems, the invention of the present application is as follows: by obtaining the reference ciphertext obtained by homomorphically encrypting the reference data based on the specified function algorithm and the private key of the data provider, the specified function algorithm is used to calculate the data to be queried that has the same data structure as the reference data, and the target fingerprint code is obtained. Based on the preset splitting algorithm, the target fingerprint code is split into multiple fragmented fingerprint codes and sent to the data provider, so as to obtain multiple fragmented ciphertexts obtained by homomorphically encrypting the multiple fragmented fingerprint codes using the private key from the data provider. Finally, through the homomorphic characteristics of the homomorphic encryption algorithm, several overall ciphertexts are synthesized based on the multiple fragmented ciphertexts to form the target ciphertext, and the difference or product between the target ciphertext and the multiple reference ciphertexts is calculated to determine whether there is reference data with the same content as the data to be queried. The above-mentioned anonymous query process does not need to set a public-private key pair for the data query party. Only the private key of the data provider participates in the homomorphic operation, which greatly reduces the amount of data homomorphic encryption and decryption operations, and saves the computational overhead and communication overhead of the anonymous query process.
[0081] The solution provided in the embodiment of the present application can be applied to the interaction scenario between the terminal device and the server. Figure 1 As shown, it is a schematic diagram of an application scenario provided by an embodiment of the present application. In this scenario, a terminal device 101, a server 102, and a network 103 may be included.
[0082] The terminal device 101 may be a mobile phone, a tablet computer (PAD), a laptop computer, a desktop computer, a smart TV, a smart vehicle-mounted device, a smart wearable device, or the like.
[0083] The server 102 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, i.e., content delivery networks (CDNs), and big data and artificial intelligence platforms, but is not limited thereto. Multiple processors 103 for providing processing resources may be deployed on the server 102.
[0084] In the embodiment of the present application, the terminal device 101 and the server 102 can be directly or indirectly connected to each other 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 (Wireless-Fidelity, WIFI) network, and of course, it can also be other possible networks, which are not limited in the embodiment of the present application.
[0085] In some embodiments, the terminal device 101 and the server 102 pre-agreed on a designated function algorithm for anonymous query. The data query party may send an anonymous query request to the data provider's server 102 through the terminal device 101. In response to the request, the server 102 may send a reference ciphertext obtained by homomorphically encrypting the reference data based on the designated function algorithm and the private key to the terminal device 101.
[0086] In some embodiments, the terminal device 101 may use a specified function algorithm to calculate the data to be queried that has the same data structure as the reference data to obtain a target fingerprint code, and then split the target fingerprint code into multiple fragmented fingerprint codes based on a preset splitting algorithm.
[0087] In some embodiments, the terminal device 101 may send a ciphertext generation request carrying the multiple shard fingerprint codes to the server 102. In response to the request, the server 102 homomorphically encrypts the multiple shard fingerprint codes using a private key to obtain the ciphertext of the multiple shards, and sends them to the terminal device 101.
[0088] In some embodiments, the terminal device 101 can synthesize the multiple shard ciphertexts to obtain the corresponding target ciphertext based on the multiple shard ciphertexts sent by the server 102, using the homomorphic encryption characteristics and the splitting rules for forming the shard fingerprint code. Then calculate the associated ciphertexts of the target ciphertext and the multiple reference ciphertexts, decrypt each associated ciphertext to obtain the corresponding associated plaintext, and then judge whether the target fingerprint code is the same as a reference fingerprint code based on the comparison result of the associated plaintext and the preset threshold, thereby determining whether the data to be queried exists in the data of the data provider.
[0089] In combination with the application scenarios described above, the following describes a data anonymity query method based on homomorphic encryption provided by an exemplary embodiment of the present application with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate the understanding of the present application scheme, and the implementation methods of the present application are not subject to any restrictions in this regard.
[0090] Figure 2 The following is a time sequence flow of a data query party and a data provider executing a data anonymization query method based on homomorphic encryption provided in an embodiment of the present application, such as Figure 2 As shown, the following steps may be included:
[0091] Step 201: The data query party sends an anonymous query request to the data provider;
[0092] Step 202: The data provider uses a specified function algorithm to calculate the reference fingerprint code corresponding to each reference data on the multiple reference data;
[0093] Use the private key to homomorphically encrypt the reference fingerprint code to obtain the reference ciphertext corresponding to each reference fingerprint code;
[0094] For the sake of convenience, steps 201 to 210 are all illustrated by the information verification example of "investigating whether Zhang San has purchased a large amount of stock funds in a certain trading institution" mentioned above. It should be understood that the explanation using this example is only for the convenience of describing the technical solution of the present application, rather than limiting the solution itself.
[0095] In the example of "investigating whether Zhang San has purchased a large amount of stock funds in a certain trading institution", the relevant public security 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, market value of stock funds held, password verification value and other data information.
[0096] The data query party can ask the data provider to provide only some items, for example, only the name, ID number, and the market value of the stock funds held. That is, [name, ID number, market value of the stock funds held] is the data structure agreed upon in advance by the data query party and the data provider.
[0097] In some embodiments, in order to improve communication security and save data transmission volume, the "market value of stock funds held" can be represented by an English letter, such as A is less than 100,000 yuan, B is 100,000 yuan and less than 1 million yuan, C is 1 million and less than 5 million yuan, and D is greater than or equal to 5 million yuan. The data query party can, under the premise of authorization, send an anonymous query request in step 201 to the data provider, requiring the data provider to generate corresponding reference data with the data structure of [name, ID number, market value of stock funds held] for all users' account information. For example, [Li Si, 123***598, B], [Wang Wu, 123****386, C], each user corresponds to a reference data generated by his own account.
[0098] When executing step 202, the data provider may use the specified function algorithm agreed in advance with the data query party to calculate each reference data to obtain the reference fingerprint code corresponding to each reference data. The specified function algorithm is any one of a message authentication algorithm, a hash function algorithm, and a compression function algorithm. For example, a hash function operation is performed on the reference data 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 uses a private key to homomorphically encrypt the reference fingerprint code to obtain a reference ciphertext corresponding to each reference fingerprint code;
[0100] After obtaining the reference fingerprint code corresponding to each reference data through the aforementioned step 202, the data provider can use the private key to homomorphically encrypt the reference fingerprint code to obtain the corresponding reference ciphertext. The embodiment of the present application does not limit the type of homomorphic encryption algorithm selected, and it 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 querying party uses a specified function algorithm to calculate the target fingerprint code for the query data;
[0103] The data query party and the data provider of the embodiment of the present application agree in advance on the data structure of the data to be queried and the reference data, namely, the [name, ID number, market value of the stock fund held] mentioned above.
[0104] The reference data has been explained in step 202 and will not be repeated here. The data to be queried refers to the predicted answer result of the data query party to the target question. In the example of "investigating whether Zhang San has purchased a large number of stock funds in a certain trading institution", "whether Zhang San holds a large number of stock funds" is the target question, and the answer prediction result can be set according to actual needs. Assuming that the judgment standard is that the stock funds purchased with a market value of more than 5 million are considered as large purchases, then the stock funds purchased by Zhang San with a market value of more than 5 million can be used as the answer prediction result. Therefore, the data query party can generate the data to be queried [Zhang San, 123****456, D] that represents the answer prediction result based on the data structure.
[0105] When executing step 205, the data query party may use the specified function algorithm (such as the hash algorithm in step 202) agreed in advance with the data provider to calculate the query data to obtain the corresponding target fingerprint code. Since the specified function algorithm is the same and the data structure of the query data and the reference data is the same, the data structure of the target fingerprint code and the reference fingerprint code is also the same.
[0106] Step 206: The data querying party splits the target fingerprint code into multiple fragmented fingerprint codes based on a preset splitting algorithm;
[0107] As shown in steps 206 to 208, the split multiple shard fingerprint codes need to be handed over to the data provider using a private key for homomorphic encryption. Therefore, the splitting requirement for the target fingerprint code here is: the data provider cannot restore the target fingerprint code based on the split multiple shard fingerprint codes, thereby improving communication security.
[0108] For ease of understanding, the following example is used to explain the splitting process of 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 convenience of introducing the solution, and does not limit the splitting algorithm used here.
[0109] Considering that most of the current homomorphic encryption algorithms regard ciphertext as an integer between 0 and P-1, and plaintext as an integer between 0 and Q-1, the ciphertext calculation is an addition and multiplication operation on the modulus P, and P and Q are both fixed values related to the algorithm. Based on this, the target fingerprint code can be regarded as an addition or multiplication that can be split into several data segments. Assuming that the target fingerprint code is A, the calculation satisfies the preset splitting algorithm: A = k1B1 + k2B2 + ... + k t B t mod Q, where k1~k t is a set of secret constants randomly selected according to the value of A, t∈[0,Q-1], B1~B t is the shard fingerprint.
[0110] Step 207: The data query direction sends a ciphertext generation request carrying multiple shard fingerprint codes to the data provider;
[0111] Step 208: The data provider uses the private key to identify multiple shard fingerprint codes B1 to B t Perform homomorphic encryption to obtain multiple sharded ciphertexts;
[0112] This step is the same as the idea of the data provider using a private key to homomorphically encrypt the reference fingerprint code in the aforementioned step 202, and will not be repeated here.
[0113] Step 209: The data provider sends multiple shard ciphertexts to the data query party;
[0114] Step 210: The data querying party concatenates multiple fragmented ciphertexts based on a preset splitting algorithm to obtain a target ciphertext;
[0115] That is, the ciphertext of the fragment and k1~k t The ciphertext of the target fingerprint code A is calculated together.
[0116] Step 211: based on the difference or product between the target ciphertext and each reference ciphertext, obtain the associated ciphertext corresponding to each reference ciphertext;
[0117] As mentioned in the above step 208, assuming that the target fingerprint code is A, the data query can calculate the preset splitting algorithm: A = k1B1+k2B2+...+k t B t mod Q, where B1~B t is the shard fingerprint.
[0118] For example, the target fingerprint code A = 48, which satisfies A = k1B1 + k2B2 + ... + k t B t One form of mod Q can be: A = 11 × 2 + 7 × 3 + 5. Among them, 2, 3, and 5 are the shard fingerprint codes. Assuming that the data provider homomorphically encrypts the shard fingerprint codes 2, 3, and 5 to obtain shard ciphertexts of 57, 43, and 89, respectively, then, based on the additive homomorphic property, it can be calculated that the ciphertext of the target fingerprint code A can be 11 × 57 + 7 × 43 + 89 = 1017.
[0119] It can be seen that according to the additive homomorphic property, the shard ciphertext corresponding to the shard fingerprint code can be substituted into the preset splitting algorithm for reverse restoration to obtain the target ciphertext, which is equivalent to the result after the data provider directly uses the private key to homomorphically encrypt the target fingerprint code.
[0120] Next, based on the difference or product between the target ciphertext and each reference ciphertext, the associated ciphertext corresponding to each reference ciphertext can be obtained. Figure 3 As shown, the same weight factor as the number of reference ciphertexts is generated. For example, the reference ciphertext includes X1~X n , that is, generate N random numbers r1~r n As the weight factor. 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 Corresponding to X n .
[0121] For each reference ciphertext, determine 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; the difference between the first product and the second product is used as the associated ciphertext corresponding to the reference ciphertext. Figure 3 As shown, taking the reference ciphertext X1 as an example, the associated ciphertext D1 corresponding to X1=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] In addition, the associated ciphertext can also be obtained in the following manner: for each reference ciphertext, determine the result of the first power operation of the reference ciphertext corresponding to the weight factor and the reference ciphertext, and the result of the second power operation of the reference ciphertext corresponding to the weight factor and the target ciphertext; and use the product of the first power operation result and the second power operation result as the associated ciphertext. Continuing with the reference ciphertext X1 as an example, Figure 3 As shown, the result of the first power operation is (X1) r1 , the result of the second power operation is (Y) -r1 In the first power operation and the second power operation, the weight factor is used to perform power operations on the reference ciphertext and the target ciphertext respectively, and they are the inverse of the power of each other, and then the associated ciphertext D1=(X1) is obtained. r1 (Y) -r1 Thus, based on the product of the target ciphertext and each reference ciphertext, the associated ciphertext corresponding to each reference ciphertext can be obtained.
[0123] When obtaining the associated ciphertext, the above process introduces a weight factor to perform a product operation on the reference ciphertext and the target ciphertext to further change the ciphertext form, thereby improving security and reducing the possibility that the data provider can restore the target fingerprint code ciphertext based on the reference ciphertext.
[0124] Step 212: The data querying party sends a ciphertext decryption request carrying the associated ciphertext to the data provider;
[0125] Step 213: The data provider uses the private key to homomorphically decrypt the associated ciphertext to obtain the associated plaintext;
[0126] This step is similar to the idea of the data provider using a private key to homomorphically encrypt the reference fingerprint code in the aforementioned step 202, and will not be repeated here.
[0127] Step 214: The data provider sends the associated plain text to the data query party;
[0128] Step 215: The data querying party determines the query answer corresponding to the data to be queried based on the associated plaintext and the preset threshold.
[0129] As explained in the aforementioned step 210, the associated ciphertext is equivalent to the difference or product between the reference ciphertext after homomorphic encryption of the reference fingerprint code and the target ciphertext after homomorphic encryption of the target fingerprint code. If it is a common 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 content corresponding to the reference ciphertext and the target ciphertext is the same. However, the characteristics of homomorphic encryption cause the same plaintext to produce different ciphertexts after multiple encryptions. Therefore, it is difficult to determine whether two ciphertexts correspond to the same plaintext without decryption. Therefore, the data provider who holds the decryption key of the homomorphic algorithm is also needed to assist in the determination.
[0130] Here, the homomorphic property can be used for judgment. If the value of the decryption result of the associated ciphertext (i.e., the associated plaintext) is the preset threshold (0), it means that the reference ciphertext corresponding to the associated 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] As described in the above steps 202 and 205, in the example of "investigating whether Zhang San has purchased a large amount of stock funds in a certain trading institution", the data provider can generate corresponding reference data with the data structure of [name, ID number, market value of stock funds held] for all users' account information. For example, [Li Si, 123***598, B], [Wang Wu, 123****386, C]. Based on this data structure, the data query party can generate the query data [Zhang San, 123****456, D] that represents the predicted answer to the target question "Does Zhang San hold a large amount of stock funds?"
[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] in the data provided, which means that the market value of the stock fund held by Zhang San in the trading institution is indeed more than 5 million, that is, it is true that Zhang San holds a large amount of stock funds.
[0133] Based on this, the data provider should send all the decrypted associated plaintexts to the data query party. Since only the data query party knows the question to be queried, as long as there is an associated plaintext with a value of 0, it means that the prediction result of the answer to the target question of the queried data is correct, otherwise it is wrong. However, since the associated plaintext is decrypted by the data provider and the result that the plaintext is not equal to 0 is not required, the data provider can also be directly informed 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 that there are countless associated plaintexts with a value of 0.
[0134] In some embodiments, the data query party may adjust the order of the associated ciphertexts corresponding to each reference ciphertext before executing step 212, so that the first order is different from the second order; wherein the first order is the order of the multiple reference ciphertexts sent by the data provider; the second order is the order of the reference ciphertexts corresponding to the associated ciphertexts after the order adjustment. Then the data query party generates the ciphertext decryption request in step 212 based on the associated ciphertexts after the order adjustment, and sends it to the data provider.
[0135] The order of the multiple reference ciphertexts sent by the data provider to the data query party in step 202 is known to the data provider. Assume that the multiple reference ciphertexts X1 to X n The order is T1~T nIf the associated ciphertexts corresponding to each reference ciphertext are sent to the data provider for decryption in the same sort order, the data provider may guess or learn the target fingerprint of the data query party based on the many associated plaintexts that appear in sequence, and then determine the current query object, which poses a risk of information leakage.
[0136] Based on this, the associated ciphertexts can be renumbered and sorted by using the chaotic data segment numbering method, so that the sorting order is different from T1 to T n The reordered associated ciphertext is then sent to the data provider, who is required to decrypt the associated ciphertext into associated plaintext. This ensures that the data provider cannot learn the current query object of the data query party based on the sorting order of the associated ciphertext, thereby reducing the risk of information leakage.
[0137] Figure 4 for Figure 2 The schematic diagram of the data anonymization query process based on homomorphic encryption is shown in FIG. Figure 4 As shown, the data provider of the embodiment of the present application can use a specified function algorithm to calculate multiple reference data to obtain 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 send the multiple reference ciphertexts to the data query party.
[0138] The data query party uses the specified function algorithm to calculate the target fingerprint code for the query data, and splits the target fingerprint code into multiple shard fingerprint codes based on the preset splitting algorithm, and sends them to the data provider. The data provider uses the private key to homomorphically encrypt multiple shard fingerprint codes to obtain multiple shard ciphertexts, and sends them to the data query party. The data query party splices multiple shard ciphertexts based on the preset splitting algorithm to obtain the target ciphertext, and obtains the associated ciphertext corresponding to each reference ciphertext based on the difference or product between the target ciphertext and each reference ciphertext. Then the associated ciphertext is reordered and sent to the data provider.
[0139] In some embodiments, considering that the data query party may provide tens of thousands of data for query in actual scenarios, an agreement can be reached with the data provider in advance during implementation. After decrypting the associated ciphertext to obtain the associated plaintext, only the data number with the associated plaintext of 0 is sent to the data query party, thereby greatly reducing the amount of data transmission and improving communication efficiency.
[0140] Specifically, the data provider uses the private key to homomorphically decrypt the associated ciphertext to obtain the associated plaintext, and checks whether the associated plaintext is 0. If so, the data number is sent to the querying party. The querying party determines which target fingerprint code is in the data provider's fingerprint code based on the data number, and obtains the query result accordingly. In the above process, there is no need to set up a public-private key pair for the data querying party. Only the private key of the data provider participates in the homomorphic operation, which saves the computational overhead and communication overhead of the anonymous query.
[0141] In addition, in order to further reduce the amount of calculation by the data query party, the embodiment of the present application can be Figure 4 The public key encryption algorithm is introduced on the basis of the process shown in the figure to omit the process of splitting the target fingerprint code by the data query party. Figure 5 As shown, the data provider holds a pair of public and private keys, and the public key is shared with the data query party.
[0142] When executing the above data anonymization query process based on homomorphic encryption, the data provider can use the specified function algorithm to calculate the reference fingerprint code corresponding to each reference data, and use the shared public key to homomorphically encrypt the reference fingerprint code to obtain the reference ciphertext corresponding to each reference fingerprint code. Then send the multiple reference ciphertexts to the data query party.
[0143] The data query party uses the specified function algorithm to calculate the target fingerprint code for the query data, and uses the shared public key to encrypt the target fingerprint code to obtain the target ciphertext. The data query party calculates the associated ciphertext between each reference ciphertext and the target ciphertext, and then reorders the associated ciphertext and sends it to the data provider.
[0144] The data provider uses the private key to homomorphically decrypt the associated ciphertext to obtain the associated plaintext, and selects the result with the associated plaintext of 0. If there is any, the data number with the associated plaintext of 0 is sent to the query party, so that the data query party can determine which target fingerprint code is in the fingerprint code of the data provider based on the data number with the associated plaintext of 0 and obtain the query result. Figure 4 The anonymous query process shown is Figure 5 The data query party uses a shared public key to encrypt the target fingerprint code to obtain the target ciphertext. There is no need to split the target fingerprint code and transfer it to the data provider for encryption, nor is there a step for the data query party to restore the encrypted result of the sharded fingerprint code to the target ciphertext. In scenarios where the amount of reference target fingerprint code data is large, it can effectively reduce the computational complexity of both parties.
[0145] Based on the same inventive concept, the embodiment of the present application also provides a data anonymization query device based on homomorphic encryption, specifically as follows: Figure 6 As shown, the device comprises:
[0146] The data acquisition unit 601 is configured to execute: sending an anonymous query request to a data provider to obtain a plurality of reference ciphertexts; the plurality of reference ciphertexts are obtained by the data provider performing homomorphic encryption on the reference data based on a specified function algorithm and a private key;
[0147] The shard processing unit 602 is configured to execute: using the specified function algorithm to calculate the target fingerprint code for the query data, and splitting the target fingerprint code into multiple shard fingerprint codes based on a preset splitting algorithm; the query data has the same data structure as the reference data;
[0148] The shard encryption unit 603 is configured to execute: sending a ciphertext generation request carrying the multiple shard fingerprint codes to the data provider to obtain multiple shard ciphertexts; the multiple shard ciphertexts are obtained by the data provider using a private key to homomorphically encrypt the multiple shard fingerprint codes;
[0149] The anonymous query unit 604 is configured to execute: determining a query answer for the data to be queried based on a difference or product between the multiple fragmented ciphertexts and the multiple reference ciphertexts; the query answer indicates whether there is reference data with the same content as the data to be queried.
[0150] In some embodiments, the step of determining the query answer for the to-be-queried data based on the difference or product between the plurality of shard ciphertexts and the plurality of reference ciphertexts is performed, and the anonymous query unit 604 is specifically configured as follows:
[0151] Based on the preset splitting algorithm, the plurality of fragmented ciphertexts are concatenated to obtain a target ciphertext;
[0152] Based on the difference or product between the target ciphertext and each reference ciphertext, obtaining the associated ciphertext of each reference ciphertext;
[0153] Sending a ciphertext decryption request carrying the associated ciphertext to the data provider to obtain an associated plaintext; the associated plaintext is obtained by the data provider using a private key to homomorphically decrypt the associated ciphertext;
[0154] The query answer is determined based on the associated plaintext and a preset threshold.
[0155] In some embodiments, the associated ciphertext of each reference ciphertext is obtained based on the difference or product between the target ciphertext and each reference ciphertext, and the anonymous query unit 604 is specifically configured as follows:
[0156] Generate a weight factor equal to the number of reference ciphertexts; each weight factor is mutually exclusive with a modulus preset in the homomorphic encryption and the homomorphic decryption, and each weight factor corresponds to a reference ciphertext;
[0157] For each reference ciphertext, determine a first product of a weight factor corresponding to the reference ciphertext and the reference ciphertext, and a second product of a weight factor corresponding to the reference ciphertext and the target ciphertext; and use a difference between the first product and the second product as an associated ciphertext corresponding to the reference ciphertext; or,
[0158] For each reference ciphertext, determine 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 a weight factor corresponding to the reference ciphertext and the target ciphertext; and use the product of the first power operation result and the second power operation result as the associated ciphertext.
[0159] In some embodiments, the to-be-queried data represents the predicted answer result of the target question; the query answer represents whether the predicted answer result is correct; and the anonymous query unit 604 is specifically configured to:
[0160] If the associated plaintext is the same as the preset threshold, it is determined that the prediction result of the answer to the target question of the query data is correct;
[0161] If the associated plaintext is different from the preset threshold, it is determined that the prediction result of the answer to the target question of the data to be queried is wrong.
[0162] In some embodiments, the ciphertext decryption request carrying the associated ciphertext is sent to the data provider, and the shard encryption unit 603 is specifically configured to:
[0163] After obtaining the associated ciphertext corresponding to each reference ciphertext, adjusting 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 multiple reference ciphertexts sent by the data provider; the second order is the order of the associated ciphertext after the order is adjusted;
[0164] Based on the adjusted and sorted associated ciphertexts, the ciphertext decryption request is generated and sent to a data provider.
[0165] In some embodiments, the multiple reference ciphertexts are obtained by the data provider using a private key to homomorphically encrypt a reference fingerprint code; the reference fingerprint code is obtained by the data provider calculating the reference data using the specified function algorithm; 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] Refer to the following Figure 7hereinafter describes an electronic device 730 according to this embodiment of the present application. Figure 7 The electronic device 730 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0168] like Figure 7 As shown, the electronic device 730 is in the form of a general electronic device. The components of the electronic device 730 may include but are not limited to: the at least one processor 731, the at least one memory 732, and a bus 733 connecting different system components (including the memory 732 and the processor 731).
[0169] Bus 733 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.
[0170] The memory 732 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 7321 and / or a cache memory 7322 , and may further include a read-only memory (ROM) 7323 .
[0171] Memory 732 may also include a program / utility 7325 having a set (at least one) of program modules 7324, such program modules 7324 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0172] The electronic device 730 may also communicate with one or more external devices 734 (e.g., keyboards, pointing devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 730, and / or communicate with any device that enables the electronic device 730 to communicate with one or more other electronic devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 735. Furthermore, the electronic device 730 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 736. As shown, the network adapter 736 communicates with other modules for the electronic device 730 via a bus 733. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 730, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0173] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 732 including instructions, and the instructions can be executed by the processor 731 of the above device to complete the above method. Alternatively, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0174] In an exemplary embodiment, a computer program product is also provided, including a computer program / instruction, which, when executed by the processor 731, implements any method in the data anonymity query method based on homomorphic encryption provided in the present application.
[0175] In an exemplary embodiment, various aspects of a data anonymity query method based on homomorphic encryption provided by the present application can also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of a data anonymity query method based on homomorphic encryption according to various exemplary embodiments of the present application described above in this specification.
[0176] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0177] The program product for data anonymization query based on homomorphic encryption of the embodiment of the present application can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on an electronic device. However, the program product of the present application is not limited to this. In this document, the readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0178] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein readable program code is carried. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium other than a readable storage medium, which may transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0179] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0180] The program code for performing the operation of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also conventional procedural programming languages such as language or similar programming languages. The program code can be executed entirely on the user electronic device, partially on the user device, as an independent software package, partially on the user electronic device and partially on the remote electronic device, or completely on the remote electronic device or server. In the case of a remote electronic device, the remote electronic device can be connected to the user electronic device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external electronic device (for example, using an Internet service provider to connect through the Internet).
[0181] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
[0182] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0183] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0184] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable image scaling device to produce a machine, so that the instructions executed by the processor of the computer or other programmable image scaling device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0185] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable image scaling device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, the instruction device being implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0186] These computer program instructions may also be loaded onto a computer or other programmable image scaling device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0187] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0188] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A data anonymization query method based on homomorphic encryption, characterized in that: The method comprises: Send an anonymous query request to the data provider to obtain multiple reference ciphertexts; the multiple reference ciphertexts are obtained by the data provider performing homomorphic encryption on the reference data based on a specified function algorithm and a private key; The target fingerprint code is calculated by using the specified function algorithm for the query data, and the target fingerprint code is split into multiple fragmented fingerprint codes based on a preset splitting algorithm; the query data has the same data structure as the reference data; Sending a ciphertext generation request carrying the multiple shard fingerprint codes to the data provider to obtain multiple shard ciphertexts; the multiple shard ciphertexts are obtained by the data provider using a private key to homomorphically encrypt the multiple shard fingerprint codes; Based on the difference or product between the multiple shard ciphertexts and the multiple reference ciphertexts, a query answer for the data to be queried is determined; the query answer indicates whether there is reference data with the same content as the data to be queried.
2. The method according to claim 1, characterized in that The determining the query answer of the to-be-queried data based on the difference or product between the multiple shard ciphertexts and the multiple reference ciphertexts includes: Based on the preset splitting algorithm, the plurality of fragmented ciphertexts are concatenated to obtain a target ciphertext; Based on the difference or product between the target ciphertext and each reference ciphertext, obtaining the associated ciphertext of each reference ciphertext; Sending a ciphertext decryption request carrying the associated ciphertext to the data provider to obtain an associated plaintext; the associated plaintext is obtained by the data provider using a private key to homomorphically decrypt the associated ciphertext; The query answer is determined based on the associated plaintext and a preset threshold.
3. The method according to claim 2, characterized in that The obtaining, based on the difference or product between the target ciphertext and each reference ciphertext, an associated ciphertext of each reference ciphertext comprises: Generate a weight factor equal to the number of reference ciphertexts; each weight factor is mutually exclusive with a modulus preset in the homomorphic encryption and the homomorphic decryption, and each weight factor corresponds to a reference ciphertext; For each reference ciphertext, determine a first product of a weight factor corresponding to the reference ciphertext and the reference ciphertext, and a second product of a weight factor corresponding to the reference ciphertext and the target ciphertext; and use a difference between the first product and the second product as an associated ciphertext corresponding to the reference ciphertext; or, For each reference ciphertext, determine 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 a weight factor corresponding to the reference ciphertext and the target ciphertext; and use the product of the first power operation result and the second power operation result as the associated ciphertext.
4. The method according to claim 2, characterized in that: The data to be queried represents the predicted result of the answer to the target question; The query answer represents whether the answer prediction result is correct; and determining the query answer based on the associated plaintext and a preset threshold includes: If the associated plaintext is the same as the preset threshold, it is determined that the prediction result of the answer to the target question of the query data is correct; If the associated plaintext is different from the preset threshold, it is determined that the prediction result of the answer to the target question of the data to be queried is wrong.
5. The method according to any one of claims 2 to 4, characterized in that: The sending a ciphertext decryption request carrying the associated ciphertext to the data provider includes: After obtaining the associated ciphertext corresponding to each reference ciphertext, adjusting the order of the associated ciphertexts so that the first order is different from the second order; the first order is the order of the multiple reference ciphertexts sent by the data provider; the second order is the order of the reference ciphertexts corresponding to the associated ciphertexts after the order adjustment; Based on the adjusted and sorted associated ciphertexts, the ciphertext decryption request is generated and sent to a data provider.
6. The method according to any one of claims 1 to 4, characterized in that: The multiple reference ciphertexts are obtained by the data provider using a private key to homomorphically encrypt the reference fingerprint code; the reference fingerprint code is obtained by the data provider using the specified function algorithm to calculate the reference data; Each reference ciphertext corresponds to a unique reference fingerprint, and each reference fingerprint corresponds to unique reference data.
7. The method according to any one of claims 1 to 4, characterized in that: The specified function algorithm is: any one of a message authentication algorithm, a hash function algorithm and a compression function algorithm.
8. A data anonymous query device based on homomorphic encryption, characterized in that: The device comprises: The data acquisition unit is configured to execute: sending an anonymous query request to a data provider to obtain a plurality of reference ciphertexts; the plurality of reference ciphertexts are obtained by the data provider performing homomorphic encryption on the reference data based on a specified function algorithm and a private key; The sharding processing unit is configured to execute: using the specified function algorithm to calculate the target fingerprint code for the query data, and splitting the target fingerprint code into multiple sharding fingerprint codes based on a preset splitting algorithm; the query data has the same data structure as the reference data; The shard encryption unit is configured to execute: sending a ciphertext generation request carrying the multiple shard fingerprint codes to a data provider to obtain multiple shard ciphertexts; the multiple shard ciphertexts are obtained by the data provider using a private key to homomorphically encrypt the multiple shard fingerprint codes; The anonymous query unit is configured to execute: determining a query answer for the data to be queried based on a difference or product between the multiple fragmented ciphertexts and the multiple reference ciphertexts; the query answer indicates whether there is reference data with the same content as the data to be queried.
9. An electronic device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in any one of claims 1-7 according to the obtained program instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Hidden trace data verification method and system based on homomorphic encryption
CN114756895A
Hierarchical trace query method and device, electronic equipment and storage medium
CN117370420A
Data processing method and device, equipment and storage medium
CN119150313A
Data processing device
US20120207299A1
Secure search of secret data in a semi-trusted environment using homomorphic encryption
US20200228308A1