Method and device for realizing integrity protection of sensitive data of database

By identifying sensitive data in the database and using SM3 hash algorithm and MAC value verification, the problem of database sensitive data being tampered with in the dynamic process is solved, real-time monitoring and visual management of data integrity are realized, and the security and management efficiency of the system are improved.

CN120449215AActive Publication Date: 2025-08-08BEIJING ZHONGAN NEBULA SOFTWARE TECH CO LTD

Patent Information

Application Number
CN202510529063.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-08-08
Estimated Expiration
2045-04-25

AI Technical Summary

Technical Problem

The prior art cannot monitor in real time whether the database sensitive data has been tampered with during dynamic addition, modification or deletion, resulting in data integrity and security that cannot be effectively protected.

Method used

The encryption system identifies the sensitive data of the key columns in the target database, configures integrity protection, uses the SM3 hash algorithm to calculate the summary value and MAC value, and the proxy connects to access the data, and compares the consistency of the MAC value of the sensitive information, and displays the results on the web page.

Benefits of technology

It realizes accurate protection of database sensitive data, improves the reliability of data integrity verification and user management efficiency, and enhances the security and credibility of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120449215A_ABST
    Figure CN120449215A_ABST
Patent Text Reader

Abstract

The invention discloses a method and device for realizing integrity protection of sensitive data of a database, and belongs to the technical field of database security, and the method comprises the following steps: identifying sensitive data of a key column of a data table in a target database through an encryption system, and recording the sensitive data as key data; integrity protection is configured for the key data, and a digital signature is applied; the method comprises the following steps: calculating an abstract value of key data by using an SM3 hash algorithm, and calculating related sensitive information of the current key data and an MAC value of a system key at the same time; the database service system accesses the key data through the proxy connection of the encryption system, data modification or new data insertion is carried out, that is, a service user carries out data entry and storage; the encryption system compares whether the MAC value of the related sensitive information of the current key data is consistent with the MAC value of the related sensitive information of the last key data, and returns a comparison result to the system; and displaying a data state corresponding to a comparison result returned by the system on a system web page.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of database security technology, and in particular to a method and device for implementing integrity protection of sensitive data in a database. Background Art

[0002] In modern information systems, data is a vital asset, and its security and integrity are crucial. Existing technologies typically only perform static integrity checks on data, failing to monitor in real time whether data has been tampered with during dynamic additions, modifications, or deletions. This limitation makes it difficult to effectively protect data integrity and security during data flow and sharing. Summary of the Invention

[0003] The purpose of the present invention is to overcome the deficiencies of the prior art and provide a method and apparatus for protecting the integrity of sensitive data in a database, so as to solve the problems raised in the above background technology.

[0004] The purpose of the present invention can be achieved through the following technical solution: A method for protecting the integrity of sensitive data in a database, comprising:

[0005] S1. The encryption system identifies sensitive data in key columns of data tables in the target database and records it as key data; configures integrity protection for the key data and applies for a digital signature;

[0006] S2. Use the SM3 hash algorithm to calculate the summary value of the key data, and at the same time calculate the relevant sensitive information of the current key data and the MAC value of the system key;

[0007] S3. The database business system accesses key data through the proxy connection of the encryption system to modify data or insert new data. That is, the business user enters and saves data.

[0008] S4. The encryption system compares the MAC values of the sensitive information related to the current key data with the sensitive information related to the most recent key data to see if they are consistent, and returns the comparison result to the system;

[0009] S5 displays the data status corresponding to the comparison result returned by the system on the system web page.

[0010] Preferably, in S1, it includes:

[0011] Based on the architecture and structure of the target database, obtain the schema information of the target database, including the structure of each data table, field definition, data type, and the relationship between tables;

[0012] The target database's schema information is judged for sensitive information, and the schema information is matched with the preset sensitive information. If the match is successful, the corresponding schema information is recorded as sensitive data, and the column where the sensitive data is located is recorded as the key column, and the sensitive data of the key column is obtained; if the match fails, it means that the corresponding schema information is not sensitive data;

[0013] Among them, the preset sensitive information includes personal privacy information and protected health information.

[0014] Preferably, in S1, it further includes:

[0015] Based on the identified critical data, configure integrity protection for the critical data, including: stipulating that only authorized users or applications can access and modify critical data, and strictly recording and auditing each access and modification operation;

[0016] When applying for a digital signature, the encryption system generates a pair of public and private keys. When other users or systems need to verify the integrity of critical data, they use the public key to verify the digital signature. If the verification passes, it means that the data has maintained integrity during transmission and storage and has not been tampered with.

[0017] Among them, the private key is held by the data owner or authorized management agency and is used to sign key data; the public key is publicly released and used to verify the validity of the signature.

[0018] Preferably, in S2, it includes:

[0019] Call the SM3 hash algorithm, group the key data according to the preset length, perform hash operation on each group, expand each group through message expansion, generate several intermediate variables, and use the compression function to perform multiple iterative operations on the intermediate variables to obtain a hash value of fixed length, that is, the summary value of the key data.

[0020] Preferably, in S2, the method further includes:

[0021] Obtain information from other columns or data tables related to key data and record it as sensitive information related to the key data;

[0022] Using the system key provided by the encryption system, the relevant sensitive information of the current key data is combined with the system key, and the HMAC algorithm is used to encrypt the combined data to generate the corresponding MAC value.

[0023] Preferably, S3 includes:

[0024] When a database business system accesses critical data, it establishes a connection through the encryption system's proxy. When establishing the connection, the proxy requires the business system to provide corresponding identity authentication information. Only business systems that pass the identity authentication can continue to access the critical data.

[0025] Once identity authentication is passed, the business system modifies key data or inserts new data through the agent, that is, the business user enters data;

[0026] When performing data modification operations, the business system will update existing key data according to business needs and issue a modification request. The agent will strictly verify and check the modification request to ensure that the modification operation complies with business rules and permission requirements. If the modification request passes the verification and inspection, the agent will forward the modification request to the database for the actual data modification operation.

[0027] When new data is inserted, the business system submits the new data record to the agent and issues an insert request. The agent verifies and checks the insert request. If the insert request passes the verification, the agent inserts the new data record into the corresponding position in the database.

[0028] Preferably, in S4, the following steps are included:

[0029] Retrieve sensitive information related to the current key data and the most recent key data from the target database;

[0030] Use the same system key and HMAC algorithm to calculate the MAC values of the sensitive information related to the current key data and the sensitive information related to the most recent key data;

[0031] Compare the two MAC values to see if they are consistent. If they are consistent, the comparison result is identical; if they are inconsistent, the comparison result is different.

[0032] Here, the same or different constitutes the comparison result.

[0033] Preferably, in S5, the following steps are included:

[0034] If the comparison result is the same, it means that the sensitive information related to the current key data has not been tampered with, and the encryption system web page displays the protection status; if the comparison result is different, it means that the sensitive information related to the current key data has been tampered with, and the encryption system web page displays the data has been tampered with.

[0035] In order to solve the above problems, the present invention further provides a device for implementing integrity protection of sensitive data in a database, comprising:

[0036] The proxy connection database service module serves as an interface for interacting with the target database and is used to establish a connection channel with the target database;

[0037] Call the SM3 hash algorithm module, which calculates the summary value of the key data by using the SM3 hash algorithm, and also calculates the MAC value of the relevant sensitive information of the current key data and the system key;

[0038] Key service module, which is used to store the system key for MAC verification, including using the key storage mechanism to store and manage the system key, and providing the system key to the SM3 hash algorithm module for MAC calculation as needed;

[0039] MAC value comparison module, which compares the MAC values of the sensitive information related to the current key data with the sensitive information related to the most recent key data to see if they are consistent, and returns the comparison result to the system;

[0040] The page display module displays the data status corresponding to the comparison result returned by the system on the system web page.

[0041] Compared with the existing solutions, the present invention achieves the following beneficial effects:

[0042] By identifying and marking sensitive data in key columns of the target database, the present invention can accurately locate the data that needs to be protected, thus avoiding the waste of resources and low efficiency caused by the traditional method of indiscriminately protecting all data.

[0043] The present invention uses the SM3 hash algorithm to calculate the summary value of key data and the MAC value of related sensitive information and system keys, providing a reliable basis for data integrity verification. The SM3 algorithm has high security and collision resistance, can effectively resist various attacks, and ensure the integrity of data during transmission and storage;

[0044] The present invention displays the data status corresponding to the comparison result returned by the system on the system web page, allowing users to intuitively understand the integrity of sensitive data in the database. This visual management method facilitates users to monitor and manage data and improves management efficiency.

[0045] In summary, the method and device provided by the present invention for realizing integrity protection of sensitive data in a database have the beneficial effects of improving data integrity protection capabilities, timely detecting data tampering behaviors, enhancing users' visual management of data status, and improving the security and credibility of the system. It can effectively solve the problems existing in the prior art and provide a reliable solution for the security protection of sensitive data in a database. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The present invention will be further described below with reference to the accompanying drawings.

[0047] Figure 1 This is a flowchart of a method for implementing integrity protection of sensitive data in a database proposed by the present invention.

[0048] Figure 2 This is a module structure diagram of a device for implementing integrity protection of sensitive data in a database proposed by the present invention. DETAILED DESCRIPTION

[0049] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0050] Example 1, as Figure 1 As shown, the present invention is a method for implementing integrity protection of sensitive data in a database, comprising the following steps:

[0051] S1. The encryption system identifies sensitive data in key columns of data tables in the target database and records it as key data; configures integrity protection for the key data and applies for a digital signature;

[0052] S2. Use the SM3 hash algorithm to calculate the summary value of the key data, and at the same time calculate the relevant sensitive information of the current key data and the MAC value of the system key;

[0053] S3. The database business system accesses key data through the proxy connection of the encryption system to modify data or insert new data. That is, the business user enters and saves data.

[0054] S4. The encryption system compares the MAC values of the sensitive information related to the current key data with the sensitive information related to the most recent key data to see if they are consistent, and returns the comparison result to the system;

[0055] S5. Display the data status corresponding to the comparison result returned by the system on the system web page.

[0056] It should be further explained that, in a specific implementation process, the encryption system identifies sensitive data in key columns of a data table in a target database and records the data as key data in the following process:

[0057] Based on the architecture and structure of the target database, obtain the schema information of the target database, including the structure of each data table, field definition, data type, and the relationship between tables;

[0058] The target database's schema information is judged for sensitive information, and the schema information is matched with the preset sensitive information. If the match is successful, the corresponding schema information is recorded as sensitive data, and the column where the sensitive data is located is recorded as the key column, and the sensitive data of the key column is obtained; if the match fails, it means that the corresponding schema information is not sensitive data;

[0059] Among them, the preset sensitive information includes personal privacy information and protected health information; for example, in the user information table, fields such as the user's ID number, bank card number, and password are considered sensitive information;

[0060] It should be further explained that, in the specific implementation process, the process of configuring integrity protection for key data and applying for digital signatures includes:

[0061] Based on the identified critical data, configure integrity protection for the critical data, including: stipulating that only authorized users or applications can access and modify critical data, and strictly recording and auditing each access and modification operation;

[0062] When applying for a digital signature, the encryption system generates a pair of public and private keys. When other users or systems need to verify the integrity of critical data, they use the public key to verify the digital signature. If the verification passes, it means that the data has maintained integrity during transmission and storage and has not been tampered with.

[0063] The private key is held by the data owner or authorized management agency and is used to sign key data; the public key is publicly released and used to verify the validity of the signature;

[0064] In the steps of the present invention, digital signature is an identity authentication and data integrity verification method based on encryption technology. By using digital signature, it is ensured that the source of key data is reliable and has not been tampered with during transmission and storage;

[0065] It should be further explained that, in a specific implementation process, the process of using the SM3 hash algorithm to calculate the summary value of the key data includes:

[0066] The SM3 hashing algorithm is called to group the key data into groups according to a preset length. A hash operation is performed on each group, and each group is expanded through message expansion to generate several intermediate variables. The intermediate variables are then iterated multiple times using a compression function to obtain a hash value of a fixed length, i.e., the summary value of the key data. The preset length is a fixed number of bits divided into each group according to actual application requirements.

[0067] It should be noted that the SM3 hash algorithm is a cryptographic hash function issued by the State Cryptography Administration and is suitable for digital signatures and verification in commercial cryptographic applications;

[0068] The summary value of the key data serves as the unique identifier or fingerprint of the key data. It is unique, that is, different input data will produce different summary values, and the key data cannot be deduced from the summary value alone;

[0069] It should be further explained that, in a specific implementation process, the process of calculating the MAC value of the relevant sensitive information of the current key data and the system key includes:

[0070] Obtain information from other columns or data tables related to the key data and record it as related sensitive information of the key data; for example, if the key data is the user's bank account number, then the related sensitive information may include the user's name, address, and phone number;

[0071] Using the system key provided by the encryption system, the relevant sensitive information of the current key data is combined with the system key, and the HMAC algorithm is used to encrypt the combined data to generate the corresponding MAC value;

[0072] It should be noted that HMAC (Hash-based Message Authentication Code) is a message authentication code based on a hash function;

[0073] MAC (Message Authentication Code) is a message authentication code that is generated by encrypting a specific portion of the data (such as sensitive information related to key data) and the system key;

[0074] It should be further explained that, in the specific implementation process, the database business system accesses key data through the proxy connection of the encryption system to modify data or insert new data, that is, the business user enters data and saves the data, which includes:

[0075] When a database business system accesses critical data, a connection is established through the encryption system's proxy. The proxy acts as an intermediary between the business system and the target database, responsible for verifying and forwarding the business system's access requests.

[0076] When establishing a connection, the proxy requires the business system to provide corresponding identity authentication information. Only the business system that passes the identity authentication can continue to access key data; the identity authentication information includes but is not limited to user name, password, and digital certificate;

[0077] Once identity authentication is passed, the business system modifies key data or inserts new data through the agent, that is, the business user enters data;

[0078] When performing data modification operations, the business system will update existing key data based on business needs and issue a modification request. For example, when a user's personal information changes, the business system needs to promptly update the corresponding record in the database. The proxy strictly verifies and checks the modification request to ensure that the modification operation complies with business rules and permission requirements. If the modification request passes the verification and inspection, the proxy will forward the modification request to the database for the actual data modification operation.

[0079] When inserting new data, the business system submits the new data record to the agent and issues an insert request. The agent verifies and checks the insert request, including but not limited to checking the format, integrity, and legitimacy of the data. For example, for user registration information, the agent checks whether the username complies with the specifications and whether the password meets the strength requirements. If the insert request passes the verification, the agent inserts the new data record into the corresponding location in the database.

[0080] It should be further explained that, in a specific implementation process, the encryption system compares the MAC values of the sensitive information related to the current key data with the sensitive information related to the most recent key data to see if they are consistent, and returns the comparison result to the system, including the following process:

[0081] Retrieve sensitive information related to the current key data and the most recent key data from the target database;

[0082] Use the same system key and HMAC algorithm to calculate the MAC values of the sensitive information related to the current key data and the sensitive information related to the most recent key data;

[0083] Compare the two MAC values to see if they are consistent. If they are consistent, the comparison result is identical; if they are inconsistent, the comparison result is different.

[0084] Among them, sameness or difference constitutes the comparison result;

[0085] It should be further explained that, in a specific implementation process, the process of displaying the data status corresponding to the comparison result returned by the system on the system web page includes:

[0086] If the comparison result is the same, it means that the sensitive information related to the current key data has not been tampered with, and the encryption system web page displays the protection status; if the comparison result is different, it means that the sensitive information related to the current key data has been tampered with, and the encryption system web page displays the data has been tampered with.

[0087] Example 2, as Figure 2 As shown, the present invention is a device for implementing integrity protection of sensitive data in a database, comprising:

[0088] The proxy connection database service module serves as an interface for interacting with the target database and is used to establish a connection channel with the target database;

[0089] Call the SM3 hash algorithm module, which calculates the summary value of the key data by using the SM3 hash algorithm, and also calculates the MAC value of the relevant sensitive information of the current key data and the system key;

[0090] Key service module, which is used to store the system key for MAC verification, including using the key storage mechanism to store and manage the system key, and providing the system key to the SM3 hash algorithm module for MAC calculation as needed;

[0091] MAC value comparison module, which compares the MAC values of the sensitive information related to the current key data with the sensitive information related to the most recent key data to see if they are consistent, and returns the comparison result to the system;

[0092] The page display module displays the data status corresponding to the comparison result returned by the system on the system web page.

[0093] In the several embodiments provided by the present invention, it should be understood that the disclosed system can be implemented in other ways. For example, the embodiments of the invention described above are merely illustrative. For example, the division of modules is only a logical function division, and other division methods may be used in actual implementation.

[0094] Modules described as separate components may or may not be physically separate, and components displayed as modules may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these modules may be selected to achieve the purpose of this embodiment based on actual needs.

[0095] In addition, the functional modules in various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or hardware plus software functional modules.

[0096] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for implementing integrity protection of sensitive data in a database, characterized in that: The following steps are involved: S1. The encryption system identifies sensitive data in key columns of data tables in the target database and records it as key data; configures integrity protection for the key data and applies for a digital signature; S2. Use the SM3 hash algorithm to calculate the summary value of the key data, and at the same time calculate the relevant sensitive information of the current key data and the MAC value of the system key; S3. The database business system accesses key data through the proxy connection of the encryption system to modify data or insert new data. That is, the business user enters and saves data. S4. The encryption system compares the MAC values of the sensitive information related to the current key data with the sensitive information related to the most recent key data to see if they are consistent, and returns the comparison result to the system; S5. Display the data status corresponding to the comparison result returned by the system on the system web page.

2. A method for implementing integrity protection of sensitive data in a database according to claim 1, characterized in that: In S1, including: Based on the architecture and structure of the target database, obtain the schema information of the target database, including the structure of each data table, field definition, data type, and the relationship between tables; The target database's schema information is judged for sensitive information, and the schema information is matched with the preset sensitive information. If the match is successful, the corresponding schema information is recorded as sensitive data, and the column where the sensitive data is located is recorded as the key column, and the sensitive data of the key column is obtained; if the match fails, it means that the corresponding schema information is not sensitive data; Among them, the preset sensitive information includes personal privacy information and protected health information.

3. A method for implementing integrity protection of sensitive data in a database according to claim 2, characterized in that: In S1, also included: Based on the identified critical data, configure integrity protection for the critical data, including: stipulating that only authorized users or applications can access and modify critical data, and strictly recording and auditing each access and modification operation; When applying for a digital signature, the encryption system generates a pair of public and private keys. When other users or systems need to verify the integrity of critical data, they use the public key to verify the digital signature. If the verification passes, it means that the data has maintained integrity during transmission and storage and has not been tampered with. Among them, the private key is held by the data owner or authorized management agency and is used to sign key data; the public key is publicly released and used to verify the validity of the signature.

4. A method for implementing integrity protection of sensitive data in a database according to claim 3, characterized in that: In S2, including: Call the SM3 hash algorithm, group the key data according to the preset length, perform hash operation on each group, expand each group through message expansion, generate several intermediate variables, and use the compression function to perform multiple iterative operations on the intermediate variables to obtain a hash value of fixed length, that is, the summary value of the key data.

5. A method for implementing integrity protection of sensitive data in a database according to claim 4, characterized in that: In S2, it also includes: Obtain information from other columns or data tables related to key data and record it as sensitive information related to the key data; Using the system key provided by the encryption system, the relevant sensitive information of the current key data is combined with the system key, and the HMAC algorithm is used to encrypt the combined data to generate the corresponding MAC value.

6. A method for implementing integrity protection of sensitive data in a database according to claim 5, characterized in that: In S3, this includes: When a database business system accesses critical data, it establishes a connection through the encryption system's proxy. When establishing the connection, the proxy requires the business system to provide corresponding identity authentication information. Only business systems that pass the identity authentication can continue to access the critical data. Once identity authentication is passed, the business system modifies key data or inserts new data through the agent, that is, the business user performs data entry; When performing data modification operations, the business system will update existing key data according to business needs and issue a modification request. The agent will strictly verify and check the modification request to ensure that the modification operation complies with business rules and permission requirements. If the modification request passes the verification and inspection, the agent will forward the modification request to the database for the actual data modification operation. When new data is inserted, the business system submits the new data record to the agent and issues an insert request. The agent verifies and checks the insert request. If the insert request passes the verification, the agent inserts the new data record into the corresponding position in the database.

7. A method for implementing integrity protection of sensitive data in a database according to claim 6, characterized in that: In S4, it includes: Retrieve sensitive information related to the current key data and the most recent key data from the target database; Use the same system key and HMAC algorithm to calculate the MAC values of the sensitive information related to the current key data and the sensitive information related to the most recent key data; Compare the two MAC values to see if they are consistent. If they are consistent, the comparison result is identical; if they are inconsistent, the comparison result is different. Here, the same or different constitutes the comparison result.

8. A method for implementing integrity protection of sensitive data in a database according to claim 7, characterized in that: In S5, it includes: If the comparison result is the same, it means that the sensitive information related to the current key data has not been tampered with, and the encryption system web page displays the protection status; if the comparison result is different, it means that the sensitive information related to the current key data has been tampered with, and the encryption system web page displays the data has been tampered with.

9. A device for implementing integrity protection of sensitive data in a database, applying the method for implementing integrity protection of sensitive data in a database as claimed in any one of claims 1 to 8, characterized in that: include: The proxy connection database service module serves as an interface for interacting with the target database and is used to establish a connection channel with the target database; Call the SM3 hash algorithm module, which calculates the summary value of the key data by using the SM3 hash algorithm, and also calculates the MAC value of the relevant sensitive information of the current key data and the system key; Key service module, which is used to store the system key for MAC verification, including using the key storage mechanism to store and manage the system key, and providing the system key to the SM3 hash algorithm module for MAC calculation as needed; MAC value comparison module, which compares the MAC values of the sensitive information related to the current key data with the sensitive information related to the most recent key data to see if they are consistent, and returns the comparison result to the system; The page display module displays the data status corresponding to the comparison result returned by the system on the system web page.

Citation Information

Patent Citations

  • Credible database integrity protecting method and system

    CN104615947A

  • Mysql database storage integrity check protection method and device

    CN110647771A

  • Sensitive information processing method and device, storage medium and equipment

    CN111104691A

  • Block chain data desensitization and traceability storage method and device

    CN111538786A

  • Sensitive data access method and device, computer equipment and storage medium

    CN112597481A

Cited By

  • Database integrity protection method and device, equipment and storage medium

    CN121365430A