Multi-attribute aggregation equivalent connection query method and device based on homomorphic encryption

By using homomorphic encryption technology on the encrypted database, multi-attribute aggregation equivalent join query is supported, which solves the problems of low query efficiency and easy attack in the existing technology of encrypted database, and realizes a safe and efficient query process.

CN118734331APending Publication Date: 2024-10-01XIDIAN UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410717343.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing encryption algorithms cannot support multi-attribute aggregation equivalent join queries of ciphertext data on the database, resulting in the need to download and decrypt the entire server data during data query, which increases unnecessary overhead and makes it difficult to prevent frequency analysis attacks.

Method used

Using the multi-attribute aggregation equivalent join query method based on homomorphic encryption, the to-be-encrypted result table is encrypted through the key generation algorithm and the data table encryption algorithm, public parameters and keys are generated, and multi-attribute aggregation equivalent values ​​are supported on the encrypted database. Join query, using multi-attribute aggregation equivalent join algorithm and decryption private key to obtain query results.

Benefits of technology

It implements safe and efficient multi-attribute aggregation equivalent join query on encrypted database, reduces the overhead of data query, and enhances the resistance to frequency analysis attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118734331A_ABST
    Figure CN118734331A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-attribute aggregation equivalent connection query method and device based on homomorphic encryption, relates to the technical field of information security, and solves the problems that semantic information of data is lost and ciphertext query cannot be performed on a database due to an existing encryption algorithm in the prior art. Public parameters and keys are generated by using a key generation algorithm and the to-be-encrypted result table; encrypting the to-be-encrypted result table by using a data table encryption algorithm, the public parameter and the key to obtain an index and an encryption result; according to the bucket query token of each grouping bucket generated by the SQL, performing aggregation query by adopting a multi-attribute aggregation equivalent connection algorithm to obtain an aggregation query result; decrypting the aggregated query result by using a decryption private key sk to obtain a query result; the method supports multi-attribute aggregation equivalent join query on an encrypted database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to a multi-attribute aggregation equal-join query method and device based on homomorphic encryption. Background Art

[0002] The rapid development of cloud service technology has led to more and more companies hosting their data on third-party cloud servers for storage. Cloud storage solutions have become a common solution for companies to manage databases. However, the endless stream of data leakage issues has caused all sectors of society to question the security of cloud storage solutions.

[0003] Encryption technology is an indispensable means to ensure data security, but traditional encryption algorithms will cause data semantic loss and cannot support ciphertext query operations on the encryption result library. Homomorphic encryption is a cryptographic encryption scheme that supports calculations on ciphertext data. It has the property that the result of the calculation performed on the data in the ciphertext state is the same as the result of the same calculation performed on the data in the plaintext state after decryption. This property can be used to implement ciphertext query operations that support the encryption result library.

[0004] CryptDB is a system that provides practical and reliable confidentiality protection for SQL database-based applications in the face of these attacks. The deterministic encryption scheme used in CryptDB allows grouping of ciphertexts and combines it with partially homomorphic encryption to achieve data aggregation. Since this approach supports aggregation based on any combination of attributes, it leaks the frequency of each grouped attribute value. Using this frequency information, a simple and efficient leakage abuse attack can reconstruct the plaintext information with high accuracy.

[0005] Seabed is a technology or method for data security or privacy protection. Seabed prevents frequency analysis attacks by flattening attribute histograms. The scheme splits the grouping attributes into multiple columns and inserts virtual elements. The virtual elements can flatten the data histogram, making the frequency analysis attack ineffective. However, this scheme requires that the combination of the grouping value and the grouping attribute be known before encryption and needs to be pre-calculated and outsourced, which increases the storage pressure of the server.

[0006] Existing homomorphic encryption algorithms only support numerical calculations and are difficult to support numerical comparison of ciphertext data, and therefore are difficult to support grouping aggregation and equivalent join queries of ciphertext data.

[0007] Encryption technology is an indispensable means to ensure data security. Traditional encryption algorithms will cause the data to lose semantic information, so it is impossible to perform ciphertext queries on the database. When querying a database using a traditional encryption algorithm, the user must first download the ciphertext data from the database and then decrypt it for use. Although this method can ensure the security of sensitive data, it greatly increases unnecessary overhead beyond data query because the entire data on the server needs to be downloaded and decrypted every time the data is needed.

[0008] Based on this, how to solve the multi-attribute aggregation equal join query on the encrypted result library is an urgent problem to be solved. Summary of the invention

[0009] The present invention provides a multi-attribute aggregate equal-join query method and device based on homomorphic encryption, which solves the problem that the encryption algorithm in the prior art will cause data to lose semantic information and cannot perform ciphertext query on the database, and realizes support for multi-attribute aggregate equal-join query on the encrypted database.

[0010] In a first aspect, the present invention provides a multi-attribute aggregation equal-join query method based on homomorphic encryption, the method comprising:

[0011] Obtain the result table to be encrypted, and use the key generation algorithm and the result table to be encrypted to generate public parameters and keys; wherein the result table to be encrypted includes: data of value attributes, data of grouping attributes and data of filtering attributes; the keys include: encryption public key pk, decryption private key sk, mapping function F and SSE key K SSE ;

[0012] Encrypt the result table to be encrypted using a data table encryption algorithm, the public parameters and the key to obtain an index and an encryption result;

[0013] A bucket query token for each grouping bucket generated according to the SQL is used, and a multi-attribute aggregation equal join algorithm is used to perform an aggregation query to obtain an aggregation query result;

[0014] The aggregate query result is decrypted using the decryption private key sk to obtain the query result.

[0015] In combination with the first aspect, in a possible implementation manner, the step of generating the public parameters and the key using the key generation algorithm and the table of results to be encrypted includes:

[0016] Generate the encryption public key pk and decryption private key sk of the SWHE algorithm according to the security parameters;

[0017] Defining the mapping function F; wherein the mapping function F determines the location where the data in the grouping attribute is mapped to the grouping bucket;

[0018] Generate the SSE key K according to the security parameter SSE .

[0019] In combination with the first aspect, in a possible implementation manner, encrypting the to-be-encrypted result table using a data table encryption algorithm, the public parameters, and the key to obtain an index and an encryption result includes:

[0020] Calculate the bucket offset position of the data of the grouping attribute in each row of data in the to-be-encrypted result table in the grouping bucket;

[0021] According to the bucket offset position and the SSE key K SSE Create an index; wherein the index represents the data row corresponding to each grouping bucket;

[0022] The data encryption calculation is performed according to a single-row data encryption method using the row offset position and the data value in the data of the value attribute in the corresponding row data to obtain an encryption result.

[0023] In combination with the first aspect, in a possible implementation, the data encryption calculation is performed according to a single-row data encryption method using the data value in the data of the value attribute in the bucketized offset position and the corresponding row data to obtain an encryption result, including:

[0024] Encoding the bucketized offset position of each row into the plaintext space of the SWHE algorithm to obtain a first code;

[0025] The first code of each row is encrypted using the encryption public key pk to obtain an encryption result.

[0026] In combination with the first aspect, in a possible implementation manner, the query token for each grouping bucket generated according to SQL includes:

[0027] Obtain a value identifier in the SQL and a grouping attribute identifier in the SQL;

[0028] The number of grouping buckets of data for each grouping attribute in the SQL is calculated using the value identifier and the grouping attribute identifier, and the SSE key K is used to calculate the number of grouping buckets of data for each grouping attribute in the SQL SSE Create a query token for each grouping bucket.

[0029] In combination with the first aspect, in a possible implementation, the multi-attribute aggregation equi-join algorithm is used to perform an aggregate query to obtain an aggregate query result, including:

[0030] Query the encryption result according to the bucket query token to obtain aggregate bucket intersection data;

[0031] Calculate the offset of each row of data in the intersection data of the aggregation buckets according to the polynomial to obtain a first offset;

[0032] The product of the first offset and the data of the value attribute in each row of data is calculated by using homomorphic multiplication to obtain an aggregate query result of the same aggregate bucket.

[0033] In a second aspect, the present invention provides a multi-attribute aggregation equal-value connection query device based on homomorphic encryption, which is applied to a client and includes: a key generation module, an encryption module, and a search module;

[0034] The key generation module is used to obtain the result table to be encrypted, and generate public parameters and keys using the key generation algorithm and the result table to be encrypted;

[0035] The encryption module is used to encrypt the result table to be encrypted using the data table encryption algorithm, the public parameters and the key to obtain an index and an encryption result;

[0036] The search module is used to decrypt the aggregated query result using the key to obtain the query result.

[0037] One or more technical solutions provided in the present invention have at least the following technical effects or advantages:

[0038] (1) The present invention uses a data table generation algorithm to solve the problem of secure query of a single-server encrypted database in the prior art, and implements multi-attribute aggregation equal-join query on the encrypted database;

[0039] (2) The present invention utilizes a data table encryption algorithm and an aggregation algorithm to solve the problem in the prior art that encrypted data may lead to redundant data, thereby realizing a secure encrypted data query solution without requiring additional data. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 A flowchart of the steps of a multi-attribute aggregation equal-join query method based on homomorphic encryption provided in an embodiment of the present invention;

[0041] Figure 2 A schematic diagram of a method for generating public parameters and a key provided in an embodiment of the present invention;

[0042] Figure 3 A diagram of a data table encryption algorithm provided by an embodiment of the present invention;

[0043] Figure 4 A diagram of a single-row data encryption algorithm provided by an embodiment of the present invention;

[0044] Figure 5 A diagram of a group token generation algorithm provided by an embodiment of the present invention;

[0045] Figure 6 A diagram of a multi-attribute aggregation equi-join algorithm provided in an embodiment of the present invention;

[0046] Figure 7 A graph of aggregate polynomial matrix multiplication provided by an embodiment of the present invention;

[0047] Figure 8 The result of performing single-table aggregation on Table 1 provided in the embodiment of the present invention;

[0048] Fig. 9 The result of performing single-table aggregation on Table 2 provided in the embodiment of the present invention;

[0049] Fig.10 This is the final aggregation connection result provided by the embodiment of the present invention. DETAILED DESCRIPTION

[0050] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0051] The present invention provides a multi-attribute aggregation equal-join query method based on homomorphic encryption, which includes the following steps S101 to S104.

[0052] S101, obtain the result table to be encrypted, and use the key generation algorithm and the result table to be encrypted to generate public parameters and keys; wherein the result table to be encrypted includes: data of value attributes, data of grouping attributes and data of filtering attributes; the keys include: encryption public key pk, decryption private key sk, mapping function F and SSE key K SSE .

[0053] Specifically, in step S101, a public parameter and a key are generated using a key generation algorithm and a table of results to be encrypted, including the following steps S1011 to S1013.

[0054] S1011, generate the encryption public key pk and decryption private key sk of the SWHE algorithm according to the security parameters. Here, the quasi-homomorphic encryption algorithm (SWHE) is used to encrypt the data. The SWHE algorithm still guarantees the homomorphic property after calculating the homomorphic multiplication. The searchable encryption algorithm (SSE) supports searching encrypted documents based on tokens.

[0055] Input SWHE security parameter λ0, SSE security parameter λ1 and data attribute value range, output public parameter pp and key K, where K contains SWHE encryption and decryption key (pk, sk), SSE key K SSE and mapping functions.

[0056] S1012, defining a mapping function F, wherein the mapping function F determines the position where the data in the grouping attribute is mapped to the grouping bucket.

[0057] S1013, generate SSE key K according to security parameters SSE .

[0058] For example, as shown in Table 1, "Salary" is a value attribute, "Gender" and "Department" are group attributes, and "Department" is a filter attribute. Table 2 is a table connected with Table 1, in which "Department" and "Title" are group attributes, and "Department" is a filter attribute.

[0059] Table 1 Examples of supported aggregate join queries

[0060] ID Salary Gender Department 1 1000 male Sales 2 5000 female Sales 3 1500 female Finance 4 3000 male Sales 5 2000 male Facility

[0061] Table 2 Examples of supported aggregate join queries

[0062] ID Department Title 1 Sales Manager 2 Sales HR 3 Sales HR 4 Sales Assistant 5 Finance Manager 6 Finance HR 7 Finance Engineer 8 Facility Manager 9 Admin HR

[0063] Exemplarily, the security parameters of the encryption key and the value range of the grouping attribute are input. Figure 2 The algorithm 1 shown firstly calculates the security parameter Generate the encryption key and decryption private key of the SWHE algorithm, corresponding to the second line of Algorithm 1; determine the mapping function, that is, a certain value in each group attribute is mapped to the position of the group bucket, corresponding to the third line of Algorithm 1; determine the public parameters, which include the public key of the SWHE algorithm and the polynomial parameters when the group attributes are aggregated, corresponding to the fourth line of Algorithm 1; according to the security parameters Generate SSE key, corresponding to line 5 of Algorithm 1; finally return public parameter pp and key K = {pk, sk, F, K SSE}.

[0064] S102, encrypting the result table to be encrypted using the data table encryption algorithm, public parameters and a key to obtain an index and an encryption result.

[0065] Specifically, in step S102, the table of results to be encrypted is encrypted using a data table encryption algorithm, public parameters and a key to obtain an index and an encryption result, including the following steps S1021 to S1023.

[0066] S1021, calculate the bucket offset position of the data of the grouping attribute in each row of data in the result table to be encrypted in the grouping bucket. Here, the ciphertext space M of SWHE is composed of multiple independent blocks. During aggregation, each block represents an aggregation result, and the value range of the block is represented by D v For example, the plaintext space M of the Paillier homomorphic encryption scheme is 2048 bits, the size of the block D is 32 bits, and the block value range is D v =0,…,2 32 -1.

[0067] First, define a mapping function f:D→0,…,|D|-1 to map the attribute value to a positive integer. Use the mapping result to determine the offset value s of the value attribute v. Construct a mapping function f for the value attribute "Salary" and the group attribute "Gender" in Table 1. The group attribute domain of "Gender" is D={female, male}. When the attribute value of "Gender" is "male", the mapping result is 0, and when the attribute value of "Gender" is "female", the mapping result is 1. The mapping result represents the offset position of the attribute corresponding to the grouping attribute in the ciphertext space, which is expressed by the formula s(g)=|D v | f(g) .

[0068] Divide the group attributes into different data buckets, each bucket has a size of B, and the size of the offset position occupied by each group attribute in the plaintext space cannot exceed the size of the group bucket. The "Department" group attribute domain D = {Sales, Finance, Facility}, the mapping function maps the attribute value "Sales" to 0, the attribute value "Finance" to 1, and the attribute value "Facility" to the ciphertext space 2. Set the size of the group bucket B to 2. At this time, the offsets of "Sales" and "Finance" in the plaintext space remain unchanged. The data of these two items are in the same bucket, recorded as "Dept1", and the "Facility" offset exceeds the area that the bucket can represent. Create a bucket "Dept2". In "Dept2", its offset value is equal to the mapping result modulo the bucket size B, that is, "Facility" is mapped to the 0th block of the ciphertext space of bucket "Dept2". The offset after bucketization, that is, the bucketized offset position can be used using the formula s(g) = |D v | f(g) modB description.

[0069] S1022, based on the bucket offset position and SSE key K SSE Create an index; the index represents the data row corresponding to each grouping bucket.

[0070] S1023, performing data encryption calculation on the data value in the bucketed offset position and the data attribute in the corresponding row data according to the single-row data encryption method to obtain an encryption result, which specifically includes the following steps.

[0071] (1) Encode the bucketized offset position of each row into the plaintext space of the SWHE algorithm to obtain the first code.

[0072] (2) Encrypt the first code of each row using the encryption public key pk to obtain an encryption result.

[0073] Exemplarily, in step S1023, the data v of the value attribute is multiplied by the offset s(g)=|D v | f(g) modB is used to encode the value attribute and the group attribute offset. The value attribute and the group attribute offset are stored separately, and the homomorphic multiplication is calculated on the server when querying. The group attribute value g i The shift s(g i ) can be calculated from the polynomial. Determine the polynomial coefficients, so that for x = f(g i )(modB), satisfying P(x)=s(g i )=|D v | x For the group attribute "Gender", when its attribute value is "male", x(g0) = 0, P(0) = s(g0) = |2 32 | 0 =1; when the attribute value is "female", x(g0) = 1, P(1) = s(g1) = |2 32 |=2 32 .

[0074]

[0075] The above equations are obtained by combining the formulas, and the solution is a0=1, a1=2 32 -1, that is, P(x) = 1 + (2 32 -1)x.

[0076] The offset of multiple group attributes uses the attribute combination G1, ..., G of l variables. l The polynomial determination of :

[0077]

[0078] Assume that the bucket size B = 2, and use G1 to represent the attribute "Gender" and G2 to represent the attribute "Department". When the value of G1 is "male" and G2 is "Sales", the offset value is 0, that is, the aggregation result is located in the 0th block in the ciphertext space; when the value of G1 is "male" and G2 is "Finance", the offset value is 2 32 , the aggregation result is located in the first block in the ciphertext space; when the value of G1 is "female" and G2 is "Sales", the offset value is 2 64 , the aggregation result is located in the second block in the ciphertext space; when the value of G1 is "male" and G2 is "Finance", the offset value is 2 96 , the aggregation result is located in the third block in the ciphertext space.

[0079]

[0080] Exemplarily, in step S102, if Figure 3 As shown in Figure 1, the input of the data table encryption algorithm is the parameter K and the information of the data table; the algorithm first calculates the offset position of the grouping attribute in each row of data in the grouping bucket, and then calculates the offset position of the grouping attribute in the grouping bucket according to K. SSE Create index I based on the offset position, where index I represents the data row corresponding to each grouping bucket. This process corresponds to lines 2-3 in Algorithm 2. Then calculate the offset position of the grouping attribute in the i-th row of data, and encrypt the real value of the value attribute of this row of data and the offset of the grouping attribute to perform a single-row data encryption algorithm calculation, corresponding to lines 4-5 of the algorithm. Finally, return index I and encryption result C.

[0081] like Figure 4 As shown in FIG. 1 , it is a single-row data encryption algorithm. The input of the single-row data encryption algorithm is the encryption public key pk, the true value of the value attribute in a row of data, and the offset result of the grouping attribute. The single-row data encryption algorithm first encodes the offset result of the grouping attribute into the plaintext space of the SWHE algorithm and then encrypts it.

[0082] S103, generating a bucket query token for each grouping bucket according to SQL, and using a multi-attribute aggregation equal join algorithm to perform an aggregation query to obtain an aggregation query result.

[0083] Specifically, in step S103, the query token for each grouping bucket is generated according to SQL, including the following steps.

[0084] (1) Obtain the value identifier V in SQL and the grouping attribute identifier Q in SQL.

[0085] (2) Use the value identifier V and the grouping attribute identifier Q to calculate the number of grouping buckets for each grouping attribute in SQL, and use the SSE key K SSECreate a query token for each grouping bucket.

[0086] Specifically, in step S103, a multi-attribute aggregation equijoin algorithm is used to perform an aggregation query to obtain an aggregation query result, including the following steps S1031 to S1033.

[0087] S1031, query the encryption result according to the bucket query token to obtain the aggregated bucket intersection data.

[0088] S1032, calculating the offset of each row of data in the intersection data of the aggregation buckets according to the polynomial to obtain a first offset.

[0089] S1033, using homomorphic multiplication to calculate the product of the first offset and the data of the value attribute in each row of data, to obtain an aggregate query result of the same aggregation bucket.

[0090] For example, Figure 5 As shown in the figure, the grouping token generation algorithm diagram is used. The input of the grouping token generation algorithm is the key K, the value attribute identifier of the query statement, and the grouping attribute identifier Q of the query statement. For each grouping attribute in the query statement, the number of grouping buckets of each grouping attribute is first calculated, and K is used to generate the grouping buckets. SSE Create a search token for each bucket. Finally, return the value attribute identifier, group attribute identifier, and token. Then use the search token to query the server.

[0091] The multi-attribute aggregation equal join query algorithm is as follows Figure 6 As shown. The input of Algorithm 5 is the public parameter pp, the query value attribute identifier V, the query group attribute identifier Q, the query token, the encrypted data C and the index I. The algorithm first calculates the number of grouping buckets and the number of polynomial coefficients corresponding to each grouping attribute in the query, and determines the polynomial coefficients and index of the query, which corresponds to lines 2-5 of the algorithm; using K SSE The search token is used to search for each grouping and aggregation bucket of the data table involving the value attribute in the equal connection, and is recorded as R1. SSE The search token is used to search for the grouping and aggregation buckets of the data table that does not involve the value attribute in the equal value connection, and it is recorded as R2. For each row of data in R1, the polynomial is used to calculate the offset result of the row of data after aggregation, and the result is homomorphically multiplied with the value attribute of the row of data to obtain the offset result of the single row of data. For each row of data in R2, the polynomial is used to calculate the offset result of the row of data after aggregation, and the result is multiplied with the value attribute of the row of data. Calculate homomorphic multiplication to get the offset result of a single row of data. Connect the aggregation results of the two tables through homomorphic multiplication, and finally output the aggregation result. The aggregation result received by the client is encrypted, so it is also necessary to decrypt the aggregation result.

[0092] S104, decrypt the aggregated query result using the decryption private key sk to obtain the query result.

[0093] The present invention provides a specific embodiment as follows.

[0094] The packet bucket size B used in the present invention is 2.

[0095] For data table 1, the grouping attribute "Gender" is constructed to map the attribute value "male" to the first block of the grouping bucket, and the attribute value "female" is mapped to the second block of the grouping bucket, that is, only one grouping bucket is needed, which is recorded as "Gen1". For the grouping attribute "Department", a mapping function is constructed to map the attribute value "Sales" to the first block of the grouping bucket, and the attribute value "Finance" is mapped to the second block of the grouping bucket, and the grouping bucket mapping these two grouping attributes is recorded as "Dept1", and the attribute value "Facility" is mapped to the first block of the grouping bucket, and this grouping bucket is recorded as "Dept2".

[0096] For data table 2, the value attribute "Admin" in the grouping attribute "Department" is mapped to the second block of the grouping bucket "Dept2". For the grouping attribute "Title", the value attribute "Manager" is mapped to the first block of the grouping bucket, and "HR" is mapped to the second block of the grouping bucket. The grouping bucket that maps these two attribute values ​​is recorded as "Title1", the value attribute "Assistant" is mapped to the first block of the grouping bucket, and the value attribute "Engineer" is mapped to the second block of the grouping bucket, and the grouping that maps these two value attributes is recorded as "Title2". According to the above mapping rules, the bucketing result tables of data table 1 and data table 2 can be obtained, as shown in Table 3 and Table 4 respectively.

[0097] Table 3 Example data Table 1 Bucketization results

[0098] Bucket Name Row Index Gen1 1-5 Dept1 1-4 Dept2 5 Title1 1-5 Title2 1-5

[0099] Table 4 Example data Table 2 Bucketization results

[0100] Bucket Name Row Index Gen1 1-9 Dept1 1-7 Dept2 8-9 Title1 1-3,5-6,8-9 Title2 4,7

[0101] Construct a polynomial to calculate the shift of different aggregation results. In the following formula, the "Gender" attribute is represented as G, the "Department" attribute is represented as "D", and the "Title" attribute is represented as "T". The matrix multiplication of the shift polynomial coefficients is as follows Figure 7 shown.

[0102] The result of the above multiplication is:

[0103]

[0104] The results of single-table aggregation in Table 1 are as follows Figure 8 As shown in Table 2, the results of single-table aggregation are as follows Fig. 9 The final aggregation result is as shown in Fig.10 shown.

[0105] According to the aggregation displacement corresponding to the above matrix multiplication, for the aggregation bucket "Gen1, Dept1, Title1", the ciphertext 0-31 block corresponds to the GDT "000", that is, the value of the "Gender" attribute is "male", the value of the "Department" attribute is "Sales", and the value corresponding to the "Title" attribute. The result of the aggregation bucket corresponds to the plaintext result as shown in Table 5:

[0106] Table 5 Decryption results of the aggregation bucket "Gen1, Dept1, Title1"

[0107] Offset Position GDT Results Gender Department Title sum(Salary) 0-31 000 male Sales Manager 4000 32-63 001 male Sales HR 8000 128-159 100 female Sales Manager 5000 160-191 101 female Sales HR 10000 192-223 110 female Finance Manager 1500 224-255 111 female Finance HR 1500

[0108] Similarly, the encryption result of the aggregation bucket "Gen, Dept1, Title2" is shown in Table 6 below:

[0109] Table 6 Decryption results of the aggregation bucket "Gen1, Dept1, Title2"

[0110] Offset Position GDT Results Gender Department Title sum(Salary) 0-31 000 male Sales Assistant 4000 128-159 100 female Sales Assistant 5000 224-255 111 female Finance Engineer 1500

[0111] Similarly, the encryption result of the aggregation bucket "Gen, Dept2, Title1" is shown in Table 7 below:

[0112] Table 7 Decryption results of the aggregation bucket "Gen1, Dept2, Title1"

[0113] Offset Position GDT Results Gender Department Title sum(Salary) 0-31 000 male Facility Manager 2000

[0114] The above results are consistent with those of the query on the plain text.

[0115] This scheme proposes a database encryption scheme based on homomorphic encryption and searchable symmetric encryption algorithm, which can support multi-attribute aggregation equal join queries on encrypted databases.

[0116] The present invention provides a multi-attribute aggregate equal-connection query device based on homomorphic encryption, which includes: a server-side device and a client-side device; the client-side device includes: a key generation module, an encryption module, and a search module; the server-side device includes: an aggregate query module.

[0117] The key generation module is used to obtain the result table to be encrypted, and use the key generation algorithm and the result table to be encrypted to generate public parameters and keys. Specifically, the SAGMA scheme uses a quasi-homomorphic encryption algorithm (SWHE) to encrypt data. The SWHE algorithm still guarantees the homomorphic property after calculating homomorphic multiplication. The searchable encryption algorithm (SSE) supports searching encrypted documents based on tokens. In addition, the key generation module is also responsible for constructing a mapping function based on attribute values. The key generation module inputs the SWHE security parameter λ0, the SSE security parameter λ1, and the data attribute value domain, and outputs the public parameter pp and the key K, where K contains the SWHE encryption and decryption key (pk, sk), the SSE key K SSE and mapping functions.

[0118] The encryption module is used to encrypt the result table to be encrypted using the data table encryption algorithm, public parameters and keys to obtain the index and encryption results. Specifically, SAGMA uses the SSE algorithm to build the index of the group attribute bucket and data row. The encrypted index is created based on all bucket identifiers of the complete data table. The document set D corresponds to the entire data table. One document corresponds to a row of data. Each document contains a specific bucket identifier as a searchable keyword. The SSE algorithm ensures that only the token generated by the client can obtain the data row contained in a specific data bucket. SAGMA uses the SWHE algorithm to encrypt the data and group attribute mapping results of the value attribute of the data row, and finally outsources the encryption result to an untrusted server.

[0119] The search module is used to decrypt the aggregate query results using the key to obtain the query results. Specifically, when the client initiates a query, the search module builds a bucket token based on the input search SQL and generates polynomial coefficients for calculating the aggregate displacement, and then sends the query, search token and coefficients to the server. The server calculates the aggregate result and sends it to the client, which decrypts the aggregate result using the private key.

[0120] The aggregation query module is used to obtain the client SQL, and query the bucket token of each grouping bucket generated by the SQL, and use the multi-attribute aggregation equal connection algorithm to perform aggregation query, obtain the aggregation query result, and return the aggregation query result to the client. The aggregation query module is divided into an aggregation unit and a query unit.

[0121] The aggregation unit is located on the server. After receiving the query request from the client, the server queries the data set based on the bucket token and finds the data of the intersection of the aggregation buckets. The query unit calculates the offset of each row of data in the attribute bucket based on the polynomial, uses homomorphic multiplication to calculate the product of the offset result and the data of the value attribute, and uses homomorphic addition to calculate the sum of the data in the same aggregation bucket. Finally, the aggregation results of each aggregation bucket are sent to the client.

[0122] Exemplarily, when storing data, the client first generates the SWHE algorithm key for the encrypted data table and the SSE key for data search, and defines the mapping function of each specific attribute value in the group attribute to the offset position of the plaintext space block; the equivalent connection in this scheme is obtained by calculating the homomorphic multiplication of the single-table aggregation results of the two data tables, so it is necessary to expand the grouping bucket of the data table so that the grouping buckets of the two connected tables are the same. The bucket expansion technology will be described in detail below; then the data in the data table is encrypted using the SWHE encryption algorithm and uploaded to a third-party server. When querying data, the client first generates a query token for the group to be queried according to the query statement, and generates the polynomial coefficients for calculating the aggregate displacement, and then sends the query, search token and coefficient to the server. The server performs an aggregate query based on the token and the aggregate query algorithm, and sends the queried encrypted data to the client.

[0123] Although the present invention provides method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in this embodiment is only one way of executing the order of many steps and does not represent the only execution order. When the device or client product in practice is executed, it can be executed in sequence or in parallel according to the method shown in this embodiment or the accompanying drawings (for example, in a parallel processor or multi-threaded processing environment).

[0124] The devices or modules described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. For the convenience of description, the above devices are described in various modules according to their functions. When implementing the present invention, the functions of each module can be implemented in the same or multiple software and / or hardware. Of course, the module that implements a certain function can also be implemented by combining multiple sub-modules or sub-units.

[0125] Some modules in the apparatus of the present invention may be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, classes, etc. that perform specific tasks or implement specific abstract data types. The present invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0126] It can be known from the description of the above implementation mode that a person skilled in the art can clearly understand that the present invention can be implemented by means of software plus necessary hardware. Based on such an understanding, the technical solution of the present invention, in essence or in other words, the part that contributes to the prior art, can be embodied in the form of a software product, or can be embodied in the implementation process of data migration. The computer software product can be stored in a storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a mobile terminal, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention or certain parts of the embodiments.

[0127] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. All or part of the present invention can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, mobile communication terminals, multi-processor systems, microprocessor-based systems, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.

[0128] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some or all of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the present invention.

Claims

1. A multi-attribute aggregation equal-join query method based on homomorphic encryption, characterized in that: include: Obtain the result table to be encrypted, and use the key generation algorithm and the result table to be encrypted to generate public parameters and keys; wherein the result table to be encrypted includes: data of value attributes and data of group attributes; the keys include: encryption public key pk, decryption private key sk, mapping function F and SSE key K SSE ; Encrypt the result table to be encrypted using a data table encryption algorithm, the public parameters and the key to obtain an index and an encryption result; Based on the bucket query token of each grouping bucket generated by SQL, an aggregate query is performed using a multi-attribute aggregation equal join algorithm to obtain an aggregate query result; The aggregate query result is decrypted using the decryption private key sk to obtain the query result.

2. According to the multi-attribute aggregation equal-value connection query method based on homomorphic encryption according to claim 1, it is characterized in that: The step of generating public parameters and keys by using a key generation algorithm and the table of results to be encrypted includes: Generate the encryption public key pk and decryption private key sk of the SWHE algorithm according to the security parameters; Defining the mapping function F; wherein the mapping function F determines the location of the data of the grouping attribute mapped to the grouping bucket; Generate the SSE key K based on the security parameter SSE .

3. The multi-attribute aggregation equal-join query method based on homomorphic encryption according to claim 1 is characterized in that: The method of encrypting the result table to be encrypted by using the data table encryption algorithm, the public parameters and the key to obtain an index and an encryption result includes: Calculate the bucket offset position of the data of the grouping attribute in each row of data in the to-be-encrypted result table in the grouping bucket; According to the bucket offset position and the SSE key K SSE Create an index; wherein the index represents the data row corresponding to each grouping bucket; The data value in the data of the value attribute in the bucketized offset position and the corresponding row data is subjected to data encryption calculation according to a single-row data encryption method to obtain an encryption result.

4. The multi-attribute aggregation equal-join query method based on homomorphic encryption according to claim 3 is characterized in that: The step of performing data encryption calculation on the data value in the data of the value attribute in the bucketized offset position and the corresponding row data according to a single row data encryption method to obtain an encryption result includes: Encoding the bucketized offset position of each row into the plaintext space of the SWHE algorithm to obtain a first code; The first code of each row is encrypted using the encryption public key pk to obtain an encryption result.

5. The multi-attribute aggregation equal-value connection query method based on homomorphic encryption according to claim 1 is characterized in that: The bucket query token for each grouping bucket generated according to SQL includes: Obtain a value identifier in the SQL and a grouping attribute identifier in the SQL; The number of grouping buckets of data for each grouping attribute in the SQL is calculated using the value identifier and the grouping attribute identifier, and the SSE key K is used to calculate the number of grouping buckets of data for each grouping attribute in the SQL SSE Create a query token for each grouping bucket.

6. The multi-attribute aggregation equal-value connection query method based on homomorphic encryption according to claim 1 is characterized in that: The multi-attribute aggregation equal join algorithm is used to perform the aggregation query to obtain the aggregation query result, including: Query the encryption result according to the bucket query token to obtain aggregate bucket intersection data; Calculate the offset of each row of data in the intersection data of the aggregation buckets according to the polynomial to obtain a first offset; The product of the first offset and the data of the value attribute in each row of data is calculated by using homomorphic multiplication to obtain an aggregate query result of the same aggregate bucket.

7. A multi-attribute aggregation equal-value connection query device based on homomorphic encryption, characterized in that: Applied to the client, the multi-attribute aggregation equal-value connection query device includes: a key generation module, an encryption module, and a search module; The key generation module is used to obtain the result table to be encrypted, and generate public parameters and keys using the key generation algorithm and the result table to be encrypted; The encryption module is used to encrypt the result table to be encrypted using the data table encryption algorithm, the public parameters and the key to obtain an index and an encryption result; The search module is used to decrypt the aggregated query result using the key to obtain the query result.

Citation Information

Cited By

  • Acceleration method for aggregation query of outsourcing homomorphic encryption database

    CN119720282A

  • Selective data aggregation method and system based on conditional classification coding

    CN120030577A