Two-stage anonymous trace query method and system, electronic equipment and computer readable medium

Through the two-stage stealth query method, the homomorphic calculation of index ciphertext and query key ciphertext is used to solve the high-performance computing problem of stealth query in key-value storage scenarios, reduce the transmission volume and execution complexity, and improve the practicality sex.

CN118606350APending Publication Date: 2024-09-06HANGZHOU FRAUDMETRIX TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410770663.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Existing invisible query technology is difficult to achieve high-performance computing in key-value storage scenarios, with large transmission volume, high execution complexity, and low practicality.

Method used

The two-stage stealth query method is used to perform homomorphic calculations on the server through the index ciphertext and query key ciphertext to obtain the query index and query value, reduce the transmission volume, simplify the execution complexity, and improve the practicality.

Benefits of technology

High-performance computing is implemented in key-value storage scenarios, reducing transmission volume and execution complexity, and improving the practicality of index-based queries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118606350A
    Figure CN118606350A
Patent Text Reader

Abstract

The invention relates to a two-stage anonymous trace query method and system, electronic equipment and a computer readable medium, and relates to the technical field of computers. Wherein the server side comprises an index key set and a key value set, each original index in the index key set corresponds to at least one original key, each original key in the key value set corresponds to one original value, and the server side provides the original indexes for the client side; the client constructs an index ciphertext and provides the index ciphertext for the server, the server performs homomorphic calculation in an index key set based on the index ciphertext to obtain a first query result, and the client determines a query key based on the first query result and provides a query key ciphertext for the server through OPRF calculation; and the server performs homomorphic calculation in the key value set based on the query key ciphertext to obtain a second query result, and the client decrypts the second query result to obtain an original value corresponding to the query key. According to the method, the keyword required by key value query is obtained on the basis of index query, so that the query result corresponding to the keyword is indirectly obtained, and high-performance calculation is widely realized.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] Private Information Retrival (PIR) technology, also known as anonymous query, is one of the key technologies in the field of privacy computing. After the client submits a query request to the server, the server can only know that the query has arrived but not the specific query conditions, and provide the client with the corresponding query results, thereby avoiding the leakage of the client's privacy information to the server.

[0003] Currently, anonymous queries can be performed through indexes. The client needs to know in advance the information about the index corresponding to the feature data to be queried on the server side, and then extract it based on the index. Alternatively, the query can be based on keywords. The server usually stores keywords and corresponding feature data in key-value format, so that the client can query the feature data based on the keywords.

[0004] Generally speaking, query solutions based on indexes reduce transmission volume, resulting in low execution complexity and low communication overhead. However, key-value storage solutions have more usage scenarios in business, which makes index-based query solutions less practical and difficult to widely implement high-performance computing. Summary of the invention

[0005] The purpose of the present disclosure is to provide a two-stage anonymous query method, a two-stage anonymous query system, an electronic device and a computer-readable medium. The method can obtain the keywords required for the key-value query on the basis of the index query, so as to be widely adapted to the key-value storage scenarios, and improve the practicality of the index-based query on the basis of reducing the transmission volume and simplifying the execution complexity to reduce the communication overhead, so as to widely realize high-performance computing.

[0006] According to the first aspect of the present disclosure, a two-stage stealth query method is provided, which can be applied to a server, and the method may include: the server includes an index key set and a key value set, each original index in the index key set corresponds to at least one original key, and each original key in the key value set corresponds to an original value, and the method may include: receiving an index ciphertext provided by a client, the index ciphertext is constructed based on a query index, and the query index is confirmed by the client in the original index provided by the server; performing homomorphic calculation in the index key set based on the index ciphertext to obtain a first query result in ciphertext form, and providing the first query result to the client, the first query result includes the original key corresponding to the query index; performing an oblivious pseudo-random function OPRF calculation with the client based on the query key to obtain a query key ciphertext provided by the client, and the query key is confirmed by the client in the original key corresponding to the query index; performing homomorphic calculation in the key value set based on the query key ciphertext to obtain a second query result in ciphertext form, and providing the second query result to the client, so that the client decrypts the second query result to obtain the original value corresponding to the query key.

[0007] Optionally, the index key set represents all original values ​​in the form of a first matrix, and the first matrix is ​​represented as a hypercube whose total dimensions include a first dimension and a plurality of second dimensions.

[0008] Optionally, homomorphic calculation is performed in the index key set based on the index ciphertext to obtain a first query result in ciphertext form, including: converting the index ciphertext to obtain a second matrix of the first dimension and a ciphertext set in which the number of elements in the set corresponds to the second dimension; the index ciphertext is obtained by the client representing the query index as a query vector, and the query vector is used to indicate the index position corresponding to the query index in the first matrix; performing a dot product calculation on the second matrix and the first matrix to obtain a ciphertext submatrix of the index key set in the first dimension; performing an outer product calculation on the ciphertext submatrix and the ciphertext set in the second dimension to obtain the first query result.

[0009] Optionally, the key-value set is represented in the form of an intersection polynomial and a label polynomial.

[0010] Optionally, a homomorphic calculation is performed on the key value set based on the query key ciphertext to obtain a second query result in ciphertext form, including: substituting the query key ciphertext into the intersection polynomial and the label polynomial to obtain the intersection calculation result and the label calculation result in ciphertext form; providing the intersection calculation result and the label calculation result as the second query result to the client, so that the client determines the intersection of the query key in the original key based on the intersection calculation result, and determines the original value corresponding to the intersection based on the label calculation result.

[0011] According to the second aspect of the present disclosure, another two-stage stealth query method is provided, which can be applied to a client. The method may include: confirming a query index in an original index provided by a server, and constructing an index ciphertext based on the query index to provide the index ciphertext to the server, the server including an index key set and a key value set, each original index in the index key set corresponds to at least one original key, and each original key in the key value set corresponds to an original value; obtaining a first query result provided by the server, the first query result is obtained by the server through homomorphic calculation in the index key set based on the index ciphertext; determining a query key based on the original key corresponding to the query index included in the first query result, and performing an oblivious pseudo-random function OPRF calculation with the server based on the query key to provide the query key ciphertext to the server; obtaining a second query result in ciphertext form provided by the server, and decrypting the second query result to obtain the original value corresponding to the query key, the second query result is obtained by the server through homomorphic calculation in the key value set based on the query key ciphertext.

[0012] Optionally, an oblivious pseudo-random function OPRF calculation is performed with the server based on the query key to provide a query key ciphertext to the server, including: performing OPRF processing with the server based on the query key to obtain a first pseudo-random value; splitting the first pseudo-random value to obtain a second pseudo-random value corresponding to the query key, and a value key indexed by the key value, the value key being used by the client to decrypt the second query result; performing homomorphic encryption on the second pseudo-random value to obtain a query key ciphertext; and providing the query key ciphertext to the server.

[0013] According to a third aspect of the present disclosure, a two-stage stealth query system is provided, which may include a client and a server, wherein the server includes an index key set and a key value set, wherein each original index in the index key set corresponds to at least one original key, and each original key in the key value set corresponds to an original value, wherein the client may include: an index ciphertext construction module, which is used to confirm a query index in an original index provided by the server, and to construct an index ciphertext based on the query index, so as to provide the index ciphertext to the server; a first query result receiving module, which is used to obtain a first query result provided by the server, and the first query result is obtained by the server in homomorphic calculation in the index key set based on the index ciphertext; a query key ciphertext construction module, which is used to determine a query key based on an original key corresponding to the query index included in the first query result, and to perform an oblivious pseudo-random function OPRF calculation with the client based on the query key, so as to provide the query key ciphertext to the server; a second query result receiving module, which is used to obtain a second query result in ciphertext form provided by the server, and to decrypt the second query result to obtain the original value corresponding to the query key, and the second query result is obtained by the server in homomorphic calculation in the key value set based on the query key ciphertext;

[0014] The server may include: an index ciphertext receiving module, which is used to receive an index ciphertext provided by a client, the index ciphertext is constructed based on a query index, and the query index is confirmed by the client in an original index provided by the server; a first query result calculation module, which is used to perform homomorphic calculation in an index key set based on the index ciphertext, obtain a first query result in ciphertext form, and provide the first query result to the client, the first query result includes an original key corresponding to the query index; a query key ciphertext receiving module, which is used to perform an oblivious pseudo-random function OPRF calculation with the client based on the query key, obtain a query key ciphertext provided by the client, and the query key is confirmed by the client in an original key corresponding to the query index; a second query result calculation module, which is used to perform homomorphic calculation in a key value set based on the query key ciphertext, obtain a second query result in ciphertext form, and provide the second query result to the client, so that the client decrypts the second query result to obtain the original value corresponding to the query key.

[0015] Optionally, the index key set represents all original values ​​in the form of a first matrix, and the first matrix is ​​represented as a hypercube whose total dimensions include a first dimension and a plurality of second dimensions.

[0016] Optionally, the first query result calculation module is specifically used to convert the index ciphertext to obtain a second matrix of the first dimension and a ciphertext set in which the number of elements in the set corresponds to the second dimension; the index ciphertext is obtained by the client representing the query index as a query vector, and the query vector is used to indicate the index position corresponding to the query index in the first matrix; the second matrix is ​​dotted with the first matrix to obtain a ciphertext submatrix of the index key set in the first dimension; the outer product of the ciphertext submatrix and the ciphertext set in the second dimension is performed to obtain the first query result.

[0017] Optionally, the key-value set is represented in the form of an intersection polynomial and a label polynomial.

[0018] Optionally, the second query result calculation module is specifically used to substitute the query key ciphertext into the intersection polynomial and the label polynomial to obtain the intersection calculation result and the label calculation result in ciphertext form; and provide the intersection calculation result and the label calculation result as the second query result to the client, so that the client determines the intersection of the query key in the original key based on the intersection calculation result, and determines the original value corresponding to the intersection based on the label calculation result.

[0019] Optionally, a query key ciphertext construction module is specifically used to perform OPRF processing based on the query key with the server to obtain a first pseudo-random value; split the first pseudo-random value to obtain a second pseudo-random value corresponding to the query key, and a value key indexed by the key value, the value key is used by the client to decrypt the second query result; perform homomorphic encryption on the second pseudo-random value to obtain a query key ciphertext; and provide the query key ciphertext to the server.

[0020] According to a fourth aspect of the present disclosure, there is provided an electronic device, including:

[0021] Processor; and

[0022] a memory for storing a computer program for the processor;

[0023] Among them, the processor is configured to implement the above-mentioned two-stage anonymous query method such as the first aspect and the two-stage anonymous query method of the second aspect by executing a computer program.

[0024] According to a fifth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the two-stage anonymous query method of the first aspect and the two-stage anonymous query method of the second aspect are implemented.

[0025] According to a sixth aspect of the present disclosure, a computer program product is provided, which, when executed on an electronic device, enables the electronic device to execute the two-stage anonymous query method of the first aspect and the two-stage anonymous query method of the second aspect.

[0026] The two-stage anonymous query method provided by the present disclosure includes an index key set and a key value set, each original index in the index key set corresponds to at least one original key, each original key in the key value set corresponds to an original value, and the server provides the original index to the client; when the client performs a query on the original value, it can first confirm the query index in the original index and construct an index ciphertext to provide to the server, the server performs homomorphic calculation in the index key set based on the index ciphertext, obtains the first query result in ciphertext form, and provides the original key corresponding to the query index to the client based on the first query result, the client determines the query key based on this and provides the query key ciphertext to the server through OPRF calculation, the server performs homomorphic calculation in the key value set based on the query key ciphertext, to provide the second query result in ciphertext form to the client, so that the client decrypts the second query result to obtain the original value corresponding to the query key. The method can obtain the keywords required for the key value query on the basis of the index query, thereby indirectly obtaining the query result corresponding to the keyword, so as to widely adapt to the key value storage scenario, and on the basis of reducing the transmission volume and simplifying the execution complexity to reduce the communication overhead, improve the practicality of the query based on the index, and widely realize high-performance computing.

[0027] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0029] Figure 1 This is one of the step flow charts of a two-stage anonymous query method provided in an embodiment of the present disclosure.

[0030] Figure 2 This is a second step flow chart of a two-stage anonymous query method provided in an embodiment of the present disclosure.

[0031] Figure 3 A flowchart of the steps of another two-stage anonymous query method provided in an embodiment of the present disclosure.

[0032] Figure 4 Schematic diagram of the process of the two-stage anonymous query method in the e-commerce scenario in the embodiment of the present disclosure.

[0033] Figure 5 A structural block diagram of a two-stage anonymous query system provided in an embodiment of the present disclosure.

[0034] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0035] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0036] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0037] It should be noted that the data obtained in this disclosure are accessed, collected, stored and used for subsequent analysis and processing with the consent and authorization of the users or the parties to whom the relevant data belong, after the users or the parties to whom the relevant data belong are clearly informed of the data collection content, data purpose, processing method and other information. The users or the parties to whom the relevant data belong may be sent the ways to access, correct and delete the data, as well as the methods to revoke consent and authorization.

[0038] Figure 1 One of the step flow charts of a two-stage anonymous query method provided in an embodiment of the present disclosure, the method can be applied to a server, the server includes an index key set and a key value set, each original index in the index key set corresponds to at least one original key, and each original key in the key value set corresponds to an original value.

[0039] In the disclosed embodiment, based on the agreement of anonymous query service execution, the server may include an index key set, a key value set, etc. The index key set is stored in a structure of mapping relationship between original index and original key. Each original index may correspond to one or more original keys. According to the requirements of data storage, business needs, and retrieval conditions, the original keys corresponding to different original indexes may or may not overlap; and the key value set is stored in a structure of mapping relationship between original key and original value. Each original key corresponds to an original value. On this basis, the server can provide the client with a query service that determines the query key based on index positioning, and obtains the corresponding original value based on query key matching. The server provides the client with a two-stage anonymous query method based on keywords, and its step flow can be shown as follows: Steps 101 to 104:

[0040] Step 101: Receive an index ciphertext provided by a client, where the index ciphertext is constructed based on a query index, and the query index is confirmed by the client in an original index provided by a server.

[0041] In the disclosed embodiment, the server can provide the original index to the client so that it can locate the corresponding original key when performing an original value query. The server can provide the original index to the client in the form of a map file to represent the association between the original index and the specific query service based on the mapping relationship. For example, each original index can correspond to a query range or filter condition. For example, in the scenario of electric field transactions, different query ranges can be distinguished by commodity category, then each original index can correspond to a commodity category, and the corresponding relationship is recorded by the mapping file.

[0042] In the disclosed embodiment, in a query, the client can determine the corresponding original index based on the commodity category to which the commodity to be retrieved by the query service belongs, and use the original index as the query index. On this basis, the client can construct the corresponding index ciphertext based on the query index and provide it to the server. The server can determine to start the second-stage anonymous query based on the obtained index ciphertext. At this time, the query process of determining the query key based on the index ciphertext in the first stage can be triggered based on the index ciphertext.

[0043] Step 102: Perform homomorphic computation in the index key set based on the index ciphertext to obtain a first query result in ciphertext form, and provide the first query result to the client, where the first query result includes the original key corresponding to the query index.

[0044] In the disclosed embodiment, the server can perform homomorphic calculations in the index key set based on the index ciphertext, and can obtain the ciphertext including the original key corresponding to the query index as the first query result. This process can be regarded as a stealth query on the original key based on the query index. Those skilled in the art can adopt similar index-based stealth query algorithms, such as homomorphic encryption, to obtain the first query result in ciphertext form. Furthermore, the server can provide the first query result to the client, and the client can determine the original key corresponding to its query index based on the decryption of the first query result, so as to perform key-value queries in the key-value set based on the original key later.

[0045] Step 103: perform an oblivious pseudo-random function OPRF calculation with the client based on the query key to obtain the query key ciphertext provided by the client, where the query key is confirmed by the client in the original key corresponding to the query index.

[0046] In the disclosed embodiment, when the client determines the original key corresponding to the query index, it can determine one or more query keys in the original key based on the actual query requirements. At this time, the server can perform OPRF calculations with the client based on the query key based on the client's request. Among them, the server may hold the OPRF key of the pseudo-random function, and the client may hold the query key. Through the OPRF calculation of both parties, the client obtains the pseudo-random value of the query key based on the pseudo-random function; further, in order to support subsequent homomorphic calculations, the client can encrypt the pseudo-random value to determine the query key ciphertext. On the basis of obtaining the query key ciphertext, the server can perform the second stage of the subsequent anonymous query and determine the homomorphic calculation of the original value based on the query key.

[0047] Step 104: Perform homomorphic computation in the key value set based on the query key ciphertext to obtain a second query result in ciphertext form, and provide the second query result to the client, so that the client decrypts the second query result to obtain the original value corresponding to the query key.

[0048] In the disclosed embodiment, the server can perform homomorphic computation in the key-value set based on the query key ciphertext. This process can be regarded as a stealth query of the original value based on the query key. Those skilled in the art can use a similar keyword-based stealth query algorithm, such as homomorphic encryption, interpolation polynomials, etc., to obtain a second query result in ciphertext form. The second query result includes the original value query result corresponding to the query key in the key-value set, so that the client can obtain the required original value by decryption.

[0049] Figure 2 The second step flow chart of a two-stage anonymous query method provided by the embodiment of the present disclosure is applied to a server. The server includes an index key set and a key value set, in which each original index in the index key set corresponds to at least one original key, and in the key value set, each original key corresponds to an original value.

[0050] In the embodiment of the present disclosure, the server can refer to the aforementioned Figure 1 To avoid repetition, the related description will not be repeated here.

[0051] In an optional method embodiment of the present disclosure, in order to improve the response speed of anonymous queries to the second or millisecond level, the server can also shard the stored data, and divide the stored data into multiple shards based on indistinguishability and sharding rules, so that the amount of data in each shard is within the range limited by indistinguishability. Preprocessing and query calculations for stored data can be performed in each shard. Among them, the index key set does not need to be sharded due to its limited size; the key value set needs to be sharded because of the one-to-one storage of key values ​​and the large scale, but the sharding rules cannot express the relationship between the original index and the original key, so as to reduce the risk of the client exposing the query range. Therefore, data sharding rules such as hash modulus can be used for sharding.

[0052] For example, the index-keys database stores index key sets. One index corresponds to multiple keys, and multiple keys are connected by separators, such as ",". Each index-keys pair is a piece of data. The database has a limited scale, so sharding is not performed.

[0053] The key-value database stores key-value sets, where one key corresponds to one value. The database is large in size, so it is sharded using the hash modulus method.

[0054] In the disclosed embodiment, on the basis that the server includes an index key set and a key value set, in order to implement the actual two-stage anonymous query process, the server can support synchronizing public parameters to the client that queries locally. The public parameters can include two sets of algorithms corresponding to the first stage and the second stage, respectively, to support the communication negotiation of encryption and decryption between the server and the client. For example, the public parameters can include hash functions, polynomial powers, etc. When selecting the public parameters, they can be selected based on the security parameter λ, the indistinguishability N, etc., and multiple anonymous queries can be performed based on the determination of the public parameters.

[0055] In an optional method embodiment of the present disclosure, the index key set represents all original values ​​in the form of a first matrix, and the first matrix is ​​represented as a hypercube whose total dimensions include a first dimension and multiple second dimensions.

[0056] In the disclosed embodiment, the first-stage anonymous query can be regarded as an anonymous query of the original key based on the query index, and the server can pre-process the index key set based on the adopted algorithm. In order to reduce the length of the request during the query process, thereby reducing the amount of data transmission, reducing transmission overhead and improving query efficiency, the index key set can be compiled into a multi-dimensional index, and each original key in the index key set is encoded in sequence to construct a high-dimensional first matrix, and the first matrix can be complemented and represented as a hypercube. On this basis, assuming that the index key set includes n original keys, when the index key set is constructed as a one-dimensional index, the client needs to send a query vector of length n in the query, and perform a binary operation of 0 and 1 on the n bits of the query vector to indicate the query position, and when it is constructed as a d-dimensional first matrix, the client can send d when querying. Long query vector, that is, the query vector length of each dimension is It can be seen that the dimension of the first matrix affects the requirements for computing power and transmission overhead, and can be set based on actual needs.

[0057] Furthermore, the first matrix can be represented as a hypercube whose total dimension includes a first dimension and multiple second dimensions, wherein the first dimension can include two or more single dimensions, and the division of the first dimension and the second dimension can be used to distinguish the parts of calculation undertaken by different encryption algorithms in the subsequent two-stage anonymous query. For example, the Regev-GSW encryption algorithm can be used to calculate the first dimension and the second dimension parts respectively in the anonymous query, thereby taking into account the high calculation rate of the Regev encryption algorithm and the asymmetric noise growth characteristics of the GSW encryption algorithm, so that the two-stage anonymous query can be calculated efficiently.

[0058] For example, based on {(index, keys)}, a d-dimensional first matrix DB representing all original keys is constructed. hyper , the DB hyper It can be expressed as

[0059] Among them, d includes the first dimension v1, and v2 second dimensions.

[0060] When the index key set includes N original keys, it can be expressed as Therefore, when the client queries the server, it can send d length The query vector of is calculated without constructing a query vector of length N.

[0061] Assuming N = 16, the first matrix DB hyper It can be expressed as 2 2×2×2, where d includes the first dimension v1=2 and v2=2 second dimensions. The client can indicate the position of the required query vector through 4 query vectors of length 2, and set the query position to 1 and other positions to 0 in each query vector.

[0062] Based on this, the first stage of the two-stage anonymous query may include the following steps 201 to 204:

[0063] Step 201: Receive an index ciphertext provided by a client, where the index ciphertext is constructed based on a query index, and the query index is confirmed by the client in an original index provided by a server.

[0064] In the embodiment of the present disclosure, step 201 may correspond to the description of the aforementioned step 101, and will not be described again here to avoid repetition.

[0065] For example, the server synchronizes the index map file to the client offline. The index map file records the one-to-one mapping relationship between the product category and the original index. The client finds the corresponding original index in the index map file based on the product category to be retrieved as the query index idx query , and provide the server with the query index idx query The index ciphertext c after Regev encryption.

[0066] Step 202: convert the index ciphertext to obtain a second matrix of the first dimension and a ciphertext set whose number of elements in the set corresponds to the second dimension; the index ciphertext is obtained by the client representing the query index as a query vector, and the query vector is used to indicate the index position corresponding to the query index in the first matrix.

[0067] In an embodiment of the present disclosure, the index ciphertext is obtained by the client representing the query index as a query vector. The query vector can convert the query key index position indicated by the query index into the corresponding index position in the first matrix, such as the query index is identified in sequence, and it can be converted into a vector representing the corresponding dimension of the first matrix. In an optional method embodiment of the present disclosure, the query vector can be encrypted and compressed into a scalar index ciphertext by the client, and the server can expand it after receiving the index ciphertext to obtain a second matrix of the first dimension, and a ciphertext set whose number of elements in the set corresponds to the second dimension.

[0068] For example, the server performs the Regev-to-GSW expansion algorithm on the index ciphertext c and converts c into the second matrix C on the first dimension. Reg , C Reg It can be expressed as And the number of elements in the set corresponds to the ciphertext set C of the second dimension v2 GSW , C GSWIncludes v2 GSW ciphertexts. C Reg , and each GSW ciphertext includes a 1 indicating the query position and a 0 at other positions.

[0069] Step 203: perform a dot product calculation on the second matrix and the first matrix to obtain a ciphertext submatrix of the index key set in the first dimension.

[0070] In the embodiment of the present disclosure, the first matrix represents the distribution of all original values ​​of the index key set in the server database in the total dimension. In the calculation process, the second matrix of the first dimension can be firstly multiplied with the original value of the first matrix in the corresponding second matrix to obtain the ciphertext submatrix of the ciphertext distributed in the first dimension.

[0071] For example, the server will C Reg With DB hyper Perform point multiplication to obtain the corresponding ciphertext submatrix DB on the v1 dimension i .

[0072] Step 204: perform outer product calculation on the ciphertext submatrix and the ciphertext set in the second dimension to obtain a first query result.

[0073] Furthermore, the outer product of the ciphertext submatrix in the other dimension, that is, the second dimension, and each ciphertext in the ciphertext set corresponding to the second dimension can be calculated, so that each ciphertext in the ciphertext set can be used to select a binary operation in each second dimension. Since the original value corresponding to the second dimension has been accumulated to the ciphertext of the first dimension, this process actually eliminates the dimension, which is equivalent to folding the ciphertext submatrix, and only outputs the ciphertext of the original key corresponding to the query index as the first query result.

[0074] For example, the server calculates the DB + and C GSW The Regev-GSW outer product of v2 GSW ciphertexts is used to perform corresponding two-choice operations on v2 second dimensions in sequence to obtain the first query result.

[0075] On this basis, the server can provide the first query result to the client, so that the client can decrypt the first query result and obtain the original key that meets the query range or filtering condition. The query process does not need to transmit all encrypted feature data during transmission, which effectively reduces the amount of information communication. Furthermore, when the obtained original key contains the keyword required by the client for the second stage retrieval, a subsequent key value query can be further performed, otherwise the anonymous query can be terminated.

[0076] For example, based on the first query result, the client obtains a list of product IDs under the product category. The ID can be constructed according to the specific e-commerce business, and can be "product number + product name" as the unique identifier of the product. When there is an item in the product ID list whose detailed information the client needs to further retrieve, a subsequent key value query can be performed; otherwise, the anonymous query can be terminated.

[0077] In an optional method embodiment of the present disclosure, the key-value set is represented in the form of an intersection polynomial and a label polynomial.

[0078] In the disclosed embodiment, the second-stage anonymous query can be regarded as an anonymous query based on the query key for the original key, and the server can pre-process the key-value set based on the adopted algorithm. For example, when homomorphic encryption is used to implement the two-stage anonymous query, the intersection of the query key and the original key can be determined by the intersection of the privacy set, and then the original value corresponding to the query key can be determined based on the intersection. On this basis, the server can construct an intersection polynomial and a label polynomial based on the key-value set, wherein the intersection polynomial can be generated based on the original key, and is used to determine whether there is an intersection between the query key and the original key. When the query key matches the original key, the evaluation result of the corresponding polynomial is 0, otherwise the evaluation result is not 0 or a random value; the label polynomial can be generated based on the corresponding relationship between the original key and the original value, and is used to determine whether there is a corresponding original value for the query key. When the query key has a corresponding original value, the evaluation result of the corresponding polynomial is the original value, otherwise the evaluation result is not 0 or a random value.

[0079] In the disclosed embodiment, the polynomial calculation can be implemented based on the homomorphic calculation of ciphertext and plaintext multiplication. The client provides the query key ciphertext, and the server performs homomorphic calculation on the intersection polynomial and label polynomial of the query key ciphertext and plaintext to complete the two-stage anonymous query in the encrypted space and provide the client with the second query result in the form of ciphertext. The two-stage anonymous query can select a homomorphic encryption algorithm that can realize the homomorphic calculation of ciphertext and plaintext multiplication according to the needs.

[0080] In the embodiment of the present disclosure, the step flow of expressing the key-value set as an intersection polynomial and a label polynomial can be shown in the following steps A1 to A4:

[0081] Step A1: perform OPRF processing on the original key in the key value set to obtain a first pseudo-random value.

[0082] In the disclosed embodiment, in order to further protect the original data of the server, the original key can be OPRF processed to convert the original key into a pseudo-random value. The server processes the original key based on the key of the pseudo-random function to generate a corresponding random number sequence as the first pseudo-random value. The first pseudo-random values ​​generated by different original keys are different, and when the pseudo-random number sequence is generated based on the same pseudo-random function, the pseudo-random number sequence generated by the same input is the same, so that privacy comparison can be performed to determine the same or different values ​​without knowing the actual plaintext value.

[0083] For example, for the original key {k i} OPRF processing is performed using the random pseudo-random function OPRF(s,k i ) will {k i} is converted to a first pseudo-random value.

[0084] Step A2: Split the first pseudo-random value to obtain a second pseudo-random value corresponding to the original key and a value key of the original value.

[0085] Furthermore, based on the first pseudo-random value, the server can respectively extract the second pseudo-random value representing the original key and the value key used to encrypt the original value, such as splitting according to the byte length of the first pseudo-random value so that part of the bytes are used as the second pseudo-random value and the other part is used as the value key. Among them, based on the byte length of the first pseudo-random value, those skilled in the art can split according to actual computing power conditions and efficiency requirements, and the embodiments of the present disclosure do not impose specific restrictions on this.

[0086] For example, if the byte length of the first pseudo-random value is 32 bytes, it can be split and the first 16 bytes can be extracted as the second pseudo-random value k′ of the original key. i , and the last 16 sections are the value key label_key of the original value.

[0087] Step A3: Encrypt the original value based on the value key.

[0088] For example, the original value value is encrypted based on the value key label_key to obtain value′ i .

[0089] Step A4: insert the second pseudo-random value and the corresponding encrypted original value into the hash table, and calculate the coefficients of the intersection polynomial and the label polynomial at each position in the hash table to obtain a key value set represented by the intersection polynomial and the label polynomial.

[0090] In the disclosed embodiment, in order to reduce computing power and transmission overhead, the second pseudo-random value and the corresponding encrypted original value can be inserted into the hash table. Specifically, the hash index of each second pseudo-random value can be calculated based on the selected hash function, and the second pseudo-random value can be inserted into the corresponding bucket according to the hash index. The hash index corresponding to each bucket is recorded in the hash table, thereby realizing the insertion of the second pseudo-random value and the corresponding encrypted original value into the hash table. Each position in the hash table corresponds to a bucket, and the coefficients of the intersection polynomial and the label polynomial can be calculated respectively according to the second pseudo-random value inserted in the bucket. The obtained polynomial can be used as a key-value set as the key-value database of the second stage in the anonymous query process. Among them, the label polynomial adopts the correspondence between the original key and the encrypted original value for calculation.

[0091] For example, for each second pseudo-random value k′ i Perform hash h(k′ i ), and according to the calculation results, (k i ,value i ) is inserted into the bucket at the corresponding position in the hash table so that each bucket contains one or more data.

[0092] On this basis, for each position j in the hash table, the intersection polynomial M(x) is calculated, as shown in the following formula (1):

[0093]

[0094] And, calculate the label polynomial L(x) so that it satisfies the following formula (2):

[0095]

[0096] In the above formulas (1) and (2), x is the independent variable of the polynomial, r is + is a random plaintext element, B Q is the set of second pseudo-random values ​​inserted at position j in the hash table, L(x) is calculated according to {(k′ i ,value′ i )}(k′ i ∈B j ) is the Newton interpolation polynomial calculated using .

[0097] In an optional method embodiment of the present disclosure, after calculating the coefficients of the intersection polynomial and the label polynomial in the hash table, SIMD (Single Instruction Multiple Data) can be used for packaging to support parallel processing in subsequent calculations, so as to improve the computational efficiency in the one-stage anonymous query process.

[0098] Based on this, the second stage of the two-stage anonymous query may include the following steps 205 to 207:

[0099] Step 205: perform an oblivious pseudo-random function OPRF calculation with the client based on the query key to obtain the query key ciphertext provided by the client, and the query key is confirmed by the client in the original key corresponding to the query index.

[0100] In the embodiment of the present disclosure, step 205 may correspond to the relevant description of the aforementioned step 103, and will not be described again here to avoid repetition.

[0101] In the embodiment of the present disclosure, referring to the related description of the aforementioned steps A1 to A4, the query key may be processed accordingly on the client, which will not be described again to avoid repetition.

[0102] For example, the client determines the query key k in the original key corresponding to the query index query For example, the server can receive the client based on k query The OPRF request initiated determines the representation k according to the calculation result query The pseudo-random value is decrypted with the value key label_key of the original value, the k query The pseudo-random value is encrypted to obtain the query key ciphertext [k′ query ] Provided to the server, the polynomial power of the pseudo-random value encrypted by the client is agreed upon in the public parameters.

[0103] Step 206: Substitute the query key ciphertext into the intersection polynomial and the label polynomial to obtain the intersection calculation result and the label calculation result in ciphertext form.

[0104] In the disclosed embodiment, the server performs homomorphic calculations on the intersection polynomial and the label polynomial based on the obtained query key ciphertext, wherein the intersection calculation result in ciphertext form can represent the intersection of the query key and the original key, and the label calculation result can include the encrypted original value hit by the query key.

[0105] Step 207: Provide the intersection calculation result and the label calculation result as the second query result to the client, so that the client determines the intersection of the query key and the original key based on the intersection calculation result, and determines the original value corresponding to the intersection based on the label calculation result.

[0106] In the disclosed embodiment, the server can provide the intersection calculation result and the label calculation result in ciphertext form to the client as the second query result. The client can decrypt based on the intersection calculation result, and determine the original key of the corresponding position hit by the query key when the intersection polynomial result is 0. Then, the multi-label calculation result outputs the encrypted original value of the corresponding position, and the client decrypts it based on the aforementioned value key to determine the original value in plaintext corresponding to the intersection.

[0107] The two-stage anonymous query method provided by the present disclosure includes an index key set and a key value set, each original index in the index key set corresponds to at least one original key, each original key in the key value set corresponds to an original value, and the server provides the original index to the client; when the client performs a query on the original value, it can first confirm the query index in the original index and construct an index ciphertext to provide to the server, the server performs homomorphic calculation in the index key set based on the index ciphertext, obtains the first query result in ciphertext form, and provides the original key corresponding to the query index to the client based on the first query result, the client determines the query key based on this and provides the query key ciphertext to the server through OPRF calculation, the server performs homomorphic calculation in the key value set based on the query key ciphertext, to provide the second query result in ciphertext form to the client, so that the client decrypts the second query result to obtain the original value corresponding to the query key. The method can obtain the keywords required for the key value query on the basis of the index query, thereby indirectly obtaining the query result corresponding to the keyword, so as to widely adapt to the key value storage scenario, and on the basis of reducing the transmission volume and simplifying the execution complexity to reduce the communication overhead, improve the practicality of the query based on the index, and widely realize high-performance computing.

[0108] Figure 3 This is a flowchart of another two-stage anonymous query method provided by the embodiment of the present disclosure, which can be applied to the client. The server can execute the above Figures 1 to 2 Any two-stage anonymous query method can be used to cooperate with the client. Specifically, the step flow of the method on the client side can include the following steps 301 to 304.

[0109] Step 301: confirm the query index in the original index provided by the server, and build an index ciphertext based on the query index to provide the index ciphertext to the server. The server includes an index key set and a key value set. In the index key set, each original index corresponds to at least one original key, and in the key value set, each original key corresponds to an original value.

[0110] In the embodiment of the present disclosure, step 301 may correspond to the relevant description of the aforementioned steps 101 and 201, and will not be described again here to avoid repetition.

[0111] When the client provides the index ciphertext to the server, it can use the query index idx qyery It is represented as a query vector, which is used to indicate the position of the original key corresponding to the query index in the first matrix of the hypercube. In the d-dimensional first matrix, each single dimension can be represented by The length of the vector representation is that the position corresponding to the query position in each single dimension is set to 1, and the other positions are set to 0. Furthermore, in order to cooperate with the subsequent server-side Regev-GSW algorithm, the query vector is represented as two parts: the first dimension and multiple second dimensions. Depending on the computing power requirements, the first dimension can include multiple single dimensions, and the second dimension includes one single dimension, but the second dimension can be multiple.

[0112] After determining the query vector, the client can encrypt the query vector into a scalar to reduce its communication volume and further improve its data information transmission sales. The server can expand the ciphertext scalar into a ciphertext matrix in the first dimension by executing the conversion algorithm of the ciphertext scalar, and obtain the ciphertext set of each vector corresponding to the second dimension.

[0113] For example, the client will idx qyery Represented as query vector Among them, i is in the first dimension v1, Each position is filled with {0,1} or one of them; In the v1 second dimension, the two positions in each dimension are filled with {0,1}.

[0114] Specifically, the first matrix is ​​represented as 2 2 ×2×2 as an example, when the query index is represented as a query vector, it can be 4 vectors of length 2 (1,0), (0,0), (0,1), (0,1), then i=(1,0,0,0), j1=(0,1), j2=(0,1), thus obtaining the query vector (i,j1,j2).

[0115] Furthermore, the client The Regev encryption algorithm is used to calculate the index ciphertext c in scalar form.

[0116] Step 302: Obtain a first query result provided by the server, where the first query result is obtained by the server through homomorphic calculation in the index key set based on the index ciphertext.

[0117] Among them, referring to the aforementioned Figure 1 to Figure 2 In any of the first-stage anonymous query methods on the server side, the original key points to the original index and the original value in the index key set and key value set of the server, respectively.

[0118] In the embodiment of the present disclosure, corresponding to the aforementioned server, the second matrix C Reg represents i in the query vector, the ciphertext set C GSW Represents the query vector The GSW ciphertext corresponds to each j. After obtaining the first query result provided by the server, the client performs decryption based on the aforementioned encryption algorithm to obtain the original key corresponding to the query index.

[0119] Step 303: determine a query key based on the original key corresponding to the query index included in the first query result, and perform an oblivious pseudo-random function OPRF calculation based on the query key with the server to provide the query key ciphertext to the server.

[0120] In the disclosed embodiment, based on the original key corresponding to the query index obtained based on the first query result, the query key applied to the second stage can be determined from the original key according to the actual retrieval requirements.

[0121] In an optional method embodiment of the present disclosure, referring to the processing of the key-value set by the server in steps A1 to A4, step 303 may include the following steps B1 to B4.

[0122] Step B1: Perform OPRF processing with the server based on the query key to obtain a first pseudo-random value.

[0123] For example, the client queries with key k query Initiate an OPRF request to the server and obtain the first pseudo-random value OPRF(s,k) based on the pseudo-random function held by the server query ).

[0124] Step B2: Split the first pseudo-random value to obtain a second pseudo-random value corresponding to the query key and a value key indexed by the key value, where the value key is used by the client to decrypt the second query result.

[0125] For example, the client has a 32-bit OPRF (s, k query ) is split, the first 16 bits are used as the fourth pseudo-random value corresponding to the query key, and the last 16 bits are used as the value key label_key of the key value index.

[0126] Step B3: Perform homomorphic encryption on the second pseudo-random value to obtain a query key ciphertext.

[0127] For example, the client has k′ query The BFV encryption algorithm is used to generate homomorphic public and private keys for encryption, and the polynomial power calculation based on the public parameter agreement is performed. That is, the client can calculate the homomorphic ciphertext of all powers to obtain the query key ciphertext [k′ query ].

[0128] Furthermore, the client can also query ]Hash h(k′ query), and use SIMD to pack after inserting into the hash table so that the server can support parallel homomorphic computing.

[0129] Step B4: Provide the query key ciphertext to the server.

[0130] For example, the client can query ] is sent to the server.

[0131] Step 304: Obtain a second query result in ciphertext form provided by the server, and decrypt the second query result to obtain the original value corresponding to the query key. The second query result is obtained by the server by performing homomorphic calculation in the key value set based on the query key ciphertext.

[0132] For example, the client decrypts the second query result based on the homomorphic encryption algorithm to obtain M(k′ query )=0, then use label_key to decrypt L(k′ query )=value query , get the query key k query The corresponding original value query .

[0133] The two-stage anonymous query method provided by the present disclosure includes an index key set and a key value set, each original index in the index key set corresponds to at least one original key, each original key in the key value set corresponds to an original value, and the server provides the original index to the client; when the client performs a query on the original value, it can first confirm the query index in the original index and construct an index ciphertext to provide to the server, the server performs homomorphic calculation in the index key set based on the index ciphertext, obtains the first query result in ciphertext form, and provides the original key corresponding to the query index to the client based on the first query result, the client determines the query key based on this and provides the query key ciphertext to the server through OPRF calculation, the server performs homomorphic calculation in the key value set based on the query key ciphertext, to provide the second query result in ciphertext form to the client, so that the client decrypts the second query result to obtain the original value corresponding to the query key. The method can obtain the keywords required for the key value query on the basis of the index query, thereby indirectly obtaining the query result corresponding to the keyword, so as to widely adapt to the key value storage scenario, and on the basis of reducing the transmission volume and simplifying the execution complexity to reduce the communication overhead, improve the practicality of the query based on the index, and widely realize high-performance computing.

[0134] Figure 4 A schematic diagram of the process of the two-stage anonymous query method in the e-commerce scenario in the embodiment of the present disclosure is disclosed, such as Figure 4As shown, the client stores an index map, where the commodity category "bags" corresponds to the original index "0", the commodity category "books" corresponds to the original index "1", and the commodity category "daily necessities" corresponds to the original index "2". The server stores an index key set (index keys DB), where the original index "0" corresponds to "BG001 backpack, BG002 tote bag, ...", the original index "1" corresponds to "BK001 machine learning, BK002 statistics, ...", the original index "2" corresponds to "LF001 tissue paper, LF002 doll, ...", and the server also stores a key value set (key value DB), which is divided into three shards after sharding. The illustrated key value set shard 1 includes the original key "BK001 machine learning" corresponding to the original value "the price of "Basics of Machine Learning" is 50 yuan", "the price of "large bear doll" is 100 yuan", etc.; the key value set shard 2 includes the original key "BK002 statistics" corresponding to the original value "the price of "Principles of Statistics" is 60 yuan", "the price of "small package tissue paper" is 5 yuan", etc.; the key value set shard 3 is not specifically illustrated, and in actual applications, the data can be sharded according to actual needs.

[0135] The method may include the following steps 401 to 407:

[0136] Step 401: The client determines the query index as "1" in the index mapping according to the retrieval requirement.

[0137] Step 402: The client constructs an index ciphertext based on the query index "1" and provides it to the server.

[0138] Step 403: The server performs homomorphic computation in the index key set based on the index ciphertext, and returns the first query result to the client, including the original key "BK001 machine learning, BK002 statistics, ..." corresponding to the query index "1".

[0139] Step 404: The client determines the query key “BK002 Statistics” from the original keys “BK001 Machine Learning, BK002 Statistics, . . . ” according to the search requirements.

[0140] Step 405: The client performs OPRF calculation with the server based on the query key "BK002 Statistics", so that the server obtains the query key ciphertext.

[0141] Step 406: The server performs homomorphic computation on key-value set shard 2 based on the query key ciphertext, and returns a second query result to the client.

[0142] Step 407: The client decrypts the second query result and obtains the original value "Principles of Statistics price 60 yuan" corresponding to the query key "BK002 Statistics".

[0143] Similarly, the two-stage anonymous query method provided by the embodiment of the present disclosure can also be applied to medical, digital library and other information, and the original key obtained by the first stage retrieval can be exposed to the client.

[0144] Figure 5 A structural block diagram of a two-stage anonymous query system 500 is also provided. Figure 5 As shown, the system may include a client 510 and a server 520, the server 520 includes an index key set and a key value set, each original index in the index key set corresponds to at least one original key, and each original key in the key value set corresponds to an original value, wherein the client 510 may include: an index ciphertext construction module 511, used to confirm the query index in the original index provided by the server, and to construct an index ciphertext based on the query index to provide the index ciphertext to the server; a first query result receiving module 512, used to obtain a first query result provided by the server, the first query result is received by the server The server end obtains the query key by homomorphic calculation in the index key set based on the index ciphertext; the query key ciphertext construction module 513 is used to determine the query key based on the original key corresponding to the query index included in the first query result, and perform an oblivious pseudo-random function OPRF calculation with the server end based on the query key to provide the query key ciphertext to the server end; the second query result receiving module 514 is used to obtain the second query result in ciphertext form provided by the server end, and decrypt the second query result to obtain the original value corresponding to the query key, and the second query result is obtained by the server end by performing homomorphic calculation in the key value set based on the query key ciphertext;

[0145] The server 520 may include: an index ciphertext receiving module 521, which is used to receive an index ciphertext provided by a client, the index ciphertext is constructed based on a query index, and the query index is confirmed by the client in an original index provided by the server; a first query result calculation module 522, which is used to perform homomorphic calculation in an index key set based on the index ciphertext to obtain a first query result in ciphertext form, and provide the first query result to the client, the first query result including an original key corresponding to the query index; a query key ciphertext receiving module 523, which is used to perform an oblivious pseudo-random function OPRF calculation with the client based on the query key to obtain a query key ciphertext provided by the client, and the query key is confirmed by the client in an original key corresponding to the query index; a second query result calculation module 524, which is used to perform homomorphic calculation in a key value set based on the query key ciphertext to obtain a second query result in ciphertext form, and provide the second query result to the client, so that the client decrypts the second query result to obtain the original value corresponding to the query key.

[0146] In an optional system embodiment of the present disclosure, the index key set represents all original values ​​in the form of a first matrix, and the first matrix is ​​represented as a hypercube whose total dimensions include a first dimension and multiple second dimensions.

[0147] In an optional system embodiment of the present disclosure, the first query result calculation module 522 is specifically used to convert the index ciphertext to obtain a second matrix of the first dimension and a ciphertext set whose number of elements in the set corresponds to the second dimension; the index ciphertext is obtained by the client representing the query index as a query vector, and the query vector is used to indicate the index position corresponding to the query index in the first matrix; the second matrix is ​​dotted with the first matrix to obtain a ciphertext submatrix of the index key set in the first dimension; the outer product of the ciphertext submatrix and the ciphertext set in the second dimension is performed to obtain the first query result.

[0148] In an optional system embodiment of the present disclosure, the key-value set is represented in the form of an intersection polynomial and a label polynomial.

[0149] In an optional system embodiment of the present disclosure, the second query result calculation module 524 is specifically used to substitute the query key ciphertext into the intersection polynomial and the label polynomial to obtain the intersection calculation result and the label calculation result in ciphertext form; and provide the intersection calculation result and the label calculation result as the second query result to the client, so that the client determines the intersection of the query key in the original key based on the intersection calculation result, and determines the original value corresponding to the intersection based on the label calculation result.

[0150] In an optional system embodiment of the present disclosure, the query key ciphertext construction module 513 is specifically used to perform OPRF processing based on the query key with the server to obtain a first pseudo-random value; split the first pseudo-random value to obtain a second pseudo-random value corresponding to the query key, and a value key indexed by the key value, the value key is used by the client to decrypt the second query result; perform homomorphic encryption on the second pseudo-random value to obtain a query key ciphertext; and provide the query key ciphertext to the server.

[0151] The present disclosure provides a two-stage stealth query system and a two-stage stealth query method. The server includes an index key set and a key value set. Each original index in the index key set corresponds to at least one original key. Each original key in the key value set corresponds to an original value. The server provides the original index to the client. When the client queries the original value, it can first confirm the query index in the original index and construct an index ciphertext to provide to the server. The server performs homomorphic calculation in the index key set based on the index ciphertext to obtain a first query result in ciphertext form, and provides the client with the original key corresponding to the query index based on the first query result. The client determines the query key based on this and provides the query key ciphertext to the server through OPRF calculation. The server performs homomorphic calculation in the key value set based on the query key ciphertext to provide the client with a second query result in ciphertext form, so that the client decrypts the second query result to obtain the original value corresponding to the query key. This method can obtain the keywords required for key-value query on the basis of index query, thereby indirectly obtaining the query results corresponding to the keywords, so as to be widely adapted to key-value storage scenarios. On the basis of reducing the transmission volume and simplifying the execution complexity to reduce the communication overhead, it improves the practicality of index-based query and widely realizes high-performance computing.

[0152] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0153] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps 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, etc.

[0154] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0155] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.

[0156] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0157] Refer to the following Figure 6 The electronic device 600 according to this embodiment of the present disclosure is described. Figure 6 The electronic device 600 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0158] like Figure 6 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include but are not limited to: at least one processing unit 610, at least one storage unit 620, and a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610).

[0159] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 executes the steps described in the above “Exemplary Method” section of this specification according to various exemplary embodiments of the present disclosure.

[0160] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .

[0161] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 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.

[0162] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0163] The electronic device 600 may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through a display unit 640 and an input / output (I / O) interface 650 connected to the display unit 640. In addition, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 660. As shown, the network adapter 660 communicates with other modules of the electronic device 600 through a bus 630. 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 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0164] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0165] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above "Exemplary Method" section of the present specification.

[0166] In the embodiments of the present disclosure, a program product for implementing the above method is also provided, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a 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.

[0167] The program product may use 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 of the above. 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 of the above.

[0168] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which 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 above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0169] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0170] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0171] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0172] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

Claims

1. A two-stage anonymous query method, characterized in that: The method is applied to a server, the server includes an index key set and a key value set, each original index in the index key set corresponds to at least one original key, and each original key in the key value set corresponds to an original value, the method includes: Receiving an index ciphertext provided by a client, the index ciphertext being constructed based on a query index, the query index being confirmed by the client in an original index provided by the server; Performing homomorphic computation in an index key set based on the index ciphertext to obtain a first query result in ciphertext form, and providing the first query result to the client, where the first query result includes the original key corresponding to the query index; Performing an oblivious pseudo-random function (OPRF) calculation with the client based on a query key to obtain a ciphertext of the query key provided by the client, wherein the query key is confirmed by the client in the original key corresponding to the query index; Based on the query key ciphertext, homomorphic computation is performed in the key value set to obtain a second query result in ciphertext form, and the second query result is provided to the client, so that the client decrypts the second query result to obtain the original value corresponding to the query key.

2. The method according to claim 1, characterized in that The index key set represents all the original values ​​in the form of a first matrix, and the first matrix is ​​represented as a hypercube whose total dimensions include a first dimension and a plurality of second dimensions.

3. The method according to claim 1, characterized in that The performing homomorphic computation in the index key set based on the index ciphertext to obtain the first query result in ciphertext form includes: The index ciphertext is converted to obtain a second matrix of the first dimension and a ciphertext set whose number of elements in the set corresponds to the second dimension; the index ciphertext is obtained by the client representing the query index as a query vector, and the query vector is used to indicate the index position corresponding to the query index in the first matrix; Performing a dot product calculation on the second matrix and the first matrix to obtain a ciphertext submatrix of the index key set in the first dimension; An outer product calculation is performed on the ciphertext submatrix and the ciphertext set in a second dimension to obtain the first query result.

4. The method according to claim 1, characterized in that: The key-value set is represented in the form of an intersection polynomial and a label polynomial.

5. The method according to claim 4, characterized in that The method of performing homomorphic computation in the key value set based on the query key ciphertext to obtain a second query result in ciphertext form includes: Substituting the query key ciphertext into the intersection polynomial and the label polynomial to obtain an intersection calculation result and a label calculation result in ciphertext form; The intersection calculation result and the label calculation result are provided to the client as the second query result, so that the client determines the intersection of the query key and the original key based on the intersection calculation result, and determines the original value corresponding to the intersection based on the label calculation result.

6. A two-stage anonymous query method, characterized in that: Applied to a client, the method comprises: Confirming a query index in an original index provided by a server, and constructing an index ciphertext based on the query index to provide the index ciphertext to the server, wherein the server includes an index key set and a key value set, wherein each original index in the index key set corresponds to at least one original key, and each original key in the key value set corresponds to an original value; Obtain a first query result provided by the server, the first query result being obtained by the server through homomorphic calculation in the index key set based on the index ciphertext Determine a query key based on the original key corresponding to the query index included in the first query result, and perform an oblivious pseudo-random function (OPRF) calculation based on the query key with the server to provide a query key ciphertext to the server; Obtain a second query result in ciphertext form provided by the server, and decrypt the second query result to obtain the original value corresponding to the query key, the second query result being obtained by the server performing homomorphic calculation in the key value set based on the query key ciphertext.

7. The method according to claim 6, characterized in that The server performs an oblivious pseudo-random function OPRF calculation based on the query key to provide the query key ciphertext to the server, including: Performing OPRF processing with the server based on the query key to obtain a first pseudo-random value; Splitting the first pseudo-random value to obtain a second pseudo-random value corresponding to the query key and a value key indexed by the key value, wherein the value key is used by the client to decrypt the second query result; Performing homomorphic encryption on the second pseudo-random value to obtain the query key ciphertext; The query key ciphertext is provided to the server.

8. A two-stage anonymous query system, characterized in that: The system includes a client and a server, the server includes an index key set and a key value set, each original index in the index key set corresponds to at least one original key, and each original key in the key value set corresponds to an original value, wherein the client includes: An index ciphertext construction module, used to confirm a query index in an original index provided by the server, and to construct an index ciphertext based on the query index, so as to provide the index ciphertext to the server; A first query result receiving module is used to obtain a first query result provided by the server, wherein the first query result is obtained by the server through homomorphic calculation in the index key set based on the index ciphertext a query key ciphertext construction module, configured to determine a query key based on the original key corresponding to the query index included in the first query result, and perform an oblivious pseudo-random function OPRF calculation based on the query key with the server to provide the query key ciphertext to the server; A second query result receiving module is used to obtain a second query result in ciphertext provided by the server, and decrypt the second query result to obtain an original value corresponding to the query key, wherein the second query result is obtained by the server performing homomorphic calculation in the key value set based on the query key ciphertext; The server includes: An index ciphertext receiving module, used to receive an index ciphertext provided by a client, wherein the index ciphertext is constructed based on a query index, and the query index is confirmed by the client in an original index provided by the server; A first query result calculation module, configured to perform homomorphic calculation in an index key set based on the index ciphertext, obtain a first query result in ciphertext form, and provide the first query result to the client, wherein the first query result includes the original key corresponding to the query index; A query key ciphertext receiving module, configured to perform an oblivious pseudo-random function (OPRF) calculation with the client based on the query key to obtain a query key ciphertext provided by the client, wherein the query key is confirmed by the client in the original key corresponding to the query index; The second query result calculation module is used to perform homomorphic calculation in the key value set based on the query key ciphertext to obtain the second query result in ciphertext form, and provide the second query result to the client so that the client decrypts the second query result to obtain the original value corresponding to the query key.

9. An electronic device, characterized in that: include: processor; as well as a memory for storing a computer program for the processor; Wherein, the processor is configured to execute the two-stage anonymous query method described in any one of claims 1 to 7 by executing the computer program.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the two-stage anonymous query method as described in any one of claims 1 to 7 is implemented.