A data desensitization and restoration method based on symmetric encryption
By marking data fields with sensitive types and encryption methods, dividing and storing encryption salts, and using symmetric encryption algorithms for data desensitization and restoration, the problems of privacy leakage and irreversible encryption in the existing technology are solved, and high data security is achieved. sex and flexibility.
Patent Information
- Application Number
- CN202210911974.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-07-29
AI Technical Summary
The existing technology has the risk of privacy leakage and difficulty in data restoration caused by irreversible encryption during the data desensitization process, and the management of encrypted ciphertext is uncertain, and the violent credential stuffing method is unreliable.
A data desensitization method based on symmetric encryption is adopted. Data fields are marked twice and encrypted salt is used for segmentation and storage. A secure transmission protocol is used for data transmission, and encryption and decryption are performed based on metadata information.
It improves the security of data desensitization and restoration, avoids the risk of privacy leakage and credential stuffing, and realizes flexible encryption and controllable restoration of data.
Smart Images

Figure CN115333809B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a data desensitization and restoration method based on symmetric encryption. Background Art
[0002] With the development of the information age, people pay more and more attention to the security requirements of data information, especially financial institutions such as banks and insurance companies. There are a lot of business data that need to be desensitized. For example, the desensitization protection of sensitive data in the production environment is mainly used for data development and data testing. If data encryption protection cannot be effectively implemented, it is very easy to cause sensitive data leakage. At present, it is generally necessary to desensitize and deform data information such as ID card number, mobile phone number, landline number, bank card number, customer biometric information, etc. The conventional technical solution is to use irreversible algorithms such as DES, SHA256, MD5, etc. to encrypt the corresponding fields, and then send the desensitized data files to other application systems for business processing.
[0003] Although the current technical solution can perform desensitization operations based on each sensitive field type according to the predetermined encryption process and produce desensitized data files, it can improve data security to a certain extent and avoid the leakage of sensitive information, but there are still the following problems:
[0004] 1. In the process of data desensitization, since readable intermediate files will be generated and these data and the original data are stored in the same environment, there is still a risk of privacy leakage;
[0005] 2. Once the user needs to use the original file of sensitive information corresponding to the data, such as in judicial review, the data cannot be restored to the original data due to the irreversibility of the MD5 / SHA256 encryption algorithm;
[0006] 3. If data restoration is required, the usual approach is to use symmetric encryption methods, such as the DES algorithm, and use a pre-saved encryption key to decrypt the ciphertext to obtain the original data, or to perform a brute force attack. However, there are many uncertain factors in the generation and management of ciphertext, and the brute force attack method is heavily dependent on the data integrity of the original sensitive database, which is highly unreliable. Summary of the invention
[0007] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a data desensitization and restoration method based on symmetric encryption, which can effectively improve the security of data encryption and data restoration.
[0008] The purpose of the present invention can be achieved by the following technical solution: A data desensitization method based on symmetric encryption, comprising the following steps:
[0009] T1. Obtain the data set or data table to be desensitized;
[0010] T2, mark the fields in the data set or data table for the first time and the second time in sequence;
[0011] T3. Request a random encryption salt based on the database name or table name of the data table to which the dataset belongs, and generate a random encryption key accordingly;
[0012] T4. Record and save random encryption salt and random encryption key;
[0013] T5. Initiate a data acquisition request and use a secure transmission protocol for data transmission;
[0014] T6. Based on the symmetric encryption algorithm, the acquired data is desensitized to produce a desensitized data file;
[0015] T7. Save the desensitized data file and create the corresponding table structure to complete the data desensitization process.
[0016] Furthermore, the step T2 specifically includes the following steps:
[0017] T21. Mark the fields in the data set or data table with sensitive types for the first time;
[0018] T22. Mark the fields in the data set or data table with a second encryption method.
[0019] Furthermore, the sensitive type marking is specifically for marking fields of mobile phone number, ID number, email address, and bank card number type.
[0020] Furthermore, the encryption mode mark is specifically for marking the field at a set position in the certificate number.
[0021] Furthermore, the random encrypted salt in step T3 includes a first encrypted salt and a second encrypted salt, and the first encrypted salt and the second encrypted salt are independently stored in different servers.
[0022] Furthermore, the step T5 specifically includes the following steps:
[0023] T51, concatenating the first encrypted salt and the second encrypted salt to obtain a complete encrypted salt;
[0024] T52: Initiate a data acquisition request based on the complete encryption salt and the random encryption key.
[0025] Furthermore, the step T7 specifically creates a table structure of the desensitized data file based on the metadata information.
[0026] A data restoration method based on symmetric encryption comprises the following steps:
[0027] H1. Obtain the data set or data table to be restored;
[0028] H2. Get the structural information of the data file in the data set or data table;
[0029] H3. According to the structure information of the data file, request to obtain the encryption salt and encryption key in sequence;
[0030] H4. Based on the obtained encryption salt and encryption key, restore the data file based on the symmetric encryption algorithm to produce restored data;
[0031] H5. Save the restored data and create the corresponding table structure according to the file structure to complete the data restoration process.
[0032] Furthermore, the structural information of the data file in step H2 includes library name, table name, field information, field type and field sensitive type.
[0033] Furthermore, the step H3 specifically requests to obtain the first encryption salt, the second encryption salt and the encryption key in sequence according to the library name and the table name.
[0034] Compared with the prior art, the present invention has the following advantages:
[0035] 1. The present invention marks the data field twice, once for sensitive type marking and twice for encryption method marking, thereby being able to implement multiple encryption methods for the same field. For example, some specific parts of the field can be encrypted while the other parts can still be saved and displayed in the original text, thereby improving the flexibility of data desensitization, that is, data encryption, and being able to ensure the security of the data desensitization process.
[0036] 2. The present invention sets the encryption salt to be composed of two parts, which are independently saved by different servers. The parts are dynamically obtained and spliced during encryption, making the use process safer. The encryption keys are automatically generated and saved, which are completely invisible to users. The desensitized data and the original sensitive data are completely physically isolated to avoid the risk of database collision.
[0037] 3. In the present invention, when the acquired data is transmitted, a secure transmission protocol is used for data transmission, which can prevent information leakage caused by database collision and feature matching.
[0038] 4. When executing the data restoration process, the present invention also performs data restoration according to the pre-stored encryption salt and encryption key, thereby ensuring the security and controllability of the data restoration process.
[0039] 5. In practical applications, the present invention can be combined with big data distributed processing technology, that is, deployed as a sensitive data cluster, a data desensitization / restoration server, and a desensitized data cluster, and use the data desensitization / restoration server to realize the production and record preservation of random encryption salts and random encryption keys; realize data encryption or restoration processing, thereby being able to perform data desensitization and restoration on massive data (P level). BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a schematic diagram of the data desensitization process in the present invention;
[0041] Figure 2 This is a schematic diagram of the data restoration process in the present invention;
[0042] Figure 3 This is a schematic diagram of the distributed data desensitization processing process in the embodiment;
[0043] Figure 4 Schematic diagram of the distributed data restoration process in the embodiment. DETAILED DESCRIPTION
[0044] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0045] Example
[0046] like Figure 1 As shown, a data desensitization method based on symmetric encryption includes the following steps:
[0047] T1. Obtain the data set or data table to be desensitized;
[0048] T2. Mark the fields in the data set or data table for the first time and the second time in sequence. Specifically:
[0049] First, the fields in the data set or data table are marked with sensitive types, such as mobile phone number, ID number, email address, and bank card number.
[0050] Then, the fields in the data set or data table are marked in a second encryption mode, for example, the field at a set position in the ID number is marked;
[0051] T3. Request a random encryption salt according to the library name or table name of the data table to which the data set belongs, and generate a random encryption key accordingly, wherein the random encryption salt includes a first encryption salt and a second encryption salt, and the first encryption salt and the second encryption salt are independently stored in different servers;
[0052] T4. Record and save random encryption salt and random encryption key;
[0053] T5. Initiate a data acquisition request and use a secure transmission protocol for data transmission. Specifically:
[0054] First, the first encrypted salt and the second encrypted salt are concatenated to obtain a complete encrypted salt;
[0055] Then, a data acquisition request is initiated based on the complete encryption salt and the random encryption key;
[0056] T6. Based on the symmetric encryption algorithm, the acquired data is desensitized to produce a desensitized data file;
[0057] T7. Save the desensitized data file and create the corresponding table structure. Specifically, the table structure of the desensitized data file is created based on the metadata information to complete the data desensitization process.
[0058] like Figure 2 As shown, a data restoration method based on symmetric encryption includes the following steps:
[0059] H1. Obtain the data set or data table to be restored;
[0060] H2. Obtain the structural information of the data file in the data set or data table, including the library name, table name, field information, field type, and field sensitive type;
[0061] H3. According to the structure information of the data file, request to obtain the encryption salt and encryption key in sequence. Specifically, according to the library name and table name, request to obtain the first encryption salt, the second encryption salt and the encryption key in sequence.
[0062] H4. Based on the obtained encryption salt and encryption key, restore the data file based on the symmetric encryption algorithm to produce restored data;
[0063] H5. Save the restored data and create the corresponding table structure according to the file structure to complete the data restoration process.
[0064] This embodiment applies the above technical solution and combines it with distributed data processing technology to construct a sensitive data cluster, a data desensitization and restoration server device, and a desensitized data cluster. Figure 3 and Figure 4 As shown in the figure, the data desensitization process mainly includes:
[0065] S001 performs a sensitive type tag on the field to mark whether the field is a mobile phone number, ID number, email address, bank card number, etc.
[0066] S002 marks the field with a secondary encryption method, such as 18-digit ID number and 15-digit ID number, where bits X to Y in the field are sensitive data and need to be encrypted;
[0067] S003 requests a random encryption salt from the desensitizing server based on the library name and table name. The encryption salt consists of two parts, which are requested from two independent servers respectively, and the two servers record them separately;
[0068] S004 servers store encryption salts independently;
[0069] After S005 obtains the complete encryption salt and secret key, it requests the sensitive data cluster to obtain the data;
[0070] S006 locates the data file according to the request parameters;
[0071] S007 uses a secure transmission protocol to transmit the data to a desensitizing and restoring device;
[0072] S008 uses a symmetric encryption algorithm to perform desensitization calculations on the data and produce a desensitized data file;
[0073] S009 saves the desensitized data file;
[0074] S010 creates the table structure of desensitized data files based on metadata information to facilitate use by business users.
[0075] The data restoration process mainly includes:
[0076] S001 The user selects a data set, which can be a table or a data file;
[0077] S002 obtains the structural information of the data file, including the library name, table name, field information, field type, and field sensitivity type, which is used to determine the field encryption algorithm in the next stage;
[0078] S003 transmitting the selected data set to a data restoration device;
[0079] S004 temporarily stores the data in the desensitizing and restoring device;
[0080] S005 requests encryption salt from the desensitization and restoration device according to the library name and table name;
[0081] S006 requests an encryption key from the desensitization restoration device according to the library name and the table name;
[0082] S007 performs restoration calculation on the encrypted data using a symmetric encryption algorithm based on the encryption salt and the encryption key;
[0083] S008 transmits the calculated restored data to the sensitive data cluster;
[0084] S009 creates table structure information of sensitive data based on the file structure to facilitate users to use data.
[0085] In summary, when performing data desensitization processing, the present technical solution judges the first layer of marking on the data. If it can match the preset encryption method corresponding to the field and there is no second layer marking, the corresponding scheme is called to encrypt it; by judging the second layer marking of the data, such as the length of the field and other information, if there is a matching encryption scheme, the scheme is called for encryption; the flexibility of the encryption algorithm is guaranteed, and the security of data desensitization is correspondingly improved.
[0086] This technical solution proposes to set the encryption salt to be composed of two parts, which are stored in different physical locations and dynamically obtained during encryption. In addition, different encryption salts can be used for different data according to their characteristics (library, table, column), thereby further improving the security of data processing.
[0087] After completing the encryption operation on the original cluster, this technical solution transmits the encrypted data to the desensitizing cluster using a secure transmission method, effectively preventing information leakage caused by database collision and feature matching methods.
[0088] In this technical solution, after the desensitized data is encrypted using a symmetric encryption method, the data is restored based on the pre-stored encryption salt and encryption key, which reliably ensures the security and controllability of data restoration.
Claims
1. A data desensitization method based on symmetric encryption, characterized in that: The following steps are involved: T1. Obtain the data set or data table to be desensitized; T2, mark the fields in the data set or data table for the first time and the second time in sequence; T3. Request a random encryption salt based on the database name or table name of the data table to which the dataset belongs, and generate a random encryption key accordingly; T4. Record and save random encryption salt and random encryption key; T5. Initiate a data acquisition request and use a secure transmission protocol for data transmission; T6. Based on the symmetric encryption algorithm, the acquired data is desensitized to produce a desensitized data file; T7. Save the desensitized data file and create the corresponding table structure to complete the data desensitization process; Step T2 specifically includes the following steps: T21. Mark the fields in the data set or data table with sensitive types for the first time; T22. Mark the fields in the data set or data table with a second encryption method; The random encryption salt in step T3 includes a first encryption salt and a second encryption salt, and the first encryption salt and the second encryption salt are independently stored in different servers; Step T5 specifically includes the following steps: T51, concatenating the first encrypted salt and the second encrypted salt to obtain a complete encrypted salt; T52: Initiate a data acquisition request based on the complete encryption salt and the random encryption key.
2. According to a data desensitization method based on symmetric encryption according to claim 1, it is characterized in that: The sensitive type marking is specifically for marking fields of mobile phone number, ID number, email address, and bank card number types.
3. According to the data desensitization method based on symmetric encryption according to claim 1, it is characterized in that: The encryption mode mark is specifically for marking the field at a set position in the certificate number.
4. According to a data desensitization method based on symmetric encryption according to claim 1, it is characterized in that: The step T7 specifically creates a table structure of the desensitized data file based on the metadata information.
5. A data restoration method based on symmetric encryption, characterized in that: The following steps are involved: H1. Obtain the data set or data table to be restored; H2. Get the structural information of the data file in the data set or data table; H3. According to the structure information of the data file, request to obtain the encryption salt and encryption key in sequence; H4. Based on the obtained encryption salt and encryption key, restore the data file based on the symmetric encryption algorithm to produce restored data; H5. Save the restored data and create the corresponding table structure according to the file structure to complete the data restoration process; The data set or data table to be restored in step H1 is obtained by applying the data desensitization method based on symmetric encryption as claimed in claim 1; The structural information of the data file in step H2 includes the library name, table name, field information, field type and field sensitive type.
6. A data restoration method based on symmetric encryption according to claim 5, characterized in that: The step H3 specifically requests to obtain the first encryption salt, the second encryption salt and the encryption key in sequence according to the library name and the table name.
Citation Information
Patent Citations
Data encryption and decryption method and system on basis of double salt values
CN106301763A
Method and apparatus for encrypting information, computer device, and storage medium
CN107666479A
Cited By
Encryption and desensitization cooperative processing method and system for data life cycle
CN121786888A
Data lifecycle-oriented encryption and desensitization collaborative processing method and system
CN121786888B
