Data processing method and device
Through multiple conversions and encryption processes of sensitive data in the database, multi-protected target ciphertext data is formed, which solves the problem of poor data protection in the existing technology and improves data security and reducibility.
Patent Information
- Application Number
- CN202210950280.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-09
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-08-09
AI Technical Summary
Existing data protection methods have poor protection effects on sensitive data in databases, making it difficult to effectively prevent data leakage and cracking.
By converting plaintext data into index data and index characters, and using preset encryption information and encryption identification information for multiple mappings and combinations, encryption processing is performed to form multi-protected target ciphertext data.
It improves the security of data, increases the difficulty of cracking the target ciphertext data, ensures the restoreability of data, and enhances the protection of sensitive data.
Smart Images

Figure CN116132079B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data security technology, and in particular to a data processing method and device. Background Art
[0002] At present, the protection of sensitive data is a key technology that major companies attach great importance to. For this type of sensitive data, companies usually use various encryption methods to encrypt it when using it. As one of the essential core technologies in the enterprise Internet system, the database is mainly used to store important data within the enterprise. For the enterprise, the security of the data stored in the database is undoubtedly very important, especially the business data within the enterprise. Data may be the foundation of the enterprise. Therefore, before storing the data in the database, the data must be encrypted first. In related technologies, symmetric encryption, asymmetric encryption, transparent encryption, non-transparent encryption and other methods are usually used to encrypt data. These encryption methods are too simple and it is difficult to effectively protect sensitive data. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a data processing method and device to solve the problem of poor data protection effect in the prior art.
[0004] To solve the above technical problems, the embodiments of the present application are implemented as follows:
[0005] On the one hand, an embodiment of the present application provides a data processing method, including:
[0006] According to a preset conversion algorithm between index data and character data, convert at least one character data included in the plaintext data into first index data respectively;
[0007] Determine, according to a pre-created first mapping relationship between index characters and index data, a first index character corresponding to each of the first index data;
[0008] Determine the first encryption information and the first encryption identification information corresponding to the plaintext data, and encrypt the first index string according to the first encryption information to obtain index ciphertext data; wherein the first index string is determined according to the first index character, and the first encryption identification information is determined based on a second mapping relationship between the preset encryption information and the encryption identification information;
[0009] The first encryption identification information and the index ciphertext data are combined to obtain target ciphertext data corresponding to the plaintext data.
[0010] The technical solution of the embodiment of the present application is adopted, by first converting at least one character data included in the plaintext data into the first index data respectively, and then determining the first index character corresponding to each first index data according to the first mapping relationship between the pre-created index character and the index data, and then encrypting the first index string according to the first encryption information corresponding to the plaintext data, and combining the encrypted index ciphertext data and the first encryption identification information corresponding to the first encryption information to obtain the target ciphertext data corresponding to the plaintext data. It can be seen that when encrypting the plaintext data, the technical solution does not adopt a single encryption method or directly encrypt the plaintext data, but first converts the plaintext data multiple times, such as converting it into the first index data, then converting it into the first index character, and then encrypting the first index string obtained after the conversion. Since the data conversion process of the plaintext data is not easy to be cracked by outsiders, and by combining the data conversion process and the data encryption method, the plaintext data is given multiple protections, it can increase the difficulty of cracking the target ciphertext data and improve data security. In addition, since the target ciphertext data is obtained by combining the first encryption identification information and the index ciphertext data, that is, the encryption identification information is implicit in the target ciphertext data, a user with permission to obtain plaintext data can determine the corresponding encryption information based on the encryption identification information implicit in the target ciphertext data, thereby facilitating the user to restore the target ciphertext data to plaintext data, thereby ensuring that the encryption of the plaintext data is reversible.
[0011] On the other hand, an embodiment of the present application provides a data processing method, including:
[0012] Parsing the target ciphertext data to obtain first encryption identification information and index ciphertext data corresponding to the target ciphertext data;
[0013] Determine, according to the first encryption identification information, first decryption information corresponding to the index ciphertext data, and decrypt the index ciphertext data according to the first decryption information to obtain a first index string; wherein the first decryption information matches the first encryption information corresponding to the first encryption identification information, and the first encryption information is determined based on a second mapping relationship between the preset encryption information and the encryption identification information;
[0014] Determine, according to a pre-created first mapping relationship between index characters and index data, first index data corresponding to each first index character included in the first index character string;
[0015] According to a preset conversion algorithm between index data and character data, each of the first index data is converted into corresponding character data, and the plaintext data corresponding to the target ciphertext data is determined according to each of the character data.
[0016] The technical solution of the embodiment of the present application is adopted, by parsing the target ciphertext data into the first encryption identification information and the index ciphertext data, and using the first decryption information determined based on the first encryption identification information to decrypt the index ciphertext data, a first index string is obtained; then each first index character included in the first index string is converted into the corresponding first index data, and each first index data is further converted into the corresponding character data, and the plaintext data corresponding to the target ciphertext data is determined according to each character data. It can be seen that when the technical solution decrypts the target ciphertext data, it is first necessary to determine the decryption information according to the encryption identification information implicit in the target ciphertext data. Since the implicit manner (such as the implicit position) of the encryption identification information in the target ciphertext data is not easy to be known by outsiders, the difficulty of cracking the target ciphertext data is increased. Further, after decrypting the index ciphertext data using the decryption information, what is obtained is not the plaintext data itself, but the first index string corresponding to the plaintext data. Only after each first index character included in the first index string is converted multiple times (such as converted into the first index data and then converted into character data), the plaintext data itself can be obtained. Since the target ciphertext data is obtained by performing multiple protections on the plaintext data, it is necessary to crack the multiple protection methods one by one before obtaining the plaintext data, which increases the difficulty of cracking the target ciphertext data and improves data security.
[0017] On the other hand, the embodiment of the present application provides a data processing method, including:
[0018] In response to a data storage request to store plaintext data in a target database, determining a target field corresponding to the plaintext data; the data storage request includes the plaintext data and the target field, and the target database includes a plurality of fields;
[0019] If the target field belongs to a preset sensitive field, encrypting the plaintext data by the data processing method described in the first aspect above to obtain ciphertext data corresponding to the plaintext data;
[0020] The ciphertext data is stored in a location in the target database corresponding to the target field.
[0021] According to the technical solution of the embodiment of the present application, before storing the plaintext data in the target database, the target field corresponding to the plaintext data is first determined. If the target field belongs to a preset sensitive field, the plaintext data needs to be encrypted according to the data processing method described in the above aspect, and the encrypted ciphertext data is stored in the position corresponding to the target field in the target data. It can be seen that the technical solution ensures the security of the data corresponding to the sensitive field by encrypting the plaintext data of the sensitive field in a targeted manner. In addition, since the plaintext data is protected by combining the data conversion process and the data encryption method, the difficulty of cracking the ciphertext data in the target database is increased compared to a single encryption method or a method of directly encrypting the plaintext data, thereby ensuring the security of the data in the target database.
[0022] On the other hand, the embodiment of the present application provides a data processing method, including:
[0023] In response to a data acquisition request for acquiring plaintext data from a target database, determining a target field corresponding to the plaintext data; the data acquisition request includes the target field, and the target database includes a plurality of fields;
[0024] If the target field belongs to a preset sensitive field, obtaining ciphertext data corresponding to the plaintext data from the target database;
[0025] The ciphertext data is decrypted by the data processing method described in the above another aspect to obtain the plaintext data corresponding to the ciphertext data.
[0026] By adopting the technical solution of the embodiment of the present application, when obtaining the data corresponding to the sensitive field from the target database, the plaintext data is not directly obtained, but the ciphertext data corresponding to the plaintext data is obtained. The ciphertext data needs to be decrypted according to the data processing method described in the other aspect before the plaintext data can be obtained. It can be seen that the technical solution ensures the security of the data corresponding to the sensitive field by storing the data corresponding to the sensitive field in the form of ciphertext data in a targeted manner. In addition, since the ciphertext data stored in the target database is obtained by performing multiple protections on the plaintext data, the plaintext data can only be obtained after the multiple protection methods are cracked one by one, which increases the difficulty of cracking the ciphertext data, thereby improving the security of the data in the target database.
[0027] On the other hand, an embodiment of the present application provides a data processing device, including:
[0028] A first conversion module, used for converting at least one character data included in the plaintext data into first index data according to a preset conversion algorithm between index data and character data;
[0029] A first determining module, configured to determine a first index character corresponding to the first index data according to a pre-created first mapping relationship between the index character and the index data;
[0030] a first encryption module, used to determine first encryption information and first encryption identification information corresponding to the plaintext data, and encrypt a first index string according to the first encryption information to obtain index ciphertext data; wherein the first index string is determined according to the first index character, and the first encryption identification information is determined based on a second mapping relationship between the preset encryption information and the encryption identification information;
[0031] A combining module is used to combine the first encrypted identification information and the index ciphertext data to obtain target ciphertext data corresponding to the plaintext data.
[0032] On the other hand, an embodiment of the present application provides a data processing device, including:
[0033] A parsing module, used to parse the target ciphertext data to obtain the first encryption identification information and index ciphertext data corresponding to the target ciphertext data;
[0034] A first decryption module, configured to determine, according to the first encryption identification information, first decryption information corresponding to the index ciphertext data, and decrypt the index ciphertext data according to the first decryption information to obtain a first index string; wherein the first decryption information matches the first encryption information corresponding to the first encryption identification information, and the first encryption information is determined based on a second mapping relationship between a preset encryption information and the encryption identification information;
[0035] A second determining module, configured to determine first index data corresponding to each first index character included in the first index character string according to a pre-created first mapping relationship between index characters and index data;
[0036] The second conversion module is used to convert each of the first index data into corresponding character data according to a preset conversion algorithm between index data and character data, and determine the plaintext data corresponding to the target ciphertext data according to each of the character data.
[0037] On the other hand, an embodiment of the present application provides a data processing device, including:
[0038] A third determination module is configured to determine a target field corresponding to the plaintext data in response to a data storage request for storing the plaintext data in a target database; the data storage request includes the plaintext data and the target field, and the target database includes a plurality of fields;
[0039] A second encryption module, configured to encrypt the plaintext data by the data processing method described in the first aspect to obtain ciphertext data corresponding to the plaintext data if the target field belongs to a preset sensitive field;
[0040] A storage module is used to store the ciphertext data in a location in the target database corresponding to the target field.
[0041] On the other hand, an embodiment of the present application provides a data processing device, including:
[0042] A fourth determination module, configured to determine a target field corresponding to the plaintext data in response to a data acquisition request for acquiring plaintext data from a target database; the data acquisition request includes the target field, and the target database includes a plurality of fields;
[0043] An acquisition module, configured to acquire ciphertext data corresponding to the plaintext data from the target database if the target field belongs to a preset sensitive field;
[0044] The second decryption module is used to decrypt the ciphertext data through the data processing method described in the other aspect to obtain the plaintext data corresponding to the ciphertext data.
[0045] On the other hand, an embodiment of the present application provides a data processing device, including a processor and a memory electrically connected to the processor, the memory storing a computer program, and the processor being used to call and execute the computer program from the memory to implement the above-mentioned data processing method.
[0046] On the other hand, an embodiment of the present application provides a storage medium for storing a computer program, wherein the computer program can be executed by a processor to implement the above-mentioned data processing method. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0048] Figure 1 is a schematic flow chart of a data processing method according to an embodiment of the present application;
[0049] Figure 2 is a schematic principle diagram of a data processing method according to a specific embodiment of the present application;
[0050] Figure 3is a schematic flow chart of a data processing method according to another embodiment of the present application;
[0051] Figure 4 is a schematic flow chart of a data processing method according to yet another embodiment of the present application;
[0052] Figure 5 is a schematic flow chart of a data processing method according to yet another embodiment of the present application;
[0053] Figure 6 is a schematic block diagram of a data processing device according to an embodiment of the present application;
[0054] Figure 7 is a schematic block diagram of a data processing device according to another embodiment of the present application;
[0055] Figure 8 is a schematic block diagram of a data processing device according to yet another embodiment of the present application;
[0056] Fig. 9 is a schematic block diagram of a data processing device according to yet another embodiment of the present application;
[0057] Fig.10 It is a schematic block diagram of a data processing device according to an embodiment of the present application. DETAILED DESCRIPTION
[0058] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0059] In the field of data security, data security is very important for major enterprises or individuals. In the related technology, a combination of one or more technologies is usually used to encrypt data, such as symmetric encryption, asymmetric encryption, transparent encryption (i.e., automatic encryption), non-transparent encryption (i.e., non-automatic encryption) and other encryption methods. The encrypted data is stored in the database to ensure the security of the data in the database. The following scenario of writing data into the database is taken as an example to list two common encryption methods: the first method is for some databases with built-in encryption functions, such as the encryption function ENCODE() built into the MySQL (relational database management system) database. By inputting the data to be encrypted and the key into the encryption function ENCODE() as parameters, the encrypted data can be returned, and then the encrypted data is written into the database. The second method is to encrypt the data to be encrypted through the software in the computer, and assemble the encrypted data into sql (Structured Query Language) and then write it into the database. Obviously, the above two common encryption methods are relatively simple and have low data protection. In addition, users need to maintain the key themselves. In the scenario where the amount of sensitive data is large, it is very inconvenient for users to maintain a large number of keys, and the management is relatively complicated. In order to enhance data protection, the embodiment of the present application provides a data processing method, by first converting the character data included in the plaintext data into index data, and then determining the index character corresponding to each index data according to the mapping relationship between the pre-created index character and the index data, and then encrypting the index character string according to the encryption information corresponding to the plaintext data, thereby providing a data protection scheme by combining the data conversion process and the data encryption method, so that the plaintext data is given multiple protections, increasing the difficulty of cracking the ciphertext data, and improving data security. Further, in order to facilitate users to restore ciphertext data to plaintext data, in the data processing method provided by the embodiment of the present application, by combining the index ciphertext data obtained after encryption and the encryption identification information corresponding to the encryption information, the encryption identification information is implicit in the ciphertext data corresponding to the plaintext data, so that when the user wants to restore the plaintext data, he only needs to determine the corresponding encryption information according to the encryption identification information implicit in the ciphertext data, and the ciphertext data can be restored to the plaintext data based on the encryption information combined with the data conversion method, ensuring that the encryption of the plaintext data is reversible, and there is no need for the user to maintain the key.
[0060] The data processing method provided in the embodiment of the present application can be executed by a data processing device, or by software installed in the data processing device. Specifically, the data processing device can be a terminal device or a server device. The data processing method provided in the embodiment of the present application is described in detail below.
[0061] Figure 1is a schematic flow chart of a data processing method according to an embodiment of the present application, such as Figure 1 As shown, the method includes:
[0062] S102: Convert at least one character data included in the plaintext data into first index data according to a preset conversion algorithm between index data and character data.
[0063] The plaintext data includes at least one character data, which refers to an information unit. Simply put, a Chinese character, a letter or a number can be considered as a character data. For example, the plaintext data "Man" includes three character data: M, a, and n.
[0064] The conversion algorithm between the index data and the character data can be a single algorithm or a combination of multiple algorithms. Optionally, if the conversion algorithm is a single algorithm, the conversion algorithm can be understood as a mapping relationship between the index data and the character data, and the mapping relationship can be a one-to-one, many-to-one or one-to-many mapping relationship. According to the mapping relationship between the index data and the character data, the character data can be directly converted into the corresponding first index data.
[0065] Optionally, the conversion algorithm between index data and character data is a combination of multiple algorithms. In this case, when converting character data into first index data, the character data needs to be first converted into at least one intermediate data (such as the first category data, second category data, etc. in the following embodiments), and finally the intermediate data is converted into the first index data.
[0066] S104: Determine a first index character corresponding to each first index data according to a pre-created first mapping relationship between the index character and the index data.
[0067] Among them, the first mapping relationship between the index character and the index data can be created by the user, or it can be represented by an existing normative encoding method, such as the standard base64 encoding algorithm, which is a common encoding method for transmitting 8-bit bytecodes, including 64 characters for representing binary data. Specifically, the standard base64 encoding table includes 64 numerical values (0-63) and mapping relationships between characters. The 64 numerical values in the standard base64 encoding table can be used as index data, and the characters in the standard base64 encoding table can be used as index characters. Thus, the standard base64 encoding table is the first mapping relationship between the index character and the index data. Optionally, the first mapping relationship between the index character and the index data can also be improved based on the normative encoding method, for example, it can be improved on the basis of the standard base64 encoding algorithm, so that the mapping relationship between the 64 numerical values and characters in the standard base64 encoding algorithm is changed.
[0068] Optionally, after the first mapping relationship is created, in order to ensure the data encryption effect, the first mapping relationship can be updated at regular intervals. There are multiple ways to update the first mapping relationship. Optionally, the mapping relationship between the index characters and the index data is rearranged regularly, for example, the index data remains unchanged and each adjacent two index characters are swapped, so that the mapping relationship between the index data and the index characters is changed.
[0069] S106, determine the first encryption information and the first encryption identification information corresponding to the plaintext data, and encrypt the first index string according to the first encryption information to obtain index ciphertext data; wherein, the first index string is determined according to the first index character, and the first encryption identification information is determined based on the second mapping relationship between the preset encryption information and the encryption identification information.
[0070] If the plaintext data corresponds to only one first index character, the first index character is the first index string. If the plaintext data corresponds to multiple first index characters, the combination of the multiple first index characters is the first index string.
[0071] When encrypting the first index string according to the first encryption information, any existing encryption method can be used for encryption. For example, the first index string can be directly encrypted using the first encryption information. Alternatively, an existing encryptor can be used for encryption. Specifically, the first encryption information and the first index string are input into the encryptor in the form of parameters, and the output of the encryptor is the index ciphertext data. Alternatively, a more complex encryption algorithm can be used for encryption, such as AES128 (Advanced Encryption Standard). The encryption principle of AES128 is a well-known technology and will not be elaborated here.
[0072] S108, combining the first encrypted identification information and the index ciphertext data to obtain target ciphertext data corresponding to the plaintext data.
[0073] In this step, there may be multiple ways to combine the first encrypted identification information and the index ciphertext data. Optionally, the first encrypted identification information and the index ciphertext data may be directly spliced. This embodiment does not limit the splicing method of the first encrypted identification information and the index ciphertext data. For example, the splicing method may be a splicing method in which the first encrypted identification information is in front and the index ciphertext data is in the back, or a splicing method in which the index ciphertext data is in front and the first encrypted identification information is in the back. Optionally, the first encrypted identification information may be added to a preset position in the index ciphertext data. The preset position may be any position in the index ciphertext data, such as before the first bit of the index ciphertext data, after the last bit of the index ciphertext data, between two adjacent bits of data in the index ciphertext data (such as between the nth bit of data and the n+1th bit of data), etc.
[0074] The technical solution of the embodiment of the present application is adopted, by first converting at least one character data included in the plaintext data into the first index data respectively, and then determining the first index character corresponding to each first index data according to the first mapping relationship between the pre-created index character and the index data, and then encrypting the first index string according to the first encryption information corresponding to the plaintext data, and combining the encrypted index ciphertext data and the first encryption identification information corresponding to the first encryption information to obtain the target ciphertext data corresponding to the plaintext data. It can be seen that when encrypting the plaintext data, the technical solution does not adopt a single encryption method or directly encrypt the plaintext data, but first converts the plaintext data multiple times, such as converting it into the first index data, then converting it into the first index character, and then encrypting the first index string obtained after the conversion. Since the data conversion process of the plaintext data is not easy to be cracked by outsiders, and by combining the data conversion process and the data encryption method, the plaintext data is given multiple protections, it can increase the difficulty of cracking the target ciphertext data and improve data security. In addition, since the target ciphertext data is obtained by combining the first encryption identification information and the index ciphertext data, that is, the encryption identification information is implicit in the target ciphertext data, a user with permission to obtain plaintext data can determine the corresponding encryption information based on the encryption identification information implicit in the target ciphertext data, thereby facilitating the user to restore the target ciphertext data to plaintext data, thereby ensuring that the encryption of the plaintext data is reversible.
[0075] In one embodiment, when executing the step of converting at least one character data included in the plaintext data into the first index data according to the preset conversion algorithm between the index character and the character data, the following steps A1-A4 may be specifically performed:
[0076] Step A1: convert each character data into first-category data according to a preset first-category data conversion method.
[0077] Optionally, the first-category data conversion method can be an ASCII (American Standard Code for Information Interchange) encoding algorithm, and the first-category data is an ASCII code. The ASCII encoding algorithm defines an encoding method for 128 specified characters. When each character data in the plain text data is converted into the first-category data (i.e., ASCII code) using the ASCII encoding algorithm, the character data in the plain text data can be matched with the specified characters defined in the ASCII table, and the ASCII code corresponding to the matched specified character is used as the first-category data corresponding to the character data. Since the ASCII encoding algorithm and the ASCII table are already known technologies, they will not be described in detail.
[0078] Step A2: Determine the second type of data corresponding to each first type of data corresponding to the plaintext data according to the third mapping relationship between the first type of data and the second type of data, wherein each second type of data includes N bits of data, where N is an integer greater than or equal to 1.
[0079] To enhance data protection, the first category data and the second category data may be represented in different ways. Optionally, the first category data is ASCII code and the second category data is binary data. Since ASCII code is represented by decimal numbers, the ASCII code can be converted into binary data based on the conversion method between decimal numbers and binary numbers, thereby converting the first category data into the corresponding second category data.
[0080] Optionally, the second category data includes a plurality of character data, and the number of digits of the second category data can be determined according to the number of character data included in the second category data, wherein each character data is considered as a single bit of data. Therefore, the number of character data included in the second category data is the number of digits of the second category data, that is, the second category data includes N-bit data, where N is the number of character data included in the second category data.
[0081] When the second type of data is binary data, each binary character in the binary data is one bit of data of the second type of data. For example, the second type of data "011" includes 0, 1, 1, a total of three bits of data.
[0082] Step A3: reorganize the second category data according to a preset data reorganization rule to obtain each reorganized second category data; each reorganized second category data includes M bits of data, where M and N have different values, and M is an integer greater than or equal to 1.
[0083] In this step, reorganization refers to changing the number of bits of the second type of data. By executing step A2, each second type of data obtained includes N bits of data, and after executing step A3, the reorganized second type of data obtained includes M bits of data.
[0084] Optionally, the data reorganization rule may be: according to the order of the number of data bits in each second category data from high to low, each adjacent M-bit data is divided as a group in turn, so as to obtain each reorganized second category data.
[0085] If the plaintext data corresponds to only one second-category data, the second-category data can be reorganized by reducing the number of data bits of the second-category data. For example, the second-category data containing 6 bits of data is reorganized to obtain two reorganized second-category data, each of which contains 3 bits of data, where N=6 and M=3.
[0086] If the plaintext data corresponds to multiple second-category data, the second-category data can be reorganized by reducing or increasing the number of data bits of the second-category data. Assuming N=6, M=4, the last 2 bits of the first second-category data need to be combined with the first 2 bits of the second second-category data so that each reorganized second-category data includes 4 bits of data. For example, the plaintext data corresponds to 2 first-category data. According to the third mapping relationship between the first-category data and the second-category data, the 2 first-category data are converted into corresponding second-category data: "011000" and "011011" respectively. If N=6, M=4, the following second-category data can be obtained after reorganization: "0110", "0001" and "1011".
[0087] In addition to the data reorganization rules in the above examples, other data reorganization rules can also be preset. For example, according to the order of the number of data bits in each second-category data from low to high, each adjacent M-bit data is divided as a group; or, each second-category data is first arranged in the order of the number of data bits from low to high or from high to low, and then the second-category data is reorganized in a jumping reorganization method, and the jumping reorganization method is that the selected data bits are not adjacent, such as selecting M-bit data on an even-numbered bit in turn, and reorganizing the selected M-bit data into a new second-category data. For example, after arranging each second-category data in the order of the number of data bits from low to high or from high to low, select the 2nd, 4th, 6th, 8th...bit data (a total of M bits) to reorganize into a new second-category data.
[0088] Step A4: Determine the first index data corresponding to each reorganized second category data according to the fourth mapping relationship between the second category data and the index data.
[0089] In this step, since the number of data bits of the second type of data changes after the second type of data is reorganized, even if the first type of data and the index data are both decimal data, the values of the two are different. Optionally, the first type of data is ASCII code, the second type of data is binary data, and the index data is decimal data different from the ASCII code.
[0090] In this embodiment, the character data included in the plaintext data is first converted into the first type of data, and then the first type of data is converted into the second type of data, and then the second type of data is reorganized, and the first index data corresponding to the reorganized second type of data is determined according to the mapping relationship between the second type of data and the index data. Since the process of converting the character data into the first index data is not a single process, but is achieved after multiple conversions between different types of data, the protection of the plaintext data is strengthened, and even if the first index data is leaked, it is difficult to be restored to the plaintext data, thereby ensuring the security of the plaintext data. In addition, when determining the corresponding first index data based on the second type of data, it is not determined based on the initial second type of data, but the second type of data is reorganized according to different data bit numbers, thereby adding another layer of data protection means on the basis of multiple conversions of the character data, thereby greatly improving the security of the plaintext data.
[0091] In one embodiment, the first encryption information corresponding to the plaintext data can be determined based on a preset key library. The preset key library includes a second mapping relationship between multiple encryption information and encryption identification information. Based on this, an encryption information can be screened out from the preset key library as the first encryption information corresponding to the plaintext data, and the encryption identification information corresponding to the screened encryption information is the first encryption identification information corresponding to the plaintext data.
[0092] Each encrypted information in the preset key library is a key, which can be a symmetric key or an asymmetric key. Optionally, multiple keys can be randomly generated by an existing password generator, and a preset key library can be created based on the randomly generated multiple keys. The encryption identification information corresponding to the encrypted information can be any one or more identifications such as numbers, letters, graphics, etc. For example, the numbers "1, 2, 3...n" can be used as encryption identification information, or letters "a, b, c" can be used as encryption identification information, or a combination of numbers and letters "1, 2, 3...a, b, c..." can be used as encryption identification information. It should be noted that for ease of understanding, the encryption identification information listed here is relatively simple. In actual applications, the encryption identification information can be a more complex representation method, such as a12, >2p-1, etc. According to the encryption identification information, the corresponding encryption information can be accurately and uniquely determined.
[0093] Optionally, an encryption information may be selected from a preset key library as the first encryption information according to a preset key selection method. The key selection method may be any of the following: a random selection method, a sequential selection method (for example, if the nth key information in the preset key library was selected last time, the n+1th key information may be selected this time), etc.
[0094] In this embodiment, since the preset key library includes multiple encryption information, the first encryption information screened out by the preset screening method is not easy to be known by outsiders. In particular, when there are multiple plaintext data to be encrypted, multiple different encryption information is selected to encrypt the first index character strings corresponding to different plaintext data, which can increase the difficulty for outsiders to know the encryption information, thereby ensuring the security of the data.
[0095] The following takes the plaintext data "Man" as an example to explain in detail the data processing method provided by the present application.
[0096] Figure 2 is a schematic diagram of a data processing method according to a specific embodiment of the present application. Figure 2 As shown, first, according to the preset conversion algorithm between index data and character data, each character data included in the plaintext data "Man" is converted into the first index data. Specifically, the conversion algorithm between index data and character data includes multiple conversion steps. The first step is to convert the character data into the first type of data, the second step is to convert the first type of data into the second type of data, the third step is to reorganize the second type of data, and the fourth step is to convert the reorganized second type of data into the first index data. In this embodiment, the first type of data conversion method is the ASCII encoding algorithm, the first type of data is ASCII code, and the second type of data is binary data including 8-bit data. The index data is decimal data, and the reorganized second type of data includes 6-bit data.
[0097] The plaintext data "Man" includes three character data, M, a, and n. For these three character data, they are matched with the specified characters defined in the ASCII table respectively, and the ASCII codes corresponding to the matched specified characters are used as the first type of data corresponding to the character data. Specifically, by matching each character data with the ASCII table, it can be obtained that the ASCII code corresponding to the character data "M" is 77, the ASCII code corresponding to the character data "a" is 97, and the ASCII code corresponding to the character data "n" is 100.
[0098] Then, according to the conversion method between binary data and decimal data (i.e., the third mapping relationship between the first type of data and the second type of data), the ASCII code is converted into binary data (i.e., the second type of data). In this embodiment, by converting ASCII codes 77, 97, and 100, the following binary data (i.e., the second type of data) can be obtained: 01001101, 01100001, and 01101110. It can be seen that each second type of data includes 8 bits of data, and each bit of data is a binary character.
[0099] Then, according to the preset data reorganization rule, the binary data (i.e., the second type of data) obtained after the previous step of conversion is reorganized. In this embodiment, the data reorganization rule is: according to the order of the number of data bits in each second type of data from high to low, each adjacent M-bit data is divided as a group in turn, so as to obtain each reorganized second type of data, where M=6. By reorganizing the binary data "01001101", "01100001" and "01101110", the following binary data "010011", "010110", "000101" and "101110" can be obtained. It can be seen that each reorganized second type of data includes 6 bits of data.
[0100] Then, according to the conversion method between binary data and decimal data (i.e., the fourth mapping relationship between the second category data and the index data), the decimal data (i.e., the first index data) corresponding to each binary data obtained after the reorganization is determined. In this embodiment, by converting each binary data obtained after the reorganization, the following decimal data can be obtained: 19, 22, 5, 46. It can be seen that although the first index data and the first category data are both represented by decimal data, the values of the first index data and the first category data are different after the reorganization process of the second category data, thereby increasing the difficulty of restoring the character data, thereby enhancing the protection of the plaintext data.
[0101] After converting each character data included in the plaintext data into the first index data, the first index character corresponding to each first index data is determined according to the first mapping relationship between the index character and the index data created in advance. In this embodiment, the first mapping relationship between the index character and the index data is an index table improved on the basis of the standard base64 encoding algorithm, hereinafter referred to as the base64 index table. Table 1 below shows a base64 index table in one embodiment.
[0102] Table 1
[0103]
[0104]
[0105] Compared with the traditional standard base64 encoding table, the base64 index table shown in Table 1 is adjusted in the following way: in the mapping relationship between 64 values (0-63) and characters in the standard base64 encoding table, the mapping relationship between each value and character is taken as a pair of mapping relationships, then starting from the first pair of mapping relationships, every 10 pairs of mapping relationships are grouped together to form a primary group. Inside the primary group, it is divided into two secondary groups again according to every 5 pairs of mapping relationships as a group, assuming that it is divided into two secondary groups A and B. Then, the two secondary groups A and B are swapped. Then, inside each secondary group, the first character and the fifth character are swapped while keeping the value unchanged. The above process is performed once for each primary group to obtain the adjusted base64 index table. Of course, only one adjustment method is schematically listed here. In practical applications, other adjustment methods can also be used to adjust the standard base64 encoding table, as long as the mapping relationship between the adjusted base64 index table and the standard base64 encoding table changes.
[0106] As can be seen from Table 1, compared with the traditional standard base64 encoding table, the mapping relationship between 64 numerical values and characters has changed, that is, the first mapping relationship between the index character and the index data is different from the mapping relationship between the 64 numerical values and characters in the standard base64 encoding table. By matching the first index character with the base64 index table, the first index character corresponding to each first index data can be determined. In this embodiment, by matching each first index data (19, 22, 5, 46) with the base64 index table respectively, the following first index characters can be obtained: K, b, E, P. By combining multiple first index characters, the first index string "KbEP" can be obtained.
[0107] For ease of understanding, the following Table 2 shows the conversion process from the plain text data "Man" to the first index characters "K, b, E, P".
[0108] Table 2
[0109]
[0110]
[0111] After determining each first index character and the first index string, determine the first encryption information and the first encryption identification information corresponding to the plaintext data, and encrypt the first index string according to the first encryption information to obtain the index ciphertext data. In this embodiment, a preset key library is pre-created, and the preset key library includes a mapping relationship between multiple encryption information and encryption identification information. Among them, the encryption information can be randomly generated using an existing password generator. Table 3 below shows the mapping relationship between the encryption information and the encryption identification information in one embodiment. The preset key library shown in Table 3 includes 999 encryption information (i.e., a 16-bit key string), and each encryption information corresponds to a unique encryption identification information, such as numbering 001-999. It should be noted that the 16-bit key string "k1(xxxxx), k2(xxxxx)...k999(xxxxx)" shown in Table 3 is only a schematic representation method and does not represent a real key string.
[0112] Table 3
[0113] Encrypted identification information 16-bit key string 001 k1(xxxxx) 002 k2(xxxxx) … … 999 K999(xxxx)
[0114] According to the preset key screening method, an encryption information can be screened out from the preset key library shown in Table 3 as the first encryption information corresponding to the plaintext data "Man". The key screening method can be any of the following: random screening method, sequential screening method (for example, if the nth key information in the preset key library was selected last time, the n+1th key information can be selected this time), etc. In this embodiment, it is assumed that the encryption information "i4k1i0p5h0AXBjuC" (16-bit key string) with a number (i.e., encryption identification information) of 847 is screened out as the first encryption information corresponding to the plaintext data "Man".
[0115] Then, the first index character string “KbEP” corresponding to the plaintext data “Man” is encrypted using the encryption information “i4k1i0p5h0AXBjuC” to obtain the index ciphertext data “U2FsdGVkX19hZi7jbc2hBJXbgtIWRtd3Ufg4UzrgBdc”.
[0116] After obtaining the index ciphertext data corresponding to the plaintext data, the first encryption identification information corresponding to the plaintext data and the index ciphertext data are combined to obtain the target ciphertext data corresponding to the plaintext data. In this embodiment, the target ciphertext data is obtained by adding the first encryption identification information to the preset position in the index ciphertext data. Since the encryption identification information listed in this embodiment all includes 3 bits, the preset position also includes 3 bits. Specifically, the preset position may include: the first bit before the first bit of the index ciphertext data, and the two bits after the last bit of the data. The first bit "8" of the encryption identification information "847" is added to the first bit before the first bit of the index ciphertext data, and the last two bits "47" of the encryption identification information "847" are added to the two bits after the last bit of the index ciphertext data to obtain the target ciphertext data "8U2FsdGVkX19hZi7jbc2hBJXbgtIWRtd3Ufg4UzrgBdc47".
[0117] It can be seen that, by adopting the data processing method provided by this embodiment, the plaintext data "Man" undergoes multiple data conversion processes and data encryption processes, and the target ciphertext data obtained is difficult to be cracked by outsiders, thereby greatly improving the security of the data. In addition, since the encryption identification information is implicit in the target ciphertext data, users with the permission to obtain the plaintext data can determine the corresponding encryption information based on the encryption identification information implicit in the target ciphertext data, so that it is convenient for users to restore the target ciphertext data to plaintext data, ensuring that the encryption of the plaintext data is reversible.
[0118] Figure 3 is a schematic flow chart of a data processing method according to another embodiment of the present application, such as Figure 3 As shown, the method includes:
[0119] S302, parsing the target ciphertext data to obtain first encryption identification information and index ciphertext data corresponding to the target ciphertext data.
[0120] In this step, the target ciphertext data is obtained by combining the first encryption identification information and the index ciphertext data. Therefore, the parsing method of the target ciphertext data should match the combination method.
[0121] There can be many ways to combine the first encrypted identification information and the index ciphertext data. Optionally, the first encrypted identification information and the index ciphertext data can be directly spliced. For example, the first encrypted identification information includes 3 bits of data (i.e., the first encrypted identification information includes 3 character data), and the index ciphertext data includes 8 bits of data (i.e., the index ciphertext data includes 8 character data). Then, by splicing the first encrypted identification information and the index ciphertext data, a target ciphertext data including 11 bits of data can be obtained, wherein the first 3 bits of data constitute the first encrypted identification information, and the last 8 bits of data constitute the index ciphertext data. Based on this, the target ciphertext data can be split between the first 3 bits and the last 8 bits of data, thereby obtaining the first encrypted identification information and index ciphertext data corresponding to the target ciphertext data.
[0122] Optionally, the target ciphertext data is obtained by adding the first encryption identification information to a preset position in the index ciphertext data, and the preset position can be any position in the index ciphertext data, such as before the first bit of the index ciphertext data, after the last bit of the index ciphertext data, between two adjacent bits of the index ciphertext data, etc. Based on this, when parsing the target ciphertext data, the first encryption identification information can be obtained from the preset position of the target ciphertext data, and the other data in the target ciphertext data except the first encryption identification information is determined as the index ciphertext data. For example, if the preset position is after the third bit of the index ciphertext data, and the first encryption identification information includes 3 bits of data, the 3 bits of data after the third bit of the target ciphertext data can be split out to obtain the first encryption identification information, and the other character data in the target ciphertext data except the split 3 bits of data constitute the index ciphertext data.
[0123] S304, determining the first decryption information corresponding to the index ciphertext data according to the first encryption identification information, and decrypting the index ciphertext data according to the first decryption information to obtain a first index character string; wherein the first decryption information matches the first encryption information corresponding to the first encryption identification information, and the first encryption information is determined based on a second mapping relationship between the preset encryption information and the encryption identification information.
[0124] Since the encrypted information can be a symmetric key or an asymmetric key, if the encrypted information is a symmetric key, the first decryption information that matches the first encrypted information is the symmetric key itself, that is, the first encrypted information and the first decryption information are the same. If the encrypted information is an asymmetric key, the first encrypted information and the first decryption information that matches it constitute an asymmetric key pair, for example, the first encrypted information is a public key, and the first decryption information is the corresponding private key.
[0125] S306: Determine first index data corresponding to each first index character included in the first index character string according to a pre-created first mapping relationship between index characters and index data.
[0126] Among them, the first mapping relationship between the index character and the index data can be created by the user, or it can be represented by an existing normative encoding method, such as the standard base64 encoding algorithm, which is a common encoding method for transmitting 8-bit bytecodes, including 64 characters for representing binary data. Specifically, the standard base64 encoding table includes 64 numerical values (0-63) and mapping relationships between characters. The 64 numerical values in the standard base64 encoding table can be used as index data, and the characters in the standard base64 encoding table can be used as index characters. Thus, the standard base64 encoding table is the first mapping relationship between the index character and the index data. Optionally, the first mapping relationship between the index character and the index data can also be improved based on the normative encoding method, for example, it can be improved on the basis of the standard base64 encoding algorithm, so that the mapping relationship between the 64 numerical values and characters in the standard base64 encoding algorithm is changed.
[0127] Optionally, after the first mapping relationship is created, in order to ensure the data encryption effect, the first mapping relationship can be updated at regular intervals. There are multiple ways to update the first mapping relationship. Optionally, the mapping relationship between the index characters and the index data is rearranged regularly, for example, the index data remains unchanged and each adjacent two index characters are swapped, so that the mapping relationship between the index data and the index characters is changed.
[0128] S308, converting each first index data into corresponding character data according to a preset conversion algorithm between index data and character data, and determining plaintext data corresponding to the target ciphertext data according to each character data.
[0129] The conversion algorithm between the index data and the character data can be a single algorithm or a combination of multiple algorithms. Optionally, if the conversion algorithm is a single algorithm, the conversion algorithm can be understood as a mapping relationship between the index data and the character data, and the mapping relationship can be a one-to-one, many-to-one or one-to-many mapping relationship. According to the mapping relationship between the index data and the character data, the character data can be directly converted into the corresponding first index data.
[0130] Optionally, the conversion algorithm between index data and character data is a combination of multiple algorithms. In this case, when converting character data into first index data, the character data needs to be first converted into at least one intermediate data (such as the first category data, second category data, etc. in the following embodiments), and finally the intermediate data is converted into the first index data.
[0131] The technical solution of the embodiment of the present application is adopted, by parsing the target ciphertext data into the first encryption identification information and the index ciphertext data, and using the first decryption information determined based on the first encryption identification information to decrypt the index ciphertext data, a first index string is obtained; then each first index character included in the first index string is converted into the corresponding first index data, and each first index data is further converted into the corresponding character data, and the plaintext data corresponding to the target ciphertext data is determined according to each character data. It can be seen that when the technical solution decrypts the target ciphertext data, it is first necessary to determine the decryption information according to the encryption identification information implicit in the target ciphertext data. Since the implicit manner (such as the implicit position) of the encryption identification information in the target ciphertext data is not easy to be known by outsiders, the difficulty of cracking the target ciphertext data is increased. Further, after decrypting the index ciphertext data using the decryption information, what is obtained is not the plaintext data itself, but the first index string corresponding to the plaintext data. Only after each first index character included in the first index string is converted multiple times (such as converted into the first index data and then converted into character data), the plaintext data itself can be obtained. Since the target ciphertext data is obtained by performing multiple protections on the plaintext data, it is necessary to crack the multiple protection methods one by one before obtaining the plaintext data, which increases the difficulty of cracking the target ciphertext data and improves data security.
[0132] In one embodiment, when executing the step of converting each first index data into corresponding character data according to a preset conversion algorithm between index data and character data, the following steps B1-B4 may be specifically performed:
[0133] Step B1: determine the second category data corresponding to each first index data according to the fourth mapping relationship between the second category data and the index data; each second category data includes M bits of data, where M is an integer greater than or equal to 1.
[0134] Step B2: reorganize the second category data according to a preset data reorganization rule to obtain each reorganized second category data; each reorganized second category data includes N bits of data, and the values of M and N are different.
[0135] Step B3: According to the third mapping relationship between the first category data and the second category data, determine the first category data corresponding to each reorganized second category data.
[0136] Step B4: According to a preset first-category data conversion method, each first-category data corresponding to the target ciphertext data is converted into corresponding character data.
[0137] Optionally, the first type of data is ASCII code, the second type of data is binary data, and the index data is decimal data different from the ASCII code. In this embodiment, the data reorganization rule, the fourth mapping relationship between the second type of data and the index data, the third mapping relationship between the first type of data and the second type of data, and the preset first type of data conversion method have been described in detail in the above embodiment (such as steps A1-A4), and will not be repeated here. The difference is that steps A1-A4 are the inverse process of steps B1-B4 in this embodiment.
[0138] Figure 4 is a schematic flow chart of a data processing method according to another embodiment of the present application, such as Figure 4 As shown, the method includes:
[0139] S402, in response to a data storage request to store the plaintext data in a target database, determining a target field corresponding to the plaintext data; the data storage request includes the plaintext data and the target field, and the target database includes multiple fields.
[0140] Optionally, the target database is a MySQL (an open source relational database management system) database. The target database is used to store data corresponding to multiple fields. Some or all of the multiple fields can be pre-identified as sensitive fields, and the data corresponding to the sensitive fields are sensitive data that need to be encrypted and stored.
[0141] There are many ways to identify sensitive fields, for example, adding corresponding tag information to sensitive fields, and the tag information is used to identify the corresponding field as a sensitive field. When a data storage request is received, the target field carried in the data storage request is matched with the field in the target database. If the matched field has the corresponding tag information, it means that the target field is a sensitive field.
[0142] For another example, a sub-database is established in the target database, and the sub-database is used to store the field names of sensitive fields. When a data storage request is received, the field name of the target field carried in the data storage request is matched with the field name stored in the sub-database. If the match is successful, it means that the target field is a sensitive field.
[0143] S404: If the target field belongs to a preset sensitive field, the plaintext data is encrypted by the data processing method provided in the above embodiment to obtain ciphertext data corresponding to the plaintext data.
[0144] The encryption method for plaintext data has been described in detail in the above embodiments and will not be repeated here.
[0145] S406, storing the ciphertext data in a location corresponding to the target field in the target database.
[0146] According to the technical solution of the embodiment of the present application, before storing the plaintext data in the target database, the target field corresponding to the plaintext data is first determined. If the target field belongs to a preset sensitive field, the plaintext data needs to be encrypted according to the data processing method described in the above aspect, and the encrypted ciphertext data is stored in the position corresponding to the target field in the target data. It can be seen that the technical solution ensures the security of the data corresponding to the sensitive field by encrypting the plaintext data of the sensitive field in a targeted manner. In addition, since the plaintext data is protected by combining the data conversion process and the data encryption method, the difficulty of cracking the ciphertext data in the target database is increased compared to a single encryption method or a method of directly encrypting the plaintext data, thereby ensuring the security of the data in the target database.
[0147] In one embodiment, before responding to a data storage request to store plaintext data in a target database, an encryption function implemented based on an encryption plug-in may be written into the target database, and an encryption trigger may be added for a sensitive field. Thus, when it is determined that the target field belongs to a preset sensitive field, the encryption trigger may be triggered to call the encryption function, so that the encryption function encrypts the plaintext data.
[0148] Among them, the encryption plug-in method can realize the definition of the encryption function. Optionally, the encryption plug-in method can be a UDF (User-Defined Function) plug-in method, that is, the UDF plug-in method is used to realize the development of the encryption function. The function of the encryption function is the data processing method provided in the above embodiment (such as Figure 1 , Figure 2 The embodiment shown) encrypts the plaintext data. After the encryption function is developed, the encryption function is loaded into the target database, such as loaded into a MySQL database instance for use.
[0149] Optionally, the encryption trigger can be an Insert trigger, which can cause a statement to be automatically executed when the target database responds to a certain instruction (or request). For example, when the target database responds to a data storage request to store plaintext data in the target database, and the target field corresponding to the plaintext data belongs to a preset sensitive field, the Insert trigger will be triggered. After the Insert trigger is triggered, the pre-written encryption function will be called to encrypt the plaintext data.
[0150] It can be seen that in this embodiment, by writing the encryption function implemented by the encryption plug-in method into the target database, and adding an encryption trigger for the sensitive field, when the plaintext data needs to be encrypted, the encryption trigger will be automatically triggered, and then the encryption trigger will call the encryption function, and the plaintext data will be encrypted based on the data processing method provided in the above embodiment. Therefore, the entire data encryption and storage process achieves an automated effect without manual participation. In addition, data encryption is achieved through the encryption function written in the target database, so that the encryption process is implicit in the data storage process, that is, "implicit encryption". Compared with the existing "explicit encryption" (such as directly inputting the key and data into the encryptor in the form of parameters), the encryption method is more concealed, thereby improving the data protection effect.
[0151] Figure 5 is a schematic flow chart of a data processing method according to another embodiment of the present application, such as Figure 5 As shown, the method includes:
[0152] S502, in response to a data acquisition request for acquiring plaintext data from a target database, determining a target field corresponding to the plaintext data; the data acquisition request includes a target field, and the target database includes multiple fields.
[0153] Optionally, the target database is a MySQL database. The target database is used to store data corresponding to multiple fields. Some or all of the multiple fields can be pre-identified as sensitive fields, and the data corresponding to the sensitive fields are sensitive data that need to be encrypted and stored.
[0154] There are many ways to identify sensitive fields, for example, adding corresponding tag information to sensitive fields, and the tag information is used to identify the corresponding field as a sensitive field. When a data storage request is received, the target field carried in the data storage request is matched with the field in the target database. If the matched field has the corresponding tag information, it means that the target field is a sensitive field.
[0155] For another example, a sub-database is established in the target database, and the sub-database is used to store the field names of sensitive fields. When a data storage request is received, the field name of the target field carried in the data storage request is matched with the field name stored in the sub-database. If the match is successful, it means that the target field is a sensitive field.
[0156] S504: If the target field is a preset sensitive field, the ciphertext data corresponding to the plaintext data is obtained from the target database.
[0157] S506, decrypting the ciphertext data through the data processing method provided in the above embodiment to obtain the plaintext data corresponding to the ciphertext data.
[0158] The method for decrypting the ciphertext data has been described in detail in the above embodiments and will not be repeated here.
[0159] By adopting the technical solution of the embodiment of the present application, when obtaining the data corresponding to the sensitive field from the target database, the plaintext data is not directly obtained, but the ciphertext data corresponding to the plaintext data is obtained. The ciphertext data needs to be decrypted according to the data processing method described in the other aspect before the plaintext data can be obtained. It can be seen that the technical solution ensures the security of the data corresponding to the sensitive field by storing the data corresponding to the sensitive field in the form of ciphertext data in a targeted manner. In addition, since the ciphertext data stored in the target database is obtained by performing multiple protections on the plaintext data, the plaintext data can only be obtained after the multiple protection methods are cracked one by one, which increases the difficulty of cracking the ciphertext data, thereby improving the security of the data in the target database.
[0160] In one embodiment, before responding to a data acquisition request to obtain plaintext data from a target database, a decryption function implemented based on an encryption plug-in can be written into the target database, and a decryption trigger can be added for a sensitive field. In this way, when it is determined that the target field belongs to a preset sensitive field and the ciphertext data corresponding to the plaintext data is obtained from the target database, the decryption trigger will be triggered to call the decryption function, so that the decryption function decrypts the plaintext data.
[0161] Among them, the encryption plug-in method can realize the definition of the decryption function. Optionally, the encryption plug-in method can be a UDF plug-in method, that is, the UDF plug-in method is used to develop the decryption function. The function of the decryption function is the data processing method provided in the above embodiment (such as Figure 3 After the decryption function is developed, the decryption function is loaded into the target database, such as a MySQL database instance, for use.
[0162] Optionally, the decryption trigger can be an Update trigger, which can cause a statement to be automatically executed when the target database responds to a certain instruction (or request). For example, when the target database responds to a data acquisition request to obtain plaintext data from the target database, and the target field corresponding to the plaintext data belongs to a preset sensitive field, the Update trigger will be triggered. After the Update trigger is triggered, the pre-written decryption function will be called to decrypt the obtained ciphertext data to obtain the plaintext data.
[0163] It can be seen that in this embodiment, by writing the decryption function implemented by the encryption plug-in method into the target database and adding a decryption trigger for the sensitive field, when it is necessary to obtain the encrypted and stored plaintext data, the decryption trigger will be automatically triggered, and then the decryption trigger will call the decryption function, and the ciphertext data will be decrypted based on the data processing method provided in the above embodiment. Therefore, the entire data decryption and acquisition process achieves an automated effect without manual participation. In addition, data decryption is achieved through the decryption function written in the target database, so that the decryption process is implicit in the data acquisition process, that is, "implicit decryption". Compared with the existing "explicit decryption" (such as directly inputting the key and ciphertext into the decryptor in the form of parameters), the decryption method is more concealed, thereby improving the data protection effect.
[0164] In summary, specific embodiments of the present subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recorded in the claims can be performed in a different order and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing can be advantageous.
[0165] The above is a data processing method provided in an embodiment of the present application. Based on the same idea, an embodiment of the present application also provides a data processing device.
[0166] Figure 6 is a schematic block diagram of a data processing device according to an embodiment of the present application, such as Figure 6 As shown, the data processing device includes:
[0167] A first conversion module 61, configured to convert at least one character data included in the plaintext data into first index data according to a preset conversion algorithm between index data and character data;
[0168] A first determining module 62, configured to determine a first index character corresponding to the first index data according to a pre-created first mapping relationship between the index character and the index data;
[0169] A first encryption module 63, configured to determine first encryption information and first encryption identification information corresponding to the plaintext data, and encrypt a first index string according to the first encryption information to obtain index ciphertext data; wherein the first index string is determined according to the first index character, and the first encryption identification information is determined based on a second mapping relationship between the preset encryption information and the encryption identification information;
[0170] The combining module 64 is used to combine the first encrypted identification information and the index ciphertext data to obtain the target ciphertext data corresponding to the plaintext data.
[0171] In one embodiment, the first determining module 62 includes:
[0172] A first conversion unit, used for converting each of the character data into first-category data according to a preset first-category data conversion method;
[0173] A first determining unit, configured to determine, according to a third mapping relationship between the first-category data and the second-category data, the second-category data corresponding to each of the first-category data; each of the second-category data includes N-bit data, where N is an integer greater than or equal to 1;
[0174] A first reorganization unit is used to reorganize the second-category data according to a preset data reorganization rule to obtain each reorganized second-category data; each reorganized second-category data includes M bits of data, and the values of M and N are different;
[0175] The second determining unit is used to determine the first index data corresponding to each reorganized second category data according to a fourth mapping relationship between the second category data and the index data.
[0176] In one embodiment, the first encryption module 63 includes:
[0177] A screening and determination unit is used to screen out an encrypted information as the first encrypted information from a preset key library according to a preset key screening method, and determine that the encryption identification information corresponding to the screened encryption information is the first encryption identification information; wherein the preset key library includes the second mapping relationship.
[0178] In one embodiment, the combining module 64 includes:
[0179] An adding unit is used to add the first encryption identification information to a preset position in the index ciphertext data.
[0180] The device of the embodiment of the present application is adopted, by first converting at least one character data included in the plaintext data into the first index data, and then determining the first index character corresponding to each first index data according to the first mapping relationship between the pre-created index character and the index data, and then encrypting the first index string according to the first encryption information corresponding to the plaintext data, and combining the encrypted index ciphertext data and the first encryption identification information corresponding to the first encryption information, to obtain the target ciphertext data corresponding to the plaintext data. It can be seen that when the device encrypts the plaintext data, it does not adopt a single encryption method or directly encrypt the plaintext data, but first converts the plaintext data multiple times, such as converting it into the first index data, and then converting it into the first index character, and then encrypting the first index string obtained after the conversion. Since the data conversion process of the plaintext data is not easy to be cracked by outsiders, and by combining the data conversion process and the data encryption method, the plaintext data is given multiple protections, so it can increase the difficulty of cracking the target ciphertext data and improve data security. In addition, since the target ciphertext data is obtained by combining the first encryption identification information and the index ciphertext data, that is, the encryption identification information is implicit in the target ciphertext data, a user with permission to obtain plaintext data can determine the corresponding encryption information based on the encryption identification information implicit in the target ciphertext data, thereby facilitating the user to restore the target ciphertext data to plaintext data, thereby ensuring that the encryption of the plaintext data is reversible.
[0181] Figure 7 is a schematic block diagram of a data processing device according to an embodiment of the present application, such as Figure 7 As shown, the data processing device includes:
[0182] The parsing module 71 is used to parse the target ciphertext data to obtain the first encryption identification information and index ciphertext data corresponding to the target ciphertext data;
[0183] A first decryption module 72 is used to determine the first decryption information corresponding to the index ciphertext data according to the first encryption identification information, and decrypt the index ciphertext data according to the first decryption information to obtain a first index string; wherein the first decryption information matches the first encryption information corresponding to the first encryption identification information, and the first encryption information is determined based on a second mapping relationship between the preset encryption information and the encryption identification information;
[0184] A second determining module 73, configured to determine first index data corresponding to each first index character included in the first index character string according to a pre-created first mapping relationship between index characters and index data;
[0185] The second conversion module 74 is used to convert each of the first index data into corresponding character data according to a preset conversion algorithm between index data and character data, and determine the plaintext data corresponding to the target ciphertext data according to each of the character data.
[0186] In one embodiment, the second conversion module 74 includes:
[0187] A third determining unit, configured to determine, according to a fourth mapping relationship between the second-category data and the index data, the second-category data corresponding to each of the first index data; each of the second-category data includes M bits of data, where M is an integer greater than or equal to 1;
[0188] A second reorganization unit is used to reorganize the second type of data according to a preset data reorganization rule to obtain each reorganized second data; each reorganized second type of data includes N bits of data, and the values of M and N are different;
[0189] A fourth determining unit, configured to determine the first category data corresponding to each reorganized second category data according to a third mapping relationship between the first category data and the second category data;
[0190] The second conversion unit is used to convert each of the first-category data corresponding to the target ciphertext data into corresponding character data according to a preset first-category data conversion method.
[0191] In one embodiment, the parsing module 71 includes:
[0192] An acquiring unit, configured to acquire the first encryption identification information from a preset position in the target ciphertext data;
[0193] A fifth determining unit is used to determine other data in the target ciphertext data except the first encryption identification information as the index ciphertext data.
[0194] The device of the embodiment of the present application is used to parse the target ciphertext data into the first encryption identification information and the index ciphertext data, and use the first decryption information determined based on the first encryption identification information to decrypt the index ciphertext data to obtain the first index string; then each first index character included in the first index string is converted into the corresponding first index data, and each first index data is further converted into the corresponding character data, and the plaintext data corresponding to the target ciphertext data is determined according to each character data. It can be seen that when the device decrypts the target ciphertext data, it is first necessary to determine the decryption information according to the encryption identification information implicit in the target ciphertext data. Since the encryption identification information is not easily known to outsiders in the implicit way (such as the implicit position) in the target ciphertext data, the difficulty of cracking the target ciphertext data is increased. Further, after decrypting the index ciphertext data using the decryption information, what is obtained is not the plaintext data itself, but the first index string corresponding to the plaintext data. Only after each first index character included in the first index string is converted multiple times (such as converted into the first index data and then converted into character data), the plaintext data itself can be obtained. Since the target ciphertext data is obtained by performing multiple protections on the plaintext data, it is necessary to crack the multiple protection methods one by one before obtaining the plaintext data, which increases the difficulty of cracking the target ciphertext data and improves data security.
[0195] Figure 8 is a schematic block diagram of a data processing device according to an embodiment of the present application, such as Figure 8 As shown, the data processing device includes:
[0196] A third determination module 81 is used to determine a target field corresponding to the plaintext data in response to a data storage request for storing the plaintext data in a target database; the data storage request includes the plaintext data and the target field, and the target database includes multiple fields;
[0197] A second encryption module 82 is used to encrypt the plaintext data by the above-mentioned data processing method to obtain ciphertext data corresponding to the plaintext data if the target field belongs to a preset sensitive field;
[0198] The storage module 83 is used to store the ciphertext data in a location in the target database corresponding to the target field.
[0199] In one embodiment, the apparatus further comprises:
[0200] A first adding module is used for writing an encryption function implemented based on an encryption plug-in manner into the target database before responding to a data storage request for storing plaintext data in the target database, and adding an encryption trigger for the sensitive field;
[0201] The second encryption module 82 includes:
[0202] The first trigger unit is used to trigger the encryption trigger to call the encryption function if the target field belongs to a preset sensitive field, so that the encryption function encrypts the plaintext data; the encryption function is used to execute the data processing method described above.
[0203] Using the device of the embodiment of the present application, before storing the plaintext data in the target database, first determine the target field corresponding to the plaintext data. If the target field belongs to the preset sensitive field, it is necessary to encrypt the plaintext data according to the data processing method described in the above aspect, and store the encrypted ciphertext data in the position corresponding to the target field in the target data. It can be seen that the device ensures the security of the data corresponding to the sensitive field by encrypting the plaintext data of the sensitive field in a targeted manner. In addition, since the plaintext data is protected by combining the data conversion process and the data encryption method, the difficulty of cracking the ciphertext data in the target database is increased compared to a single encryption method or a method of directly encrypting the plaintext data, thereby ensuring the security of the data in the target database.
[0204] Fig. 9 is a schematic block diagram of a data processing device according to an embodiment of the present application, such as Fig. 9 As shown, the data processing device includes:
[0205] A fourth determination module 91 is configured to determine a target field corresponding to the plaintext data in response to a data acquisition request for acquiring plaintext data from a target database; the data acquisition request includes the target field, and the target database includes a plurality of fields;
[0206] An acquisition module 92, configured to acquire ciphertext data corresponding to the plaintext data from the target database if the target field belongs to a preset sensitive field;
[0207] The second decryption module 93 is used to decrypt the ciphertext data through the data processing method described above to obtain the plaintext data corresponding to the ciphertext data.
[0208] In one embodiment, the apparatus further comprises:
[0209] A second adding module is used for writing a decryption function implemented based on an encryption plug-in into the target database before responding to a data acquisition request for acquiring plaintext data from the target database, and adding a decryption trigger for the sensitive field;
[0210] The second decryption module 93 includes:
[0211] The second trigger unit is used to trigger the decryption trigger to call the decryption function, so that the decryption function decrypts the plaintext data.
[0212] When the device of the embodiment of the present application is used to obtain the data corresponding to the sensitive field from the target database, it does not directly obtain the plaintext data, but obtains the ciphertext data corresponding to the plaintext data. The ciphertext data needs to be decrypted according to the data processing method described in the other aspect before the plaintext data can be obtained. It can be seen that the device ensures the security of the data corresponding to the sensitive field by storing the data corresponding to the sensitive field in the form of ciphertext data in a targeted manner. In addition, since the ciphertext data stored in the target database is obtained by performing multiple protections on the plaintext data, it is necessary to crack the multiple protection methods one by one before obtaining the plaintext data, which increases the difficulty of cracking the ciphertext data, thereby improving the security of the data in the target database.
[0213] Those skilled in the art should understand that the above-mentioned data processing device can be used to implement the data processing method described above, and the detailed description thereof should be similar to the description of the method part above, and will not be further described here to avoid tediousness.
[0214] Based on the same idea, the embodiment of the present application also provides a data processing device, such as Fig.10 As shown. The data processing device may have relatively large differences due to different configurations or performances, and may include one or more processors 1001 and memory 1002, and the memory 1002 may store one or more storage applications or data. Among them, the memory 1002 can be a short-term storage or a persistent storage. The application stored in the memory 1002 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the data processing device. Furthermore, the processor 1001 can be configured to communicate with the memory 1002 and execute a series of computer executable instructions in the memory 1002 on the data processing device. The data processing device may also include one or more power supplies 1003, one or more wired or wireless network interfaces 1004, one or more input and output interfaces 1005, and one or more keyboards 1006.
[0215] Specifically in this embodiment, the data processing device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions in the data processing device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:
[0216] According to a preset conversion algorithm between index data and character data, convert at least one character data included in the plaintext data into first index data respectively;
[0217] Determine, according to a pre-created first mapping relationship between index characters and index data, a first index character corresponding to each of the first index data;
[0218] Determine the first encryption information and the first encryption identification information corresponding to the plaintext data, and encrypt the first index string according to the first encryption information to obtain index ciphertext data; wherein the first index string is determined according to the first index character, and the first encryption identification information is determined based on a second mapping relationship between the preset encryption information and the encryption identification information;
[0219] The first encryption identification information and the index ciphertext data are combined to obtain target ciphertext data corresponding to the plaintext data.
[0220] The technical solution of the embodiment of the present application is adopted, by first converting at least one character data included in the plaintext data into the first index data respectively, and then determining the first index character corresponding to each first index data according to the first mapping relationship between the pre-created index character and the index data, and then encrypting the first index string according to the first encryption information corresponding to the plaintext data, and combining the encrypted index ciphertext data and the first encryption identification information corresponding to the first encryption information to obtain the target ciphertext data corresponding to the plaintext data. It can be seen that when encrypting the plaintext data, the technical solution does not adopt a single encryption method or directly encrypt the plaintext data, but first converts the plaintext data multiple times, such as converting it into the first index data, then converting it into the first index character, and then encrypting the first index string obtained after the conversion. Since the data conversion process of the plaintext data is not easy to be cracked by outsiders, and by combining the data conversion process and the data encryption method, the plaintext data is given multiple protections, it can increase the difficulty of cracking the target ciphertext data and improve data security. In addition, since the target ciphertext data is obtained by combining the first encryption identification information and the index ciphertext data, that is, the encryption identification information is implicit in the target ciphertext data, a user with permission to obtain plaintext data can determine the corresponding encryption information based on the encryption identification information implicit in the target ciphertext data, thereby facilitating the user to restore the target ciphertext data to plaintext data, thereby ensuring that the encryption of the plaintext data is reversible.
[0221] Specifically in another embodiment, a data processing device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the data processing device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:
[0222] Parsing the target ciphertext data to obtain first encryption identification information and index ciphertext data corresponding to the target ciphertext data;
[0223] Determine, according to the first encryption identification information, first decryption information corresponding to the index ciphertext data, and decrypt the index ciphertext data according to the first decryption information to obtain a first index string; wherein the first decryption information matches the first encryption information corresponding to the first encryption identification information, and the first encryption information is determined based on a second mapping relationship between the preset encryption information and the encryption identification information;
[0224] Determine, according to a pre-created first mapping relationship between index characters and index data, first index data corresponding to each first index character included in the first index character string;
[0225] According to a preset conversion algorithm between index data and character data, each of the first index data is converted into corresponding character data, and the plaintext data corresponding to the target ciphertext data is determined according to each of the character data.
[0226] The technical solution of the embodiment of the present application is adopted, by parsing the target ciphertext data into the first encryption identification information and the index ciphertext data, and using the first decryption information determined based on the first encryption identification information to decrypt the index ciphertext data, a first index string is obtained; then each first index character included in the first index string is converted into the corresponding first index data, and each first index data is further converted into the corresponding character data, and the plaintext data corresponding to the target ciphertext data is determined according to each character data. It can be seen that when the technical solution decrypts the target ciphertext data, it is first necessary to determine the decryption information according to the encryption identification information implicit in the target ciphertext data. Since the implicit manner (such as the implicit position) of the encryption identification information in the target ciphertext data is not easy to be known by outsiders, the difficulty of cracking the target ciphertext data is increased. Further, after decrypting the index ciphertext data using the decryption information, what is obtained is not the plaintext data itself, but the first index string corresponding to the plaintext data. Only after each first index character included in the first index string is converted multiple times (such as converted into the first index data and then converted into character data), the plaintext data itself can be obtained. Since the target ciphertext data is obtained by performing multiple protections on the plaintext data, it is necessary to crack the multiple protection methods one by one before obtaining the plaintext data, which increases the difficulty of cracking the target ciphertext data and improves data security.
[0227] Specifically in another embodiment, a data processing device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the data processing device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:
[0228] In response to a data storage request to store plaintext data in a target database, determining a target field corresponding to the plaintext data; the data storage request includes the plaintext data and the target field, and the target database includes a plurality of fields;
[0229] If the target field belongs to a preset sensitive field, the plaintext data is encrypted by the data processing method described above to obtain ciphertext data corresponding to the plaintext data;
[0230] The ciphertext data is stored in a location in the target database corresponding to the target field.
[0231] According to the technical solution of the embodiment of the present application, before storing the plaintext data in the target database, the target field corresponding to the plaintext data is first determined. If the target field belongs to the preset sensitive field, the plaintext data needs to be encrypted according to the data processing method described above, and the encrypted ciphertext data is stored in the position corresponding to the target field in the target data. It can be seen that the technical solution ensures the security of the data corresponding to the sensitive field by encrypting the plaintext data of the sensitive field in a targeted manner. In addition, since the plaintext data is protected by combining the data conversion process and the data encryption method, the difficulty of cracking the ciphertext data in the target database is increased compared to a single encryption method or a method of directly encrypting the plaintext data, thereby ensuring the security of the data in the target database.
[0232] Specifically in another embodiment, a data processing device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the data processing device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:
[0233] In response to a data acquisition request for acquiring plaintext data from a target database, determining a target field corresponding to the plaintext data; the data acquisition request includes the target field, and the target database includes a plurality of fields;
[0234] If the target field belongs to a preset sensitive field, obtaining ciphertext data corresponding to the plaintext data from the target database;
[0235] The ciphertext data is decrypted by the data processing method described in the above another aspect to obtain the plaintext data corresponding to the ciphertext data.
[0236] By adopting the technical solution of the embodiment of the present application, when obtaining the data corresponding to the sensitive field from the target database, the plaintext data is not directly obtained, but the ciphertext data corresponding to the plaintext data is obtained. The ciphertext data needs to be decrypted according to the data processing method described above before the plaintext data can be obtained. It can be seen that the technical solution ensures the security of the data corresponding to the sensitive field by storing the data corresponding to the sensitive field in the form of ciphertext data in a targeted manner. In addition, since the ciphertext data stored in the target database is obtained by performing multiple protections on the plaintext data, it is necessary to crack the multiple protection methods one by one before the plaintext data can be obtained, which increases the difficulty of cracking the ciphertext data, thereby improving the security of the data in the target database.
[0237] The present application also provides a storage medium, which stores one or more computer programs. The one or more computer programs include instructions. When the instructions are executed by an electronic device including multiple application programs, the electronic device can perform various processes of the above data processing method embodiment, and are specifically used to perform:
[0238] According to a preset conversion algorithm between index data and character data, convert at least one character data included in the plaintext data into first index data respectively;
[0239] Determine, according to a pre-created first mapping relationship between index characters and index data, a first index character corresponding to each of the first index data;
[0240] Determine the first encryption information and the first encryption identification information corresponding to the plaintext data, and encrypt the first index string according to the first encryption information to obtain index ciphertext data; wherein the first index string is determined according to the first index character, and the first encryption identification information is determined based on a second mapping relationship between the preset encryption information and the encryption identification information;
[0241] The first encryption identification information and the index ciphertext data are combined to obtain target ciphertext data corresponding to the plaintext data.
[0242] The present application also provides a storage medium, which stores one or more computer programs. The one or more computer programs include instructions. When the instructions are executed by an electronic device including multiple application programs, the electronic device can perform various processes of the above data processing method embodiment, and are specifically used to perform:
[0243] Parsing the target ciphertext data to obtain first encryption identification information and index ciphertext data corresponding to the target ciphertext data;
[0244] Determine, according to the first encryption identification information, first decryption information corresponding to the index ciphertext data, and decrypt the index ciphertext data according to the first decryption information to obtain a first index string; wherein the first decryption information matches the first encryption information corresponding to the first encryption identification information, and the first encryption information is determined based on a second mapping relationship between the preset encryption information and the encryption identification information;
[0245] Determine, according to a pre-created first mapping relationship between index characters and index data, first index data corresponding to each first index character included in the first index character string;
[0246] According to a preset conversion algorithm between index data and character data, each of the first index data is converted into corresponding character data, and the plaintext data corresponding to the target ciphertext data is determined according to each of the character data.
[0247] The present application also provides a storage medium, which stores one or more computer programs. The one or more computer programs include instructions. When the instructions are executed by an electronic device including multiple application programs, the electronic device can perform various processes of the above data processing method embodiment, and are specifically used to perform:
[0248] In response to a data storage request to store plaintext data in a target database, determining a target field corresponding to the plaintext data; the data storage request includes the plaintext data and the target field, and the target database includes a plurality of fields;
[0249] If the target field belongs to a preset sensitive field, the plaintext data is encrypted by the data processing method described above to obtain ciphertext data corresponding to the plaintext data;
[0250] The ciphertext data is stored in a location in the target database corresponding to the target field.
[0251] The present application also provides a storage medium, which stores one or more computer programs. The one or more computer programs include instructions. When the instructions are executed by an electronic device including multiple application programs, the electronic device can perform various processes of the above data processing method embodiment, and are specifically used to perform:
[0252] In response to a data acquisition request for acquiring plaintext data from a target database, determining a target field corresponding to the plaintext data; the data acquisition request includes the target field, and the target database includes a plurality of fields;
[0253] If the target field belongs to a preset sensitive field, obtaining ciphertext data corresponding to the plaintext data from the target database;
[0254] The ciphertext data is decrypted by the data processing method described above to obtain the plaintext data corresponding to the ciphertext data.
[0255] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0256] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0257] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0258] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0259] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0260] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0261] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0262] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0263] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0264] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0265] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0266] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0267] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A data processing method, characterized in that: include: When it is determined that the field corresponding to the plaintext data is a sensitive field, the encryption function pre-written in the target database is called, and the following encryption process is performed on the plaintext data through the encryption function: According to a preset conversion algorithm between index data and character data, convert at least one character data included in the plaintext data into first index data respectively; Determine, according to a pre-created first mapping relationship between index characters and index data, a first index character corresponding to each of the first index data; Determine the first encryption information and the first encryption identification information corresponding to the plaintext data, and encrypt the first index string according to the first encryption information to obtain index ciphertext data; wherein the first index string is determined according to the first index character, and the first encryption identification information is determined based on a second mapping relationship between the preset encryption information and the encryption identification information; The first encryption identification information and the index ciphertext data are combined to obtain target ciphertext data corresponding to the plaintext data.
2. The method according to claim 1, characterized in that: The step of converting at least one character data included in the plaintext data into first index data according to a preset conversion algorithm between index characters and character data comprises: According to a preset first-category data conversion method, each of the character data is converted into first-category data respectively; the first-category data conversion method includes an ASCII encoding algorithm, and the first-category data includes an ASCII code; According to a third mapping relationship between the first-category data and the second-category data, determining the second-category data corresponding to each of the first-category data; each of the second-category data includes N-bit data, where N is an integer greater than or equal to 1; and the second-category data is binary data; The second type of data is reorganized according to a preset data reorganization rule to obtain each reorganized second type of data; each reorganized second type of data includes M bits of data, and the values of M and N are different; the data reorganization rule is used to change the number of bits of the second type of data; According to a fourth mapping relationship between the second category data and the index data, the first index data corresponding to each reorganized second category data is determined.
3. The method according to claim 1, characterized in that: The determining the first encryption information and the first encryption identification information corresponding to the plaintext data includes: According to a preset key screening method, an encrypted information is screened out from a preset key library as the first encrypted information, and the encryption identification information corresponding to the screened encrypted information is determined to be the first encryption identification information; wherein the preset key library includes the second mapping relationship.
4. The method according to claim 1, characterized in that: The combining the first encrypted identification information and the index ciphertext data includes: The first encryption identification information is added to a preset position in the index ciphertext data.
5. A data processing method, characterized in that: include: Parsing the target ciphertext data to obtain first encryption identification information and index ciphertext data corresponding to the target ciphertext data; Determine, according to the first encryption identification information, first decryption information corresponding to the index ciphertext data, and decrypt the index ciphertext data according to the first decryption information to obtain a first index string; wherein the first decryption information matches the first encryption information corresponding to the first encryption identification information, and the first encryption information is determined based on a second mapping relationship between the preset encryption information and the encryption identification information; Determine, according to a pre-created first mapping relationship between index characters and index data, first index data corresponding to each first index character included in the first index character string; According to a preset conversion algorithm between index data and character data, each of the first index data is converted into corresponding character data, and the plaintext data corresponding to the target ciphertext data is determined according to each of the character data.
6. The method according to claim 5, characterized in that The step of converting each of the first index data into corresponding character data according to a preset conversion algorithm between the index data and the character data comprises: Determine, according to a fourth mapping relationship between the second-category data and the index data, the second-category data corresponding to each of the first index data; each of the second-category data includes M-bit data, where M is an integer greater than or equal to 1; and the second-category data is binary data; The second type of data is reorganized according to a preset data reorganization rule to obtain each reorganized second type of data; each reorganized second type of data includes N bits of data, and the values of M and N are different; the data reorganization rule is used to change the number of bits of the second type of data; According to a third mapping relationship between the first-category data and the second-category data, determining the first-category data corresponding to each reorganized second-category data; the first-category data includes ASCII code; According to a preset first-category data conversion method, each of the first-category data corresponding to the target ciphertext data is converted into corresponding character data; the first-category data conversion method includes an ASCII encoding algorithm.
7. The method according to claim 5, characterized in that The step of parsing the target ciphertext data to obtain first encryption identification information and index ciphertext data corresponding to the target ciphertext data includes: Obtaining the first encryption identification information from a preset position in the target ciphertext data; The other data in the target ciphertext data except the first encryption identification information is determined as the index ciphertext data.
8. A data processing method, characterized in that: include: In response to a data storage request to store the plaintext data in a target database, determining a target field corresponding to the plaintext data; The data storage request includes the plaintext data and the target field, and the target database includes a plurality of fields; If the target field belongs to a preset sensitive field, encrypting the plaintext data by the data processing method described in any one of claims 1 to 4 above to obtain ciphertext data corresponding to the plaintext data; The ciphertext data is stored in a location in the target database corresponding to the target field.
9. The method according to claim 8, characterized in that Before responding to the data storage request to store the plaintext data in the target database, the method further includes: Writing the encryption function implemented based on the encryption plug-in into the target database, and adding an encryption trigger for the sensitive field; The encrypting the plaintext data comprises: The encryption trigger is triggered to call the encryption function, so that the encryption function encrypts the plaintext data.
10. A data processing method, characterized in that: include: In response to a data acquisition request to acquire plaintext data from a target database, determining a target field corresponding to the plaintext data; The data acquisition request includes the target field, and the target database includes multiple fields; If the target field belongs to a preset sensitive field, obtaining ciphertext data corresponding to the plaintext data from the target database; The ciphertext data is decrypted by the data processing method described in any one of claims 5 to 7 to obtain the plaintext data corresponding to the ciphertext data.
11. The method according to claim 10, characterized in that Before responding to the data acquisition request for acquiring plaintext data from the target database, the method further includes: Writing a decryption function implemented based on an encryption plug-in into the target database, and adding a decryption trigger for the sensitive field; The decrypting the ciphertext data to obtain the plaintext data corresponding to the ciphertext data includes: The decryption trigger is triggered to call the decryption function, so that the decryption function decrypts the plaintext data.
12. A data processing device, characterized in that: It comprises a processor and a memory electrically connected to the processor, the memory stores a computer program, and the processor is used to call and execute the computer program from the memory to implement the data processing method according to any one of claims 1 to 11.
13. A storage medium, characterized in that: The storage medium is used to store a computer program, and the computer program can be executed by a processor to implement the data processing method according to any one of claims 1 to 11.
