Method for supporting fuzzy query of encrypted sensitive field
By setting a ciphertext index field in the database and using a block encryption algorithm to generate an encrypted index string, the compatibility, performance, and security issues of fuzzy queries for encrypted sensitive fields in existing technologies are resolved, achieving efficient and accurate fuzzy queries.
Patent Information
- Application Number
- CN202211678891.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-26
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2042-12-26
AI Technical Summary
Existing technologies suffer from compatibility issues, performance degradation, low security, and high memory consumption in fuzzy queries of encrypted sensitive fields, resulting in insufficient retrieval efficiency and accuracy.
An encrypted index is generated using a block encryption algorithm, a fuzzy search is performed using the database indexing mechanism, and a secondary matching is performed in memory. Only the filtered result set is decrypted, thereby improving query efficiency and accuracy.
By setting the encrypted index field as the database index and using the block encryption algorithm to generate an encrypted index string, query efficiency is improved, memory consumption is reduced, and the accuracy and performance of fuzzy queries are enhanced.
Smart Images

Figure CN116186108B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of computer retrieval, in particular to a method for supporting fuzzy query of encrypted sensitive field. BACKGROUND
[0002] Nowadays, data security becomes more and more important, and encryption of sensitive field is an effective security measure to prevent leakage of customer information when personal privacy data is involved. The privacy data mainly includes customer name, ID number, address, user account, password, card number and other information. When logging into a personal system, the user needs to view the corresponding plaintext information. For administrators with data authority, fuzzy query is often needed when performing data statistical analysis and data search and statistics.
[0003] Currently, there are several methods to realize encryption and decryption query, but each has its own shortcomings: 1. The database implements encryption and decryption functions, stores encrypted data, and queries decrypted data. This method may not be compatible with different databases, resulting in database encryption and program decryption failure. The use of decryption functions to decrypt data during query will reduce query performance and cannot use indexes. 2. Use encoding encryption such as base64; this method is too low in security and can be easily cracked, resulting in data leakage; it cannot effectively protect privacy data. 3. The program implements encryption and decryption, and when querying, the data is loaded into the system memory, and the information is queried in memory after decryption; this method requires loading data into memory, which consumes too much memory when the data volume is large. 4. Add an extended column and use a tokenizer; this method has a complex tokenizer algorithm, and the index ciphertext is prone to explosive growth.
[0004] Therefore, how to improve the retrieval efficiency and accuracy of encrypted fields is an important research direction in current database retrieval. SUMMARY
[0005] In order to overcome the defects of the prior art, the purpose of the present application is to support efficient left matching fuzzy query of privacy data.
[0006] The present application provides a method for supporting fuzzy query of encrypted sensitive field, comprising the following steps:
[0007] S1, establish a database, set an encryption algorithm and a ciphertext grouping unit length;
[0008] Establish a database, and divide the fields in the database into three categories, specifically: normal fields, ciphertext fields, and ciphertext index fields corresponding to the ciphertext fields, and set the ciphertext index fields as the index of the database;
[0009] Set the encryption method and the ciphertext grouping unit length cellLength;
[0010] S2, database data storage;
[0011] S21, obtaining data to be entered into the database;
[0012] S22, obtaining the field content fieldkey of the field field of the current record to be processed;
[0013] S23, determining whether the current field needs to be stored in encrypted form, if so, encrypting fieldkey according to the encryption algorithm to generate ciphertext data stored in des_info, storing des_info into the current field, and then executing step S24; if not, directly storing data fieldkey into the corresponding field and returning to step S22;
[0014] S24, generating an encryption index using a block encryption algorithm;
[0015] According to the relationship between the string length of the input data fieldKey and the value of cellLength, the encryption index is generated in different cases, specifically:
[0016] (1) When the length of fieldKey is not greater than cellLength,
[0017] Each character in fieldKey is encrypted respectively, and the encryption results are spliced in the original character order to obtain the encryption index string des_index;
[0018] (2) When fieldKey is an integer multiple n of cellLength, n is an integer greater than 1,
[0019] fieldKey is divided into firstCell and lastStr, where firstCell is the first cellLength characters, and lastStr is the remaining characters;
[0020] firstCell is encrypted and spliced character by character to obtain pre_des_index;
[0021] lastStr is evenly divided into (n-1) groups, and each group is encrypted and spliced to obtain last_des_index;
[0022] The encryption index des_index = pre_des_index + last_des_index is obtained;
[0023] (3) When fieldKey is greater than n*cellLength and less than (n+1)*cellLength, n is an integer greater than 1,
[0024] The fieldKey is divided into three parts, firstCell, lastStr and tailStr; wherein firstCell is the first cellLength characters, lastStr is the characters from cellLength+1 to n*cellLength; tailStr is the remaining string;
[0025] The firstCell is encrypted and spliced character by character to obtain pre_des_index;
[0026] The lastStr is evenly divided into (n-1) groups, and each group is encrypted and spliced to obtain last_des_index;
[0027] The tailStr string with a length less than cellLength is directly discarded;
[0028] The encrypted index des_index = pre_des_index + last_des_index is obtained;
[0029] S25, save the encrypted index des_index to the corresponding ciphertext index field of the current ciphertext field, return to step S22, until all data processing is completed;
[0030] S3, encrypted data query;
[0031] S31, determine the query key query_key;
[0032] S32, generate an encrypted index query string desQueryKey and return the query result, specifically:
[0033] According to the relationship between the string length of the current query key query_key and the value of cellLength, the encrypted index query string desQueryKey is generated and queried in different cases, specifically:
[0034] (1) When the length of query_key is not greater than cellLength,
[0035] Each character in query_key is encrypted respectively, and the encrypted results are spliced in the original character order to obtain the encrypted index query string desQueryKey;
[0036] The encrypted index query string desQueryKey is used for database fuzzy matching to accurately filter out the result set, and then the query result is decrypted and responded to the user;
[0037] (2) When the length of query_key is an integer multiple of cellLength, n, where n is an integer greater than 1,
[0038] The query_key is divided into firstCell and lastStr, where firstCell is the first cellLength characters and lastStr is the remaining characters;
[0039] The firstCell is encrypted and concatenated character by character to obtain pre_index;
[0040] The lastStr is evenly divided into (n-1) groups, and each group is encrypted and concatenated to obtain last_index;
[0041] The lastStr is evenly divided into (n-1) groups, and each group is encrypted and concatenated to obtain last_index;
[0042] The encrypted index query string desQueryKey = pre_index + last_index is obtained;
[0043] The encrypted index query string desQueryKey is used for fuzzy matching in the database to accurately filter the result set, and then the query result is decrypted and responded to the user;
[0044] (3) When query_key is greater than n*cellLength and less than (n+1)*cellLength, n is an integer greater than 1,
[0045] The query_key is divided into three parts firstCell, lastStr and tailStr; where firstCell is the first cellLength characters, lastStr is from cellLength+1 to n*cellLength characters, and tailStr is the remaining string;
[0046] The firstCell is encrypted and concatenated character by character to obtain pre_index;
[0047] The lastStr is evenly divided into (n-1) groups, and each group is encrypted and concatenated to obtain last_index;
[0048] If the length of tailStr is less than cellLength, no processing is performed;
[0049] The encrypted index query string desQueryKey = pre_index + last_index is obtained;
[0050] Using the encrypted index query string desQueryKey to perform fuzzy matching through the database, a filtered result set is obtained, the ciphertext in the filtered result set is decrypted in the memory, and then the query keyword is matched in a loop, and the data matched successfully is returned to the user.
[0051] Preferably, the database in the step S1 only establishes a normal field for information that does not need to be encrypted, and the normal field stores plaintext information; and two fields, a ciphertext field and a ciphertext index field, are established for information that needs to be encrypted, the ciphertext field stores encrypted ciphertext, and the ciphertext index field stores corresponding indexes.
[0052] Preferably, an annotation mark is added to the field in the database to indicate that the field is a ciphertext field.
[0053] Preferably, the encryption algorithm in the step S23 is a symmetric encryption algorithm, and the following one of the following modes is used in specific encryption: the same encryption algorithm and key are used for different fields, different encryption methods are used for different fields, or the same encryption method is used for different fields but different keys are used.
[0054] Preferably, the encryption algorithm in the step S23 is des, aes or des3.
[0055] Preferably, the query keyword query_key in the step S31 is saved in a field mode, and the field type is the same as the field type to be queried in the database.
[0056] Compared with the prior art, the present application has the following beneficial effects:
[0057] 1. The present application sets the index ciphertext column as the index of the database, and uses the database index mechanism to improve the query efficiency.
[0058] 2. The grouping algorithm of the present application generates encrypted index strings in different ways according to the different lengths of strings, and only the first several characters with the same length as the grouping length are encrypted for strings longer than the grouping length, and the rear part is encrypted by grouping, so that efficient left matching is achieved without causing the ciphertext to be too long.
[0059] 3. The present application only needs to perform memory matching when the string length of the query keyword is greater than the grouping length and is not an integer multiple of the grouping length, and only the filtered result set needs to be decrypted in the memory matching, without decrypting all the ciphertexts, so that the matching efficiency is greatly improved. BRIEF DESCRIPTION OF DRAWINGS
[0060] Figure 1 is a method flow chart for supporting fuzzy query of encrypted sensitive fields;
[0061] Figure 2 is a block encryption algorithm to generate encryption index;
[0062] Figure 3 is a block encryption algorithm to generate encryption index query string. DETAILED DESCRIPTION
[0063] For better understanding of the technical solutions of the present application, the specific embodiments of the present application are described in further detail below in combination with the drawings and examples. The same reference signs in the drawings represent functionally identical or similar elements. Although various aspects of the embodiments are shown in the drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
[0064] The present application adopts a grouping algorithm when storing the field in order to maximize the needs of the user input character query matching. Different encryption index strings of different grouping modes are generated according to the different lengths of the strings. At the same time, due to the use of the grouping method, there is a situation that the result set obtained in the query database is greater than the actual result set. Therefore, in the memory, the result set is matched again by the plaintext matching mode, so as to return the accurate query result to the user.
[0065] The present application discloses a method for supporting fuzzy query of encrypted sensitive field, as shown in Figure 1 The specific implementation steps are as follows:
[0066] S1, a database is established, and an encryption algorithm and a ciphertext grouping unit length are set.
[0067] The database is established, and the fields in the database are divided into three categories, specifically: normal field, ciphertext field, and ciphertext index field corresponding to the ciphertext field. The input content is directly saved to the field in the normal field, such as username, user nickname, etc. The input content is encrypted and saved to the field in the ciphertext field. The ciphertext field is usually used to save user privacy data, and the privacy data usually includes customer name, ID number, address, user account, password, card number, etc. The ciphertext index field is used to save the corresponding ciphertext index generated according to the ciphertext field, and the ciphertext index field is set as the index of the database. The query efficiency can be improved by means of the database index mechanism. Table 1 is an example of database field setting:
[0068] Table 1
[0069] Field Name Field Type Whether to encrypt storage Field Description userName String No Username nickName String No User Nickname idCardNo String Yes ID Card idCardNoindex String No ID Card Index address String Yes Address addressindex String No Address Index … … … …
[0070] As can be seen from Table 1, in the exemplary database, the userName and nickName are common fields, the idCardNo and address are ciphertext fields, the data in the two fields need to be encrypted and saved, and the idCardNoindex and addressindex are ciphertext index fields, in which the idCardNoindex is the index of the idCardNo, and the addressindex is the index of the address.
[0071] In the embodiment, the database is mysql supporting index, but the database can also use oracle, sqlserver, and other relational databases and es and other non-relational databases.
[0072] When the corresponding fields are established in the database, a common field is established for information that does not need to be encrypted, and the common field saves plaintext information; two fields, a ciphertext field and a ciphertext index field, are established for information that needs to be encrypted, the ciphertext field saves encrypted ciphertext, and the ciphertext index field saves the corresponding index. The fields established in the database are saved in the data storage interface, and an annotation mark @NeedEncode is added to the field that needs to be encrypted, and when the system receives data, it will determine whether to perform encryption storage processing on the field according to the mark. Because the present application mainly considers the retrieval of ciphertext, the field data types shown are all strings.
[0073] The encryption method is set, and in the embodiment, des is used for encryption, and the generated des secret key is deskey. Aes, des3, and other symmetric encryption algorithms can also be used to encrypt the information in the encrypted field. Even different encryption methods can be used for different fields, or although the same encryption method is used for different fields, different secret keys are used.
[0074] The ciphertext grouping unit length cellLength is set as N.
[0075] S2, database data storage.
[0076] S21, obtaining data that needs to be recorded in the database.
[0077] S22, obtaining the field content fieldkey of the field field of the current record that needs to be processed; if the data has been completely saved to the database, ending step S2.
[0078] For example, the current record is the mth record, the current field field is address, the field contains @NeedEncode, and the field content fieldkey of the address field of the mth record is “a1c”.
[0079] S23, judging whether the current field needs to be encrypted according to the annotation mark of the current field, if yes, encrypting the fieldkey according to the encryption algorithm, generating the ciphertext data stored in des_info, storing the des_info into the current field, and then executing step S24; if no, storing the data fieldkey into the corresponding field, and returning to step S22.
[0080] For example, the current field is the address field, and it is judged that the address field belongs to the ciphertext field, so the fieldkey of the mth record needs to be encrypted, the encrypted ciphertext data is stored in the des_info variable, then the des_info is stored into the address field of the mth record, and then step S24 is executed.
[0081] For example, the current field is the nickName field, and since the nickName field is not a ciphertext field, the fieldkey of the mth record can be directly stored into the nickName field, and then step S22 is returned. The next time step S22 is executed, the value of m can be changed, the field can be changed, or both can be changed.
[0082] S24, generating an encrypted index by using a group encryption algorithm, as shown in Figure 2
[0083] According to the relationship between the string length of the field content fieldKey and the value of cellLength, the encrypted index is generated in different cases, which is specifically:
[0084] (1) When the length of fieldKey is not greater than cellLength,
[0085] Each character in fieldKey is encrypted respectively, and the encrypted results are spliced in the original character order to obtain the encrypted index string des_index.
[0086] For example, the set value of cellLength is 4, and the input data filedKey = "a1c". Since the length of filedKey is less than the set value 4 of cellLength, 'a', '1', and 'c' are encrypted respectively:
[0087] After 'a' is encrypted, "sdfsd / rfew / erwer" is obtained.
[0088] After '1' is encrypted, "nges / fad" is obtained.
[0089] After 'c' is encrypted, "mm / sfsdf" is obtained.
[0090] The encryption results are spliced in the original character order to obtain an encryption index;
[0091] des_index = sdfsd / rfew / erwer nges / fad mm / sfsdf.
[0092] (2) When fieldKey is an integer multiple of cellLength, n is an integer greater than 1,
[0093] fieldKey is divided into firstCell and lastStr, wherein firstCell is the first cellLength characters, and lastStr is the remaining characters;
[0094] firstCell is encrypted and spliced character by character to obtain pre_des_index;
[0095] lastStr is divided into (n-1) groups, and each group is encrypted and spliced to obtain last_des_index;
[0096] The encryption index des_index = pre_des_index + last_des_index is obtained.
[0097] (3) When fieldKey is greater than n*cellLength and less than (n+1)*cellLength, n is an integer greater than 1,
[0098] fieldKey is divided into three parts firstCell, lastStr and tailStr; wherein firstCell is the first cellLength characters, lastStr is from cellLength+1 to n*cellLength characters, and tailStr is the remaining string;
[0099] firstCell is encrypted and spliced character by character to obtain pre_des_index;
[0100] lastStr is divided into (n-1) groups, and each group is encrypted and spliced to obtain last_des_index;
[0101] tailStr is directly discarded if the length of the tailStr string is less than cellLength;
[0102] The encryption index des_index = pre_des_index + last_des_index is obtained.
[0103] S25, after the encrypted index des_index is saved to the ciphertext index field corresponding to the current ciphertext field, return to step S22 until all data processing is completed.
[0104] As the current field is the ciphertext field address in step S22, and filedKey=a1c, which belongs to the first case in step S24, the encrypted index des_index is obtained; des_index=sdfsd / rfew / erwer nges / fad mm / sfsdf; the encrypted index des_index is saved to the addressindex ciphertext index field corresponding to the ciphertext field address.
[0105] S3, encrypt the data query.
[0106] S31, determine the query keyword.
[0107] Field Name Field Type Field Description queryKey String Query Key
[0108] The query keyword is saved in the form of the field queryKey, and the field type is the same as the field type to be queried in the database, which is a string. Therefore, there can be only one record in the queryKey field, or there can be multiple records, that is, the query keyword can be only one string, or can be composed of multiple strings, and when there are multiple strings, each string is queried according to the manner of only one string. The value of the current query keyword is saved using the variable query_key.
[0109] S32, generate the encrypted index query string desQueryKey and return the query result, as shown in Figure 3 , specifically:
[0110] According to the relationship between the string length of the current query keyword query_key and the value of cellLength, the encrypted index query string desQueryKey is generated and queried according to the case, specifically:
[0111] (1) When the length of query_key is not greater than cellLength,
[0112] Each character in query_key is encrypted, and the encrypted results are spliced in the original character order to obtain the encrypted index query string desQueryKey;
[0113] The encrypted index query string desQueryKey is used for database fuzzy matching to accurately filter out the result set, and then the query result is decrypted and responded to the user.
[0114] (2) When the length of query_key is an integer multiple of cellLength, n, where n is an integer greater than 1,
[0115] Divide query_key into firstCell and lastStr, where firstCell is the first cellLength characters and lastStr is the remaining characters;
[0116] Encrypt and concatenate firstCell character by character to obtain pre_index;
[0117] Divide lastStr into (n-1) groups, and encrypt and concatenate each group to obtain last_index;
[0118] Obtain the encrypted index query string desQueryKey = pre_index + last_index;
[0119] Use the encrypted index query string desQueryKey to perform fuzzy matching on the database to accurately filter the result set, and then decrypt the query results and respond to the user.
[0120] (3) When query_key is greater than n*cellLength and less than (n+1)*cellLength, n is an integer greater than 1,
[0121] Divide query_key into three parts firstCell, lastStr, and tailStr; where firstCell is the first cellLength characters, lastStr is from cellLength+1 to n*cellLength characters, and tailStr is the remaining string;
[0122] Encrypt and concatenate firstCell character by character to obtain pre_index;
[0123] Divide lastStr into (n-1) groups, and encrypt and concatenate each group to obtain last_index;
[0124] If the length of tailStr is less than cellLength, do not perform any processing;
[0125] Obtain the encrypted index query string desQueryKey = pre_index + last_index.
[0126] The encrypted index query string desQueryKey is used to perform fuzzy matching on the database to obtain a filtered result set, but the filtered data is not accurate at this time and only contains the first n*4 bits, and further memory matching is required. The memory matching process is as follows: after the ciphertext in the filtered result set is decrypted, the query key is matched in a loop, and in the specific implementation, the system function String.startWith() can be used to determine whether the selected query key is included, and the data that matches successfully is returned to the user. That is, the result set is matched again in memory to return accurate query results to the user.
[0127] The core of the present scheme is that a grouping algorithm (the grouping algorithm can consider algorithms such as the tokenizer ei, ik) is used when storing the field, and the grouping algorithm generates encrypted index strings in different ways according to the different lengths of the strings. When querying the database, the same grouping algorithm is used to generate an encrypted index query string for the query key, and the ciphertext index field can be used to directly match the encrypted index query string to obtain the query result. Only when the string length of the query key is greater than the grouping length and is not an integer multiple of the grouping length, memory matching is required, and only the filtered result set needs to be decrypted, without decrypting all ciphertexts, which greatly improves the matching efficiency.
[0128] The steps in the present application do not need to be executed simultaneously and sequentially, but they are only prerequisites for the execution of the next step, that is, step S2 must be performed after the database is established in step S1 to store data. Similarly, step S3 must be performed in the case where the database saved by step S2 is present, and it is not necessary to perform step S3 immediately after step S2, nor is it necessary to perform step S2 before performing step S3. They are placed together only to better express the mutual correspondence and execution relationship between the two, and those skilled in the art should understand.
[0129] Finally, it should be noted that: the above-described embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions described in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for supporting a fuzzy query for a cipher-sensitive field, the method comprising: It comprises the following steps: S1, establishing a database, setting an encryption algorithm and a ciphertext grouping unit length; Establishing a database, the fields in the database are divided into three categories, specifically: ordinary fields, ciphertext fields, and ciphertext index fields corresponding to the ciphertext fields, and setting the ciphertext index fields as the indexes of the database; Setting an encryption method and a ciphertext grouping unit length cellLength; S2, database data storage; S21, obtaining data to be entered into the database; S22, obtaining the field content fieldkey of the field field of the current record to be processed; S23, judging whether the current field needs to be encrypted and stored, if yes, encrypting fieldkey according to the encryption algorithm, generating ciphertext data stored in des_info, storing des_info into the current field, and then executing step S24; if not, directly storing data fieldkey into the corresponding field, and returning to step S22; S24, generating an encryption index by using a grouping encryption algorithm; According to the relationship between the string length of the input data fieldKey and the value of cellLength, the encryption index is generated in different cases, specifically: (1) When the length of fieldKey is not greater than cellLength, encrypt each character in fieldKey respectively, and splice the encryption results in the original character order to obtain the encryption index string des_index; (2) When fieldKey is an integer multiple n of cellLength, n is an integer greater than 1, fieldKey is divided into firstCell and lastStr, wherein firstCell is the first cellLength characters, and lastStr is the remaining characters; firstCell is encrypted and spliced character by character to obtain pre_des_index; lastStr is evenly divided into (n-1) groups, and each group is encrypted and spliced to obtain last_des_index; the encryption index des_index = pre_des_index + last_des_index is obtained; (3) When fieldKey is greater than n*cellLength and less than (n+1)*cellLength, n is an integer greater than 1, fieldKey is divided into three parts firstCell, lastStr and tailStr; wherein firstCell is the first cellLength characters, lastStr is the characters from cellLength+1 to n*cellLength; tailStr is the remaining string; firstCell is encrypted and spliced character by character to obtain pre_des_index; lastStr is evenly divided into (n-1) groups, and each group is encrypted and spliced to obtain last_des_index; the string length of tailStr is less than cellLength, and tailStr is discarded directly; Get the encrypted index des_index = pre_des_index + last_des_index; S25, save the encrypted index des_index to the ciphertext index field corresponding to the current ciphertext field, return to step S22 until all data processing is completed; S3, encrypt data query; S31, determine the query keyword query_key; S32, generate the encrypted index query string desQueryKey and return the query result, specifically: According to the relationship between the string length of the current query keyword query_key and the value of cellLength, the encrypted index query string desQueryKey is generated and queried in different cases, specifically: (1) When the length of query_key is not greater than cellLength, Encrypt each character in query_key respectively, and concatenate the encrypted results in the original character order to obtain the encrypted index query string desQueryKey; Use the encrypted index query string desQueryKey to accurately filter out the result set through database fuzzy matching, and then decrypt the query results and respond to the user; (2) When the length of query_key is an integer multiple n of cellLength, n is an integer greater than 1, Divide query_key into firstCell and lastStr, where firstCell is the first cellLength characters, and lastStr is the remaining characters; Encrypt and concatenate firstCell character by character to obtain pre_index; Divide lastStr into (n-1) groups, and encrypt and concatenate each group to obtain last_index; Get the encrypted index query string desQueryKey = pre_index + last_index; Use the encrypted index query string desQueryKey to accurately filter out the result set through database fuzzy matching, and then decrypt the query results and respond to the user; (3) When query_key is greater than n*cellLength and less than (n+1)*cellLength, n is an integer greater than 1, Divide query_key into three parts firstCell, lastStr and tailStr; Where firstCell is the first cellLength characters, lastStr is from cellLength+1 to n*cellLength characters; tailStr is the remaining string; Encrypt and concatenate firstCell character by character to obtain pre_index; Divide lastStr into (n-1) groups, and encrypt and concatenate each group to obtain last_index; If the length of tailStr string is less than cellLength, do not perform any processing; Get the encrypted index query string desQueryKey = pre_index + last_index; The encrypted index query string desQueryKey is used to perform fuzzy matching on the database to obtain a filtered result set, the ciphertext in the filtered result set is decrypted in memory, and then the query key is matched in a loop, and the data that is successfully matched is returned to the user.
2. The method for supporting a fuzzy query of a cipher-sensitive field according to claim 1, characterized in that: In the database in the step S1, a normal field is established for information that does not need to be encrypted, and the plaintext information is stored in the normal field; two fields, a ciphertext field and a ciphertext index field, are established for information that needs to be encrypted, the ciphertext field stores the encrypted ciphertext, and the ciphertext index field stores the corresponding index.
3. The method for supporting a fuzzy query of a cipher-sensitive field according to claim 1, wherein: An annotation is added to the field in the database to indicate that the field is a ciphertext field.
4. The method for supporting a blurred query of a cipher-sensitive field according to claim 1, characterized in that: The encryption algorithm in the step S23 is a symmetric encryption algorithm, and the following method is used in specific encryption: the same encryption algorithm and key are used for different fields, different encryption methods are used for different fields, or the same encryption method is used for different fields but different keys are used.
5. The method for supporting a blurred query of a cipher-sensitive field according to claim 1, wherein: The encryption algorithm in the step S23 is des, aes or des3.
6. The method for supporting a blurred query of a cipher-sensitive field according to claim 1, wherein: The query key query_key in the step S31 is stored in a field, and the field type is the same as the field type to be queried in the database.
Citation Information
Patent Citations
Data encryption and retrieval method for database
CN103927357A
Database encryption field fuzzy retrieval method based on GCM encryption mode
CN113076562A