A frequency-hiding semantically secure fuzzy searchable ciphertext query method
By generating semantically secure frequency-hidden ciphertext through AES ciphertext substitution and frequency hiding algorithms, the problems of low efficiency, large storage, and frequency leakage in fuzzy queries are solved, thus achieving efficient and secure fuzzy queries.
Patent Information
- Application Number
- CN202510292432.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-03-12
AI Technical Summary
Existing fuzzy encrypted query methods suffer from low efficiency, large storage space consumption, and security risks such as leakage of plaintext frequency information, which affect user data privacy and security.
The algorithm employs an AES-based ciphertext permutation algorithm and a frequency hiding algorithm. Plaintext is encrypted by generating an encrypted permutation mapping table, and random IVs and random position sequences are inserted into the ciphertext to generate semantically secure frequency hiding ciphertext. The original permutation ciphertext is then restored for fuzzy querying.
It improves the efficiency and security of fuzzy queries, prevents the leakage of plaintext frequency information, reduces storage overhead, and protects user data privacy.
Smart Images

Figure CN120144640B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of searchable ciphertext queries, and is mainly applied to the fuzzy searchable ciphertext query of relational databases. More specifically, it relates to a frequency-hiding semantically secure fuzzy searchable ciphertext query method. Background Art
[0002] The fuzzy query of a database refers to a technology for searching the content in a database through flexible conditions without completely precisely matching the data. It allows users to use incomplete, partially correct, or approximate inputs to find target data, and is commonly used to handle situations where information is incomplete or incorrect. For example, in the MYSQL database, to fuzzy query the records where the user name contains "Xiaohong", a fuzzy query statement can be constructed by using the like function in the where statement of the SQL query, such as select * from table where name like "%Xiaohong" to achieve the fuzzy query.
[0003] In today's big data era, the Internet is filled with a large amount of private data information of users. To protect the data privacy and security of users, data is usually stored in the database in ciphertext form. How to implement the fuzzy query of ciphertext data to meet the imprecise matching of ciphertext data, that is, the fuzzy query, has great value in practical applications.
[0004] Currently, the mainstream fuzzy ciphertext query methods are mainly divided into two types. One is to achieve fuzzy query based on keyword similarity. However, this method requires quantifying the similarity between keywords, which will generate a certain amount of computational overhead, affecting the query search efficiency, and the flexibility of the search is also affected by the preset similarity threshold. The other is to achieve fuzzy query based on constructing a fuzzy set. Although this method does not introduce additional computational overhead, it usually requires more storage space to maintain the preset fuzzy keyword set. Moreover, if the fuzzy set is not complete, the query results may not be returned. If the constructed fuzzy set is large, it will also affect the fuzzy query efficiency to a certain extent.
[0005] Moreover, if the method supporting ciphertext fuzzy query uses a deterministic encryption algorithm, the same plaintext will always generate the same ciphertext, and it is impossible to hide the frequency of the plaintext data. An attacker can recover most of the ciphertexts by obtaining the frequency information of the ciphertext, posing a great security risk to the data security of users. Therefore, when performing a fuzzy query on ciphertext data, it is necessary to consider the attack of plaintext data frequency leakage. It is necessary to use an efficient and secure encryption algorithm that can hide the frequency of plaintext data to encrypt the user's plaintext data, and then complete the fuzzy searchable ciphertext query of the ciphertext without leaking the plaintext frequency.
[0006] Therefore, it is necessary and practically valuable to study how to design an efficient fuzzy ciphertext query method that does not reveal the user's plaintext frequency information.
[0007] Current fuzzy encrypted text lookup methods have two main problems: 1. In terms of efficiency and storage, using fuzzy sets or similarity calculations results in fuzzy queries consuming significant storage space and having low efficiency. 2. In terms of security, using deterministic encryption algorithms to encrypt plaintext can leak frequency information, leading to certain security vulnerabilities. Summary of the Invention
[0008] To address this, this invention proposes a semantically secure fuzzy searchable ciphertext query method based on frequency hiding. Firstly, regarding security and efficiency, this fuzzy ciphertext query method employs an AES-based ciphertext permutation algorithm. It encrypts 256 different 2-digit hexadecimal numbers from 00 to FF using AES encryption. The encrypted AES ciphertext values are then sorted in ascending order of numerical value, with the smallest ciphertext value being 00 and the largest being FF. The order value of the AES ciphertext is used as the permutation mapping value for the corresponding plaintext byte, thus obtaining the permutation mapping values for the 256 combinations of the original plaintext bytes 00-FF and an encrypted permutation mapping table. Based on this encrypted permutation mapping table, the input string is encrypted and replaced, replacing each byte with its corresponding byte value. This ensures that the length of the encrypted ciphertext is equal to the length of the original plaintext information, without introducing additional ciphertext length expansion, thereby guaranteeing the efficiency and security of the fuzzy ciphertext query operation.
[0009] Secondly, to further ensure the security of fuzzy queries and prevent frequency information leakage caused by deterministic ciphertext permutation algorithms, this fuzzy ciphertext query method further employs a frequency-hidden ciphertext generation algorithm to randomly generate a random iv value of the same length as the permutation ciphertext for each row of the fuzzy query in the database. This iv is then XORed with the permutation ciphertext to generate a random ciphertext. Finally, the iv and the random ciphertext are inserted into the corresponding byte position of the final ciphertext based on a random position sequence randposition generated for each column, thereby generating a semantically safe frequency-hidden ciphertext for fuzzy queries.
[0010] Finally, a ciphertext substitution algorithm is used to generate a fuzzy query trapdoor Tr for the fuzzy query content. Then, a frequency-hidden ciphertext fuzzy query algorithm is used to remove the frequency-hidden ciphertext in the database to recover the original substitution ciphertext. This ciphertext is then matched with the fuzzy query trapdoor Tr to achieve efficient and semantically secure fuzzy query operations on ciphertext data.
[0011] To achieve the above objectives, the present invention provides the following technical solution:
[0012] A frequency-hidden, semantically secure fuzzy searchable ciphertext query method includes the following steps:
[0013] The plaintext data is replaced byte by byte according to the generated encrypted permutation mapping table using the AES ciphertext permutation algorithm to generate deterministic permutation ciphertext with the same length as the plaintext.
[0014] By randomly generating a random iv value of the same length as the permutation ciphertext for each row, XORing this iv with the permutation ciphertext to generate a random ciphertext, and inserting this iv and the random ciphertext into the corresponding byte position of the final ciphertext based on a random position sequence randposition generated for each column, a semantically secure frequency-hidden ciphertext is generated.
[0015] For the frequency-hidden ciphertext fuzzy query algorithm, the corresponding byte positions of the random IV and random ciphertext in the final frequency-hidden ciphertext are obtained by a custom function that generates a random position sequence randposition, thereby recovering the random IV and random ciphertext. Then, the original encrypted permutation ciphertext is recovered by XORing them. Finally, the ciphertext permutation algorithm is used to generate a fuzzy query trapdoor Tr for the fuzzy query content and to perform string matching with the encrypted permutation ciphertext.
[0016] In a further optimization of this technical solution, the AES ciphertext substitution algorithm generates an encryption result for each byte from 00 to FF using the AES encryption algorithm. Then, each byte is sorted according to the encryption result, and the sorted value is used as a mapping from 00 to FF, thereby generating an encryption substitution mapping table that maps the original byte to the ciphertext sorted value of the byte. The input string is then encrypted and substituted according to this encryption substitution mapping table, that is, each byte of the string is replaced with the corresponding byte value.
[0017] This technical solution is further optimized, and the specific steps of the AES ciphertext permutation algorithm are as follows:
[0018] S1.1 Encode each character in the original plaintext using UTF8;
[0019] S1.2. Use the AES256 encryption algorithm for encryption, use the encrypted AES ciphertext as the key, sort the key in ascending order, and then use the sorted AES ciphertext as the mapping of plaintext bytes 00-FF, thereby generating an encryption mapping table table_SPF for 256 combinations of plaintext bytes 00-FF.
[0020] S1.3. Based on the encryption permutation table table_SPF generated in S1.2, the UTF8 encoding of the original plaintext name is mapped one by one to the corresponding permutation ciphertext by looking up the encryption mapping table table_SPF, thereby generating the deterministic encryption permutation ciphertext C of the original plaintext name.
[0021] Further optimization of this technical solution includes the following steps:
[0022] S1.4 Unification of Deterministic Ciphertext Length: Based on the deterministic permutation ciphertext generated in steps S1.1-S1.3, the length L of the longest ciphertext in C is used as the standard. max To ensure consistency, pad the right side of each ciphertext with zeros, generating a ciphertext of uniform length L. max The ciphertext C';
[0023] S1.5, Generate random iv: For each ciphertext C' padded with 0, randomly generate a iv of length L. max The length of iv is the same as the length of C';
[0024] S1.6, Generate random ciphertext: Random ciphertext = Ciphertext C'⊕iv;
[0025] S1.7, Generate a random position sequence randposition: Using the key k and the attribute column name (e.g., name is the name attribute column of the data table), generate a sequence of length 2L. max A random position sequence randposition, where the first L positions of randposition are... max The bit represents the position of iv in the final frequency hidden ciphertext, and the L after randposition. max The bit represents the position of the random ciphertext within the final frequency-hidden ciphertext;
[0026] S1.8. Generate the extended column name_FH_fuzzy_ext containing the frequency-hidden ciphertext for fuzzy queries: Initialize the final frequency-hidden ciphertext C. final If it is NULL, then based on the first L of randposition. max The values of iv are inserted into the final frequency hidden ciphertext C. final The corresponding byte position, based on the L after randposition. max The random ciphertext is inserted into the final frequency hidden ciphertext C. final The corresponding byte position is used to obtain the final frequency-hidden ciphertext C. final Finally, the frequency is hidden in the ciphertext C. final Add it to the fuzzy query extended column name_FH_fuzzy_ext.
[0027] A further optimization of this technical solution is that the frequency-hidden ciphertext fuzzy query algorithm includes:
[0028] S2.1 The database client uses an AES-based ciphertext substitution algorithm to generate query substitution ciphertext: The database client uses the AES-based ciphertext substitution algorithm's encryption substitution function SPF() to encrypt and substitute all bytes of the UTF8 encoded query content one by one by searching the encryption substitution table table_SPF, thereby obtaining the query substitution ciphertext corresponding to the query content, i.e., the fuzzy query trapdoor Tr.
[0029] S2.2 The database client sends an SQL fuzzy query statement containing the ciphertext permutation query condition: The database client sends the SQL query statement containing the ciphertext permutation query condition SPF() to the database server, which is: select id, encrpt_name from table where FH_fuzzy_search(key k, attribute column name, SPF(), name_FH_fuzzy_ext) = 1. Here, "FH_fuzzy_search" is a user-defined fuzzy query function based on the frequency-hidden ciphertext fuzzy query algorithm.
[0030] Further optimization of this technical solution includes the following steps:
[0031] S2.3, Database server parses and executes SQL query statements: The database server parses the fuzzy query SQL statement by calling the custom fuzzy query function FH_fuzzy_search based on the frequency-hidden ciphertext fuzzy query algorithm, and generates a random position sequence randposition corresponding to the attribute column based on the key k and the attribute column name in the SQL statement.
[0032] S2.4 Database server-side recovery of iv and original deterministic cryptographic permutation ciphertext C': The database server uses the value of randposition to perform a fuzzy search on each row of ciphertext data in the extended column name_FH_fuzzy_ext in the data table to find iv. After removing iv, the remaining ciphertext can be obtained. The remaining ciphertext is ⊕iv = C', thus obtaining the original deterministic cryptographic permutation ciphertext C'.
[0033] S2.5 Database server performs string matching to return encrypted data: The query permutation ciphertext SPF() is matched against the deterministic encrypted permutation ciphertext C'. If a match is found, the database server will return the encrypted data in the ciphertext column such as the encrpt_name column that meets the query conditions to the database client user.
[0034] S2.6 Database client uses decryption key to decrypt and obtain original plaintext: Database client user uses its symmetric encryption key key_AES stored on the client to decrypt the returned ciphertext, thereby obtaining all plaintext data that meets the fuzzy query conditions.
[0035] Unlike existing technologies, the above technical solution has the following beneficial effects:
[0036] 1. Improved the query efficiency of fuzzy search for encrypted data;
[0037] 2. Improved the computational and storage overhead of current fuzzy queries on encrypted data;
[0038] 3. Resolved the issue of frequency information leakage caused by dense data during fuzzy queries;
[0039] 4. Improved the scalability of fuzzy queries for dense data. Attached Figure Description
[0040] Figure 1 A schematic diagram of a semantically secure fuzzy searchable ciphertext query method for frequency hiding;
[0041] Figure 2 A schematic diagram for generating an extended column for a fuzzy query containing frequency-hidden ciphertext;
[0042] Figure 3 Generate encrypted permutation representation intent for AES-based ciphertext permutation algorithms;
[0043] Figure 4 This is a diagram illustrating a fuzzy query for frequency-hidden ciphertext. Detailed Implementation
[0044] To explain in detail the technical content, structural features, objectives, and effects of the technical solution, the following description is provided in conjunction with specific embodiments and accompanying drawings.
[0045] To prevent attackers from obtaining users' plaintext frequency information through their ciphertext and recovering their data, thus avoiding the leakage of users' privacy information, frequency hiding security processing is applied to each row of encrypted permutation ciphertext in the fuzzy query. The main implementation of the semantically secure fuzzy searchable ciphertext query method based on frequency hiding is as follows: For each row of deterministic ciphertext in the fuzzy query, a random iv value of the same length as the ciphertext is randomly generated, and this iv is XORed with the ciphertext to generate a random ciphertext. Then, this iv and the random ciphertext are used to generate a random position sequence randposition (whose value is the insertion position information of the iv and the random ciphertext) based on each column, and inserted into the corresponding byte position of the final ciphertext, thereby generating semantically secure frequency-hidden ciphertext for fuzzy queries.
[0046] The main implementation process of the fuzzy searchable ciphertext query method with frequency hiding is as follows:
[0047] First, the generation from user plaintext data to ciphertext data (this step is also used to return the ciphertext data corresponding to the original plaintext that meets the fuzzy query conditions later): To prevent the data stored by the user on the database from being leaked, before the user sends its data to the database server for storage, the user first encrypts the original plaintext columns of its plaintext data, such as the plaintext data tables containing the user's name, ID number, mobile phone number, etc., using the AES encryption algorithm. Here, taking the name column as an example, a 256-bit symmetric encryption key key_AES is used for encryption, and the generated ciphertext replaces the plaintext, thus forming a ciphertext column, such as the encrypted name column encrpt_name.
[0048] Secondly, the frequency-hiding ciphertext fuzzy query extension column with semantic security: While generating the ciphertext column above, for the attribute columns such as name, ID number, and mobile phone number in the database that need to perform fuzzy queries, the frequency-hiding ciphertext generation algorithm is used to generate the frequency-hiding ciphertext fuzzy query extension column respectively. Here, taking the frequency-hiding ciphertext fuzzy query extension column name_FH_fuzzy_ext of the name as an example, by using the de-frequency-hiding ciphertext fuzzy query algorithm to match the fuzzy query conditions with the data in the extension column name__FH_fuzzy_ext, the corresponding ciphertext column such as the ciphertext data in the encrpt_name column that meets the fuzzy query conditions is returned to the user, and then the user decrypts it with the symmetric encryption key key_AES stored on the client side to obtain all the plaintext data that meets its fuzzy query conditions.
[0049] The fuzzy searchable ciphertext query method with frequency-hiding semantic security consists of two entities: the database client and the database server. To achieve secure fuzzy queries against frequency leakage attacks, the database client sends the selectid, encrpt_name fromtable where FH_fuzzy_search(secret key k, attribute column name, SPF('Liu'), name_FH_fuzzy_ext)=1; this SQL fuzzy query statement containing the user-defined function FH_fuzzy_search to the database server. Among them, "FH_fuzzy_search" is a user-defined fuzzy query function based on the de-frequency-hiding ciphertext fuzzy query algorithm, and "SPF" is a user-defined encryption permutation function based on the AES ciphertext permutation algorithm. This "attribute column name" is the name of the attribute field to be queried, such as name. The database server side analyzes the query SQL statement and executes the fuzzy ciphertext query request of the client.
[0050] The specific implementation process of the semantic-secure fuzzy query method with frequency hiding mainly includes two parts: generating the frequency-hiding ciphertext fuzzy query extended column based on the frequency-hiding ciphertext generation algorithm and performing the fuzzy query on the frequency-hiding ciphertext fuzzy query extended column based on the de-frequency-hiding ciphertext fuzzy query algorithm, as Figure 1 shown.
[0051] (1) Generate the fuzzy query extended column name_FH_fuzzy_ext containing frequency-hiding ciphertext
[0052] Generating the fuzzy query extended column name_FH_fuzzy_ext containing frequency-hiding ciphertext is performed by the user on the database client, and then the client sends the generated ciphertext data to the database server for subsequent fuzzy searchable ciphertext queries. The following is a process of how to generate the fuzzy query extended column containing frequency-hiding ciphertext from the data in the plaintext attribute name column, as Figure 2 shown.
[0053] Steps ①-③ are the specific implementation of the ciphertext permutation algorithm based on AES, which first performs deterministic permutation encryption on the plaintext data. To prevent the problem that the same plaintext is encrypted into the same ciphertext due to deterministic permutation encryption, thereby leaking the frequency of the plaintext data, further, in steps ④-⑧, frequency hiding is performed on the ciphertext after deterministic permutation encryption. Steps ④-⑧ are the specific implementation of the frequency-hiding ciphertext generation algorithm. Next, taking the data 'Liu Zheli' in the plaintext name column as an example, the main implementation process is described:
[0054] ① UTF8 encoding: Each character in the original plaintext 'Liu Zheli' is encoded using UTF8 respectively: UTF8(Liu) UTF8(Zhe) UTF8(Li). The result of encoding a single character such as 'Liu' using UTF8, UTF8(Liu), occupies 3 bytes. For example, UTF8(Liu) = 0xE58898.
[0055] ② Generate the encryption permutation table based on the AES ciphertext permutation algorithm: Since a Chinese character is 3 bytes, and each byte such as 0xE5 is represented by 2-digit hexadecimal numbers, and there are 16 2 (256) combinations of 2-digit hexadecimal numbers from 00 to FF. Each of these 256 combinations of 2-digit hexadecimal numbers is encrypted using the AES256 encryption algorithm, and the encrypted AES ciphertext is used as the key value key. The key values key are sorted in ascending order according to the numerical relationship. The sequence value of the smallest ciphertext value is set to 00, and the sequence value of the largest ciphertext value is set to FF. Then, the sequence value of the AES ciphertext is used as the permutation mapping value of the corresponding plaintext byte, thereby generating the permutation mapping values and the encryption permutation mapping table table_SPF for the 256 combinations of plaintext bytes from 00 to FF, as Figure 3 shown.
[0056] ③ Generate deterministic permutation ciphertext based on the encryption permutation table: Based on the encryption mapping table table_SPF generated in ②, the UTF8 encoding of the original plaintext name in the name column is mapped one by one to the corresponding permutation ciphertext by searching the encryption mapping table table_SPF, thereby generating the deterministic encrypted permutation ciphertext C of the original plaintext name.
[0057] ④ Standardizing the length of deterministic ciphertext: Based on the deterministic permutation ciphertext generated in steps ①-③ above, the length L of the longest ciphertext in C is used as the standard. max To ensure consistency, pad the right side of each ciphertext with zeros, generating a ciphertext of uniform length L. max The ciphertext C'.
[0058] ⑤ Generate random iv: For each ciphertext C' padded with 0, randomly generate an iv of length L. max The length of iv is the same as the length of C'.
[0059] ⑥ Generate random ciphertext: Random ciphertext = Ciphertext C'⊕iv.
[0060] ⑦ Generate a random position sequence randposition: Use the key k and the attribute column name (e.g., name is the name attribute column of the data table) to generate a sequence of length 2L. max The random position sequence randposition. The first L positions of randposition are... max The bit represents the position of iv in the final frequency hidden ciphertext, and the L after randposition. max The bit represents the position of the random ciphertext within the final frequency-hidden ciphertext.
[0061] ⑧ Generate the extended column name_FH_fuzzy_ext containing the frequency-hidden ciphertext for fuzzy queries: Initialize the final frequency-hidden ciphertext C final If it is NULL, then based on the first L of randposition. max The values of iv are inserted into the final frequency hidden ciphertext C. final The corresponding byte position. Based on the L after randposition. max The random ciphertext is inserted into the final frequency hidden ciphertext C. final The corresponding byte position is used to obtain the final frequency-hidden ciphertext C. final Finally, the frequency is hidden in the ciphertext C. final Add it to the fuzzy query extended column name_FH_fuzzy_ext.
[0062] (2) Fuzzy query on the extended column name_FH_fuzzy_ext of frequency-hidden ciphertext
[0063] When the database client wants to perform a fuzzy query on the extended column name_FH_fuzzy_ext of frequency-hidden ciphertext stored on the database server, the specific implementation process is as follows Figure 4 shown.
[0064] The first step is to generate a query permutation ciphertext based on the AES ciphertext permutation algorithm, that is, the fuzzy query trapdoor Tr. The second step is to initiate a fuzzy query request using the custom fuzzy query function FH_fuzzy_search. The third to sixth steps are the specific implementation of the frequency-hidden ciphertext fuzzy query algorithm based on frequency removal, which is to perform frequency removal and fuzzy query processing operations on the frequency-hidden ciphertext in the extended column. The specific implementation process includes the following 6 steps:
[0065] ① The database client uses the AES ciphertext permutation algorithm to generate a query permutation ciphertext: The database client uses the encryption permutation function SPF('Liu') of the AES ciphertext permutation algorithm to encrypt and permute each byte of the UTF8 encoding of the query content such as 'Liu' one by one through looking up the encryption permutation table table_SPF, so as to obtain the query permutation ciphertext corresponding to the query content, that is, the fuzzy query trapdoor Tr.
[0066] ② The database client sends a SQL fuzzy query statement containing the permutation ciphertext query condition: The database client sends the select id, encrpt_name from table where FH_fuzzy_search(secret key k, attribute column name, SPF('Liu'), name_FH_fuzzy_ext)=1; this SQL query statement containing the encrypted permutation ciphertext query condition SPF('Liu') to the database server, where "FH_fuzzy_search" is a user-defined fuzzy query function based on the frequency-hidden ciphertext fuzzy query algorithm.
[0067] ③ The database server parses and executes the SQL query statement: The database server parses the fuzzy query SQL statement by calling the custom fuzzy query function FH_fuzzy_search of the frequency-hidden ciphertext fuzzy query algorithm based on frequency removal, and generates a random position sequence randposition corresponding to the attribute column according to the secret key k and the attribute column name in the SQL statement.
[0068] ④ Database server-side recovery of iv and original deterministic cryptographic permutation ciphertext C': The database server uses the value of randposition to perform a fuzzy search on each row of ciphertext data in the extended column name_FH_fuzzy_ext of the data table to find iv. After removing iv, the remaining ciphertext is obtained. The remaining ciphertext is then divided by iv to obtain C', thus obtaining the original deterministic cryptographic permutation ciphertext C'.
[0069] ⑤ Database server performs string matching to return encrypted data: The query permutation ciphertext SPF('Liu') is matched against the deterministic encrypted permutation ciphertext C'. If a match is found, the database server will return the encrypted data from the ciphertext column such as the encrpt_name column that meets the query conditions to the database client user.
[0070] The database client uses the decryption key to decrypt and obtain the original plaintext: The database client user uses its symmetric encryption key key_AES stored on the client to decrypt the returned ciphertext, thereby obtaining all plaintext data that meets the fuzzy query conditions.
[0071] This invention provides an AES-based ciphertext permutation algorithm and a frequency-hiding-based fuzzy ciphertext secure query algorithm to ensure high efficiency and immunity to frequency leakage attacks during fuzzy ciphertext queries. The method includes:
[0072] For AES-based ciphertext permutation algorithms: Plaintext data is byte-by-byte replaced according to a generated encrypted permutation mapping table using the AES ciphertext permutation algorithm, generating deterministic permuted ciphertext of the same length as the plaintext. This invention uses an AES-based ciphertext permutation algorithm to perform deterministic permutation encryption on the original plaintext data without introducing additional ciphertext length extension, thus ensuring the efficiency and security of fuzzy ciphertext lookup operations.
[0073] For frequency-hidden fuzzy ciphertext security query algorithms: This invention designs a frequency-hidden ciphertext generation algorithm and a frequency-hidden ciphertext fuzzy query algorithm. For the frequency-hidden ciphertext generation algorithm, this invention randomly generates a random iv value of the same length as the permutation ciphertext for each row, XORs this iv with the permutation ciphertext to generate a random ciphertext, and inserts this iv and the random ciphertext into the corresponding byte position of the final ciphertext based on a random position sequence randposition generated for each column, generating semantically secure frequency-hidden ciphertext. For the frequency-hidden ciphertext fuzzy query algorithm, this invention obtains the corresponding byte positions of the random iv and random ciphertext in the final frequency-hidden ciphertext through a custom function that generates the random position sequence randposition, thereby recovering the random iv and random ciphertext. Then, by XORing them, the original encrypted permutation ciphertext is recovered. Finally, the ciphertext permutation algorithm is used to generate a fuzzy query trapdoor Tr for the fuzzy query content and performs string matching with the encrypted permutation ciphertext, thus achieving semantically secure and efficient fuzzy ciphertext query.
[0074] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Unless otherwise specified, an element defined by the phrase "comprising..." or "including..." does not exclude the presence of additional elements in the process, method, article, or terminal device that includes said element. Additionally, in this document, "greater than," "less than," "exceeding," etc., are understood to exclude the stated number; "above," "below," "within," etc., are understood to include the stated number.
[0075] Although the above embodiments have been described, those skilled in the art, once they understand the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the above descriptions are merely embodiments of the present invention and do not limit the scope of patent protection of the present invention. Any equivalent structural or procedural transformations made using the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A frequency-hidden, semantically secure fuzzy searchable ciphertext query method, characterized in that, Includes the following steps: The plaintext data is replaced byte by byte according to the generated encrypted permutation mapping table using the AES ciphertext permutation algorithm to generate deterministic permutation ciphertext with the same length as the plaintext. By randomly generating a random iv value of the same length as the permutation ciphertext for each row, XORing this iv with the permutation ciphertext to generate a random ciphertext, and inserting this iv and the random ciphertext into the corresponding byte position of the final ciphertext based on a random position sequence randposition generated for each column, a semantically secure frequency-hidden ciphertext is generated. For the frequency-hidden fuzzy query algorithm, a custom function `randposition` is used to generate a random position sequence to obtain the corresponding byte positions of the random IV and random ciphertext in the final frequency-hidden ciphertext, thereby recovering the random IV and random ciphertext. Then, by XORing them, the original encrypted permutation ciphertext is recovered. Finally, a fuzzy query trapdoor is generated for the fuzzy query content using a ciphertext permutation algorithm. It then performs string matching with the encrypted permutation ciphertext.
2. The frequency-hidden, semantically secure fuzzy searchable ciphertext query method as described in claim 1, characterized in that, The AES ciphertext permutation algorithm encrypts 256 two-digit hexadecimal numbers from 00 to FF using the AES256 encryption algorithm. The encrypted AES ciphertext values are then sorted in ascending order of their numerical values, with the smallest ciphertext value being 00 and the largest being FF. The order value of the AES ciphertext is used as the permutation mapping value of the original plaintext byte corresponding to that ciphertext, thereby obtaining the permutation mapping values of the 256 combinations of the original plaintext bytes from 00 to FF and the encrypted permutation mapping table table_SPF.
3. The frequency-hidden, semantically secure fuzzy searchable ciphertext query method as described in claim 2, characterized in that, The specific steps of the AES ciphertext permutation algorithm are as follows: S1.1 Encode each character in the original plaintext using UTF8; S1.
2. Use the AES256 encryption algorithm for encryption, use the encrypted AES ciphertext as the key, sort the key in ascending order, and then use the sorted AES ciphertext as the mapping of plaintext bytes 00-FF, thereby generating an encryption mapping table table_SPF for 256 combinations of plaintext bytes 00-FF. S1.
3. Based on the encryption permutation table table_SPF generated in S1.2, the UTF8 encoding of the original plaintext name is mapped one by one to the corresponding permutation ciphertext by looking up the encryption mapping table table_SPF, thereby generating the deterministic encryption permutation ciphertext C of the original plaintext name.
4. The frequency-hidden, semantically secure fuzzy searchable ciphertext query method as described in claim 3, characterized in that, It also includes the following steps: S1.4 Unification of Deterministic Ciphertext Length: Based on the deterministic permutation ciphertext generated in steps S1.1-S1.3, the length L of the longest ciphertext in C is used as the standard. max To ensure consistency, pad the right side of each ciphertext with zeros, generating a ciphertext of uniform length L. max The ciphertext C'; S1.5, Generate random iv: For each ciphertext C' padded with 0, randomly generate a iv of length L. max The length of iv is the same as the length of C'; S1.6, Generate random ciphertext: Random ciphertext = Ciphertext C'⊕iv; S1.7, Generate a random position sequence randposition: Use the key k and attribute column names to generate a sequence of length 2L. max A random position sequence randposition, where the first L positions of randposition are... max The bit represents the position of iv in the final frequency hidden ciphertext, and the L after randposition. max The bit represents the position of the random ciphertext within the final frequency-hidden ciphertext; S1.
8. Generate the extended column name_FH_fuzzy_ext containing the frequency-hidden ciphertext for fuzzy queries: Initialize the final frequency-hidden ciphertext C. final If it is NULL, then based on the first L of randposition. max The values of iv are inserted into the final frequency hidden ciphertext C. final The corresponding byte position, based on the L after randposition. max The random ciphertext is inserted into the final frequency hidden ciphertext C. final The corresponding byte position is used to obtain the final frequency-hidden ciphertext C. final Finally, the frequency is hidden in the ciphertext C. final Add it to the fuzzy query extended column name_FH_fuzzy_ext.
5. The frequency-hidden, semantically secure fuzzy searchable ciphertext query method as described in claim 4, characterized in that, The frequency-hidden ciphertext fuzzy query algorithm includes: S2.1 The database client uses an AES-based ciphertext substitution algorithm to generate the query substitution ciphertext: The database client uses the AES-based ciphertext substitution algorithm's encryption substitution function SPF() to encrypt and substitute each byte of the UTF-8 encoded query content by searching the encryption substitution table table_SPF, thereby obtaining the query substitution ciphertext corresponding to the query content, i.e., a fuzzy query trapdoor. ; S2.2 The database client sends an SQL fuzzy query statement containing the ciphertext substitution query condition: The database client sends the SQL query statement containing the ciphertext substitution query condition SPF(), select id, encrpt_name from table where FH_fuzzy_search(key k, attribute column name, SPF(), name_FH_fuzzy_ext)=1, to the database server. Here, "FH_fuzzy_search" is a user-defined fuzzy query function based on the frequency-hidden ciphertext fuzzy query algorithm.
6. The frequency-hidden, semantically secure fuzzy searchable ciphertext query method as described in claim 5, characterized in that, It also includes the following steps: S2.3, Database server parses and executes SQL query statements: The database server parses the fuzzy query SQL statement by calling the custom fuzzy query function FH_fuzzy_search based on the frequency-hidden ciphertext fuzzy query algorithm, and generates a random position sequence randposition corresponding to the attribute column based on the key k and the attribute column name in the SQL statement. S2.4 Database server-side recovery of iv and original deterministic cryptographic permutation ciphertext C': The database server uses the value of randposition to perform a fuzzy search on each row of ciphertext data in the extended column name_FH_fuzzy_ext in the data table to find iv. After removing iv, the remaining ciphertext can be obtained. The remaining ciphertext is then divided by iv to obtain C', thus obtaining the original deterministic cryptographic permutation ciphertext C'. S2.
5. Database server performs matching and returns encrypted data: The query permutation ciphertext SPF() is matched against the deterministic encryption permutation ciphertext C'. If a match is found, the database server will return the encrypted data in the ciphertext column that meets the query conditions to the database client user. S2.6 Database client uses decryption key to decrypt and obtain original plaintext: Database client user uses its symmetric encryption key key_AES stored on the client to decrypt the returned ciphertext, thereby obtaining all plaintext data that meets the fuzzy query conditions.
Citation Information
Patent Citations
Sequence cipher based search encryption method in cloud storage environment
CN107454059A
Systems and methods for privacy-assured similarity joins over encrypted datasets
US20180157703A1