An efficient method and device for multi-table connection query of a ciphertext database
By calculating pseudo-random values for each table in the encrypted database and generating XOR operation results, the high storage and computing problems in multi-table join queries are solved, and efficient and secure multi-table join queries are implemented, supporting equal joins and hiding query information.
Patent Information
- Application Number
- CN202411395827.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-10-08
AI Technical Summary
Existing technologies have high storage overhead and computational complexity when performing multi-table join queries in encrypted relational databases, and cannot effectively support equi-join queries, leaking the frequency of join attribute values and query information.
By calculating a pseudo-random value for each attribute value pair in each data table, generating an XOR operation result and storing it in an encrypted data structure, only processing the first occurrence of the connection attribute value pair, and using the pseudo-random value to encrypt the identifier of the data record, an encrypted database is constructed to support multi-table connection queries.
It optimizes storage and computing overhead, supports multi-table equal-value join queries, improves query efficiency and security, and avoids the leakage of join attribute value frequency and query information.
Smart Images

Figure CN119442265B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of cloud computing security, and particularly relates to an efficient ciphertext database multi-table connection query method and device. BACKGROUND
[0002] In 2000, Song et al. proposed the concept of symmetric searchable encryption, which can allow the server to search encrypted data based on keywords while ensuring data and query privacy. Subsequent research has made various progress in enhancing the security of searchable encryption, enriching the query function of searchable encryption, and optimizing its performance. However, although searchable encryption can achieve efficient search of encrypted documents, it is still challenging to apply it to encrypted relational databases for secure queries.
[0003] Hacigumus et al. first studied queries in encrypted relational databases, where each attribute domain is mapped to a series of non-overlapping data buckets, and all entries corresponding to the bucket need to be returned. Therefore, it will cause high communication overhead and leak the exact range of query data. Popa et al. proposed a practical encrypted relational database system through attribute-preserving encryption, such as deterministic encryption and order-preserving encryption, where each column in the data table will be encrypted using a combination of different types of attribute-preserving encryption schemes. To execute queries, the server will decrypt the combined ciphertext layer by layer until it reaches the corresponding layer. However, the construction based on attribute-preserving encryption will leak the underlying data ordering and frequency information. Therefore, it is still crucial to study queries on encrypted relational databases while leaking as little information as possible.
[0004] To design a less-leaking encrypted relational database, Kamara et al. proposed a new query scheme based on structure encryption, where all possible connections are pre-computed and stored in the encrypted database through heuristic paradigms. Although this scheme leaks less information than the construction of attribute-preserving encryption, it inevitably brings considerable storage overhead due to the need to pre-compute all possible connections. Later, Cash et al. introduced a method of partially pre-computed connections, which transfers some connection operations to the client. Subsequently, Shafieinejad et al. further designed a secure equi-join query scheme based on function-hiding inner-product encryption, which only leaks the sum of each query leak. However, due to the high overhead of public-key operations, this method has a performance bottleneck.
[0005] In 2022, Jutla et al. extended the single-table multi-keyword searchable encryption scheme OXT proposed by Cash et al. to support join queries across two tables, and proposed a new join query scheme JXT without join precomputation. More specifically, the server performs single-keyword search on the two query tables respectively, and checks whether the combination of the matching data record identifiers of the first table and the join attribute value pairs of the second table exists in the encrypted database of the first table. This approach requires a large amount of computational overhead, specifically, the computational complexity is the product of the number of matching data records of the single-keyword search on the two tables, and the scheme only supports natural join between two tables, and does not support equi-join queries, i.e. the join attribute names of the two tables need to be the same. SUMMARY
[0006] In order to solve the above problems existing in the prior art, the present application provides an efficient ciphertext database multi-table join query method and device.
[0007] The technical problem to be solved by the present application is solved by the following technical scheme:
[0008] In a first aspect, the present application provides an efficient ciphertext database multi-table join query method, which comprises:
[0009] For each attribute value pair of each data table, a first pseudo-random value is calculated, and for the first occurrence of the join attribute value pair in the data record corresponding to each attribute value pair, a second pseudo-random value is calculated, and the first pseudo-random value and the second pseudo-random value are subjected to XOR operation to obtain a first calculation result, the first calculation result is added to the first data structure of the data table, and the first data structure is added to the first encrypted data structure;
[0010] For the first occurrence of the join attribute value pair in the data record corresponding to each attribute value pair in each data table, the third pseudo-random value, the second pseudo-random value of the join attribute value pair, the fourth pseudo-random value and the fifth pseudo-random value are subjected to XOR operation to obtain the second calculation result of the join attribute value pair; for the non-first occurrence of the join attribute value pair, the sixth pseudo-random value is generated based on the count value, and the sixth pseudo-random value, the third pseudo-random value, the second pseudo-random value of the join attribute value pair and the fourth pseudo-random value are subjected to XOR operation to obtain the second calculation result of the join attribute value pair; all second calculation results are added to the second data structure of the data table, and the second data structure is added to the second encrypted data structure; the third pseudo-random value is calculated for each attribute value pair;
[0011] encrypting the identifier of the data record corresponding to each attribute value pair by using the seventh pseudo-random value calculated based on each attribute value pair in each data table as an encryption key to obtain ciphertext, adding the ciphertext to the third data structure of the data table, and taking the second calculation result as an index of the ciphertext; and adding the third data structure of each data table to the third encrypted data structure;
[0012] obtaining an encrypted database based on the first encrypted data structure, the second encrypted data structure and the third encrypted data structure, and implementing a multi-table join query based on the encrypted database.
[0013] Optionally, the first calculation result is obtained by performing an exclusive OR operation on the first pseudo-random value and the second pseudo-random value, and the first calculation result is added to the first data structure of the data table, including:
[0014] For the join attribute value pair first appearing in the data record corresponding to each attribute value pair in each data table, the first calculation result is obtained by performing an exclusive OR operation on the first pseudo-random value and the second pseudo-random value; the first calculation result is added to the first data structure of the data table, and the attribute value pair and the join attribute name are taken as an index of the first calculation result.
[0015] Optionally, the encryption of the identifier of the data record corresponding to each attribute value pair by using the seventh pseudo-random value calculated based on each attribute value pair in each data table as an encryption key to obtain ciphertext, includes:
[0016] The seventh pseudo-random value is calculated for each attribute value pair in each data table, and the seventh pseudo-random value is used as an encryption key for encrypting the identifier of the data record corresponding to each attribute value pair to obtain ciphertext.
[0017] Optionally, the third data structure of each data table is added to the third encrypted data structure, including:
[0018] The third data structure of each data table is filled by using a general padding method or a member judgment data structure padding method, and the filled third data structure is added to the third encrypted data structure.
[0019] Optionally, a multi-table join query is implemented based on the encrypted database, including:
[0020] receiving query trapdoor information sent by a client;
[0021] After determining the data table based on the data table index in the query trapdoor information, finding the corresponding first calculation result from the first data structure of the data table according to the query trapdoor information, and obtaining a target calculation result by calculation according to the first calculation result;
[0022] determine whether the target calculation result is a second calculation result in a second data structure of another data table other than the data table;
[0023] if the determination result is yes, index to a corresponding ciphertext from a third data structure according to the target calculation result, and return the ciphertext as a query result to the client, so that the client decrypts the query result to obtain a plaintext multi-table connection query result.
[0024] In a second aspect, the application provides an efficient ciphertext database multi-table connection query device, which comprises:
[0025] a first encrypted data structure determination module, configured to calculate a first pseudo-random value for each attribute value pair of each data table, calculate a second pseudo-random value for a first occurrence of a connection attribute value pair in a corresponding data record of each attribute value pair, and perform XOR operation on the first pseudo-random value and the second pseudo-random value to obtain a first calculation result, add the first calculation result to a first data structure of the data table, and add the first data structure to a first encrypted data structure;
[0026] a second encrypted data structure determination module, configured to perform XOR operation on a third pseudo-random value, a second pseudo-random value of a connection attribute value pair, a fourth pseudo-random value and a fifth pseudo-random value to obtain a second calculation result of the connection attribute value pair for a first occurrence of the connection attribute value pair in a corresponding data record of each attribute value pair in each data table; based on a count value, generate a sixth pseudo-random value for a non-first occurrence of the connection attribute value pair, and perform XOR operation on the sixth pseudo-random value, the third pseudo-random value, the second pseudo-random value of the connection attribute value pair and the fourth pseudo-random value to obtain a second calculation result of the connection attribute value pair; add all the second calculation results to a second data structure of the data table, and add the second data structure to a second encrypted data structure; the third pseudo-random value is calculated for each attribute value pair;
[0027] a third encrypted data structure determination module, configured to encrypt an identifier of a data record corresponding to each attribute value pair by using a seventh pseudo-random value calculated based on each attribute value pair in each data table to obtain ciphertext, add the ciphertext to a third data structure of the data table, and index the second calculation result to the ciphertext; add the third data structure of each data table to a third encrypted data structure;
[0028] a query module, configured to obtain an encrypted database according to the first encrypted data structure, the second encrypted data structure and the third encrypted data structure, and implement multi-table connection query based on the encrypted database.
[0029] Optionally, the first encrypted data structure determining module obtains a first calculation result by performing XOR operation on the first pseudo-random value and the second pseudo-random value, and adds the first calculation result into the first data structure of the data table, including:
[0030] For each attribute value pair in each data table, the first calculation result is obtained by performing XOR operation on the first pseudo-random value and the second pseudo-random value, and the first calculation result is added into the first data structure of the data table, and the attribute value pair and the connection attribute name are used as the index of the first calculation result.
[0031] Optionally, the third encrypted data structure determining module encrypts the identifier of the data record corresponding to each attribute value pair by using the seventh pseudo-random value calculated based on each attribute value pair in each data table to obtain ciphertext, including:
[0032] The seventh pseudo-random value is calculated for each attribute value pair in each data table, and the seventh pseudo-random value is used as an encryption key to encrypt the identifier of the data record corresponding to each attribute value pair to obtain ciphertext.
[0033] Optionally, the third encrypted data structure determining module adds the third data structure of each data table to the third encrypted data structure, including:
[0034] The third data structure of each data table is filled by using a general filling method or a member judgment data structure filling method, and the filled third data structure is added to the third encrypted data structure.
[0035] Optionally, the query module implements multi-table join query based on the encrypted database, including:
[0036] Receiving query trapdoor information sent by a client;
[0037] After determining the data table based on the data table index in the query trapdoor information, the corresponding first calculation result is found from the first data structure of the data table according to the query trapdoor information, and the target calculation result is obtained by calculation according to the first calculation result;
[0038] Judging whether the target calculation result is the second calculation result in the second data structure of other data tables except the data table;
[0039] If the judgment result is yes, the corresponding ciphertext is indexed from the third data structure according to the target calculation result, and the ciphertext is returned as a query result to the client, so that the client decrypts the query result to obtain the plaintext multi-table join query result.
[0040] The application provides a high-efficiency ciphertext database multi-table connection query method, supports multi-table connection query on an encrypted database, and only processes corresponding first occurrence of an attribute value pair in a first encrypted data structure, that is, only one copy of a data record with the same attribute value pair and connection attribute value pair is stored in the first data structure, so that storage cost and calculation cost are greatly optimized, and the frequency of a connection attribute value in the connection attribute value pair and the connection attribute name of the query are not disclosed, so that the efficiency and security of the query are improved. In addition, separate encryption of each data table in the ciphertext database constructed based on the application is performed, and there is no need to calculate possible connection success data in advance, so that the calculation cost is further reduced.
[0041] The application will be further described in detail below with reference to the drawings and the application. BRIEF DESCRIPTION OF DRAWINGS
[0042] Figure 1 is a flowchart of a high-efficiency ciphertext database multi-table connection query method provided by an embodiment of the application;
[0043] Figure 2 is a plaintext database schematic diagram containing two data tables provided by an embodiment of the application;
[0044] Figure 3 is a system schematic diagram of an encrypted database provided by an embodiment of the application;
[0045] Figure 4 is a comparison schematic diagram of single-table storage cost changing with different connection attribute numbers;
[0046] Figure 5 is a comparison schematic diagram of search cost changing with different matching numbers of the first data structure;
[0047] Figure 6 is a comparison schematic diagram of search cost changing with the same matching number of the first data structure;
[0048] Figure 7 is a comparison schematic diagram of search cost changing with different search table numbers;
[0049] Figure 8 is a structure schematic diagram of a high-efficiency ciphertext database multi-table connection query device provided by an embodiment of the application. DETAILED DESCRIPTION
[0050] The application will be further described in detail below with reference to the drawings and the application.
[0051] In order to solve the problems of not supporting equi-join and multi-table join query, large storage overhead and leaking connection attribute value pairs of the existing encrypted database, an efficient multi-table join query method of the ciphertext database is provided in the embodiment of the present application, referring to Figure 1 , Figure 1 is a flowchart of the efficient multi-table join query method of the ciphertext database provided by the embodiment of the present application, and specifically comprises the following steps:
[0052] In step S101, a first pseudo-random value is calculated for each attribute value pair of each data table, a second pseudo-random value is calculated for the first appearing connection attribute value pair in the corresponding data record of each attribute value pair, and the first pseudo-random value and the second pseudo-random value are subjected to XOR operation to obtain a first calculation result, the first calculation result is added to the first data structure of the data table, and the first data structure is added to the first encrypted data structure.
[0053] First, the data structure of each data table in the plaintext database is initialized; the data structure comprises a first data structure, a second data structure and a third data structure. The data structure of each data table in the plaintext database is initialized, and specifically as follows:
[0054] In the embodiment of the present application, the first key k z , the second key k w , the third key k z′ , the fourth key k r , the fifth key k c , the sixth key k T and the seventh key k enc , wherein {0,1} λ is a set of bit strings with a length of λ, λ is a preset security parameter, is any selected element from the set.
[0055] In the embodiment of the present application, the plaintext database DB={Tab i ,W i} i∈[N] is a database comprising N data tables, wherein each table is represented by Tab i , i.e., Tab i is the i-th data table, and W i is the combination of all attribute names and corresponding attribute values (referred to as attribute value pairs) in the table, wherein the symbol [N] represents the integer set {0,1,…,N}.
[0056] Referring to Figure 2 , Figure 2is a plaintext database diagram provided by an embodiment of the present application, and each row of each data table represents a data record, for example, T1, 01 / 2022, China, 6F0X1 represents a data record, and the rows where T2, T3, T4, T5, T6, L1, L2, L3 and L4 are located each represent a different data record. In Table 1 (data table Tab1), the column where ID-1 is located is the identifier of the data record, and Table 1 includes three attributes, namely attribute 1, attribute 2 and attribute 3, wherein attribute 1 is Date (date), attribute 2 is Country (country), and attribute 3 is Transaction ID (transaction identification number). In Table 2 (data table Tab2), the column where ID-2 is located is the identifier of the data record, and Table 2 includes two attributes, namely attribute 1 and attribute 2, wherein attribute 1 is Location (location), and attribute 2 is Transaction ID2 (transaction identification number 2). An attribute value pair is a combination of an attribute name and a corresponding attribute value. In Table 1, the attribute value pairs can include Date||01 / 2022, Country||US and Transaction ID||2C3W3, etc. In Table 2, the attribute value pairs can include Location||China and Transaction ID2||4S9T6, etc.
[0057] In an embodiment of the present application, according to the plaintext database DB={Tab i ,W i} i∈[N] , three data structures are initialized for each table, including initializing the first data structure T i is an empty array array, the second data structure XSet[i] is initialized as an empty set set, and the third data structure M i is an empty map.
[0058] In an embodiment of the present application, for N data tables DB={Tab i ,W i} i∈[N] , a first encrypted data structure TSet is generated, a first pseudo-random value is calculated for each attribute value pair in each data table, a second pseudo-random value is calculated for the first occurrence of the connection attribute value pair in the corresponding data record, and further an exclusive OR operation is performed using the first pseudo-random value and the second pseudo-random value to obtain a first calculation result, and the first calculation result is added to the first data structure of the data table. The first data structures T1, T2, …, T N are all added to the first encrypted data structure TSet of the encrypted database.
[0059] The record identifier of the data record in the data table is id, the attribute value pair contained in the data record entry is w, and the contained connection attribute name is attr * , and the connection attribute value is w * . Referring to Figure 2 , the two attributes Transaction ID in Table1 and Transaction ID2 in Table2 are connected, and the two attributes are called connection attributes. On this basis, the connection attribute name in Table1 is Transaction ID, the connection attribute name in Table2 is Transaction ID2, and the attribute value under the connection attribute name is the connection attribute value, such as 6F0X1, 5S4D2, etc. That is, the connection attribute name and the connection attribute value are contained in the general attribute name and the attribute value.
[0060] In an implementation mode, a first calculation result is obtained by performing XOR operation on the first pseudo-random value and the second pseudo-random value, and the first calculation result is added to the first data structure of the data table, including:
[0061] For each connection attribute value pair corresponding to the first occurrence of the attribute value pair in each data record in each data table, a first calculation result is obtained by performing XOR operation on the first pseudo-random value and the second pseudo-random value; the first calculation result is added to the first data structure of the data table, and the attribute value pair and the connection attribute name are used as the index of the first calculation result.
[0062] In the embodiment of the application, for each attribute value pair w∈W i in each data table Tab i , a first pseudo-random value F(k z ,w) is calculated, where F:{0,1} λ ×{0,1} * →{0,1} λ is a cryptographically secure pseudo-random function, and k z is a first key.
[0063] In the embodiment of the application, for each data record corresponding to the attribute value pair w∈W i , the connection attribute name attr * and the connection attribute value w * , a repetition judgment is performed, and if the connection attribute value pair attr * ||w * first appears, a second pseudo-random value F(k w ,w * ) is calculated, where k w is a second key; the first pseudo-random value F(k z ,w) and the second pseudo-random value F(k ww * ) to obtain a first calculation result If the connection attribute value pair attr * ||w * appears multiple times, it is only calculated once.
[0064] In the embodiment of the present application, the first calculation result y is added to the first data structure T i of the data table Tab i , and is indexed by the attribute value pair and the connection attribute name w||attr * when added, that is, T i [w||attr * ]←y.
[0065] In the embodiment of the present application, after the first data structures T1, T2, …, T N of all the data tables are generated, they are all added to the first encrypted data structure TSet of the encrypted database. At this time, the first encrypted data structure TSet is generated by calling the result-revealing encrypted multi-pointer mapping establishment algorithm TSetSetup by using the general result-revealing encrypted multi-pointer mapping construction, that is, (TSet, k T )←TSetSetup(1 λ , T1||T2||…||T N ), where k T is the sixth secret key.
[0066] In step S102, for each connection attribute value pair corresponding to the first occurrence of the connection attribute value pair in each data record of each attribute value pair in each data table, a second calculation result of the connection attribute value pair is obtained by performing XOR operation on the third pseudo-random value, the second pseudo-random value of the connection attribute value pair, the fourth pseudo-random value and the fifth pseudo-random value; for the connection attribute value pair that does not occur for the first time, the sixth pseudo-random value is generated based on the count value, and the second calculation result of the connection attribute value pair is obtained by performing XOR operation on the sixth pseudo-random value, the third pseudo-random value, the second pseudo-random value of the connection attribute value pair and the fourth pseudo-random value; all the second calculation results are added to the second data structure of the data table, and the second data structure is added to the second encrypted data structure; the third pseudo-random value is calculated for each attribute value pair.
[0067] In the embodiment of the present application, for N data tables DB={Tab i ,W i} i∈[N] , the second encrypted data structure XSet is generated, the third pseudo-random value is calculated for each attribute value pair in each data table, the fourth pseudo-random value, the fifth pseudo-random value and the sixth pseudo-random value are calculated for the connection attribute value pair that occurs for the first time in each data record corresponding to each attribute value pair.
[0068] For the connection attribute value pair that appears for the first time, an exclusive OR operation is performed on the second pseudo-random value, the third pseudo-random value, the fourth pseudo-random value, and the fifth pseudo-random value to obtain a second calculation result of the connection attribute value pair that appears for the first time.
[0069] For a connection attribute value pair that does not appear for the first time, a sixth pseudo-random value is generated based on the count value, and an exclusive-OR operation is performed on the sixth pseudo-random value, the second pseudo-random value, the third pseudo-random value, and the fourth pseudo-random value to obtain a second calculation result for the connection attribute value pair that does not appear for the first time. The second pseudo-random value, the third pseudo-random value, and the fourth pseudo-random value of the connection attribute value pair that does not appear for the first time can be obtained based on the second pseudo-random value, the third pseudo-random value, and the fourth pseudo-random value of the connection attribute value pair that appears for the first time.
[0070] The second calculation results of the connection attribute value pairs that appear for the first time and the second calculation results of the connection attribute value pairs that do not appear for the first time are added to the second data structure of the data table, and the second data structures XSet[1], XSet[2],…, XSet[N] of all generated data tables are merged to construct the second encrypted data structure XSet of the encrypted database.
[0071] In the embodiment of the present invention, for each data table Tab i Each attribute-value pair w∈W i , calculate the third pseudo-random value F(k z′ ,w), where F:{0,1} λ ×{0,1} * →{0,1} λ is a cryptographically secure pseudo-random function, k z′ is the third key.
[0072] In the embodiment of the present invention, for the attribute value pair w∈W i Each corresponding data record and its connection attribute name attr * and the connection attribute value w * , repeatability check, if the connection attribute value is attr * ||w * The first occurrence, calculate the fourth pseudo-random value F(k r ,attr * ) and the fifth pseudo-random value F(k c ,1), where k r is the fourth key, k c Is the fifth key. Using the second pseudo-random value F(k w ,w * ), the third pseudo-random value F(k z′ ,w), the fourth pseudo-random value F(k r ,attr* ) and the fifth pseudo-random value F(k c ,1) to obtain a second calculation result If the connection attribute value pair attr * ||w * appears multiple times, an integer cnt, i.e., a count value, is randomly and non-repeatedly selected from the set {1,2,…,L max [i][attr * ]} each time it appears, the sixth pseudo-random value F(k c ,cnt) is calculated, and a second calculation result is obtained, where L max [i][attr * ] is the maximum number of times the connection attribute value w i appears in the data table Tab * corresponding to the connection attribute name attr * .
[0073] Referring to Figure 2 , the maximum number of times the connection attribute value appears in the data table Table1 corresponding to the connection attribute name Transaction ID is L max [1][Transaction ID] = 2, where 6F0X1 appears once, 4J9T6 appears once, 2C3W3 appears once, 8P7A5 appears once, and 5S4D2 appears twice, so the maximum number of times L max [1][Transaction ID] = 2. The maximum number of times the connection attribute value appears in the data table Table2 corresponding to the connection attribute name Transaction ID2 is L max [2][TransactionID2] = 1, where 5S4D2 appears once, 4S9T6 appears once, 6F8T9 appears once, and 3D8M9 appears once, so the maximum number of times L max [2][Transaction ID2] = 1.
[0074] In the embodiments of the present application, the second calculation result xtag is added to the second data structure XSet[i] of the data table Tab i , and the second data structures XSet[1], XSet[2],…, XSet[N] of all data tables are further combined to obtain a second encrypted data structure XSet. The second data structure XSet can be essentially a set, or a data structure providing member judgment function, such as a Bloom filter.
[0075] Step S103, encrypt the identifier of each data record corresponding to each attribute value pair using the seventh pseudo-random value calculated based on each attribute value pair in each data table to obtain ciphertext, add the ciphertext to the third data structure of the data table, and index the second calculation result as the ciphertext; add the third data structure of each data table to the third encrypted data structure.
[0076] In the embodiment of the application, for N data tables DB={Tab i ,W i} i∈[N] The third encrypted data structure CSet is generated, the seventh pseudo-random value is calculated for each attribute value pair in each data table, the seventh pseudo-random value is used as an encryption key, each identifier of each data record corresponding to the attribute value pair is encrypted using a symmetric encryption algorithm to obtain ciphertext, the ciphertext is added to the third data structure of the data table, and the third encrypted data structure of the data table is obtained. The third encrypted data structures CSet[1], CSet[2], …, CSet[N] of all the generated data tables are merged to construct the third encrypted data structure CSet of the encrypted database.
[0077] In an implementation manner, encrypting the identifier of each data record corresponding to each attribute value pair using the seventh pseudo-random value calculated based on each attribute value pair in each data table to obtain ciphertext comprises:
[0078] The seventh pseudo-random value is calculated for each attribute value pair in each data table, and the seventh pseudo-random value is used as an encryption key to encrypt the identifier of each data record corresponding to each attribute value pair to obtain ciphertext.
[0079] In the embodiment of the application, the seventh pseudo-random value F(k i is calculated for each attribute value pair w∈W i in each data table Tab enc , wherein F:{0,1} λ ×{0,1} * →{0,1} λ is a cryptographically secure pseudo-random function, and k enc is the seventh key. The seventh pseudo-random value F(k enc is also called an encryption key of the identifier of the encrypted data record.
[0080] In the embodiment of the application, the identifier id of each data record corresponding to the attribute value pair w∈W i is encrypted to obtain ciphertext C←Enc(F(k enc, where the encryption algorithm Enc(·,·) is a secure symmetric encryption algorithm, specifically can be an AES (Advanced Encryption Standard) encryption algorithm, etc., and the encryption key is the seventh pseudo-random value F(k enc , w).
[0081] In the embodiment of the present application, the ciphertext C is added to the third data structure M i of the data table Tab i , and the second calculation result xtag is used as an index when the ciphertext C is added, that is, M i [xtag]←C. The corresponding third encryption data structure CSet[i] is constructed for the third data structure M i .
[0082] Finally, the third encryption data structures CSet[1], CSet[2], …, CSet[N] of all the data tables are merged to obtain the third encryption data structure CSet.
[0083] In an implementation manner, adding the third data structure of each data table to the third encryption data structure includes:
[0084] The third data structure of each data table is filled by using a general filling method or a member determination data structure filling method, and the filled third data structure is added to the third encryption data structure.
[0085] In the embodiment of the present application, for the data table Tab i , the corresponding third encryption data structure CSet[i] is constructed for the third data structure M i , and there are two example methods, including a general filling method and a member determination data structure filling method, which are further described as follows:
[0086] (a) The general filling method refers to filling the number of ciphertexts corresponding to a set of attribute value pairs w∈W i , a connection attribute name attr * , and a connection attribute value w * to a maximum value L max [i][attr * ]. Specifically, an integer cnt that has never been selected is randomly and repeatedly selected from the set {1, 2, …, L max [i][attr * ], the sixth pseudo-random value F(k c , cnt) is recalculated, and the filled second calculation result Then a virtual value D is randomly selected as a virtually filled ciphertext, and the virtual value D is added to the data table Tab i .i the third data structure M i , and the second calculation result xtag filled in is used as an index, that is, M i [xtag]←D, the third data structure M filled in i is the third encrypted data structure CSet[i].
[0087] (b) The member determination data structure filling method refers to storing the ciphertext by using the member determination data structure with high storage and calculation efficiency. Specifically, all elements in the third data structure M i of the data table Tab i are added to the member determination data structure, such as an Xor Filter, a Binary Fuse Filter, etc. These member determination structures have a filling function, so that the corresponding third encrypted data structure CSet[i] can be constructed, and high storage and calculation efficiency can be achieved.
[0088] In the embodiment of the present application, by filling the third data structure storing the ciphertext, the information of the intermediate query result in the multi-table connection query can be hidden, and the query security of the database is improved.
[0089] In step S104, the encrypted database is obtained according to the first encrypted data structure, the second encrypted data structure and the third encrypted data structure, and the multi-table connection query is implemented based on the encrypted database.
[0090] In the embodiment of the present application, the encrypted database generated by using the above method of constructing the encrypted database is stored in the server. Referring to Figure 3 , Figure 3 is a system schematic diagram of applying the encrypted database provided by the embodiment of the present application, and the system involves a client and a server, and includes two processes of encryption and search. The encrypted database includes the first encrypted data structure TSet, the second encrypted data structure XSet and the third encrypted data structure CSet. In the process of the multi-table connection query, the client selects the data table to be queried, the attribute value pair to be queried and the connection attribute name, calculates the search trapdoor, and the server uses the trapdoor search calculation to obtain the encrypted identifier in Figure 3 , which is also the encrypted query result, that is, the ciphertext, and returns to the client, and the client decrypts the ciphertext to obtain the plaintext query result.
[0091] In the embodiment of the present application, only the first occurrence of the connection attribute value pair in each data table is processed in the first encrypted data structure, that is, only one copy of the data record with the same attribute value pair and connection attribute value pair is stored in the first data structure, thereby greatly optimizing the storage and calculation overheads and without leaking the frequency of the connection attribute value in the connection attribute value pair and the connection attribute name of the query, thereby improving the efficiency and security of the query. The separate encryption of each data table in the ciphertext database constructed based on the present application does not need to pre-calculate the possible connection success data, thereby further reducing the calculation overhead.
[0092] In addition, the ciphertext database multi-table connection query method provided in the embodiment of the present application allows the connection attribute names on each table to be different, the corresponding pseudo-random values are calculated by separating the connection attribute names from the connection attribute values, the multi-table equivalent connection query is realized, and the connection of any attribute is supported, including low-entropy attributes.
[0093] The ciphertext database constructed based on the present application is filled in the third encrypted data structure, the frequency of the connection attribute value is hidden, and the subquery leakage is eliminated, that is, the query results of any two tables are not leaked.
[0094] In one implementation mode, the multi-table connection query is implemented based on the encrypted database, including:
[0095] The query trapdoor information sent by the client is received;
[0096] After the data table is determined based on the data table index in the query trapdoor information, the corresponding first calculation result is found from the first data structure of the data table according to the query trapdoor information, and the target calculation result is obtained by calculation according to the first calculation result;
[0097] It is judged whether the target calculation result is the second calculation result in the second data structure of the other data table except the data table;
[0098] If the judgment result is yes, the corresponding ciphertext is indexed from the third data structure according to the target calculation result, and the ciphertext is returned as the query result to the client, so that the client decrypts the query result to obtain the plaintext multi-table connection query result.
[0099] In an embodiment of the present invention, based on an encrypted database containing three encrypted data structures, the client and the server perform a multi-table connection query. The client first sends query trapdoor information to the server, including the queried data table index, the query token for querying attribute value pairs on each table, and the query trapdoor for querying connection attributes; based on the query trapdoor information, the server first performs an attribute value pair query on a single table, finds a matching result from the first encrypted data structure of the data table, that is, the corresponding first calculation result, and then uses the query matching result of the table to perform calculations to obtain the target calculation result, and uses the target calculation result to perform a judgment query in the second encrypted data structure of the remaining data tables. After passing, the final multi-table connection ciphertext result is found from the third encrypted data structure and returned to the client; the client decrypts the query result to obtain the plaintext multi-table connection query result, which is as follows:
[0100] The client selects k data tables to be queried The query attribute value pairs w1,w2,…,w on each table k , and the query connection attribute name on each data table The encrypted multi-finger mapping tag generation algorithm TSetGetTag revealed by the client call result generates a query token for the query attribute value pair with the lowest frequency (assuming the first query attribute value pair w1), that is, where k T is the sixth key. The client indexes the data table {t1.t2,…,t k} and the query token stag of the attribute value pair is sent to the server.
[0101] In the embodiment of the present invention, the client further generates a query trap for the connection query, that is, calculates where 1≤i≤k and k z is the first key, k z′ is the third key, k r is the fourth key, k c The client sends the query trapdoor xjointoken to query the connection attributes.
[0102] In the embodiment of the present invention, the server sends the data table index {t1.t2,…,t k} and the query token stag of the attribute value pair obtain the attribute value pair matching result on the corresponding first data table from the first encrypted data structure TSet, specifically by calling the encrypted multi-finger mapping retrieval algorithm TSetRetrieve revealed by the result to obtain the first data table The attribute value pair w1 and the connection attribute value pair The matching result is According to the data sheet corresponding first data structure , contains a plurality of first calculation results
[0103] In the embodiment of the application, the server uses the obtained first calculation result y cnt , calculates the first index related to the remaining k-1 data tables wherein 2≤i≤k, judges whether the first index xtoken[i][1] is in the data table corresponding to the second encrypted data structure XSet[t i ]. If the k-1 first indexes xtoken[2][1], …, xtoken[k][1] all belong to the second encrypted data structure XSet[t i ], the server calculates the second index wherein 1≤j≤k and 1≤c≤|xjointoken[j]|; otherwise, the next first calculation result y cnt is used. The above operation is executed in a loop until a group of first indexes that pass the judgment are found. The server uses the second indexes that pass the judgment to index the corresponding ciphertexts from the third encrypted structure data CSet of the encrypted database, and takes the ciphertexts as the query result. Specifically, the k second indexes xtoken[1][c], …, xtoken[k][c] are used to find a group of ciphertexts (C1[c], C2[c], …, C k [c]) in the corresponding third encrypted structure data CSet[t j ]. Finally, the server returns all the ciphertexts {(C1, C2, …, C k )} to the client.
[0104] In the embodiment of the application, the client receives the ciphertext query result returned by the server and decrypts to obtain the plaintext query result. Specifically, the client calculates a seventh pseudo-random value F(k enc ,w i ) to obtain a decryption key for each query attribute value pair w i in each query data table , wherein F:{0,1} λ ×{0,1} * →{0,1} λ is a cryptographically secure pseudo-random function, and k enc is the seventh key. For a group of ciphertext query results (C1[c], C2[c], …, C k [c]), the client decrypts to obtain the plaintext result, that is, Res[i][c]←Dec(F(kenc ,w i ),C i [c]), where 1≤i≤k and 1≤c≤|C i |. The decryption algorithm Dec(·,·) is a decryption algorithm of a secure symmetric encryption algorithm.
[0105] In an embodiment of the present invention, multi-table join queries (i.e., join queries involving two or more data tables) are supported on an encrypted database. Furthermore, the join attribute names on each table can be unique. By separating the join attribute names from the join attribute values and calculating the corresponding pseudo-random values, multi-table equal-value join queries are implemented, supporting joins involving arbitrary attributes, including low-entropy attributes. Furthermore, the encrypted database structure for multi-table join queries provided by the embodiment of the present invention implements separate encryption for each data table, eliminating the need to precalculate the data that may be successfully joined.
[0106] In the embodiment of the present invention, in the first encrypted data structure TSet, only the data tables Tab i The attribute-value pair w∈W i The corresponding first occurrence of the connection attribute value pair attr * ||w * Processing is performed, that is, only one copy of the data record with the same attribute value pair and connection attribute value pair is stored in the first data structure, thereby greatly optimizing the storage overhead and computing overhead and not leaking the frequency of the connection attribute value and the connection attribute name of the query, thereby improving the efficiency and security of the query.
[0107] In an embodiment of the present invention, padding is performed in the third encrypted data structure CSet, which hides the frequency of the connection attribute value and eliminates subquery leakage, that is, the query results of any two tables will not be leaked. For example, a connection query on three data tables will not leak the query results of the first table and the second table, the query results of the first table and the third table, etc.
[0108] During the query process, it is only necessary to perform a single keyword search in the first encrypted data structure of a single table, then perform a judgment query in the second encrypted data structure of the remaining query data table, and finally retrieve the ciphertext result from the third encrypted data structure. Therefore, the retrieval complexity of the embodiment of the present invention is O(R w Lmax), with lower retrieval complexity, where R w Indicates the number of valid data record entries matched in the first encrypted data structure of a single table (when there are records with the same attribute value pairs and the same connection attribute values, only one data record is stored in the first encrypted data structure), Lmax is ... Connection attribute name The corresponding connection attribute value w * The maximum number of occurrences.
[0109] Based on the simulation experiment of the high-efficiency ciphertext database multi-table connection query method provided by the embodiment of the application, the specific simulation experiment is divided into the following three aspects: (1) the encryption database storage overhead performance comparison of the high-efficiency ciphertext database multi-table connection query method provided by the embodiment of the application and the connection query scheme (JXT) of the encryption database without pre-computation; (2) the search performance comparison of the high-efficiency ciphertext database multi-table connection query method provided by the embodiment of the application and the connection query scheme (JXT) of the encryption database without pre-computation in the case of two data table connection query; and (3) the search performance comparison of the high-efficiency ciphertext database multi-table connection query method provided by the embodiment of the application and the connection query scheme (MJXT) of the encryption database without pre-computation in the case of multi-data table connection query. The MJXT scheme is extended from the JXT scheme by using the method provided by the embodiment of the application.
[0110] The encryption database storage overhead comparison can be seen from Figure 4 , Figure 4 is a comparison diagram of single-table storage overheads changing with different connection attribute numbers. The unit of the storage overhead is MB. The encryption method provided by the embodiment of the application greatly reduces the storage overhead because the storage of the repeated record items in the first encryption data structure is simplified.
[0111] The search performance comparison in the case of two data table connection query can be seen from Figure 5 and Figure 6 . Figure 5 is a comparison diagram of search overheads changing with different matching numbers of the first data structure. Specifically, the search overheads are compared in the case that the number of the results of single-keyword retrieval matching is different, but all meet the connection query condition. Figure 6 is a comparison diagram of search overheads changing with the same matching number of the first data structure. Specifically, the search overheads are compared in the case that the number of the results of single-keyword retrieval matching is the same, but part of them meet the connection query condition. The total number of the retrieval results is 1000, and the unit of the search time overhead is ms.
[0112] The search performance comparison in the case of multi-data table connection query can be seen from Figure 7 , Figure 7 is a comparison diagram of search overheads changing with different retrieval table numbers. Compared with the prior art, the encryption database construction provided by the embodiment of the application can achieve better retrieval performance while having higher security. The abscissa represents the number of query data tables, and the ordinate represents the search time overhead, which is ms.
[0113] The search performance of the efficient ciphertext database multi-table connection query method provided by the embodiment is superior to the prior art in the two cases of two data table connection and multi-data table connection, because the encryption database construction and search method provided by the embodiment only needs one retrieval of attribute value pairs on a single table, while JXT or MJXT needs two or more retrievals of attribute value pairs on a single table, and the retrieval complexity is O(l1l2) or wherein l1,…,l k are the number of results of retrieval matching of attribute value pairs on a single table, respectively.
[0114] Based on the same inventive concept, the embodiment of the present application also provides an efficient ciphertext database multi-table connection query device, which is described below with reference to Figure 8 , Figure 8 is a structural schematic diagram of an efficient ciphertext database multi-table connection query device provided by the embodiment of the present application, which comprises:
[0115] A first encrypted data structure determination module 801 is configured to calculate a first pseudo-random value for each attribute value pair of each data table, calculate a second pseudo-random value for a first-occurred connection attribute value pair in a data record corresponding to each attribute value pair, and perform an exclusive OR operation on the first pseudo-random value and the second pseudo-random value to obtain a first calculation result, add the first calculation result to a first data structure of the data table, and add the first data structure to a first encrypted data structure;
[0116] A second encrypted data structure determination module 802 is configured to perform an exclusive OR operation on a third pseudo-random value, a second pseudo-random value of a connection attribute value pair, a fourth pseudo-random value and a fifth pseudo-random value to obtain a second calculation result of the connection attribute value pair for the first-occurred connection attribute value pair in each data record corresponding to each attribute value pair in each data table; for a non-first-occurred connection attribute value pair, generate a sixth pseudo-random value based on a count value, and perform an exclusive OR operation on the sixth pseudo-random value, the third pseudo-random value, the second pseudo-random value of the connection attribute value pair and the fourth pseudo-random value to obtain a second calculation result of the connection attribute value pair; add all the second calculation results to a second data structure of the data table, and add the second data structure to a second encrypted data structure; the third pseudo-random value is calculated for each attribute value pair;
[0117] A third encrypted data structure determination module 803 is configured to encrypt an identifier of a data record corresponding to each attribute value pair by using a seventh pseudo-random value calculated based on each attribute value pair in each data table to obtain ciphertext, add the ciphertext to a third data structure of the data table, and index the ciphertext with the second calculation result; add the third data structure of each data table to a third encrypted data structure;
[0118] The query module 804 is configured to obtain an encrypted database according to the first encrypted data structure, the second encrypted data structure and the third encrypted data structure, and implement a multi-table connection query based on the encrypted database.
[0119] In the embodiment of the application, only the first occurrence of the connection attribute value pair corresponding to each attribute value pair in each data table is processed in the first encrypted data structure, that is, only one copy of the data record having the same attribute value pair and connection attribute value pair is stored in the first data structure, so that the storage cost and the calculation cost are greatly optimized, and the frequency of the connection attribute value in the connection attribute value pair and the connection attribute name of the query are not disclosed, thereby improving the efficiency and security of the query. The separate encryption of each data table in the ciphertext database constructed based on the application does not need to calculate the possible connection success data in advance, and further reduces the calculation cost.
[0120] Optionally, the first encrypted data structure determination module obtains a first calculation result by performing XOR operation on the first pseudo-random value and the second pseudo-random value, and adds the first calculation result to the first data structure of the data table, including:
[0121] For the first occurrence of the connection attribute value pair in the data record corresponding to each attribute value pair in each data table, a first calculation result is obtained by performing XOR operation on the first pseudo-random value and the second pseudo-random value; the first calculation result is added to the first data structure of the data table, and the attribute value pair and the connection attribute name are used as the index of the first calculation result.
[0122] Optionally, the third encrypted data structure determination module encrypts the identifier of the data record corresponding to each attribute value pair by using a seventh pseudo-random value calculated based on each attribute value pair in each data table as an encryption key, to obtain ciphertext, including:
[0123] For each attribute value pair in each data table, a seventh pseudo-random value is calculated, and the seventh pseudo-random value is used as an encryption key to encrypt the identifier of the data record corresponding to each attribute value pair, to obtain ciphertext.
[0124] Optionally, the third encrypted data structure determination module adds the third data structure of each data table to the third encrypted data structure, including:
[0125] The third data structure of each data table is filled by using a general padding method or a member judgment data structure padding method, and the filled third data structure is added to the third encrypted data structure.
[0126] Optionally, the query module implements a multi-table connection query based on the encrypted database, including:
[0127] Receiving the query trapdoor information sent by the client;
[0128] After determining the data table based on the data table index in the query trapdoor information, a corresponding first calculation result is found from a first data structure of the data table according to the query trapdoor information, and a target calculation result is obtained by calculation according to the first calculation result;
[0129] It is judged whether the target calculation result is a second calculation result in a second data structure of another data table except the data table;
[0130] If the judgment result is yes, corresponding ciphertext is indexed from a third data structure according to the target calculation result, and the ciphertext is returned as a query result to the client, so that the client decrypts the query result to obtain a plaintext multi-table join query result.
[0131] It should be noted that the terms "first", "second", and the like are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application.
[0132] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in the specification.
[0133] Although the present application is described herein in conjunction with various embodiments, other variations of the disclosed embodiments can be understood and implemented by those skilled in the art by viewing the drawings and disclosure. In the description of the present application, the word "comprising" does not exclude other components or steps, "one" or "one" does not exclude multiple cases, and "multiple" means two or more, unless otherwise explicitly specified. In addition, some measures are described in different embodiments, but this does not mean that these measures cannot be combined to produce good results.
[0134] The above is further detailed description of the present application in combination with specific preferred embodiments, and cannot be deemed as limitation of the specific implementation of the present application to these descriptions. For those skilled in the art to which the present application belongs, without departing from the concept of the present application, a number of simple deductions or substitutions can be made, and all should be deemed as falling within the protection scope of the present application.
Claims
1. An efficient multi-table join query method for a ciphertext database, characterized in that: The multi-table connection query method for the ciphertext database includes: Calculating a first pseudo-random value for each attribute value pair in each data table, calculating a second pseudo-random value for the first occurrence of a connection attribute value pair in the data record corresponding to each attribute value pair, performing an exclusive-OR operation on the first pseudo-random value and the second pseudo-random value to obtain a first calculation result, adding the first calculation result to a first data structure of the data table, and adding the first data structure to the first encrypted data structure; For the first occurrence of a connection attribute value pair in the data record corresponding to each attribute value pair in each data table, an exclusive OR operation is performed on the third pseudo-random value, the second pseudo-random value of the connection attribute value pair, the fourth pseudo-random value, and the fifth pseudo-random value to obtain a second calculation result of the connection attribute value pair; for a connection attribute value pair that does not appear for the first time, a sixth pseudo-random value is generated based on the count value, and an exclusive OR operation is performed on the sixth pseudo-random value, the third pseudo-random value, the second pseudo-random value of the connection attribute value pair, and the fourth pseudo-random value to obtain a second calculation result of the connection attribute value pair; all second calculation results are added to a second data structure of the data table, and the second data structure is added to a second encrypted data structure; the third pseudo-random value is calculated for each attribute value pair; Encrypting the identifier of the data record corresponding to each attribute value pair using a seventh pseudo-random value calculated based on each attribute value pair in each data table to obtain ciphertext, adding the ciphertext to a third data structure of the data table, and using the second calculation result as an index of the ciphertext; adding the third data structure of each data table to the third encrypted data structure; An encrypted database is obtained according to the first encrypted data structure, the second encrypted data structure, and the third encrypted data structure, and a multi-table join query is implemented based on the encrypted database.
2. The method for querying multiple tables in a ciphertext database according to claim 1, characterized in that: Performing an XOR operation on the first pseudo-random value and the second pseudo-random value to obtain a first calculation result, and adding the first calculation result to the first data structure of the data table, including: For the first occurrence of a connection attribute value pair in the data record corresponding to each attribute value pair in each data table, an XOR operation is performed using a first pseudo-random value and a second pseudo-random value to obtain a first calculation result; the first calculation result is added to a first data structure of the data table, and the attribute value pair and the connection attribute name are used as indexes of the first calculation result.
3. The method for querying multiple tables in a ciphertext database according to claim 1, characterized in that: The identifier of the data record corresponding to each attribute value pair is encrypted using the seventh pseudo-random value calculated based on each attribute value pair in each data table to obtain ciphertext, including: A seventh pseudo-random value is calculated for each attribute value pair in each data table, and an encryption operation is performed using the seventh pseudo-random value as an encryption key for encrypting the identifier of the data record corresponding to each attribute value pair to obtain a ciphertext.
4. The method for querying multiple tables in a ciphertext database according to claim 1, characterized in that: Add the third data structure of each data table to the third encrypted data structure, including: The third data structure of each data table is filled using a general filling method or a member-based data structure filling method, and the filled third data structure is added to the third encrypted data structure.
5. The method for querying multiple tables in a ciphertext database according to claim 1, characterized in that: Implementing multi-table join query based on the encrypted database includes: Receive query trapdoor information sent by the client; After determining a data table based on the data table index in the query trapdoor information, searching for a corresponding first calculation result from a first data structure of the data table according to the query trapdoor information, and performing calculation based on the first calculation result to obtain a target calculation result; Determining whether the target calculation result is a second calculation result in a second data structure of another data table other than the data table; If the judgment result is yes, the corresponding ciphertext is indexed from the third data structure according to the target calculation result, and the ciphertext is returned to the client as the query result, so that the client decrypts the query result to obtain a plaintext multi-table join query result.
6. An efficient multi-table connection query device for a ciphertext database, characterized in that: The ciphertext database multi-table connection query device includes: a first encrypted data structure determination module, configured to calculate a first pseudo-random value for each attribute value pair in each data table, calculate a second pseudo-random value for the first occurrence of a connection attribute value pair in the data record corresponding to each attribute value pair, perform an exclusive-OR operation using the first pseudo-random value and the second pseudo-random value to obtain a first calculation result, add the first calculation result to a first data structure of the data table, and add the first data structure to the first encrypted data structure; a second encrypted data structure determination module configured to, for each attribute value pair in each data table, perform an exclusive-OR operation on the first occurrence of a connection attribute value pair in the data record corresponding to the attribute value pair, based on the third pseudo-random value, the second pseudo-random value of the connection attribute value pair, the fourth pseudo-random value, and the fifth pseudo-random value, to obtain a second calculation result of the connection attribute value pair; for each connection attribute value pair that does not appear for the first time, generate a sixth pseudo-random value based on the count value, and perform an exclusive-OR operation on the sixth pseudo-random value, the third pseudo-random value, the second pseudo-random value of the connection attribute value pair, and the fourth pseudo-random value, to obtain a second calculation result of the connection attribute value pair; add all second calculation results to a second data structure of the data table, and add the second data structure to the second encrypted data structure; the third pseudo-random value is calculated for each attribute value pair; a third encrypted data structure determination module, configured to encrypt the identifier of the data record corresponding to each attribute value pair in each data table using a seventh pseudo-random value calculated based on each attribute value pair to obtain ciphertext, add the ciphertext to the third data structure of the data table, and use the second calculation result as an index of the ciphertext; and add the third data structure of each data table to the third encrypted data structure; The query module is used to obtain an encrypted database according to the first encrypted data structure, the second encrypted data structure and the third encrypted data structure, and implement a multi-table connection query based on the encrypted database.
7. The multi-table connection query device for a ciphertext database according to claim 6, characterized in that: The first encrypted data structure determining module performs an XOR operation on the first pseudo-random value and the second pseudo-random value to obtain a first calculation result, and adds the first calculation result to the first data structure of the data table, including: For the first occurrence of a connection attribute value pair in the data record corresponding to each attribute value pair in each data table, an XOR operation is performed using a first pseudo-random value and a second pseudo-random value to obtain a first calculation result; the first calculation result is added to a first data structure of the data table, and the attribute value pair and the connection attribute name are used as indexes of the first calculation result.
8. The multi-table connection query device for a ciphertext database according to claim 6, characterized in that: The third encrypted data structure determination module uses the seventh pseudo-random value calculated based on each attribute value pair in each data table to encrypt the identifier of the data record corresponding to each attribute value pair to obtain ciphertext, including: A seventh pseudo-random value is calculated for each attribute value pair in each data table, and an encryption operation is performed using the seventh pseudo-random value as an encryption key for encrypting the identifier of the data record corresponding to each attribute value pair to obtain a ciphertext.
9. The multi-table connection query device for a ciphertext database according to claim 6, characterized in that: The third encrypted data structure determination module adds the third data structure of each data table to the third encrypted data structure, including: The third data structure of each data table is filled using a general filling method or a member-based data structure filling method, and the filled third data structure is added to the third encrypted data structure.
10. The multi-table connection query device for a ciphertext database according to claim 6, characterized in that: The query module implements multi-table connection query based on the encrypted database, including: Receive query trapdoor information sent by the client; After determining a data table based on the data table index in the query trapdoor information, searching for a corresponding first calculation result from a first data structure of the data table according to the query trapdoor information, and performing calculation based on the first calculation result to obtain a target calculation result; Determining whether the target calculation result is a second calculation result in a second data structure of another data table other than the data table; If the judgment result is yes, the corresponding ciphertext is indexed from the third data structure according to the target calculation result, and the ciphertext is returned to the client as the query result, so that the client decrypts the query result to obtain a plaintext multi-table join query result.
Citation Information
Patent Citations
Ciphertext data range query method and system based on comparison index
CN115168909A
Static connection keyword ciphertext retrieval method and system based on XOR filter and OXT protocol
CN118673518A