A trusted third-party-based anonymous query method, system and device and storage medium
By introducing a trusted third party and hybrid multiplication homomorphic operations into the hidden query, the problems of high computational complexity and key exchange risks in the existing technology are solved, and efficient and secure keyword retrieval and data acquisition are achieved.
Patent Information
- Application Number
- CN202310727629.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-19
- Publication Date
- 2026-03-17
- Estimated Expiration
- 2043-06-19
AI Technical Summary
Existing covert query techniques suffer from high computational complexity, limited keyword retrieval, high service expansion costs, and key exchange risks, making it easy for data providers to obtain the query results.
By introducing a trusted third party, an encrypted database is built by the data provider and an index database is built by the trusted third party. Hybrid multiplication homomorphic operations are used. The querying party performs keyword queries on the trusted third party, the data provider only performs encryption operations, and the querying party decrypts to obtain the data.
It enables efficient and scalable keyword retrieval, protects the query content from being known by the data provider, improves security and efficiency, and avoids the risks of key exchange.
Smart Images

Figure CN116821056B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of privacy computing, and in particular to a method, system, device, and storage medium for covert querying based on a trusted third party. Background Technology
[0002] With the development of internet big data technology, more and more data and computational activities are being generated. Private Information Retrieval (PIR) technology aims to eliminate the adverse effects of computation on data stakeholders. This technology allows the querying party to obtain the required data even when the data provider cannot identify the query content.
[0003] Currently, the main covert query techniques include PIR based on unintentional transmission, PIR based on homomorphic encryption algorithms, and Keyword PIR based on polynomial interpolation and homomorphic encryption. Among them, PIR based on unintentional transmission and homomorphic encryption algorithms requires the querying party to know the row index number of the record in advance, which has low application value in practical scenarios. While Keyword PIR based on polynomial interpolation and homomorphic encryption can use keywords for querying, it suffers from high computational complexity, limited keyword retrieval methods, and high service expansion costs.
[0004] Patent document CN115905238A discloses a covert query method, apparatus, electronic device, and storage medium. The method includes: in response to a query request for data to be queried, determining a query identifier for the data to be queried; the query identifier is used to determine a segmented storage area of the data to be queried in a service provider; sending the query identifier to the service provider, instructing the service provider to query and return a ciphertext sequence and a corresponding location index sequence in the segmented storage area corresponding to the query identifier; wherein the segmented storage area is an area where the service provider segments and stores each piece of data according to the original location index of each piece of data in a database; obtaining the ciphertext sequence and the location index sequence, and determining a target ciphertext from the ciphertext sequence based on the location index sequence; obtaining a covert key sequence sent by the service provider based on an unintentional transmission protocol, and determining a target key for the target ciphertext from the covert key sequence; and decrypting the target ciphertext according to the target key to obtain the plaintext information of the data to be queried. In this method, the ciphertext sequence and the corresponding position index sequence obtained by the querying party contain information about other data unrelated to the query, which poses a risk of data redundancy and exposure; the key needs to be transmitted and there are multiple keys, which also pose a risk of redundancy and exposure.
[0005] Patent document CN112367170A discloses a secure data concealment query and sharing system and method based on multi-party secure computation. This method includes a DH key exchange module, a user key information concealment exchange module, a user core data concealment exchange module, and a user core data secure sharing module. However, this method requires key exchange and also suffers from the problem of key leakage during data transmission. Summary of the Invention
[0006] The purpose of this invention is to provide a keyword-based hidden query method, system, device, and storage medium, thereby protecting the query content from being known by the data provider.
[0007] To achieve the first objective of this invention, a hidden query method based on a trusted third party is provided, comprising a querying party, a data provider, and a trusted third party. The hidden query method includes the following steps:
[0008] The construction of a multi-party database based on the data file to be stored includes building a database containing the data file encoding format on the data provider's side, and building an index database containing data file keywords and corresponding index rows on a trusted third party's side.
[0009] The query method initiates a search for keywords by a trusted third party to obtain the index rows corresponding to the keywords.
[0010] The index rows obtained from the query are encrypted to obtain an encrypted file, which is then sent to the data provider.
[0011] The data provider performs calculations based on the encrypted file and the database to obtain the corresponding ciphertext file and sends it back to the querying party.
[0012] The querying party decrypts the encrypted file to obtain the data file corresponding to the search keywords.
[0013] The method of this invention, based on PIR implemented with homomorphic encryption, introduces a trusted third-party service to achieve an efficient and scalable hidden query method that supports keyword retrieval.
[0014] Specifically, the database construction process of the data provider is as follows:
[0015] The data provider encodes the data file to be stored to generate a ciphertext file compatible with the encryption algorithm and stores it in the database.
[0016] Specifically, the process of building the index database of the trusted third party is as follows:
[0017] The data provider extracts keywords from the data file and uses the location information of the extracted keywords as index rows to form a keyword index file containing keywords and corresponding index rows;
[0018] The trusted third party constructs a corresponding index database based on the keyword index file.
[0019] Specifically, the trusted third party uses a HashMap as a mapping tool to traverse the keyword index file line by line to obtain an index database with the same storage format.
[0020] Specifically, the MD5 algorithm is used to generate a digest of the keywords, and the digest is used to replace the keywords and form a keyword index file with the corresponding line index. This prevents third parties from directly obtaining the original keyword information, thus improving security.
[0021] Specifically, the encryption employs hybrid multiplication homomorphic operations.
[0022] Specifically, the process of initiating a keyword query with a trusted third party is as follows:
[0023] The search keywords are transmitted to a trusted third party via HTTPS. The trusted third party then searches its index database based on the search keywords to obtain the corresponding row indexes, which are then fed back to the querying party.
[0024] To achieve the second objective of this invention, a hidden query system is provided, which is implemented by the hidden query method based on a trusted third party as described above, including a data provider with a database, a trusted third party with an index database, and a querying party.
[0025] The data provider is used to convert data files into keyword index files and send them to a trusted third party, and to perform calculations with the database based on encrypted row indexes to obtain ciphertext files.
[0026] The trusted third party is used to map the keyword index file to build the corresponding index database, and to retrieve the corresponding row index from the index database based on the search keywords.
[0027] The querying party is used to input search keywords and decrypt the encrypted file returned by the data provider to obtain the data file corresponding to the search keywords.
[0028] To achieve a third objective of the present invention, a storage medium is provided, the storage medium comprising a stored program, wherein the above-described covert query method based on a trusted third party is executed by a processor when the program is run.
[0029] To achieve the fourth objective of this invention, a covert query device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the aforementioned covert query method based on a trusted third party.
[0030] When the computer processor executes the computer program, it performs the following steps:
[0031] The queryer enters search keywords for the target data file.
[0032] A trusted third party generates a corresponding row index based on the input search keywords and sends it back to the querying party.
[0033] The querying party encrypts the row index using a key and sends it to the data provider.
[0034] The data provider performs calculations with the database based on the encrypted row index to obtain the corresponding ciphertext file and sends it back to the querying party.
[0035] The querying party decrypts the encrypted file to obtain the data file corresponding to the search keywords.
[0036] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0037] By using a trusted third party to provide the keyword query row index, and employing physical isolation to protect the query content from being known by the data provider, compared to keyword retrieval methods implemented on the data provider's side based on other specific algorithms, the trusted third party can fully utilize mainstream relational databases and in-memory database technologies to improve the efficiency and retrieval methods of keyword retrieval, and has better scalability.
[0038] It also employs encryption technology that supports hybrid multiplication homomorphic operations, eliminating the need for key exchange, making it more secure and efficient compared to other solutions that require key exchange and escrow services. Attached Figure Description
[0039] Figure 1 This is a communication framework diagram of the covert query method based on a trusted third party provided in this embodiment;
[0040] Figure 2 A flowchart illustrating the covert query method based on a trusted third party provided in this embodiment;
[0041] Figure 3 This is a flowchart illustrating the construction process of the keyword index file provided in this embodiment;
[0042] Figure 4 The flowchart for querying the keyword index file provided in this embodiment. Detailed Implementation
[0043] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0044] It should be noted that, unless otherwise specified, the features in the following embodiments and implementation methods can be combined with each other.
[0045] like Figure 1 The diagram shown illustrates the communication framework of the covert query method provided in this embodiment. It includes the querying party, the data provider, and a trusted third party.
[0046] like Figure 2 The diagram shows a flowchart of the hidden query method provided in this embodiment, and its specific process is as follows:
[0047] First, a multi-party database is constructed based on the data file to be stored. This includes building a database containing the data file encoding format on the data provider's side, and building an index database containing data file keywords and corresponding index rows on a trusted third party's side.
[0048] During the retrieval process, the querying party initiates a query for search keywords to a trusted third party in order to obtain the index rows corresponding to the keywords.
[0049] The index rows obtained from the query are encrypted to obtain an encrypted file, which is then sent to the data provider.
[0050] The data provider performs calculations based on the encrypted file and the database to obtain the corresponding ciphertext file and sends it back to the querying party.
[0051] The querying party decrypts the encrypted file to obtain the data file corresponding to the search keywords.
[0052] More specifically, the data provider constructs a vector p(p1,p2,p3,…,p) using plaintext data. n ), where p i This represents the data element in the i-th row.
[0053] The data queryer has row index i and expects to retrieve p without the data provider knowing the content of its query. i The data querying party first constructs a query vector q(0,0,…,1…,0), where the i-th dimension is 1 and the others are 0. The data querying party calculates E(q) and transmits it to the data provider. After receiving E(q), the data provider performs encrypted multiplication, i.e., calculates… Due to the nature of the algorithm, the data provider cannot extract useful information about the query content from the above results; the data query provider then transmits the results to the data query provider. The data query provider finally uses a decryption function to decrypt the results, a process that involves computation. Based on the homomorphic property of mixed multiplication Furthermore, since q and p are real vectors here, the × operation is the vector dot product operation, i.e., q·p=p i Through decryption, the querying party ultimately obtains p. i .
[0054] Data providers have several methods for generating keyword index files, such as... Figure 3 As shown, the keyword index file construction method used in this embodiment is as follows:
[0055] The data provider selected the MD5 algorithm as the keyword digest generation tool, specified the data content of column c in data file P as the search keyword, and created a new blank file W as the output.
[0056] For P, execute line by line: In the i-th line, calculate MD5(c i )=d i , will d i i is written to W.
[0057] Ultimately, W is the keyword index file generated by the data provider.
[0058] In the embodiments, such as Figure 4 As shown, the technical solution provided by a trusted third party for querying keyword index files by keyword is implemented as follows:
[0059] The trusted third party uses a HashMap as the mapping tool, iterates through W row by row, and sets key = d. i The value = i is stored in a HashMap.
[0060] The HashMap is stored in a cache-level database. During a query, the data queryer uses the keyword s. x Execute MD5(s) x )=d x and d x Transmitted to a trusted third party via HTTPS protocol, the trusted third party uses key=d x Retrieve value = x from HashMap and transmit x to the data query party.
[0061] Its keyword index file has the following characteristics:
[0062] The elements of this index file contain keywords or data or summaries generated by an algorithm based on those keywords.
[0063] The elements of this index file contain data row indexes or data that can be restored to row indexes generated by some algorithm.
[0064] The index file can be used as input, along with a keyword or a keyword processed by a certain algorithm. A computational algorithm can then be used to calculate the row index of the specific keyword within the data provider's data. The computational algorithm includes, but is not limited to, hashing, tree search, and traversal.
[0065] This embodiment also provides a hidden query system, implemented by the hidden query method proposed in the above embodiments, including a data provider with a database, a trusted third party with an indexed database, and a querying party.
[0066] The data provider is used to convert data files into keyword index files and send them to a trusted third party, as well as to perform operations on the database based on encrypted row indexes to obtain ciphertext files.
[0067] A trusted third party is used to map keyword index files to build a corresponding index database, and to retrieve the corresponding row index from the index database based on search keywords.
[0068] The querying party is used to input search keywords and decrypt the encrypted file returned by the data provider to obtain the data file corresponding to the search keywords.
[0069] This embodiment also provides a storage medium, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the covert query method proposed in the above embodiment.
[0070] This embodiment also provides a covert query device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the covert query method proposed in the above embodiment. When the computer processor executes the computer program, it implements the following steps: the queryer inputs search keywords for the target data file.
[0071] A trusted third party generates a corresponding row index based on the input search keywords and sends it back to the querying party. The querying party encrypts the row index using a key and sends it to the data provider. The data provider performs calculations with the database based on the encrypted row index to obtain the corresponding ciphertext file and sends it back to the querying party. The querying party decrypts the ciphertext file to obtain the data file corresponding to the search keywords.
[0072] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of this application can be implemented in various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.
[0073] The above description is merely an embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the present invention should be included within the scope of the claims of the present invention.
Claims
1. A method for privacy-preserving query based on trusted third party, characterized in that, The anonymous query method comprises a query party, a data provider and a trusted third party, and comprises the following steps: Multi-party database construction based on a data file to be stored, which comprises constructing a database containing an encoding format of the data file at the data provider, and constructing an index database containing keywords of the data file and corresponding index rows at the trusted third party; The index database construction process of the trusted third party is as follows: The data provider extracts keywords from the data file and takes position information of the keyword extraction as an index row to form a keyword index file containing the keyword and the corresponding index row; The trusted third party constructs a corresponding index database based on the keyword index file; The query party initiates a search keyword query to the trusted third party to obtain the index row corresponding to the keyword; The index row obtained by the query is encrypted to obtain an encrypted file and sent to the data provider; The data provider performs operation based on the encrypted file and the database to obtain a corresponding ciphertext file and feedback to the query party, and the encryption uses hybrid multiplication homomorphic operation; The specific process of the query party initiating a keyword query to the trusted third party is as follows: The search keyword is transmitted to the trusted third party through the https protocol, and the trusted third party searches the index database according to the search keyword to obtain the row index corresponding to the search keyword and feedback to the query party The query party decrypts the ciphertext file to obtain the data file corresponding to the search keyword.
2. The trusted third party based obfuscated query method of claim 1, wherein, The specific process of the database construction of the data provider is as follows: The data provider encodes the data file to be stored to generate a ciphertext file compatible with the encryption algorithm and stores it in the database.
3. The trusted third party based anonymous query method of claim 1, wherein, The MD5 algorithm is used to generate a digest of the keyword, and the digest is used to replace the keyword and the corresponding row index to form a keyword index file.
4. The trusted third party based anonymous query method of claim 1, wherein, The trusted third party uses HashMap as a mapping tool to traverse the keyword index file row by row to obtain an index database with the same storage format.
5. A system for obfuscating queries, the system comprising: The anonymous query method based on the trusted third party is realized by the method of any one of claims 1-4, comprising a data provider with a database, a trusted third party with an index database, and a query party; The data provider is configured to convert the data file into a keyword index file and send it to the trusted third party, and perform operation based on the encrypted row index and the database to obtain a ciphertext file; The trusted third party is configured to map the keyword index file to construct a corresponding index database, and search the index database according to the search keyword to obtain the corresponding row index; The query party is configured to input the search keyword and decrypt the ciphertext file feedback by the data provider to obtain the data file corresponding to the search keyword.
6. A storage medium, characterized by The storage medium comprises a stored program, wherein the program is executed by the processor to perform the anonymous query method based on the trusted third party in any one of claims 1-4.
7. An apparatus for obfuscating queries, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the computer program comprises instructions for: The processor executes the computer program to realize the anonymous query method based on the trusted third party in any one of claims 1-4. The computer processor executes the computer program to realize the following steps: The search key of the target data file is input by the query party; The corresponding row index is generated by the trusted third party according to the input search key and is fed back to the query party; The row index is encrypted by the query party through the key and is sent to the data provider; The data provider performs operation on the encrypted row index and the database to obtain the corresponding ciphertext file and feeds back to the query party; The query party decrypts the ciphertext file to obtain the data file corresponding to the search key.
Citation Information
Patent Citations
Data hiding query security sharing system and method based on multi-party security computing
CN112367170A
Hidden query method and device, electronic equipment and storage medium
CN115905238A
Koji library cloud retrieval method based on searchable encryption
CN109582818A
Hidden query method and system based on homomorphic encryption, medium and equipment
CN115098515A