Methods and systems for handling obfuscated sensitive data in financial business scenarios
By classifying sensitive data in financial business scenarios into multiple types and applying obfuscation rules, the problem of data format changes caused by traditional encryption or desensitization methods is solved. This enables transparent and reversible data obfuscation and recovery of sensitive data in financial business scenarios, improving security and reducing system complexity.
Patent Information
- Application Number
- CN202611444444.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-17
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies cannot effectively protect the format, length, and checksum of various types of sensitive data in financial business scenarios. This makes it easy for encryption or desensitization methods to change the data format, affecting the identification and use of business systems, while also increasing system complexity and the risk of leakage.
By classifying sensitive data into multiple types according to data format, using corresponding obfuscation rules to maintain data format and character type, and recalculating check bits when they are included, recovery assistance information is generated. Database operations are intercepted to automatically complete obfuscation and recovery, avoiding the need to create separate recovery tables or backup databases.
It enables transparent and reversible data obfuscation and recovery of sensitive data in financial business scenarios, improving security, reducing performance overhead and management complexity, and ensuring data availability, consistency and recoverability.
Smart Images

Figure CN123116334A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of emerging software and new information technology service technology, and in particular to a method and system for obfuscating multiple types of sensitive data for financial business scenarios. Background Technology
[0002] With the widespread application of information technology in the financial sector, including credit, the security protection of customer data has become increasingly important. Customer data in financial business scenarios typically includes various types of sensitive information such as ID card numbers, mobile phone numbers, names, addresses, company names, and email addresses. The leakage of such data can cause serious losses. To protect this sensitive data, existing technologies often employ encryption or de-identification methods.
[0003] Common encryption methods include one-way encryption, symmetric encryption, and asymmetric encryption. One-way encryption, such as MD5, SHA-1, and SHA-256, can only convert input data into fixed-length output data and cannot restore the original data; it is typically used for password storage and integrity verification. Symmetric encryption, such as DES, 3DES, and AES, uses the same key for encryption and decryption, offering high speed but complex key management and security risks during transmission. Asymmetric encryption, such as RSA, DSA, and ECC, uses a public key for encryption and a private key for decryption, offering high security but incurring significant computational overhead. While these encryption methods can guarantee data confidentiality to a certain extent, they generally suffer from the following problems: the length and format of the encrypted data often change, making it unrecognizable and unusable by existing business systems; encryption and decryption operations increase system computational and storage overhead, impacting performance, especially in scenarios with large data volumes or high real-time requirements; key generation, storage, distribution, and update management are complex, and key leakage directly leads to the failure of security defenses; furthermore, encryption only guarantees confidentiality, not data integrity, and for data containing check bits, such as ID card numbers, the check bits become invalid after encryption, making it difficult to pass the format verification of business systems.
[0004] Besides encryption, existing technologies often employ data anonymization methods, such as directly replacing, masking, or generalizing sensitive fields. However, simple replacement or masking is often irreversible, making data unrecoverable when needed. Creating a separate recovery table or backup database for each sensitive field to store the original data increases system complexity and data migration costs, and the backup data itself may become a new source of leakage risk. Furthermore, existing anonymization schemes lack a unified format preservation mechanism for different data types; obfuscated data may still be identified as sensitive by data scanning software, or may be unusable by business systems due to changes in character type or length.
[0005] In view of this, how to provide a method for obfuscating multiple types of sensitive data in financial business scenarios, so that the obfuscated data can maintain the original data format, character type and length, still meet the business format verification requirements when including check bits, and can associate and store recovery auxiliary information in the same physical table, thereby automatically completing obfuscation and recovery by intercepting database read and write operations, has become an urgent technical problem to be solved.
[0006] This section is intended to provide background or context for the embodiments of this application set forth in the claims. The description herein is not an admission that it is prior art simply because it is included in this section. Summary of the Invention
[0007] In view of this, this application provides a method and system for obfuscating multiple types of sensitive data in financial business scenarios to solve at least one of the problems mentioned above.
[0008] To achieve the above objectives, this application adopts the following approach: According to a first aspect of this application, a method for obfuscating multiple types of sensitive data in financial business scenarios is provided, the method comprising: Acquire sensitive data to be processed in financial business scenarios, and classify the sensitive data to be processed into multiple data types according to the data format; Based on the defined data types, different data types are subjected to desensitization and obfuscation processing using their corresponding obfuscation rules to obtain obfuscated data. Recovery auxiliary information for reverse recovery of the original sensitive data is then generated. The obfuscation rules are configured to ensure that the obfuscated data maintains the same data format and character type as the original sensitive data without increasing the data length. Furthermore, when the original sensitive data contains check bits, the check bits are recalculated based on the obfuscated data to ensure that the obfuscated data meets the financial business format verification requirements corresponding to that data type. The recovery auxiliary information includes original information that was replaced during the obfuscation process and cannot be directly restored through inverse operations. Intercept database write operation statements to write the obfuscated data into the corresponding business field during the write operation, and store the recovery assistance information in an extended field located in the same physical table as the business field; When data needs to be read or recovered, the database read operation statement is intercepted, and the original sensitive data is recovered by using a recovery rule that is the opposite of the obfuscation rule, based on the recovery auxiliary information stored in the extended field.
[0009] According to a second aspect of this application, a multi-type sensitive data obfuscation processing system for financial business scenarios is provided, the system comprising: The data acquisition and segmentation unit is used to acquire sensitive data to be processed in financial business scenarios and to segment the sensitive data to be processed into multiple data types according to the data format. The data obfuscation unit is used to perform desensitization and obfuscation processing on different data types according to the defined data types, using their corresponding obfuscation rules to obtain obfuscated data, and to generate recovery assistance information for reverse recovery of the original sensitive data. The obfuscation rules are configured to ensure that the obfuscated data maintains the same data format and character type as the original sensitive data without increasing the data length. When the original sensitive data contains a checksum, the checksum is recalculated based on the obfuscated data to ensure that the obfuscated data meets the financial business format verification requirements corresponding to that data type. The recovery assistance information includes original information that was replaced during the obfuscation process and cannot be directly restored through inverse operations. A write operation processing unit is used to intercept database write operation statements, so as to write the obfuscated data into the corresponding business field during the write operation, and to associate and store the recovery auxiliary information in an extended field located in the same physical table as the business field; The read operation processing unit is used to intercept database read operation statements when data needs to be read or recovered, and to recover the obfuscated data by using a recovery rule that is the opposite of the obfuscation rule, based on the recovery auxiliary information stored in the extended field, so as to obtain the original sensitive data.
[0010] According to a third aspect of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method described above.
[0011] According to a fourth aspect of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the above-described method.
[0012] According to a fifth aspect of this application, a computer program product is provided, comprising a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.
[0013] As can be seen from the above technical solution, the multi-type sensitive data obfuscation processing method and system for financial business scenarios provided in this application classifies the sensitive data to be processed in financial business scenarios into multiple types according to data format, and adopts corresponding obfuscation rules for different data types. This ensures that the obfuscated data maintains the data format and character type corresponding to the original sensitive data without increasing the data length. When the original data contains a check bit, the check bit is recalculated based on the obfuscated data, thereby ensuring that the obfuscation result still meets the format verification requirements of financial business. This overcomes the problem that traditional encryption or desensitization methods easily change the data format, length, and verification failure, resulting in the business system being unable to directly recognize and use the data. At the same time, the recovery of auxiliary information only includes... This includes original information that was replaced during the obfuscation process and cannot be directly restored through inverse operations, and extended fields that are stored in the same physical table as business fields. This avoids the increased system complexity and risk of secondary leakage caused by creating a separate recovery table or fully backing up the original data. Furthermore, by intercepting database write and read operations, the system automatically completes the writing of obfuscated data and recovery auxiliary information when writing to the database, and automatically performs reverse recovery based on the extended fields when reading from the database. This achieves transparent and reversible data obfuscation and recovery for the business system, which not only improves the security of sensitive data during storage and transfer, but also reduces performance overhead and management complexity, ensuring the availability, consistency and recoverability of data in financial business scenarios. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings: Figure 1 A flowchart illustrating a method for obfuscating multiple types of sensitive data in a financial business scenario, provided as an embodiment of this application; Figure 2 A flowchart illustrating the process of obtaining obfuscated data by performing desensitization and obfuscation processing using corresponding obfuscation rules, as provided in this application embodiment; Figure 3 Example diagram showing each data bit of the ID card number provided in the embodiments of this application; Figure 4 This is a flowchart illustrating the process of de-identifying and obfuscating email address data to obtain obfuscated data, as provided in an embodiment of this application. Figure 5 This is a flowchart of the process for recovering obfuscated data provided in an embodiment of this application; Figure 6This application provides a schematic diagram of the structure of a multi-type sensitive data obfuscation processing system for financial business scenarios. Figure 7 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0015] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the embodiments of this application will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments and descriptions of this application are used to explain this application, but are not intended to limit this application.
[0016] like Figure 1 The diagram shown is a flowchart illustrating a method for obfuscating multiple types of sensitive data in a financial business scenario, as provided in an embodiment of this application. The method includes the following steps: Step S101: Obtain the sensitive data to be processed in the financial business scenario, and divide the sensitive data to be processed into multiple data types according to the data format.
[0017] Specifically, financial business scenarios can include lending, payment, wealth management, risk control, and other business scenarios. The sensitive data to be processed can be customer information involved in the data storage, transmission, or processing of the business system. It can be obtained from databases, file systems, message queues, API calls, and other means.
[0018] Sensitive data to be processed can be segmented according to its format, based on one or more dimensions such as character composition, length, encoding method, presence of checksums, and field semantics. For example, sensitive data can be segmented into multiple data types based on whether it is purely numeric, purely text, or contains mixed characters, or whether it has a fixed length or includes checksum rules. Segmentation can be achieved using predefined rules, regular expressions, format templates, or field configuration tables. The resulting data types are then used to select appropriate obfuscation rules for different data types.
[0019] Step S102: Based on the defined data types, different data types are subjected to desensitization and obfuscation processing using their corresponding obfuscation rules to obtain obfuscated data, and recovery auxiliary information for reverse recovery of the original sensitive data is generated; wherein, the obfuscation rules are configured to ensure that the obfuscated data maintains the data format and character type corresponding to the original sensitive data without increasing the data length, and when the original sensitive data contains a check bit, the check bit is recalculated based on the obfuscated data so that the obfuscated data meets the financial business format verification requirements corresponding to the data type; the recovery auxiliary information includes the original information that was replaced during the obfuscation process and cannot be directly restored through inverse operation.
[0020] Specifically, obfuscation rules can be pre-configured for each data type. These rules can include one or more methods such as character substitution, encoding offset, segmentation, and mapping transformation. Regardless of the method used, the obfuscation rules are configured to ensure that the obfuscated data maintains the same data format and character type as the original sensitive data, without increasing the data length. For example, if the original data is numeric, it will remain numeric after obfuscation; if the original data is text, it will remain text after obfuscation; and the original data length remains unchanged, thus preventing the business system from being unable to recognize, store, or process the data due to changes in format or length.
[0021] When the original sensitive data contains a check bit, such as the last bit or a specific bit designated as a check bit in certain encoding rules, the check bit needs to be recalculated based on the obfuscated data after obfuscating the other bits. This recalculated check bit is then added to the obfuscated data, ensuring that the final obfuscated data meets the format verification requirements for the corresponding financial business data type. In this way, the obfuscated data still appears as legally formatted data in the business system and can pass the system's verification logic, thus achieving sensitive data protection without affecting business continuity.
[0022] During the obfuscation process, recovery assistance information is also generated for reversing the original sensitive data. This recovery assistance information is not a full backup of the original data, but only includes the original information that was replaced during obfuscation and cannot be directly restored through inverse operations. For example, if a data bit is replaced with a fixed value, and this fixed value cannot be derived from the original value through inverse operations, then this original value is saved as recovery assistance information. If a data bit is obfuscated using a reversible offset operation, then there is no need to save the original value of that bit; it can be directly restored later through inverse operations. By saving only the original information of the irreversibly replaced parts, data recovery is ensured while reducing the amount of recovery assistance information, thus lowering the storage overhead and leakage risk of extended fields.
[0023] Step S103: Intercept database write operation statements to write the obfuscated data into the corresponding business field during the write operation, and store the recovery assistance information in an extended field of the same physical table as the business field.
[0024] Specifically, database write operations can be intercepted through persistent layer interceptors, Aspect-Oriented Programming (AOP) aspects, database proxies, and ORM framework extensions. These write operations can include insert and update statements. Upon interception, the business fields containing sensitive data are identified, their original values are replaced with the obfuscated data obtained in step S102, and a write operation is generated for the extended field. Recovery assistance information is then stored in the extended field, which resides in the same physical table as the business field. The extended field can be a column pre-added to the physical table or a reused existing extensible field. The recovery assistance information and the business field can be associated and stored using the primary key, row identifier, or other relationships of the same record, allowing for quick location of the corresponding recovery assistance information during subsequent reads.
[0025] By storing recovery assistance information and business fields in an extended field of the same physical table, there is no need to create a separate recovery table or backup database. This simplifies the data model and system architecture, and avoids the performance overhead and data migration complexity caused by cross-table joins. Furthermore, since the extended field and business fields are in the same table, recovery assistance information can be retrieved simultaneously when reading business data, facilitating subsequent recovery processing.
[0026] Step S104: When it is necessary to read or recover data, the database read operation statement is intercepted, and the original sensitive data is recovered by using a recovery rule that is the opposite of the obfuscation rule, based on the recovery auxiliary information stored in the extended field.
[0027] Specifically, when the business system needs to read data, it can intercept database read operation statements, which may include query statements, etc. After intercepting the read operation statement, it can identify whether the query conditions or query results involve sensitive data. For obfuscated data in the query results, recovery is performed using a recovery rule that is the reverse of the obfuscation rule in step S102, based on the recovery auxiliary information stored in the extended field of the same physical table. The recovery rule corresponds to the obfuscation rule. For example, if the obfuscation rule is character replacement, the recovery rule is reverse replacement; if the obfuscation rule is encoding offset, the recovery rule is reverse offset; if the obfuscation rule is segmented processing, the recovery rule is segmented reverse restoration. For parts that cannot be directly restored through inverse operation, the corresponding recovery auxiliary information is read from the extended field for restoration. Finally, the original sensitive data is obtained and returned to the business system for use.
[0028] Furthermore, sensitive data in the query conditions can be processed during the reading process. For example, if the query conditions contain original sensitive data, it can be converted into obfuscated data according to the obfuscation rules in step S102 before the query is executed, thereby ensuring that the query can hit the obfuscated stored data. After the query results are returned, the obfuscated data is restored to the original sensitive data based on the recovery auxiliary information in the extended fields, ensuring that the business system obtains the correct data content.
[0029] As described above, the multi-type sensitive data obfuscation processing method for financial business scenarios provided in this application classifies the sensitive data to be processed in financial business scenarios into multiple types according to data format, and applies corresponding obfuscation rules for different data types. This ensures that the obfuscated data maintains the same data format and character type as the original sensitive data without increasing the data length. When the original data contains a check bit, the check bit is recalculated based on the obfuscated data, thereby ensuring that the obfuscation result still meets the format verification requirements of financial business. This overcomes the problem that traditional encryption or desensitization methods easily change the data format, length, and verification failure, resulting in the business system being unable to directly recognize and use the data. Furthermore, the recovery auxiliary information only includes the obfuscated data. The system automatically replaces the original information that cannot be directly restored through inverse operations during the process, and stores the extended fields of the data in the same physical table in association with the business fields. This avoids the increased system complexity and risk of secondary leakage caused by creating a separate recovery table or fully backing up the original data. Furthermore, by intercepting database write and read operations, the system automatically completes the writing of obfuscated data and recovery auxiliary information when writing to the database, and automatically performs reverse recovery based on the extended fields when reading from the database. This achieves transparent and reversible data obfuscation and recovery for the business system, which not only improves the security of sensitive data during storage and transfer, but also reduces performance overhead and management complexity, ensuring the availability, consistency and recoverability of data in financial business scenarios.
[0030] In some embodiments of this application, the data types in step S101 above include numeric data, pure Chinese name data, Chinese character data, and email address data.
[0031] Specifically, sensitive data to be processed can be classified into one or more of the above four categories based on information such as data format, character composition, field semantics, length characteristics, and whether it contains check bits in financial business scenarios. The following is a detailed explanation of each of the above four data types.
[0032] (1) Data in digital form
[0033] Digital data refers to sensitive data composed of numeric characters and possessing a specific business or agreed-upon format. In financial business scenarios, digital data may include, for example, ID card numbers, mobile phone numbers, card numbers, account numbers, and customer numbers. Common characteristics of this type of data include: a character set typically ranging from 0 to 9; fixed data length or conforming to certain agreed-upon rules; some data types also include check digits; and different digit segments may have specific business meanings. For example, ID card numbers are typically of fixed length, with the first few digits representing regional information, the middle few digits representing birth date information, and the last or a specific digit serving as a check digit; mobile phone numbers are typically of fixed length, with the first few digits representing network identification or number segment information, and the remaining digits representing the user number. By identifying the specific format of digital data, it can be categorized into digital data types so that in subsequent step S102, the corresponding obfuscation rules can be used for desensitization and obfuscation processing.
[0034] (2) Data of names in pure Chinese characters.
[0035] Pure Chinese character name data refers to data used to represent the names of natural persons and consisting entirely of Chinese characters. This type of data is typically short, such as two, three, or four characters, with the first character often representing the surname and the remaining characters representing the given name. The difference between pure Chinese character name data and general Chinese character data lies in the semantics of its fields: it represents the name, not just the character set. Therefore, in classification, besides determining whether it contains only Chinese characters based on the character set, it can also be identified by combining information such as field name, field semantics, surname database, and length range. For example, field names such as "Name," "Customer Name," or "Account Name," and field values composed entirely of Chinese characters, can be classified as pure Chinese character name data. Separating pure Chinese character name data into a separate category facilitates the subsequent adoption of appropriate obfuscation rules and recovery auxiliary information storage methods based on the semantic characteristics and recovery needs of the name data.
[0036] (3) Chinese character data.
[0037] Chinese character data refers to data composed of Chinese characters used to represent addresses, company names, remarks, descriptive information, etc. This type of data belongs to the same Chinese character set as pure Chinese name data, but its field semantics are usually not those of a natural person's name, but rather descriptive information. The characteristics of Chinese character data are: the character set is Chinese characters, the data length is not fixed, the content has a certain semantic meaning, it usually does not contain check digits, and it often does not require segmentation like numeric data. During classification, it can be identified based on field name, field semantics, character set, and whether it contains numbers or letters. For example, field names such as "address," "company name," "unit name," and "remarks," and field values composed of Chinese characters, can be classified as Chinese character data. Classifying Chinese character data separately facilitates subsequent obfuscation processing while maintaining the Chinese character format and character type.
[0038] (4) Email address data.
[0039] Email address data refers to data that conforms to the format of an email address. This type of data typically contains the "@" symbol and can be divided into a username part before the "@" symbol and a domain part after the "@" symbol. The username part can contain letters, numbers, underscores, periods, etc., while the domain part typically contains letters, numbers, periods, etc., and has a specific domain format. The characteristics of email address data are: mixed character types, variable length, a fixed separator "@", and different rules governing the composition of each part. Classification can be achieved using regular expressions, format templates, and field semantics. For example, field names such as "email," "electronic mailbox," or "Email" with values conforming to the email address format can be categorized as email address data. Separating email address data into a separate category facilitates the application of appropriate obfuscation rules for the username and domain parts, while ensuring that the obfuscated data still conforms to the email address format.
[0040] In practical implementation, a pre-defined data type identification rule base can be established. This rule base includes identification rules corresponding to the four types of data mentioned above, such as regular expressions, field name mapping relationships, character set judgment rules, length ranges, and validation rules. Each field or data item in the sensitive data to be processed can be matched against the identification rule base item by item. If a match is successful, it can be classified into the corresponding data type. If a data item simultaneously meets the identification rules of multiple data types, it can be classified according to a preset priority. For example, email address data can be identified first, followed by numeric data, then pure Chinese name data, and finally Chinese character data; or a comprehensive judgment can be made by combining field semantics and business rules. The classification results can be recorded in the form of field labels, type identifiers, configuration information, annotations, or metadata, so that the corresponding obfuscation rule can be selected based on the classification results in subsequent step S102.
[0041] The above classification method can divide sensitive data with different formats in financial business scenarios into different types such as numerical data, pure Chinese name data, Chinese character data, and email address data. This provides a basis for subsequently applying corresponding obfuscation rules to different data types, so that the obfuscated data can maintain the data format and character type corresponding to the original sensitive data and meet the usage requirements in financial business scenarios.
[0042] In some embodiments of this application, such as Figure 2 As shown, for the digital data, step S102 above uses the corresponding obfuscation rules for desensitization and obfuscation processing to obtain obfuscated data, including: Step S201: Decompose the digital data into the original approximate bit, the non-check bit, and the check bit.
[0043] Specifically, digital data typically has a fixed bit structure, with different bits potentially carrying different business meanings. Take an ID card number as an example... Figure 3 As shown, the ID number "44152220880831055X" can be divided into three parts according to its bit segment structure: the approximation bit, the obfuscation bit, and the check bit. The approximation bit is the first 6 digits "441522", the obfuscation bit is the middle 11 digits "20880831055", and the check bit is the last digit "X". In this application, to distinguish it from the bit segments after subsequent obfuscation processing, the approximation bit obtained from the splitting is called the original approximation bit, and the middle bit segment obtained from the splitting is called the non-check bit (i.e., the check bit). Figure 3The "confusion bit" is marked in the diagram, and the last bit is called the check bit. If a certain numerical data does not contain a check bit, the check bit in the splitting result can be empty, that is, it is only split into the original reduction bit and the non-check bit. The splitting method can be implemented through preset bit segment configuration rules, such as configuring the start bit, end bit, length and other information according to the field type, so as to accurately identify the original reduction bit, the non-check bit and the check bit.
[0044] Step S202: Store the original appointment location as recovery auxiliary information in the extended field, and set the appointment location in the obfuscated data to a fixed value that meets the requirements of the financial business format.
[0045] Specifically, since the original contract position will be replaced with a fixed value in the obfuscated data, and this fixed value cannot be used to reconstruct the original contract position through inverse operations, the original contract position obtained from the splitting needs to be stored as recovery auxiliary information in an extended field. This extended field resides in the same physical table as the business field, allowing the original contract position to be directly retrieved from the same record during subsequent reading or recovery. Simultaneously, the contract position in the obfuscated data is set to a fixed value that meets the format requirements of financial business. This fixed value can be pre-set according to the industry rules or test data format requirements of the financial business scenario. For example, for... Figure 3 The ID number shown can have its first 6 digits set to be all the same, such as "111111", to meet the industry's requirements for test data format. Setting a fixed value ensures the obfuscated data conforms to the business system's data format requirements, preventing rejection or identification as illegal data due to abnormal digit settings. Since the original digit "441522" has been stored in the extended field, it can be recovered later using the extended field without information loss.
[0046] Step S203: Obfuscate the non-check bits using a fixed offset method.
[0047] The fixed offset method involves offsetting each digit in the non-check bits by a preset offset, ensuring the result remains a numeric character. One possible implementation is to add the preset offset to each digit in the non-check bits, then take the modulo 10; the remainder is the obfuscated number. For example, for... Figure 3The non-check digit of the Chinese ID number is "20880831055". The preset offset can be set to 5. Then, each digit is added to 5 and modulo 10: 2→7, 0→5, 8→3, 8→3, 0→5, 8→3, 3→8, 1→6, 0→5, 5→0, 5→0, resulting in the obfuscated non-check digit "75335386500". Since the result of the modulo operation is still a number between 0 and 9, the obfuscated non-check digit is still composed of numeric characters, and its length is the same as the original non-check digit. It does not change the data format or character type, nor does it increase the data length. For different numeric data formats, the same or different preset offsets can be set. The fixed offset method is a reversible operation. During subsequent recovery, the original number can be restored by subtracting the same preset offset and taking the modulo 10. Therefore, it is not necessary to store the original value of the non-check digit in the extended field, thus reducing the amount of data for recovering auxiliary information.
[0048] Step S204: Recalculate the check bits based on the first n-1 bits after confusion.
[0049] For numeric data including a check bit, after approximation and obfuscation of the check bit, the first n-1 bits of the obfuscated data are determined. To ensure that the obfuscated data still passes the verification rules of the business system, the check bit needs to be recalculated based on the first n-1 bits of the obfuscated data. The calculation rules for the check bit are the same as those followed by the original numeric data. For example, for Figure 3 The ID number shown can be used to calculate a new check digit by concatenating the first 17 digits (i.e., the processed approximate check digit "111111" and the concatenated non-check digit "75335386500") according to the weighting factor and check digit calculation rules stipulated in national standards. The recalculated check digit replaces the original check digit "X", thus ensuring that the final obfuscated data meets the financial business format verification requirements corresponding to this data type. Since the check digit is calculated based on the obfuscated data, there is no need to store the original check digit in the extended field; the original check digit can be recalculated from the subsequently recovered first n-1 digits.
[0050] Step S205: Concatenate the processed approximate bit, the obfuscated non-check bit, and the recalculated check bit to obtain obfuscated data.
[0051] Specifically, the fixed value set in step S202 that meets the format requirements of financial business is used as the processed approximation bit. The obfuscated non-check bit obtained in step S203 and the check bit recalculated in step S204 are concatenated according to the bit segment order of the original digital data to obtain the complete obfuscated data. For example, for Figure 3For the illustrated ID number, the processed predetermined bits "111111", the confused non-check bits "75335386500" and the recalculated check bit are spliced in sequence to obtain confused data "11111175335386500X" (the specific check bit is subject to actual calculation), which is still an 18-digit string. The first 6 bits are fixed numbers, the middle part is the confused numbers, and the last bit is the recalculated check bit, and the whole still presents a legal ID number format. Therefore, the obtained confused data can not only be normally stored in the service field, but also will not affect the use of the service system due to format or check problems.
[0052] Through the above steps S201 to S205, combined with Figure 3 the example of each data bit of the illustrated ID number, the embodiments of the present application can realize format-preserving confusion for digital data: the original predetermined bits are stored in the extended field of the same physical table as recovery auxiliary information, the non-check bits are reversibly confused by the fixed offset method, the check bit is recalculated according to the confused data, and the finally spliced confused data maintains the format, character type and length of the original data, and meets the financial service format check requirements. When recovery is needed subsequently, the original predetermined bits in the extended field can be used to perform inverse offset operation on the non-check bits, recalculate the check bit and perform splicing, so as to accurately restore the original digital data.
[0053] In some embodiments of the present application, for pure Chinese character name data, the corresponding confusion rule is adopted in the above step S102 to perform desensitization confusion processing to obtain confused data, which includes: keeping the first Chinese character unchanged, replacing other Chinese characters except the first one with fixed characters, and storing the replaced original Chinese characters as recovery auxiliary information into the extended field.
[0054] Specifically, pure Chinese character name data is usually used to represent a natural person's name, its character set is Chinese characters, the length is generally two Chinese characters, three Chinese characters or four Chinese characters, and the first Chinese character usually represents the surname, and the remaining Chinese characters represent the given name. In this step, the pure Chinese character name data can be identified first according to the field semantics, field name, character set judgment and other manners. After the identification is completed, the Chinese characters in the name are processed by position: the first Chinese character is kept unchanged to ensure that the confused name still has identifiability and conforms to the basic format of Chinese names; other Chinese characters except the first one are uniformly replaced with preset fixed characters. The fixed characters are Chinese characters, for example, may be "certain" or other preset Chinese characters. During replacement, equal-length replacement shall be performed according to the number of replaced Chinese characters, that is, if there is one Chinese character after the first position, it shall be replaced with one fixed character; if there are two Chinese characters after the first position, they shall be replaced with two fixed characters; and so on, so that the confused data has the same length and character type as the original name, does not increase the data length, and does not change the data format.
[0055] For example, for the name "Zhang San", the first Chinese character "Zhang" is kept unchanged, the second Chinese character "San" is replaced with the fixed character "Mou", so as to obtain the obfuscated data "Zhang Mou"; for the name "Zhang San Si", the first Chinese character "Zhang" is kept unchanged, the second and third Chinese characters "San" and "Si" are respectively replaced with the fixed character "Mou", so as to obtain the obfuscated data "Zhang Mou Mou"; for the name "Zhang San Si Wu", the first Chinese character "Zhang" is kept unchanged, the second to fourth Chinese characters "San", "Si" and "Wu" are respectively replaced with the fixed character "Mou", so as to obtain the obfuscated data "Zhang Mou Mou Mou". It can be seen that the obfuscated name is still composed of pure Chinese characters, has the same length as the original name, and presents as a valid Chinese name format as a whole, which can be normally stored in the service field, and will not affect the use of the service system due to format or length changes.
[0056] Since after the Chinese characters other than the first one are replaced with the fixed character, the original Chinese characters cannot be directly restored through inverse operation, it is necessary to store the replaced original Chinese characters as restoration auxiliary information in an extended field. The extended field and the service field are located in the same physical table, so that the replaced original Chinese characters can be directly obtained from the same record during subsequent reading or restoration. For example, for "Zhang San", "San" can be stored in the extended field; for "Zhang San Si", "San Si" can be stored in the extended field; for "Zhang San Si Wu", "San Si Wu" can be stored in the extended field. During storage, the replaced Chinese characters can be stored according to their order in the original name, so as to restore them in sequence during restoration. Since the first Chinese character remains unchanged, there is no need to store the first Chinese character in the extended field, which further reduces the data volume of the restoration auxiliary information.
[0057] When data needs to be read or restored, the fixed characters in the obfuscated data can be replaced back to the original Chinese characters by position according to the replaced original Chinese characters stored in the extended field, so as to restore the original name. For example, for the obfuscated data "Zhang Mou", "San" is read from the extended field, and the fixed character "Mou" is replaced with "San" to obtain the original name "Zhang San"; for the obfuscated data "Zhang Mou Mou", "San Si" is read from the extended field, and the two fixed characters "Mou" are sequentially replaced with "San" and "Si" to obtain the original name "Zhang San Si". Through the above method, the pure Chinese character name data still maintains the data format and character type of the Chinese name after being obfuscated, without increasing the data length, and the original name can be accurately and efficiently restored through the extended field, which takes into account both data security and service availability.
[0058] In some embodiments of the present application, as Figure 3 shown, for Chinese character type data, performing desensitization obfuscation processing by using a corresponding obfuscation rule in the above step S102 to obtain obfuscated data includes: Step S301: converting the Chinese character type data into UTF-8 encoding.
[0059] Chinese character data refers to data composed of Chinese characters used to represent addresses, company names, remarks, descriptive information, etc. This type of data belongs to the same Chinese character set as pure Chinese name data, but its field semantics are usually not those of a natural person's name, but rather descriptive information. During classification, Chinese character data can be identified based on field name, field semantics, and character set. After identification, each Chinese character in the data is converted to UTF-8 encoding to obtain its corresponding encoded value. UTF-8 encoding can completely represent Chinese characters, and the encoded values have a defined numerical range, facilitating subsequent offset and modulo operations. By converting to UTF-8 encoding, the processing of Chinese character characters can be transformed into numerical processing of encoded values, thus providing a basis for subsequent obfuscation.
[0060] Step S302: Offset the UTF-8 code value according to a fixed offset.
[0061] After obtaining the UTF-8 encoded value of each Chinese character, the encoded value is offset by a preset fixed offset. This fixed offset can be preset according to actual security requirements and the range of Chinese character encoding. For example, the fixed offset can be set to 5, that is, adding 5 to the UTF-8 encoded value of each Chinese character. By uniformly offsetting the encoded values, the encoded value corresponding to the original Chinese character changes, thereby altering the Chinese character itself and achieving the purpose of obfuscation. Since the offset is fixed and the offset operation itself is reversible, the original encoded value can be restored by reverse offsetting. The offset encoded value is still in numerical form and has not been directly converted into a character; further processing is required to ensure it falls within the range of Chinese character encoding.
[0062] Step S303: Take the remainder of the maximum code value of the Chinese character.
[0063] To prevent the offset encoded value from exceeding the encoding range of Chinese characters, a modulo operation is required. The maximum code value for Chinese characters can be preset; for example, 0x9FFF can be used as the maximum code value for simplified Chinese characters. The offset encoded value is then divided by 0x9FFF to obtain the remainder value. This modulo operation constrains the offset encoded value to the Chinese character encoding range, ensuring that the remainder corresponds to a Chinese character rather than an illegal or unrecognizable character. The modulo operation is also reversible; during subsequent recovery, it can be combined with the fixed offset and the maximum code value for reverse calculation to restore the original encoded value.
[0064] Step S304: Restore the remainder value to the corresponding Chinese character to obtain the confusing data.
[0065] In this step, the remainder value obtained in step S303 is used as the new encoding value and restored to the corresponding Chinese character. The restored Chinese character is the obfuscated Chinese character. Steps S301 to S304 are performed on each Chinese character in the Chinese character data to obtain obfuscated data composed of obfuscated Chinese characters. For example, for Chinese character data such as addresses and company names, after the above processing, the resulting obfuscated data still consists of Chinese characters, with the same character type and length as the original data. The data length is not increased, and there are no garbled characters or non-Chinese characters. Therefore, the obfuscated data still appears as legitimate Chinese text in its format, can be stored normally in business fields, will not be rejected by business systems, and is not easily identified as sensitive data by data scanning software.
[0066] Because the aforementioned obfuscation rules employ a fixed offset and a deterministic reversible operation using the remainder of the maximum code value, for Chinese character data, there is no need to store the original Chinese characters as recovery auxiliary information in the extended field. The original Chinese characters can be restored through reverse offset and remainder operations. In other words, the recovery auxiliary information for Chinese character data in the overall scheme can be empty, thereby further reducing the amount of recovery auxiliary information and lowering the storage overhead of the extended field.
[0067] Through the above steps S301 to S304, the embodiments of this application can achieve format-preserving obfuscation for Chinese character data: the obfuscated data is still Chinese characters, maintaining the character type and length of the original data, without increasing the data length, and the original Chinese characters can be recovered through reversible operations, thereby improving data security while ensuring the availability and recoverability of Chinese character data in financial business scenarios.
[0068] In some embodiments of this application, such as Figure 4 As shown, for email address data, step S102 above uses the corresponding obfuscation rules for desensitization and obfuscation processing to obtain obfuscated data, including: Step S401: Replace the domain name after the @ symbol with the preset domain name, and store the original domain name as recovery auxiliary information in the extended field.
[0069] Specifically, email address data typically conforms to the email address format, contains the "@" symbol, and can be divided into a username part before the "@" symbol and a domain part after the "@" symbol. During classification, email address data can be identified using regular expressions, format templates, and field semantics. After identification, the email address is split into the username and domain parts, using the "@" symbol as the delimiter. The domain part is then replaced with a preset domain. This preset domain can be pre-defined according to actual business needs. To ensure that obfuscated data does not increase data length, in one optional implementation, the preset domain can be determined based on the length of the original domain; that is, a preset domain with the same length as the original domain is selected for replacement, thus ensuring that the overall length of the replaced email address is consistent with the original email address. In another optional implementation, a fixed preset domain, such as "test.com," can be uniformly replaced. In this case, the overall data length can be kept constant by adjusting the length of the username part or other methods, depending on the business rules.
[0070] Since the original domain name cannot be directly restored through inverse operations after being replaced with the preset domain name, it is necessary to store the original domain name as recovery auxiliary information in an extended field. This extended field resides in the same physical table as the business field, allowing the original domain name to be directly retrieved from the same record during subsequent reading or recovery. For example, for the email address "user123@example.com", the domain name "example.com" after the "@" symbol is replaced with the preset domain name, and the original domain name "example.com" is stored in the extended field. By storing the original domain name in the extended field, the obfuscated data still appears as a valid email address in terms of format, and a basis is provided for accurate recovery of the original email address.
[0071] Step S402: Obfuscate the pure numeric part and / or letter part before the @ symbol using a fixed offset method.
[0072] Specifically, the username portion before the "@" symbol can be further divided into a purely numeric portion and a letter portion based on its character composition, and each portion is obfuscated using a fixed offset method. The username portion can contain letters, numbers, underscores, periods, etc. In this step, the purely numeric and letter portions are mainly processed. If the username portion contains both numbers and letters, it can be processed in segments; if it contains only numbers or only letters, only the corresponding portions are processed.
[0073] For the purely numeric portion, a fixed offset method similar to or the same as the numeric data can be used for obfuscation. In one optional implementation, each digit in the purely numeric portion is added to a preset offset, and then modulo 10. The remainder is the obfuscated number. For example, the preset offset can be set to 5, so numbers 0 to 4 are offset to 5 to 9 respectively, and numbers 5 to 9 are offset to 0 to 4 respectively. Since the result of the modulo operation is still a number between 0 and 9, the obfuscated purely numeric portion still consists of numeric characters, and its length is the same as the original purely numeric portion. It does not change the character type or increase the data length.
[0074] For the letter portion, a fixed offset method can be used for obfuscation. In one optional implementation, each letter in the letter portion is converted to its ASCII code, then a preset offset is added to the ASCII code value, followed by taking the remainder modulo 26, and finally, the remainder is used to revert to the corresponding letter. For example, the preset offset can be set to 5. For the lowercase letter "a", its ASCII code value is 97, adding 5 gives 102, taking the remainder modulo 26 gives 24 (102 mod 26 = 24), and then the remainder 24 is used to revert to the corresponding letter, such as "y" (the specific mapping relationship can be determined according to the alphabetical order). Using this method, the obfuscated letter portion still consists of letter characters, and its length is the same as the original letter portion; it does not change the character type or increase the data length. For uppercase and lowercase letters, they can be processed according to their respective uppercase and lowercase alphabets to maintain the case attribute of the obfuscated letters.
[0075] It should be noted that the preset offsets used for the purely numeric and alphabetic parts can be the same or different, depending on security requirements and business rules. The fixed offset method is a reversible operation; during subsequent recovery, the original numeric and alphabetic parts can be recovered through reverse offset, modulo, and restoration operations. Therefore, for the purely numeric and alphabetic parts of the username, there is no need to store the original values in the extended field, thereby reducing the amount of data for recovery auxiliary information.
[0076] Through the above steps S401 to S402, this embodiment of the application can achieve format-preserving obfuscation for email address data: the domain name after the "@" symbol is replaced with a preset domain name, and the original domain name is stored in the extended field of the same physical table as recovery auxiliary information. The pure numeric part and / or letter part before the "@" symbol are reversibly obfuscated using a fixed offset method, so that the obfuscated email address still maintains the data format and character type of the email address, without increasing the data length. It can be stored normally in the business field, will not be rejected by the business system, and is not easily identified as sensitive data by data scanning software. When recovery is needed later, the original domain name can be read from the extended field and replaced with the preset domain name. At the same time, a reverse offset operation is performed on the username part, thereby accurately restoring the original email address, taking into account both data security and business availability.
[0077] In some embodiments of this application, intercepting database write operation statements in step S103 and intercepting database read operation statements in step S104 specifically includes: implementing the Intercept interface and adding the @Intercepts annotation through a MyBatis-based persistence layer interceptor to intercept SQL statements.
[0078] Specifically, MyBatis is a commonly used persistence layer framework that provides an interceptor mechanism, allowing the interception and enhancement of core objects at different stages of SQL statement execution. In this embodiment, a persistence layer interceptor class can be created, implementing the Intercept interface provided by MyBatis, and an annotation of @Intercepts can be added to the class. The @Intercepts annotation is used to declare the target objects and methods that the interceptor needs to intercept. In the @Intercepts annotation, one or more @Signature annotations can be used to specify the interface type, method name, and parameter type to be intercepted. The interface type can include, but is not limited to, Executor, StatementHandler, ParameterHandler, and ResultSetHandler. These objects correspond to different stages in the SQL execution process: Executor is used to execute SQL statements, StatementHandler is used to construct and precompile SQL statements, ParameterHandler is used to set SQL parameters, and ResultSetHandler is used to process query results. By selecting different interfaces and methods for interception, obfuscation or recovery logic of this embodiment can be inserted before SQL execution, during parameter setting, during SQL statement construction, or during result set processing.
[0079] In one optional implementation, the persistence layer interceptor can intercept update and query methods in the Executor interface. When an update method is intercepted, before the SQL statement is actually executed, information such as the SQL statement to be executed, parameter objects, and MappedStatement can be obtained. Combined with field configurations, annotations, or data type identification rules, it can be determined whether the current operation involves sensitive fields that need to be obfuscated. If sensitive fields are involved, the obfuscation rule corresponding to the data type of that field in step S102 is called to generate obfuscated data and recovery assistance information. The SQL statement or parameters are then rewritten so that obfuscated data is written to the business fields, while the recovery assistance information is written to an extended field of the same physical table. After the rewriting is complete, the corresponding method of the original object is called through reflection to continue execution, thereby completing the database write operation.
[0080] When a query method is intercepted, the query result set can be retrieved after the query results are returned. The result set can then be used to determine whether it contains obfuscated sensitive fields based on the field configuration. If it does, the recovery rule corresponding to the data type of that field in step S104 is invoked. Based on the recovery auxiliary information stored in the extended fields of the same physical table, the obfuscated data in the query results is recovered to obtain the original sensitive data. This recovered original sensitive data is then returned to the business system. In this way, the business system can obtain the correct original data without being aware of the obfuscation process when reading data.
[0081] In another optional implementation, the persistence layer interceptor can also intercept the preparation methods in the StatementHandler interface to rewrite the SQL statement itself before SQL statement pre-compilation; or intercept the parameter setting methods in the ParameterHandler interface to replace parameter values during the parameter setting phase; or intercept the result set processing methods in the ResultSetHandler interface to restore obfuscated data during the result set mapping phase. The specific interception points selected can be configured based on actual business needs, system performance, and implementation complexity.
[0082] The persistence layer interceptor can obtain the identification information of sensitive fields from annotations, configuration files, or field mapping relationships to determine whether the current field needs to be de-identified and obfuscated. For example, a custom annotation can be added to a field in the entity class. When parsing a MappedStatement or parameter object, the interceptor reads the annotation to determine whether the field is a sensitive field and its corresponding data type. If it is a sensitive field, the corresponding obfuscation rule or recovery rule is further invoked. Since the entire process is completed within the persistence layer framework, the business code does not need to explicitly call the obfuscation or recovery methods, thus providing transparency to the business system and reducing the invasiveness and maintenance costs of system modification.
[0083] By implementing the Intercept interface and adding the @Intercepts annotation using the MyBatis-based persistence layer interceptor, this embodiment of the application can automatically complete the obfuscation of sensitive data and the associated storage of recovery auxiliary information during database write operations, and automatically complete the reverse recovery of obfuscated data based on extended fields during database read operations. Thus, without modifying the business logic code, it can achieve automatic obfuscation and recovery of multiple types of sensitive data in financial business scenarios, taking into account data security, business continuity and system maintainability.
[0084] In some embodiments of this application, the database write operation statements include INSERT statements and / or UPDATE statements; when the persistence layer interceptor intercepts an INSERT or UPDATE statement, it replaces the sensitive field values in the original SQL statement with obfuscated data and adds write operations to the extended fields; the database read operation statements include SELECT statements; when the persistence layer interceptor intercepts a SELECT statement, if the query conditions contain sensitive fields, it replaces the sensitive field values in the query conditions with obfuscated data and executes the query, and restores the obfuscated data in the query results based on the extended fields.
[0085] Specifically, after intercepting an SQL statement, the persistence layer interceptor can first parse the type of the SQL statement. The type of the SQL statement can include write operation statements and read operation statements, where write operation statements can include INSERT statements and / or UPDATE statements, and read operation statements can include SELECT statements. The persistence layer interceptor can determine the type of the currently intercepted SQL statement based on the command keywords of the SQL statement, the configuration information of MappedStatement, or the method signature, and execute the corresponding processing logic accordingly.
[0086] For INSERT and / or UPDATE statements, the persistence layer interceptor can further parse the table names, field names, and parameter values to be written or updated involved in the SQL statement. The persistence layer interceptor can determine whether the current SQL statement contains sensitive fields that need to be obfuscated based on pre-defined sensitive field identification information, such as field annotations, configuration files, and mapping relationships. If sensitive fields are included, the persistence layer interceptor can invoke the obfuscation rule corresponding to the data type of the sensitive field to obfuscate the sensitive field values in the original SQL statement, generating obfuscated data and recovery assistance information for reverse recovery of the original sensitive data. Then, the persistence layer interceptor replaces the sensitive field values in the original SQL statement with the obfuscated data and adds write operations to the extended fields to associate and store the recovery assistance information in the extended fields located in the same physical table as the business fields. For example, for INSERT statements, the persistence layer interceptor can rewrite the original INSERT statement to simultaneously write obfuscated data to the business fields and recovery assistance information to the extended fields. For UPDATE statements, the persistence layer interceptor can add an update operation on the extended fields in the SET clause to write recovery assistance information to the extended fields of the same physical table. After the rewriting is complete, the persistence layer interceptor can use reflection to call the corresponding methods of the original object to continue executing the rewritten SQL statement, thereby completing the database write operation.
[0087] For SELECT statements, the persistence layer interceptor can parse the query conditions of the SELECT statement, such as WHERE clauses and JOIN conditions, and determine whether they contain sensitive fields. If the query conditions contain sensitive fields, the persistence layer interceptor can replace the original sensitive field values in the query conditions with obfuscated data according to the same obfuscation rules as when they were written, and then execute the replaced query statement. Since the database stores obfuscated data, using obfuscated data as query conditions can correctly hit the stored records. After the query is executed, the persistence layer interceptor can obtain the query result set and determine whether the result set contains the obfuscated sensitive fields. If it does, the persistence layer interceptor can use the recovery auxiliary information stored in the extended fields of the same physical table to call the recovery rules that are the opposite of the obfuscation rules to restore the obfuscated data in the query results and obtain the original sensitive data. For example, the persistence layer interceptor can obtain the primary key or row identifier of the same record from the query results, and read the corresponding recovery auxiliary information from the extended fields accordingly, and then perform reverse recovery processing on the obfuscated data. After the recovery is complete, the persistence layer interceptor returns the result set containing the original sensitive data to the business system, so that the business system can obtain the correct data without being aware of the obfuscation process.
[0088] In one alternative implementation, the persistence layer interceptor can replace sensitive field values by modifying the parameter object. For example, when intercepting a ParameterHandler method that sets parameters, the persistence layer interceptor can obtain the currently set parameter value, determine whether the corresponding field is a sensitive field, and if so, replace the parameter value with obfuscated data before passing it to the underlying execution. In another alternative implementation, the persistence layer interceptor can achieve the replacement by modifying the SQL statement. For example, when intercepting a StatementHandler method that prepares a statement, the persistence layer interceptor can obtain the SQL statement to be executed, parse the fields and parameter placeholders, replace the parameter values corresponding to sensitive fields with obfuscated data, or directly add write or update operations to extended fields in the SQL statement.
[0089] Through the above methods, the persistent layer interceptor of this application embodiment can automatically complete the obfuscation of sensitive data and the associated storage of recovery auxiliary information during database write operations, and automatically complete the obfuscation matching of query conditions and the reverse recovery of query results during database read operations. Thus, without modifying the business logic code, it can realize the automatic obfuscation and recovery of multiple types of sensitive data in financial business scenarios, taking into account data security, business continuity and system maintainability.
[0090] In some embodiments of this application, such as Figure 5 As shown, in step S104 above, based on the recovery assistance information stored in the extended field, the read obfuscated data is recovered using a recovery rule that is the opposite of the obfuscation rule, including: Step S501: For data in digital form, read the original approximate position from the extended field, perform a reverse offset operation on the non-check bits, recalculate the check bits, and concatenate to obtain the original data.
[0091] Specifically, when the obfuscated data is in digital form, the persistent layer interceptor or recovery module can read the recovery assistance information corresponding to the record from the extended field of the same physical table. This recovery assistance information includes the original contract position that was replaced before obfuscation. Since the contract position is set to a fixed value to meet the format requirements of financial transactions during obfuscation, it cannot be restored through inverse operations; therefore, it is necessary to directly read the original contract position from the extended field. For example, for obfuscated data "11111175335386500X", the original contract position "441522" is read from the extended field.
[0092] Then, a reverse offset operation is performed on the non-check bits in the obfuscated data. The reverse offset operation is inverse to the fixed offset method adopted during obfuscation. If the method of "adding a preset offset to each digit and then taking modulo 10" is adopted during obfuscation, each digit in the non-check bits can be subtracted by the same preset offset during restoration. If the subtraction result is a negative number, add 10 and then take modulo 10 to obtain the restored digit. For example, when the preset offset is 5, in the obfuscated non-check bit "75335386500", 7 minus 5 is 2, 5 minus 5 is 0, 3 minus 5 is -2, and adding 10 gives 8. Processing in sequence, the restored non-check bit "20880831055" is obtained. This reverse offset operation is reversible, so there is no need to store the original values of the non-check bits in the extended field.
[0093] Next, the check bit is recalculated according to the restored first n-1 bits. For data containing a check bit, the original check bit can be recalculated through the restored first n-1 bits according to the same check rule. For example, for an ID number, the original check bit "X" can be obtained by calculating the restored first 17 bits according to the weighting factor and check code calculation rules specified by the national standard. Finally, the restored original reserved bits, the non-check bits obtained by reverse offset, and the recalculated check bit are spliced according to the original segment order to obtain the original digital form data. For example, splicing "441522", "20880831055" and "X" gives the original data "44152220880831055X". Through the above method, the digital form data can be accurately restored, and the restoration process only relies on the original reserved bits in the extended field, while other parts are obtained through inverse operation, which reduces the storage amount of restoration auxiliary information.
[0094] Step S502: For pure Chinese character name data, read the replaced original Chinese characters from the extended field for restoration.
[0095] Specifically, when the read obfuscated data belongs to pure Chinese character name data, since the first Chinese character is kept unchanged during the obfuscation process, other Chinese characters except the first one are replaced with fixed characters, and the replaced original Chinese characters are stored in the extended field, the replaced original Chinese characters can be read from the extended field of the same physical table during restoration. For example, the obfuscated data is "Zhang Mou Mou", and the replaced original Chinese characters "San Si" are stored in the extended field. During restoration, the fixed character "Mou" in the obfuscated data is sequentially replaced with "San" and "Si" according to the position order, to obtain the original name "Zhang San Si". If the number of replaced Chinese characters and the corresponding original Chinese characters are stored in the extended field, the restoration can be performed in the same way. Since the first Chinese character is not changed during the obfuscation process, there is no need to read the first Chinese character from the extended field, and the first Chinese character in the obfuscated data can be directly retained. Through the above method, the pure Chinese character name data can be accurately restored, and the restoration process is simple and efficient.
[0096] Step S503: For Chinese character data, apply a fixed offset in reverse and restore the original Chinese character by taking the remainder of the maximum code value.
[0097] Specifically, when the obfuscated data is Chinese character data, the obfuscation process employs a reversible operation: converting the Chinese characters to UTF-8 encoding, offsetting by a fixed offset, taking the remainder of the maximum code value of the Chinese character, and then restoring the remainder to the original Chinese character. Therefore, during recovery, the same operation can be applied in reverse to each Chinese character in the obfuscated data. Specifically, the obfuscated Chinese characters are first converted to UTF-8 encoding to obtain their code values; then, they are offset in reverse by the fixed offset used during obfuscation, i.e., the fixed offset is subtracted; if the subtraction result is less than zero, the maximum code value of the Chinese character is added to ensure that the code value falls within the legal range; next, the remainder of the maximum code value of the Chinese character is taken to obtain the original code value; finally, the code value is restored to the corresponding original Chinese character. For example, if the fixed offset during forward obfuscation is 5 and the maximum code value is 0x9FFF, then during recovery, the UTF-8 code value of the obfuscated Chinese character is subtracted by 5; if it is less than 0, 0x9FFF is added, and then the remainder of 0x9FFF is taken to restore the original Chinese character. Because the obfuscation rule is a deterministic and reversible operation, the recovery of Chinese character data does not rely on the recovery assistance information in the extended fields. The corresponding content in the extended fields can be empty, thereby further reducing storage overhead. Using the above method, Chinese character data can be recovered to the original characters, and the recovered data retains the original data format and character type.
[0098] Step S504: For email address data, read the original domain name from the extended field and perform reverse offset recovery on the numbers and letters in the username part respectively.
[0099] Specifically, when the obfuscated data is email address data, the obfuscation process replaces the domain name after the "@" symbol with a preset domain name and stores the original domain name in an extended field. Simultaneously, a fixed offset method is used to obfuscate the purely numeric and / or alphabetic parts of the username before the "@" symbol. Therefore, during recovery, the original domain name can be read from the extended field of the same physical table, and the preset domain name in the obfuscated data can be replaced back with the original domain name. For example, if the obfuscated data is "user123@test.com", and the extended field stores the original domain name "example.com", during recovery, "test.com" is replaced with "example.com" to obtain the email address after domain name recovery.
[0100] For the username portion before the "@" symbol, further reverse offset recovery can be performed based on the character type. For the purely numeric portion, a reverse offset operation is used, which is the opposite of the numeric data. This involves subtracting a preset offset from each digit; if the result is negative, add 10 and take the modulo 10 to obtain the original number. For example, with a preset offset of 5, the obfuscated number "75335" becomes "20880" after reverse offset. For the letter portion, a reverse offset operation is used, which is the opposite of the letter obfuscation. The letters are converted to ASCII codes, subtracted from the preset offset, and if the result exceeds the range of uppercase and lowercase letters, add 26 and take the remainder, finally restoring the corresponding letter. Uppercase and lowercase letters can be processed according to their respective uppercase and lowercase alphabets to ensure the case attributes of the recovered letters are consistent with the original data. Using the above methods, both the domain name and username portions of email address data can be accurately recovered, ultimately yielding the original email address.
[0101] Through steps S501 to S504 described above, this embodiment of the application can perform recovery processing that is the reverse of its obfuscation rules for digital data, pure Chinese name data, Chinese character data, and email address data, respectively. Only the original information that was replaced during the obfuscation process and cannot be directly restored through inverse operations is read from the extended fields; the remaining parts are restored through reversible operations such as inverse offset, modulo, and recalculation. Therefore, while ensuring data security, accurate and efficient recovery of multiple types of sensitive data is achieved, ensuring the availability, consistency, and recoverability of data in financial business scenarios.
[0102] like Figure 6 The diagram shown is a structural schematic of a multi-type sensitive data obfuscation processing system for financial business scenarios provided in an embodiment of this application. The system includes: The data acquisition and segmentation unit 610 is used to acquire sensitive data to be processed in financial business scenarios and to segment the sensitive data to be processed into multiple data types according to the data format.
[0103] The data obfuscation unit 620 is used to perform desensitization and obfuscation processing on different data types according to the divided data types, using their corresponding obfuscation rules to obtain obfuscated data, and to generate recovery auxiliary information for reverse recovery of the original sensitive data. The obfuscation rules are configured to ensure that the obfuscated data maintains the same data format and character type as the original sensitive data without increasing the data length. When the original sensitive data contains a check bit, the check bit is recalculated based on the obfuscated data to ensure that the obfuscated data meets the financial business format verification requirements corresponding to that data type. The recovery auxiliary information includes original information that was replaced during the obfuscation process and cannot be directly restored through inverse operations.
[0104] The write operation processing unit 630 is used to intercept database write operation statements, so as to write the obfuscated data into the corresponding business field during the write operation, and to associate and store the recovery auxiliary information in an extended field located in the same physical table as the business field.
[0105] The read operation processing unit 640 is used to intercept database read operation statements when data needs to be read or recovered, and to recover the read obfuscated data by using a recovery rule that is the opposite of the obfuscation rule based on the recovery auxiliary information stored in the extended field, so as to obtain the original sensitive data.
[0106] For a detailed description of each of the above units, please refer to the corresponding descriptions in the foregoing method embodiments, which will not be repeated here.
[0107] This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described method.
[0108] This application also provides a computer-readable storage medium storing a computer program that performs the above-described methods.
[0109] This application also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the above-described method.
[0110] It should be noted that the electronic device, computer-readable storage medium, and computer program product provided in the embodiments of this application specifically implement the above steps S101-S104.
[0111] like Figure 7 As shown, the electronic device 600 may also include: a communication module 110, an input unit 120, an audio processor 130, a display 160, and a power supply 170. It is worth noting that the electronic device 600 does not necessarily need to include these components. Figure 7 All components shown; in addition, electronic device 600 may also include Figure 7 The components shown can be referenced in the prior art.
[0112] like Figure 7 As shown, the central processing unit 100, sometimes also referred to as a controller or operating control, may include a microprocessor or other processor device and / or logic device. The central processing unit 100 receives inputs and controls the operation of various components of the electronic device 600.
[0113] The memory 140 may be, for example, one or more of a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It may store the aforementioned failure-related information, and also store a program for executing that information. The central processing unit 100 may execute the program stored in the memory 140 to perform information storage or processing, etc.
[0114] Input unit 120 provides input to central processing unit 100. Input unit 120 may be, for example, a keypad or touch input device. Power supply 170 provides power to electronic device 600. Display 160 displays images and text. Display may be, for example, an LCD display, but is not limited thereto.
[0115] The memory 140 can be a solid-state memory, such as a read-only memory (ROM), random access memory (RAM), a SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and contains more data; examples of this type of memory are sometimes referred to as EPROMs. The memory 140 can also be some other type of device. The memory 140 includes a buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application / function storage unit 142 for storing application and function programs or processes for executing the operation of the electronic device 600 via the central processing unit 100.
[0116] The memory 140 may also include a data storage unit 143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 144 of the memory 140 may include various drivers for the electronic device for communication functions and / or for performing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0117] The communication module 110 is a transmitter / receiver that sends and receives signals via the antenna 111. The communication module (transmitter / receiver) is coupled to the central processing unit 100 to provide input signals and receive output signals, which can be the same as in a conventional mobile communication terminal.
[0118] Based on different communication technologies, multiple communication modules 110 can be configured in the same electronic device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication modules (transmitters / receivers) are also coupled to a speaker 131 and a microphone 132 via an audio processor 130 to provide audio output via the speaker 131 and receive audio input from the microphone 132, thereby enabling typical telecommunications functions. The audio processor 130 may include any suitable buffer, decoder, amplifier, etc. Additionally, the audio processor 130 is coupled to a central processing unit 100, enabling on-device recording via the microphone 132 and on-device playback of stored audio via the speaker 131.
[0119] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0120] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0121] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0122] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0123] This application uses specific embodiments to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A multi-type sensitive data obfuscation processing method for a financial service scenario, characterized in that, The method includes: Acquire sensitive data to be processed in financial business scenarios, and classify the sensitive data to be processed into multiple data types according to the data format; Based on the defined data types, different data types are subjected to desensitization and obfuscation processing using their corresponding obfuscation rules to obtain obfuscated data. Recovery auxiliary information for reverse recovery of the original sensitive data is then generated. The obfuscation rules are configured to ensure that the obfuscated data maintains the same data format and character type as the original sensitive data without increasing the data length. Furthermore, when the original sensitive data contains check bits, the check bits are recalculated based on the obfuscated data to ensure that the obfuscated data meets the financial business format verification requirements corresponding to that data type. The recovery auxiliary information includes original information that was replaced during the obfuscation process and cannot be directly restored through inverse operations. Intercept database write operation statements to write the obfuscated data into the corresponding business field during the write operation, and store the recovery assistance information in an extended field located in the same physical table as the business field; When data needs to be read or recovered, the database read operation statement is intercepted, and the original sensitive data is recovered by using a recovery rule that is the opposite of the obfuscation rule, based on the recovery auxiliary information stored in the extended field.
2. The method for obfuscating multiple types of sensitive data in financial business scenarios as described in claim 1, characterized in that, The data types include numeric data, pure Chinese name data, Chinese character data, and email address data.
3. The method for obfuscating multiple types of sensitive data in financial business scenarios as described in claim 2, characterized in that, For the digital data, the corresponding obfuscation rules are used for desensitization and obfuscation processing to obtain obfuscated data, including: The digital data is split into the original approximate position, the non-check bit, and the check bit; The original approximation location is stored as recovery auxiliary information in the extended field, and the approximation location in the obfuscated data is set to a fixed value that meets the format requirements of financial business. The non-check bits are obfuscated using a fixed offset method; Recalculate the check bits based on the first n-1 bits after confusing; The processed approximate bit, the obfuscated non-check bit, and the recalculated check bit are concatenated to obtain obfuscated data.
4. The method for obfuscating multiple types of sensitive data in financial business scenarios as described in claim 2, characterized in that, For the pure Chinese character name data, the corresponding obfuscation rules are used for desensitization and obfuscation processing to obtain obfuscated data, including: The first Chinese character is kept unchanged, and all other Chinese characters except the first one are replaced with fixed characters. The original Chinese characters that were replaced are stored as recovery auxiliary information in the extended field.
5. The method for obfuscating multiple types of sensitive data in financial business scenarios as described in claim 2, characterized in that, For the Chinese character data, the corresponding obfuscation rules are used for desensitization and obfuscation processing to obtain obfuscated data, including: Convert the Chinese character data to UTF-8 encoding; Offset the UTF-8 code value by a fixed offset; Take the remainder of the largest code value of a Chinese character; The remainder value is restored to the corresponding Chinese character to obtain the confused data.
6. The method for obfuscating multiple types of sensitive data in financial business scenarios as described in claim 2, characterized in that, For the email address data, the corresponding obfuscation rules are used for de-identification and obfuscation processing to obtain obfuscated data, including: Replace the domain name after the @ symbol with the preset domain name, and store the original domain name as recovery auxiliary information in the extended field; The pure numeric or alphanumeric part before the @ symbol is obfuscated using a fixed offset method.
7. The method for obfuscating multiple types of sensitive data in financial business scenarios as described in claim 1, characterized in that, The interception of database write operation statements and the interception of database read operation statements specifically include: By implementing the Intercept interface and adding the @Intercepts annotation in the MyBatis persistence layer interceptor, SQL statements can be intercepted.
8. The method for obfuscating multiple types of sensitive data in financial business scenarios as described in claim 1, characterized in that, The step of recovering the read obfuscated data based on the recovery assistance information stored in the extended field and using a recovery rule that is the opposite of the obfuscation rule includes: For data in digital form, the original approximate position is read from the extended field, the non-check bits are reversed, the check bits are recalculated, and the original data is obtained by concatenation. For names consisting entirely of Chinese characters, the original Chinese characters that were replaced are read from the extended field and restored. For Chinese character data, apply a fixed offset in reverse and then take the remainder of the maximum code value to restore the original Chinese character; For email address data, the original domain name is read from the extended field, and reverse offset recovery is performed on the numbers and letters in the username part respectively.
9. A multi-type sensitive data obfuscation processing system for financial business scenarios, characterized in that, The system includes: The data acquisition and segmentation unit is used to acquire sensitive data to be processed in financial business scenarios and to segment the sensitive data to be processed into multiple data types according to the data format. The data obfuscation unit is used to perform desensitization and obfuscation processing on different data types according to the defined data types, using their corresponding obfuscation rules to obtain obfuscated data, and to generate recovery assistance information for reverse recovery of the original sensitive data. The obfuscation rules are configured to ensure that the obfuscated data maintains the same data format and character type as the original sensitive data without increasing the data length. When the original sensitive data contains a checksum, the checksum is recalculated based on the obfuscated data to ensure that the obfuscated data meets the financial business format verification requirements corresponding to that data type. The recovery assistance information includes original information that was replaced during the obfuscation process and cannot be directly restored through inverse operations. A write operation processing unit is used to intercept database write operation statements, so as to write the obfuscated data into the corresponding business field during the write operation, and to associate and store the recovery auxiliary information in an extended field located in the same physical table as the business field; The read operation processing unit is used to intercept database read operation statements when data needs to be read or recovered, and to recover the obfuscated data by using a recovery rule that is the opposite of the obfuscation rule, based on the recovery auxiliary information stored in the extended field, so as to obtain the original sensitive data.
10. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 8.
