Data processing method, device, electronic device and storage medium
By symmetrically encrypting and splitting the encrypted data, searchable encrypted data is generated, which solves the problem of low deterministic encryption security, realizes the search function of encrypted data and enhances data security.
Patent Information
- Application Number
- CN202211476628.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-23
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2042-11-23
AI Technical Summary
In remote cloud service systems or database services, deterministic encryption has low security and is easily inferred by third parties through ciphertext relevance, resulting in data leakage, and the encrypted ciphertext does not have the retrieval function.
By symmetrically encrypting the data to be encrypted and splitting it into multiple characters to be encrypted, encryption factors are generated using the authentication information and location information of the characters to be encrypted, searchable encrypted data is generated, and search services based on encrypted data are provided.
Improve data security, enable encrypted data to be searched, and avoid correlation cracking between plain text and cipher text, enhancing data protection capabilities.
Smart Images

Figure CN115834203B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a data processing method, device, electronic device and storage medium. Background Art
[0002] In a remote cloud service system or database service, in order to ensure data security, you can choose to store the data after secure encryption. During the encryption process, some random numbers are usually used as encryption parameters. Therefore, it is impossible to directly search the encrypted ciphertext data using keywords.
[0003] In order to realize the search of ciphertext, deterministic encryption can be used, that is, the same plaintext is encrypted to obtain the same ciphertext, the keywords are encrypted, and then the encrypted keywords are used for search to match the corresponding ciphertext. However, deterministic encryption has low security and can be easily inferred by a third party through the correlation of ciphertext to obtain the plaintext, resulting in data leakage. Summary of the invention
[0004] The embodiments of the present disclosure at least provide a data processing method, device, electronic device and storage medium.
[0005] In a first aspect, an embodiment of the present disclosure provides a data processing method, including:
[0006] Acquire data to be encrypted and symmetrically encrypt the data to be encrypted to obtain initial encrypted data;
[0007] Splitting the data to be encrypted into a plurality of characters to be encrypted, and determining identity authentication information corresponding to each character to be encrypted;
[0008] For each character to be encrypted, based on the identity verification information corresponding to the character to be encrypted and the position information of the character to be encrypted in the data to be encrypted, an encryption factor corresponding to the character to be encrypted is generated;
[0009] Generate searchable encrypted data corresponding to the data to be encrypted based on the encryption factor corresponding to each character to be encrypted, the identity verification information, and the initial encrypted data;
[0010] The searchable encrypted data is stored in a database, where the database is used to store the searchable encrypted data and provide corresponding search services based on the searchable encrypted data.
[0011] In an optional implementation, the generating the encryption factor corresponding to the character to be encrypted based on the identity authentication information corresponding to the character to be encrypted and the position information of the character to be encrypted in the data to be encrypted includes:
[0012] Obtaining an initial vector used when symmetric encryption is performed on the data to be encrypted;
[0013] Generate an initial encryption factor based on the initial vector and the position information of the character to be encrypted in the data to be encrypted;
[0014] The initial encryption factor is encrypted based on the identity verification information corresponding to the character to be encrypted to obtain the encryption factor corresponding to the character to be encrypted.
[0015] In an optional implementation manner, the encrypting the initial encryption factor based on the identity authentication information corresponding to the character to be encrypted to obtain the encryption factor corresponding to the initial encrypted character includes:
[0016] Using the first key, encrypting the identity verification information to obtain a second key for the character to be encrypted;
[0017] The initial encryption factor is encrypted using the second key to obtain an encryption factor corresponding to the character to be encrypted.
[0018] In an optional implementation manner, determining the identity authentication information corresponding to each character to be encrypted includes:
[0019] Preprocessing the characters to be encrypted to obtain standardized characters to be encrypted;
[0020] The pre-processed characters to be encrypted are encrypted using the third key to obtain identity verification information corresponding to the characters to be encrypted.
[0021] In an optional implementation manner, generating searchable encrypted data corresponding to the data to be encrypted based on the encryption factor corresponding to each character to be encrypted, the identity verification information, and the initial encrypted data includes:
[0022] For any of the characters to be encrypted, performing an XOR operation on the encryption factor corresponding to the character to be encrypted and the identity verification information to obtain a keyword ciphertext of the character to be encrypted;
[0023] Based on the keyword ciphertext of each character to be encrypted and the initial encrypted data, searchable encrypted data corresponding to the data to be encrypted is generated.
[0024] In an optional implementation manner, after generating the searchable encrypted data, the method further includes:
[0025] Obtaining a search keyword, and determining a plurality of key characters based on the search keyword;
[0026] Determine identity authentication information corresponding to the key character;
[0027] Based on the identity verification information, generating an intermediate encryption factor corresponding to the key character;
[0028] Determining a search token corresponding to the keyword based on the intermediate encryption factor and the identity verification information;
[0029] The search token is sent to the database, so that the database queries the searchable encrypted data corresponding to the search keyword based on the search token.
[0030] In an optional implementation manner, the database queries the searchable encrypted data corresponding to the search keyword based on the search token, including:
[0031] generating a plurality of candidate encryption factors based on the identity authentication information indicated by the search token and the keyword ciphertext in the searchable encrypted data to be queried;
[0032] Verifying the candidate encryption factor based on the intermediate encryption factor carried by the search token and the verification rule corresponding to the search type indicated by the search token;
[0033] In the event that the candidate encryption factor passes verification, it is determined that the searchable encrypted data matches the search token.
[0034] In a second aspect, an embodiment of the present disclosure further provides a data processing device, including:
[0035] A first encryption module, used to obtain data to be encrypted and symmetrically encrypt the data to be encrypted to obtain initial encrypted data;
[0036] An identity authentication module, used for splitting the data to be encrypted into a plurality of characters to be encrypted, and determining identity authentication information corresponding to each character to be encrypted;
[0037] A generating module, configured to generate, for each character to be encrypted, an encryption factor corresponding to the character to be encrypted based on the identity authentication information corresponding to the character to be encrypted and the position information of the character to be encrypted in the data to be encrypted;
[0038] A second encryption module, configured to generate searchable encrypted data corresponding to the data to be encrypted based on the encryption factors corresponding to the characters to be encrypted, the identity verification information and the initial encrypted data;
[0039] A storage module is used to store the searchable encrypted data in a database, and the database is used to store the searchable encrypted data and provide corresponding search services based on the searchable encrypted data.
[0040] In an optional implementation manner, when the generation module generates the encryption factor corresponding to the character to be encrypted based on the identity authentication information corresponding to the character to be encrypted and the position information of the character to be encrypted in the data to be encrypted, it is used to:
[0041] Obtaining an initial vector used when symmetric encryption is performed on the data to be encrypted;
[0042] Generate an initial encryption factor based on the initial vector and the position information of the character to be encrypted in the data to be encrypted;
[0043] The initial encryption factor is encrypted based on the identity verification information corresponding to the character to be encrypted to obtain the encryption factor corresponding to the character to be encrypted.
[0044] In an optional implementation manner, when the generating module encrypts the initial encryption factor based on the identity authentication information corresponding to the character to be encrypted to obtain the encryption factor corresponding to the initial encrypted character, it is used to:
[0045] Using the first key, encrypting the identity verification information to obtain a second key for the character to be encrypted;
[0046] The initial encryption factor is encrypted using the second key to obtain an encryption factor corresponding to the character to be encrypted.
[0047] In an optional implementation manner, when determining the identity authentication information corresponding to each character to be encrypted, the identity authentication module is used to:
[0048] Preprocessing the characters to be encrypted to obtain standardized characters to be encrypted;
[0049] The pre-processed characters to be encrypted are encrypted using the third key to obtain identity verification information corresponding to the characters to be encrypted.
[0050] In an optional implementation manner, when the second encryption module generates the searchable encrypted data corresponding to the data to be encrypted based on the encryption factor corresponding to each character to be encrypted, the identity verification information and the initial encrypted data, it is used to:
[0051] For any of the characters to be encrypted, performing an XOR operation on the encryption factor corresponding to the character to be encrypted and the identity verification information to obtain a keyword ciphertext of the character to be encrypted;
[0052] Based on the keyword ciphertext of each character to be encrypted and the initial encrypted data, searchable encrypted data corresponding to the data to be encrypted is generated.
[0053] In an optional implementation manner, after generating the searchable encrypted data, the generating module is further configured to:
[0054] Obtaining a search keyword, and determining a plurality of key characters based on the search keyword;
[0055] Determine identity authentication information corresponding to the key character;
[0056] Based on the identity verification information, generating an intermediate encryption factor corresponding to the key character;
[0057] Determining a search token corresponding to the keyword based on the intermediate encryption factor and the identity verification information;
[0058] The search token is sent to the database, so that the database queries the searchable encrypted data corresponding to the search keyword based on the search token.
[0059] In an optional implementation manner, when the database queries the searchable encrypted data corresponding to the search keyword based on the search token, it is used to:
[0060] generating a plurality of candidate encryption factors based on the identity authentication information indicated by the search token and the keyword ciphertext in the searchable encrypted data to be queried;
[0061] Verifying the candidate encryption factor based on the intermediate encryption factor carried by the search token and the verification rule corresponding to the search type indicated by the search token;
[0062] In the event that the candidate encryption factor passes verification, it is determined that the searchable encrypted data matches the search token.
[0063] In a third aspect, an embodiment of the present disclosure further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned first aspect, or any possible implementation of the first aspect are performed.
[0064] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned first aspect or any possible implementation of the first aspect are executed.
[0065] The data processing method, device, electronic device and storage medium provided by the embodiments of the present disclosure obtain a plurality of characters to be encrypted by splitting the data to be encrypted, and then generate an encryption factor corresponding to the character to be encrypted by using the identity authentication information of the character to be encrypted and the position information of the character to be encrypted in the data to be encrypted, and generate searchable encrypted data by using the encryption factor, the identity authentication information and the initial encrypted data obtained by symmetric encryption, wherein the identity authentication information provides the data information required for data search, and the encryption factor ensures that the correlation between the plaintext and the ciphertext of the identity authentication information is difficult to crack, thereby improving the security of the data while enabling the encrypted data to be searched.
[0066] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0068] Figure 1 A flow chart of a data processing method provided by an embodiment of the present disclosure is shown;
[0069] Figure 2 A flowchart showing another data processing method provided by an embodiment of the present disclosure is shown;
[0070] Figure 3 A flowchart showing the steps of generating a search token provided by an embodiment of the present disclosure;
[0071] Figure 4 A flowchart showing steps of using a search token to query searchable encrypted data provided by an embodiment of the present disclosure;
[0072] Figure 5 A schematic diagram of a data processing device provided by an embodiment of the present disclosure is shown;
[0073] Figure 6 A schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0074] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0075] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0076] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.
[0077] According to research, in some scenarios, users need to store data in a database or cloud service system provided by a third party. In order to prevent the data from being leaked to a third party and to deal with external intrusions into the internal database, the data needs to be encrypted. The encrypted ciphertext usually does not have a search function. If you want to search for encrypted files, deterministic encryption is usually used. However, deterministic encryption has low security and is easy to infer the corresponding plaintext based on the correlation of ciphertext, causing data leakage.
[0078] Based on the above research, the present disclosure provides a data encryption method, which symmetrically encrypts the data to be encrypted, splits the data to be encrypted, obtains multiple characters to be encrypted, and then uses the identity authentication information of the characters to be encrypted and the position information of the characters to be encrypted in the data to be encrypted to generate an encryption factor corresponding to the characters to be encrypted, and uses the encryption factor, identity authentication information and the initial encrypted data obtained by symmetric encryption to generate searchable encrypted data, wherein the identity authentication information provides the data information required for data search, and the encryption factor ensures that the correlation between the plaintext and the ciphertext of the identity authentication information is difficult to crack, thereby improving the security of the data while enabling the encrypted data to be searched.
[0079] To facilitate understanding of this embodiment, a data processing method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the data processing method provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities, and the computer device includes, for example, a terminal device or a server or other processing device. In some possible implementations, the data processing method can be implemented by a processor calling a computer-readable instruction stored in a memory.
[0080] See also Figure 1 FIG. 1 is a flowchart of a data processing method provided by an embodiment of the present disclosure, wherein the method includes steps S101 to S104, wherein:
[0081] S101, obtaining data to be encrypted and symmetrically encrypting the data to be encrypted to obtain initial encrypted data.
[0082] The data to be encrypted may be character data, such as numbers, letters, Chinese characters, symbols, etc. The data to be encrypted can be searched by a variety of search tools, such as the data warehouse tool HIVE, the relational database management system MySQL, etc., and can apply search instructions such as full match Equality, including IN, and fuzzy match LIKE.
[0083] The above-mentioned symmetric encryption is an encryption method using a single-key cryptographic system. The same key can be used for both encryption and decryption of information. Its corresponding encryption algorithms include the Data Encryption Standard (DES), the Advanced Encryption Standard (ADES), etc.
[0084] Exemplarily, the symmetric encryption algorithm used in this embodiment may be AES encryption. When the data to be encrypted is symmetrically encrypted, a pre-agreed AES key may be used to obtain initial encrypted data corresponding to the data to be encrypted.
[0085] S102: Split the data to be encrypted into multiple characters to be encrypted, and determine identity authentication information corresponding to each character to be encrypted.
[0086] In this step, in order to realize the search of encrypted data, it is necessary to add searchable features to the characters to be encrypted, and the search is usually performed on each character, that is, the search behavior usually determines whether there are key characters in a piece of data. For example, if a search keyword is "="%el%"", it means that the second character in the data to be searched is "e", the third character is "l", and the data has only four characters. Therefore, it is necessary to generate search features for each character, that is, the above-mentioned identity verification information.
[0087] Before generating the identity authentication information of the characters to be encrypted, the characters to be encrypted may be preprocessed to obtain standardized characters to be encrypted. The specific steps of the preprocessing may be set according to actual needs. For example, in order to reduce the amount of calculation, the characters to be encrypted in uppercase letters may be uniformly converted into lowercase letters.
[0088] In order to protect the security of data, the identity feature can be generated in an encrypted manner. Specifically, the pre-processed characters to be encrypted can be encrypted using a pre-agreed third key to obtain identity authentication information corresponding to the characters to be encrypted.
[0089] Exemplarily, the third key may be a key under a Cipher Block Chaining-Message Authentication Code (CMAC), which may generate a token that characterizes the data without revealing the true content of the data.
[0090] S103: For each character to be encrypted, based on the identity verification information corresponding to the character to be encrypted and the position information of the character to be encrypted in the data to be encrypted, generate an encryption factor corresponding to the character to be encrypted.
[0091] In order to ensure the security of identity authentication information, it is necessary to encrypt the identity authentication information, while at the same time ensuring the availability of the identity authentication information. Therefore, an encryption factor corresponding to the character to be encrypted can be generated, and the identity authentication information can be encrypted using the encryption factor.
[0092] Since identity authentication information is relatively deterministic data, the position information of the characters to be encrypted in the data to be encrypted can be introduced when generating the encryption factor and used as an encryption parameter. This position information has no correlation with the encryption algorithm itself and can introduce uncertainty factors to make the encryption factor uncertain, thereby improving the security of the encryption factor.
[0093] Specifically, we can first obtain the initial vector used for symmetric encryption of the data to be encrypted, then generate an initial encryption factor based on the initial vector and the position information of the characters to be encrypted in the data to be encrypted, and then encrypt the initial encryption factor based on the identity authentication information corresponding to the characters to be encrypted to obtain the encryption factor corresponding to the characters to be encrypted.
[0094] Exemplarily, the initial vector can be concatenated with the above-mentioned position information, and the concatenated result can be used as the initial encryption factor, wherein the above-mentioned initial vector can be the initial vector (initial vector) used when the data to be encrypted is initially symmetrically encrypted, also called a nonce value, which is usually a random value. In this way, the encryption process of the data to be encrypted can be closely linked with the encryption factor, making the encryption factor exclusive and making the encryption factor valid only for the current data to be encrypted.
[0095] In the process of encrypting the initial encryption factor based on the identity authentication information, the first key can be used to process the identity authentication information to obtain the second key of the character to be encrypted, and then the second key can be used to encrypt the initial encryption factor to obtain the encryption factor corresponding to the character to be encrypted.
[0096] Exemplarily, the first key and identity authentication information can be used as input, and their input values can be used in a hash-based Message Authentication Code algorithm to obtain a second key configured with the identity authentication information, and then the CMAC algorithm is used with the second key and the initial encryption factor as input to obtain an encryption factor.
[0097] S104: Generate searchable encrypted data corresponding to the data to be encrypted based on the encryption factors corresponding to the characters to be encrypted, the identity verification information, and the initial encrypted data.
[0098] After the encryption factor and the identity verification information are obtained, the encryption factor, the identity verification information and the initial encrypted data may be combined to obtain searchable encrypted data of the data to be encrypted.
[0099] Specifically, an XOR operation can be performed on the encryption factor and identity authentication information corresponding to each character to be encrypted, and then the results of each XOR operation can be connected to obtain the keyword ciphertext of each character to be encrypted, and then the keyword ciphertext is combined with the initial encrypted data to obtain the searchable encrypted data. Among them, the keyword ciphertext can be used to realize the search of the initial encrypted data.
[0100] Furthermore, in order to ensure that the search can implement various instructions, such as "Equality", "IN", and "LIKE", the total number of characters of the initial encrypted data can be added when merging the keyword ciphertext and the initial encrypted data, and the three can be merged together to obtain searchable encrypted data to achieve the requirement for character quantity retrieval.
[0101] See also Figure 2As shown, it is a flow chart of another data processing method provided by an embodiment of the present disclosure. In this method, the data to be encrypted is taken as "yes", and the AES key ek is first used to encrypt the data to be encrypted to obtain the initial encrypted data c, and then the data to be encrypted is split into three characters to be encrypted, "y", "e", and "s", and the third key tk is used to encrypt it to obtain the identity authentication information t(y), t(e), and t(s), and then the identity authentication information is encrypted using the first key dk to obtain the second key d(y), d(e), and d(s), and then the initial vector iv when the encrypted data is encrypted is extracted, and the initial encryption factors iv(y), iv(e), and iv(s) are generated based on the position information of each character to be encrypted, and for each character to be encrypted, the initial encryption factor is encrypted using its corresponding second key to obtain the encryption factors s(y), s(e), and s(s), and then the encryption factor and the identity authentication information are XORed to obtain the keyword ciphertext, and the keyword ciphertext, the initial encrypted data c, and the number of characters to be encrypted n are combined to obtain the searchable encrypted data x.
[0102] S105: Storing the searchable encrypted data in a database, where the database is used to store the searchable encrypted data and provide corresponding search services based on the searchable encrypted data.
[0103] After obtaining the searchable encrypted data, the searchable encrypted data can be stored in a first-party or third-party database. When the searchable encrypted data is needed, a search token can be sent to the database. The database matches the data based on the search token and returns the searchable encrypted data obtained through the search.
[0104] Since the data stored in the database is encrypted, the search keyword indicated in the search token also needs to be encrypted. Therefore, the search keyword can be obtained first, and multiple key characters of the search keyword can be determined.
[0105] Then, the identity authentication information of the key character can be determined, and then based on the identity authentication information corresponding to the key character, an intermediate encryption factor corresponding to the key character is generated, and finally a search token corresponding to the search keyword is generated based on the intermediate encryption factor and the identity authentication information.
[0106] The method for determining the identity authentication information of the key character may be consistent with the method for generating the identity authentication information of the character to be encrypted; and the method for generating the intermediate encryption factor may be consistent with the method for generating the second key.
[0107] For example, see Figure 3 As shown, it is a flowchart of the steps of generating a search token provided by an embodiment of the present disclosure. Figure 3As shown, this step first obtains the search keyword "%el%", which means that the search data contains two consecutive characters e and l, and the key characters can be determined to be e and l. Then, the key characters are encrypted using the third key to obtain the identity authentication information T(e) and the identity authentication information T(l). Then, T(e) and T(l) are encrypted using the first key dk to obtain the intermediate encryption factor K(e) and the intermediate encryption factor K(l). After that, T(e) and K(e) are combined into a data pair, T(l) and K(l) are combined into a data pair, and the data pairs are merged to obtain a set, which is the search token.
[0108] Regarding the specific usage of the search token, multiple candidate encryption factors can be generated based on the keyword ciphertext in the searchable encrypted data to be queried, the initial encrypted data and the search token; the candidate encryption factors are verified based on the intermediate encryption factors carried by the search token and the verification rules corresponding to the search type indicated by the search token; when the candidate encryption factors pass the verification, it is determined that the searchable encrypted data matches the search token.
[0109] For example, see Figure 4 As shown, it is a flowchart of the steps of using the search token to query the searchable encrypted data provided by the embodiment of the present disclosure. The database can use the acquired search token to match each data stored in the database. The data currently being matched can be split first to obtain the initial encrypted data and each keyword ciphertext, and then the keyword ciphertext is XORed with the identity authentication information indicated in the search token to obtain the candidate encryption factor, and then, according to the verification rule corresponding to the search type indicated by the search token, the candidate encryption factor is verified using the intermediate encryption factor corresponding to the identity authentication information. If the search type indicates "two characters are adjacent", the candidate encryption factor is verified using the intermediate encryption factor corresponding to the identity authentication information for two consecutive characters at the same time. If both pass the verification, it can be determined that the searchable encrypted data matches the search token.
[0110] In this step, if the currently verified searchable encrypted data matches the search token, the candidate encryption factor obtained after the XOR operation between the above-mentioned identity authentication information and the keyword ciphertext is consistent with the encryption factor obtained in the data encryption process. The CMAC algorithm can be used with the key of the identity authentication information as the key to verify the correctness of the candidate encryption factor, thereby determining whether the characters corresponding to the keyword ciphertext are consistent with the key characters, thereby realizing the search for the ciphertext.
[0111] The data processing method provided by the disclosed embodiment splits the data to be encrypted to obtain multiple characters to be encrypted, and then uses the identity authentication information of the characters to be encrypted and the position information of the characters to be encrypted in the data to be encrypted to generate encryption factors corresponding to the characters to be encrypted, and uses the encryption factors, identity authentication information and initial encrypted data obtained by symmetric encryption to generate searchable encrypted data, wherein the identity authentication information provides the data information required for data search, and the encryption factor ensures that the correlation between the plaintext and the ciphertext of the identity authentication information is difficult to crack, thereby improving the security of the data while enabling the encrypted data to be searched.
[0112] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0113] Based on the same inventive concept, a data processing device corresponding to the data processing method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned data processing method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0114] Reference Figure 5 FIG. 1 is a schematic diagram of a data processing device provided by an embodiment of the present disclosure, wherein the device includes:
[0115] The first encryption module 510 is used to obtain data to be encrypted and symmetrically encrypt the data to be encrypted to obtain initial encrypted data;
[0116] The identity verification module 520 is used to split the data to be encrypted into a plurality of characters to be encrypted and determine the identity verification information corresponding to each character to be encrypted;
[0117] A generating module 530, for generating, for each character to be encrypted, an encryption factor corresponding to the character to be encrypted based on the identity authentication information corresponding to the character to be encrypted and the position information of the character to be encrypted in the data to be encrypted;
[0118] A second encryption module 540, configured to generate searchable encrypted data corresponding to the data to be encrypted based on the encryption factor corresponding to each character to be encrypted, the identity verification information and the initial encrypted data;
[0119] The storage module 550 is used to store the searchable encrypted data in a database, and the database is used to store the searchable encrypted data and provide corresponding search services based on the searchable encrypted data.
[0120] In an optional implementation manner, when the generating module 530 generates the encryption factor corresponding to the character to be encrypted based on the identity authentication information corresponding to the character to be encrypted and the position information of the character to be encrypted in the data to be encrypted, it is used to:
[0121] Obtaining an initial vector used when symmetric encryption is performed on the data to be encrypted;
[0122] Generate an initial encryption factor based on the initial vector and the position information of the character to be encrypted in the data to be encrypted;
[0123] The initial encryption factor is encrypted based on the identity verification information corresponding to the character to be encrypted to obtain the encryption factor corresponding to the character to be encrypted.
[0124] In an optional implementation manner, when the generating module 530 encrypts the initial encryption factor based on the identity authentication information corresponding to the character to be encrypted to obtain the encryption factor corresponding to the initial encrypted character, it is used to:
[0125] Using the first key, encrypting the identity verification information to obtain a second key for the character to be encrypted;
[0126] The initial encryption factor is encrypted using the second key to obtain an encryption factor corresponding to the character to be encrypted.
[0127] In an optional implementation manner, when determining the identity authentication information corresponding to each character to be encrypted, the identity authentication module 520 is used to:
[0128] Preprocessing the characters to be encrypted to obtain standardized characters to be encrypted;
[0129] The pre-processed characters to be encrypted are encrypted using the third key to obtain identity verification information corresponding to the characters to be encrypted.
[0130] In an optional implementation manner, when the second encryption module 540 generates the searchable encrypted data corresponding to the data to be encrypted based on the encryption factor corresponding to each character to be encrypted, the identity verification information, and the initial encrypted data, it is configured to:
[0131] For any of the characters to be encrypted, performing an XOR operation on the encryption factor corresponding to the character to be encrypted and the identity verification information to obtain a keyword ciphertext of the character to be encrypted;
[0132] Based on the keyword ciphertext of each character to be encrypted and the initial encrypted data, searchable encrypted data corresponding to the data to be encrypted is generated.
[0133] In an optional implementation manner, after generating the searchable encrypted data, the generating module 530 is further configured to:
[0134] Obtaining a search keyword, and determining a plurality of key characters based on the search keyword;
[0135] Determine identity authentication information corresponding to the key character;
[0136] Based on the identity verification information, generating an intermediate encryption factor corresponding to the key character;
[0137] Determining a search token corresponding to the keyword based on the intermediate encryption factor and the identity verification information;
[0138] The search token is sent to the database, so that the database queries the searchable encrypted data corresponding to the search keyword based on the search token.
[0139] In an optional implementation manner, when the database queries the searchable encrypted data corresponding to the search keyword based on the search token, it is used to:
[0140] generating a plurality of candidate encryption factors based on the identity authentication information indicated by the search token and the keyword ciphertext in the searchable encrypted data to be queried;
[0141] Verifying the candidate encryption factor based on the intermediate encryption factor carried by the search token and the verification rule corresponding to the search type indicated by the search token;
[0142] In the event that the candidate encryption factor passes verification, it is determined that the searchable encrypted data matches the search token.
[0143] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0144] Corresponds to Figure 1 The data processing method in the present disclosure also provides an electronic device 600, such as Figure 6 FIG. 6 is a schematic diagram of the structure of an electronic device 600 provided in an embodiment of the present disclosure, including:
[0145] Processor 61, memory 62, and bus 63; memory 62 is used to store execution instructions, including internal memory 621 and external memory 622; the internal memory 621 is also called internal memory, which is used to temporarily store the operation data in the processor 61 and the data exchanged with the external memory 622 such as a hard disk. The processor 61 exchanges data with the external memory 622 through the internal memory 621. When the electronic device 600 is running, the processor 61 communicates with the memory 62 through the bus 63, so that the processor 61 executes the following instructions:
[0146] Acquire data to be encrypted and symmetrically encrypt the data to be encrypted to obtain initial encrypted data;
[0147] Splitting the data to be encrypted into a plurality of characters to be encrypted, and determining identity authentication information corresponding to each character to be encrypted;
[0148] For each character to be encrypted, based on the identity verification information corresponding to the character to be encrypted and the position information of the character to be encrypted in the data to be encrypted, an encryption factor corresponding to the character to be encrypted is generated;
[0149] Generate searchable encrypted data corresponding to the data to be encrypted based on the encryption factor corresponding to each character to be encrypted, the identity verification information, and the initial encrypted data;
[0150] The searchable encrypted data is stored in a database, where the database is used to store the searchable encrypted data and provide corresponding search services based on the searchable encrypted data.
[0151] In an optional implementation manner, in the instructions executed by the processor 61, generating the encryption factor corresponding to the character to be encrypted based on the identity authentication information corresponding to the character to be encrypted and the position information of the character to be encrypted in the data to be encrypted includes:
[0152] Obtaining an initial vector used when symmetric encryption is performed on the data to be encrypted;
[0153] Generate an initial encryption factor based on the initial vector and the position information of the character to be encrypted in the data to be encrypted;
[0154] The initial encryption factor is encrypted based on the identity verification information corresponding to the character to be encrypted to obtain the encryption factor corresponding to the character to be encrypted.
[0155] In an optional implementation manner, in the instructions executed by the processor 61, encrypting the initial encryption factor based on the identity authentication information corresponding to the character to be encrypted to obtain the encryption factor corresponding to the initial encrypted character includes:
[0156] Using the first key, encrypting the identity verification information to obtain a second key for the character to be encrypted;
[0157] The initial encryption factor is encrypted using the second key to obtain an encryption factor corresponding to the character to be encrypted.
[0158] In an optional implementation, in the instruction executed by the processor 61, determining the identity authentication information corresponding to each character to be encrypted includes:
[0159] Preprocessing the characters to be encrypted to obtain standardized characters to be encrypted;
[0160] The pre-processed characters to be encrypted are encrypted using the third key to obtain identity verification information corresponding to the characters to be encrypted.
[0161] In an optional implementation manner, in the instructions executed by the processor 61, generating searchable encrypted data corresponding to the data to be encrypted based on the encryption factor corresponding to each character to be encrypted, the identity verification information, and the initial encrypted data includes:
[0162] For any of the characters to be encrypted, performing an XOR operation on the encryption factor corresponding to the character to be encrypted and the identity verification information to obtain a keyword ciphertext of the character to be encrypted;
[0163] Based on the keyword ciphertext of each character to be encrypted and the initial encrypted data, searchable encrypted data corresponding to the data to be encrypted is generated.
[0164] In an optional implementation manner, the instructions executed by the processor 61, after generating the searchable encrypted data, further include:
[0165] Obtaining a search keyword, and determining a plurality of key characters based on the search keyword;
[0166] Determine identity authentication information corresponding to the key character;
[0167] Based on the identity verification information, generating an intermediate encryption factor corresponding to the key character;
[0168] Determining a search token corresponding to the keyword based on the intermediate encryption factor and the identity verification information;
[0169] The search token is sent to the database, so that the database queries the searchable encrypted data corresponding to the search keyword based on the search token.
[0170] In an optional implementation manner, the database queries the searchable encrypted data corresponding to the search keyword based on the search token, including:
[0171] generating a plurality of candidate encryption factors based on the identity authentication information indicated by the search token and the keyword ciphertext in the searchable encrypted data to be queried;
[0172] Verifying the candidate encryption factor based on the intermediate encryption factor carried by the search token and the verification rule corresponding to the search type indicated by the search token;
[0173] In the event that the candidate encryption factor passes verification, it is determined that the searchable encrypted data matches the search token.
[0174] The present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the data processing method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0175] The embodiments of the present disclosure also provide a computer program product, which carries a program code. The instructions included in the program code can be used to execute the steps of the data processing method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0176] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0177] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0178] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0179] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0180] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0181] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A data processing method, characterized in that: include: Acquire data to be encrypted and symmetrically encrypt the data to be encrypted to obtain initial encrypted data; Splitting the data to be encrypted into a plurality of characters to be encrypted, and determining identity authentication information corresponding to each character to be encrypted; For each character to be encrypted, based on the identity authentication information corresponding to the character to be encrypted and the position information of the character to be encrypted in the data to be encrypted, an encryption factor corresponding to the character to be encrypted is generated; Generate searchable encrypted data corresponding to the data to be encrypted based on the encryption factor corresponding to each character to be encrypted, the identity verification information, and the initial encrypted data; The searchable encrypted data is stored in a database, where the database is used to store the searchable encrypted data and provide corresponding search services based on the searchable encrypted data.
2. The method according to claim 1, characterized in that The step of generating an encryption factor corresponding to the character to be encrypted based on the identity authentication information corresponding to the character to be encrypted and the position information of the character to be encrypted in the data to be encrypted includes: Obtaining an initial vector used when symmetric encryption is performed on the data to be encrypted; Generate an initial encryption factor based on the initial vector and the position information of the character to be encrypted in the data to be encrypted; The initial encryption factor is encrypted based on the identity verification information corresponding to the character to be encrypted to obtain the encryption factor corresponding to the character to be encrypted.
3. The method according to claim 2, characterized in that The encrypting the initial encryption factor based on the identity authentication information corresponding to the character to be encrypted to obtain the encryption factor corresponding to the initial encrypted character includes: Using the first key, encrypting the identity verification information to obtain a second key for the character to be encrypted; The initial encryption factor is encrypted using the second key to obtain an encryption factor corresponding to the character to be encrypted.
4. The method according to claim 1, characterized in that: The step of determining identity authentication information corresponding to each character to be encrypted includes: Preprocessing the characters to be encrypted to obtain standardized characters to be encrypted; The pre-processed characters to be encrypted are encrypted using the third key to obtain identity verification information corresponding to the characters to be encrypted.
5. The method according to claim 1, characterized in that The step of generating searchable encrypted data corresponding to the data to be encrypted based on the encryption factors corresponding to the characters to be encrypted, the identity verification information, and the initial encrypted data comprises: For any of the characters to be encrypted, performing an XOR operation on the encryption factor corresponding to the character to be encrypted and the identity verification information to obtain a keyword ciphertext of the character to be encrypted; Based on the keyword ciphertext of each character to be encrypted and the initial encrypted data, searchable encrypted data corresponding to the data to be encrypted is generated.
6. The method according to claim 1, characterized in that After generating the searchable encrypted data, the method further comprises: Obtaining a search keyword, and determining a plurality of key characters based on the search keyword; Determine identity authentication information corresponding to the key character; Based on the identity verification information, generating an intermediate encryption factor corresponding to the key character; Determining a search token corresponding to the keyword based on the intermediate encryption factor and the identity verification information; The search token is sent to the database, so that the database queries the searchable encrypted data corresponding to the search keyword based on the search token.
7. The method according to claim 6, characterized in that The database queries the searchable encrypted data corresponding to the search keyword based on the search token, including: generating a plurality of candidate encryption factors based on the identity authentication information indicated by the search token and the keyword ciphertext in the searchable encrypted data to be queried; Verifying the candidate encryption factor based on the intermediate encryption factor carried by the search token and the verification rule corresponding to the search type indicated by the search token; In the event that the candidate encryption factor passes verification, it is determined that the searchable encrypted data matches the search token.
8. A data processing device, characterized in that: include: A first encryption module, used to obtain data to be encrypted and symmetrically encrypt the data to be encrypted to obtain initial encrypted data; An identity authentication module, used for splitting the data to be encrypted into a plurality of characters to be encrypted, and determining identity authentication information corresponding to each character to be encrypted; A generating module, configured to generate, for each character to be encrypted, an encryption factor corresponding to the character to be encrypted based on the identity authentication information corresponding to the character to be encrypted and the position information of the character to be encrypted in the data to be encrypted; A second encryption module, configured to generate searchable encrypted data corresponding to the data to be encrypted based on the encryption factors corresponding to the characters to be encrypted, the identity verification information and the initial encrypted data; A storage module is used to store the searchable encrypted data in a database, and the database is used to store the searchable encrypted data and provide corresponding search services based on the searchable encrypted data.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the data processing method as described in any one of claims 1 to 7 are performed.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the data processing method according to any one of claims 1 to 7.
