A method and apparatus for implementing database sensitive data integrity protection

By identifying sensitive data in key columns of the database and using the SM3 hash algorithm and MAC value verification, the problem of protecting the integrity of sensitive data in the database during dynamic processes is solved, achieving efficient data integrity management and security improvement.

CN120449215BActive Publication Date: 2026-01-23BEIJING ZHONGAN NEBULA SOFTWARE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing technologies cannot monitor and protect the integrity and security of sensitive database data in real time during dynamic processes, resulting in ineffective protection of data during flow and sharing.

Method used

By identifying sensitive data in key columns of the target database, configuring integrity protection, using the SM3 hash algorithm to calculate digest values ​​and MAC values, using an encrypted system proxy connection to access and modify data, and comparing the consistency of MAC values ​​of sensitive information in real time, the results are displayed on a web page.

Benefits of technology

It achieves precise protection of sensitive data in the database, improves the reliability and security of data integrity verification, enhances users' visual management of data status, and improves management efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120449215B_ABST
    Figure CN120449215B_ABST
Patent Text Reader

Abstract

The application discloses a kind of method and device for realizing database sensitive data integrity protection, belong to database security technical field, comprising: by encryption system, the sensitive data of data table key column in target database is identified, and is recorded as key data;Integrity protection is configured to key data, and digital signature is applied for;By using SM3 hash algorithm, the digest value of key data is calculated, and the MAC value of the related sensitive information of current key data and system key is calculated;Database business system accesses key data by the proxy connection of encryption system, and the modification or new data insertion of data is carried out, i.e. business user carries out data entry, and saves;Encryption system compares whether the MAC value of the related sensitive information of current key data and the related sensitive information of last key data is consistent, and returns comparison result to system;The data state corresponding to the comparison result returned by system is displayed on system web page.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of database security, and particularly relates to a method and device for realizing integrity protection of sensitive data of a database. BACKGROUND

[0002] In modern information systems, data as an important asset, its security and integrity is crucial. The prior art can only perform static integrity checking on data, and cannot monitor whether the data is tampered with in the process of dynamic increase, modification or deletion in real time. This limitation leads to the fact that the integrity and security of data cannot be effectively protected when the data flows and shares. SUMMARY

[0003] The present application aims to overcome the deficiencies of the prior art, and provides a method and device for realizing integrity protection of sensitive data of a database, so as to solve the problems proposed in the background.

[0004] The object of the present application can be achieved by the following technical solutions: a method for realizing integrity protection of sensitive data of a database, comprising:

[0005] S1, an encryption system identifies sensitive data of a key column of a data table in a target database, and the sensitive data is recorded as key data; the key data is configured with integrity protection, and a digital signature is applied;

[0006] S2, an SM3 hash algorithm is used to calculate a digest value of the key data, and a MAC value of related sensitive information of the current key data and a system key is calculated;

[0007] S3, a database business system accesses the key data through a proxy connection of the encryption system, and modifies or inserts new data, that is, a business user enters data and saves;

[0008] S4, the encryption system compares whether the MAC values of the related sensitive information of the current key data and the related sensitive information of the last key data are consistent, and returns a comparison result to the system;

[0009] S5, a data state corresponding to the comparison result returned by the system is displayed on a web page of the system.

[0010] Preferably, in S1, it comprises:

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

[0012] Sensitive information judgment is performed on the schema information of the target database, the schema information is matched with preset sensitive information, if the matching is successful, the corresponding schema information is recorded as sensitive data, and the column where the sensitive data is located is recorded as a key column, and the sensitive data of the key column is obtained; if the matching fails, it indicates that the corresponding schema information is not sensitive data.

[0013] The preset sensitive information includes personal privacy information and protected health information.

[0014] Preferably, in S1, further comprising:

[0015] Based on the identified key data, configuring integrity protection for the key data includes specifying that only authorized users or applications can access and modify the key 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 the key data, the public key is used to verify the digital signature, and if the verification is passed, it means that the data has maintained its integrity during transmission and storage and has not been tampered with;

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

[0018] Preferably, in S2, comprising:

[0019] The SM3 hash algorithm is called, the key data is grouped according to a preset length, hash operation is performed on each group, each group is expanded through message expansion, a plurality of intermediate variables are generated, and the intermediate variables are iterated a plurality of times using a compression function to obtain a hash value of a fixed length, i.e. the digest value of the key data.

[0020] Preferably, in S2, further comprising:

[0021] Obtain information related to the key data in other columns or data tables, which is recorded as related sensitive information of the key data;

[0022] The related sensitive information of the current key data is combined with the system key using the system key provided by the encryption system, and the combined data is encrypted using the HMAC algorithm to generate a corresponding MAC value.

[0023] Preferably, in S3, comprising:

[0024] When the database business system accesses the key data, a connection is established through the agent of the encryption system; when the connection is established, the agent requires the business system to provide corresponding identity authentication information, and only the business system that passes the identity authentication can continue to access the key data;

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

[0026] When the data modification operation is performed, the business system updates the existing key data according to the business requirement and issues a modification request; the agent strictly verifies and checks the modification request to ensure that the modification operation meets the business rules and permission requirements, and if the modification request passes the verification and checking, the agent forwards the modification request to the database for actual data modification operation;

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

[0028] Preferably, in S4, comprising:

[0029] Retrieving the relevant sensitive information of the current key data and the relevant sensitive information of the last key data from the target database;

[0030] Using the same system key and HMAC algorithm, MAC values of the relevant sensitive information of the current key data and the relevant sensitive information of the last key data are calculated respectively;

[0031] Comparing whether the two MAC values are consistent, if the two MAC values are consistent, the comparison result is same; if the two MAC values are inconsistent, the comparison result is different;

[0032] Wherein, same or different constitutes a comparison result.

[0033] Preferably, in S5, comprising:

[0034] If the comparison result is same, it indicates that the relevant sensitive information of the current key data is not tampered with, and the encryption system web page displays the protection state; if the comparison result is different, it indicates that the relevant sensitive information of the current key data is tampered with, and the encryption system web page displays the data tampered with.

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

[0036] An agent connects a database service module, which serves as an interface for interacting with a target database, to establish a connection channel with the target database;

[0037] An SM3 hash algorithm module is called to calculate the digest value of the key data by using the SM3 hash algorithm, and to calculate the MAC value of the related sensitive information of the current key data and the system key at the same time;

[0038] A key service module is used to store the MAC-verified system key, including storing and managing the system key by using a key storage mechanism, and providing the system key to the SM3 hash algorithm module for MAC calculation as needed;

[0039] A MAC value comparison module compares whether the MAC values of the related sensitive information of the current key data and the related sensitive information of the last key data are consistent, and returns the comparison result to the system;

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

[0041] Compared with the prior art, the present application has the following beneficial effects:

[0042] The present application can accurately locate the data to be protected by identifying and marking the sensitive data of the key column in the target database, avoiding the resource waste and low efficiency caused by indiscriminate protection of all data in the traditional method;

[0043] The present application calculates the digest value of the key data and the MAC value of the related sensitive information and the system key by using the SM3 hash algorithm, providing a reliable basis for data integrity verification, and the SM3 algorithm has high security and anti-collision property, which can effectively resist various attacks and ensure the integrity of the data in the transmission and storage process;

[0044] The present application displays the data state corresponding to the comparison result returned by the system on the system web page, so that the user can intuitively understand the integrity of the sensitive data in the database, and this visual management method facilitates the user to monitor and manage the data, improving the management efficiency;

[0045] In summary, the present application provides a method and device for realizing the integrity protection of database sensitive data, which has the beneficial effects of improving the data integrity protection capability, discovering the data tampering behavior in time, enhancing the visual management of the user to the data state, and improving the security and reliability of the system, and can effectively solve the problems in the prior art, providing a reliable solution for the security protection of database sensitive data. BRIEF DESCRIPTION OF DRAWINGS

[0046] The application will be further described below with reference to the drawings.

[0047] Figure 1 A flow chart of a method for realizing database sensitive data integrity protection is provided in the application.

[0048] Figure 2 A module structure diagram of an apparatus for realizing database sensitive data integrity protection is provided in the application. DETAILED DESCRIPTION

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

[0050] Embodiment 1, as shown in the figure, the application is a method for realizing database sensitive data integrity protection, comprising the following steps: Figure 1

[0051] S1, the encryption system identifies the sensitive data of the key column of the data table in the target database, which is recorded as key data; the key data is configured with integrity protection, and a digital signature is applied;

[0052] S2, the SM3 hash algorithm is used to calculate the digest value of the key data, and the MAC value of the related sensitive information of the current key data and the system key is calculated;

[0053] S3, the database business system accesses the key data through the proxy connection of the encryption system, and modifies or inserts new data, that is, the business user enters the data and saves;

[0054] S4, the encryption system compares whether the MAC values of the related sensitive information of the current key data and the related sensitive information of the last key data are consistent, and returns the comparison result to the system;

[0055] S5, the data state corresponding to the comparison result returned by the system is displayed on the system web page.

[0056] It needs to be further explained that, in the specific implementation process, the process that the encryption system identifies the sensitive data of the key column of the data table in the target database, which is recorded as key data, comprises:

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

[0058] ​The mode information of the target database is subjected to sensitive information judgment, and the mode information is matched with preset sensitive information, if the matching is successful, the corresponding mode information is recorded as sensitive data, and the column where the sensitive data is located is recorded as a key column, and the sensitive data of the key column is obtained, if the matching fails, it indicates that the corresponding mode information is not sensitive data;

[0059] The preset sensitive information includes personal privacy information and protected health information, for example, in the user information table, the user's ID number, bank card number, password and the like are regarded as sensitive information.

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

[0061] Based on the identified key data, configuring integrity protection for the key data includes: stipulating that only authorized users or application programs can access and modify the key data, and strictly recording and auditing each access and modification operation;

[0062] When applying digital signature, the encryption system generates a pair of public key and private key; when other users or systems need to verify the integrity of the key data, the public key is used to verify the digital signature, if the verification is passed, it indicates that the data remains complete in the transmission and storage process and has not been tampered with;

[0063] The private key is held by the owner of the data or the authorized management agency, and is used for signing the key data; the public key is publicly published, and is used for verifying the validity of the signature;

[0064] In the step of the application, the digital signature is an identity authentication and data integrity verification method based on encryption technology, by using the digital signature, the source of the key data is ensured to be reliable, and the key data is not tampered with in the transmission and storage process;

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

[0066] The SM3 hash algorithm is called, the key data is grouped according to a preset length, hash operation is performed on each group, each group is expanded through message expansion, a plurality of intermediate variables are generated, and the intermediate variables are subjected to multiple iteration operations by using a compression function, to obtain a fixed-length hash value, i.e. the digest value of the key data; wherein the preset length is to divide the length of each group into a fixed number of bits according to actual application requirements;

[0067] It should be noted that the SM3 hash algorithm is a cryptographic hash function published by the National Cryptographic Administration, which is suitable for digital signature and verification in commercial cryptographic applications.

[0068] The digest value of the key data as a unique identifier or fingerprint of the key data has uniqueness, that is, different input data will generate different digest values, and the key data cannot be inferred from the digest value;

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

[0070] Obtaining information in other columns or data tables related to the key data, denoted as related sensitive information of the key data; for example, if the key data is a user's bank account number, 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 related sensitive information of the current key data is combined with the system key, and the combined data is encrypted using the HMAC algorithm 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 generated by encrypting a specific part of the data (such as the related sensitive information of the key data) and the system key;

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

[0075] When the database business system accesses the key data, a connection is established through the proxy of the encryption system; wherein the proxy serves as an intermediate layer between the business system and the target database, responsible for verifying and forwarding the access request of the business system;

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

[0077] Once the identity authentication is passed, the business system performs data modification or new data insertion on the key data through the proxy, that is, the business user performs data entry;

[0078] When performing data modification operations, the business system updates the existing key data according to business needs and issues a modification request; for example, when the user's personal information changes, the business system needs to update the corresponding record in the database in a timely manner; the agent strictly verifies and checks the modification request to ensure that the modification operation meets the business rules and permission requirements, and if the modification request passes the verification and check, the agent forwards the modification request to the database for actual data modification operation;

[0079] When new data is inserted, the business system submits the new data record to the agent and issues an insertion request, and the agent verifies and checks the insertion request, including but not limited to checking the format, integrity, and legality of the data; for example, for user registration information, the agent checks whether the username meets the specification and whether the password meets the strength requirement; if the insertion request passes the verification, the agent inserts the new data record into the corresponding position in the database;

[0080] It should be further explained that, in the specific implementation process, the process of comparing the MAC values of the related sensitive information of the current key data and the related sensitive information of the last key data by the encryption system and returning the comparison result to the system includes:

[0081] Retrieving the related sensitive information of the current key data and the related sensitive information of the last key data from the target database;

[0082] Using the same system key and HMAC algorithm, the MAC values of the related sensitive information of the current key data and the related sensitive information of the last key data are calculated respectively;

[0083] Comparing whether the two MAC values are consistent, if the two MAC values are consistent, the comparison result is the same; if the two MAC values are not consistent, the comparison result is not the same;

[0084] Wherein, the same or not the same constitutes the comparison result;

[0085] It should be further explained that, in the specific implementation process, the process of displaying the data state 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 related sensitive information of the current key data has not been tampered with, and the encryption system web page displays the protection state; if the comparison result is not the same, it means that the related sensitive information of the current key data has been tampered with, and the encryption system web page displays that the data has been tampered with.

[0087] Embodiment 2, as shown in Figure 2 The present application is a device for realizing the integrity protection of sensitive data in a database, which comprises:

[0088] The agent connects a database service module, which is an interface for interacting with a target database, to establish a connection channel with the target database;

[0089] An SM3 hash algorithm module is called to calculate the digest value of the key data by using the SM3 hash algorithm, and to calculate the MAC value of the related sensitive information of the current key data and the system key;

[0090] A key service module is used to store the MAC-verified system key, including storing and managing the system key by using a key storage mechanism, and providing the system key to the SM3 hash algorithm module for MAC calculation according to the need;

[0091] A MAC value comparison module is used to compare whether the MAC values of the related sensitive information of the current key data and the related sensitive information of the last key data are consistent, and returns the comparison result to the system;

[0092] A page display module is used to display the data state corresponding to the comparison result returned by the system on the web page of the system.

[0093] In several embodiments provided by the present application, it should be understood that the disclosed system can be implemented in other manners. For example, the above described embodiments of the application are merely schematic, and the division of the modules is merely a logical function division, and there can be another division manner in actual implementation.

[0094] The modules illustrated as separate components may or may not be physically separate, and the components illustrated as modules may or may not be physical units, that is, they can be located in one place, or distributed on multiple network units. According to actual needs, some or all of the modules can be selected to achieve the purpose of the embodiments.

[0095] In addition, each functional module in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware, or in the form of hardware plus software function modules.

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

[0097] Finally, it should be noted that the above examples are merely intended to illustrate the technical solutions of the present application and not to limit the present application. Although the present application 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 application can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present application.

Claims

1. A method for protecting the integrity of sensitive data in a database, characterized in that, Includes the following steps: S1. The encryption system identifies sensitive data in key columns of data tables in the target database and marks them as key data; it configures integrity protection for the key data and applies for digital signatures. S2. Use the SM3 hash algorithm to calculate the digest 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 encrypted system to modify the data or insert new data, that is, business users enter and save data. S4. The encryption system compares the MAC values ​​of the relevant sensitive information of the current critical data with those of the most recent critical data to see if they match, and returns the comparison results to the system; including: Retrieve relevant sensitive information about the current key data and the most recent key data from the target database; obtain information from other columns or data tables related to the key data, and record it as relevant sensitive information about the key data; Using the encryption system key and the HMAC algorithm, calculate the MAC values ​​of the relevant sensitive information of the current key data and the relevant sensitive information of the most recent key data, respectively. Compare two MAC values ​​to see if they are the same. If they are the same, the comparison result is that they are the same; if they are different, the comparison result is that they are different. S5. Display the data status corresponding to the comparison results returned by the system on the system web page; including: If the comparison results are 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 results are different, it means that the sensitive information related to the current key data has been tampered with, and the encryption system web page displays that the data has been tampered with.

2. The method for protecting the integrity of sensitive data in a database according to claim 1, characterized in that, S1 includes: 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 definitions, data types, and relationships between tables; Sensitive information is determined from the schema information of the target database. 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, thus obtaining the sensitive data of the key column. If the match fails, it means that the corresponding schema information is not sensitive data. The preset sensitive information includes personal privacy information and protected health information.

3. The method for protecting the integrity of sensitive data in a database according to claim 2, characterized in that, S1 also includes: Based on the identified critical data, the integrity protection for critical data includes: 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 is successful, it means that the data has maintained its integrity during transmission and storage and has not been tampered with. The private key is held by the data owner or authorized management authority and is used to sign critical data; the public key is publicly released and used to verify the validity of the signature.

4. The method for protecting the integrity of sensitive data in a database according to claim 1, characterized in that, S2 includes: The SM3 hash algorithm is called to group the key data into groups according to a preset length. A hash operation is performed on each group. Each group is expanded by message expansion to generate several intermediate variables. The intermediate variables are then iteratively operated on multiple times using a compression function to obtain a hash value of a fixed length, which is the digest value of the key data.

5. A method for protecting the integrity of sensitive data in a database according to claim 1, characterized in that, S2 also includes: 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 protecting the integrity of sensitive data in a database according to claim 1, characterized in that, In S3, the following are included: When a database business system accesses critical data, a connection is established through a proxy of the encryption system. When establishing the connection, the proxy requires the business system to provide corresponding authentication information. Only business systems that have passed authentication can continue to access critical data. Once identity authentication is successful, the business system can modify key data or insert new data through the agent, i.e., the business user enters data. When performing data modification operations, the business system will update the 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 check, the agent will forward the modification request to the database for actual data modification operations. 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. An apparatus for protecting the integrity of sensitive data in a database, comprising the method for protecting the integrity of sensitive data in a database as described in any one of claims 1-6, characterized in that, include: The proxy database connection service module serves as an interface for interacting with the target database and is used to establish a connection channel with the target database. The SM3 hash algorithm module is invoked. This module uses the SM3 hash algorithm to calculate the digest value of the key data, and at the same time calculates the relevant sensitive information of the current key data and the MAC value of the system key. The key service module is used to store the system key for MAC verification. This includes using a 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. The MAC value comparison module compares the MAC values ​​of the relevant sensitive information of the current key data with those of the most recent key data to see if they are consistent, and returns the comparison results to the system. The page display module displays the data status corresponding to the comparison results returned by the system on the system's web page.

Citation Information

Patent Citations

  • Credible database integrity protecting method and system

    CN104615947A

  • Database integrity verification method, device and system, medium and equipment

    CN119670158A