WO2021098293A1 - 一种数据库的安全保护方法及装置 - Google Patents

一种数据库的安全保护方法及装置 Download PDF

Info

Publication number
WO2021098293A1
WO2021098293A1 PCT/CN2020/108288 CN2020108288W WO2021098293A1 WO 2021098293 A1 WO2021098293 A1 WO 2021098293A1 CN 2020108288 W CN2020108288 W CN 2020108288W WO 2021098293 A1 WO2021098293 A1 WO 2021098293A1
Authority
WO
WIPO (PCT)
Prior art keywords
database
tampered
module
security protection
backup
Prior art date
Application number
PCT/CN2020/108288
Other languages
English (en)
French (fr)
Inventor
王旭宁
窦中山
杨辉
杨震晖
周晓娟
万首丰
艾邵伟
李先鹏
樊鹏
孙航飞
田萍
罗欣
Original Assignee
许继集团有限公司
许继电气股份有限公司
许昌许继软件技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 许继集团有限公司, 许继电气股份有限公司, 许昌许继软件技术有限公司 filed Critical 许继集团有限公司
Publication of WO2021098293A1 publication Critical patent/WO2021098293A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Definitions

  • This application belongs to the technical field of embedded and industrial control, and particularly relates to a method and device for database security protection.
  • databases such as DB2, Oracle, MySQL, etc.
  • databases are used to store a large amount of important data. If the database is maliciously tampered with, it will have an immeasurable impact on the system. Therefore, it is necessary to protect the security of the database.
  • a database security protection method In a database security protection method, a message is received and parsed, and database operation information in the message is extracted; statistics are performed on the database operation information; a normal behavior model is generated according to the statistical results; and according to the normal behavior model, Check whether the database operation is abnormal.
  • This database protection method can effectively detect abnormal operations, but is powerless for direct database file replacement operations.
  • the embodiments of the present application provide a database security protection method and device, which are used to solve the problem that the database in the system has low security and is easy to be maliciously tampered with causing system abnormalities.
  • an embodiment of the present application provides a database security protection method, which includes:
  • the database update module updates the database, backs up the updated database, calculates the summary of the updated database, encrypts and saves the summary, and saves the decryption key to the database inspection module;
  • the database inspection module uses the encrypted digest and decryption key to regularly check whether the database has been tampered with. If the database is tampered with, the backup database is used to replace the tampered database.
  • the database security protection method of the embodiment of the present application can prevent the database from being maliciously tampered with, and improve the security of the database.
  • the database update module when the database update module backs up the updated database, it encrypts the backup database and saves the decryption key to the database inspection module; if the database is tampered, the database The inspection module decrypts the backup database and replaces the tampered database with the decrypted backup database.
  • the encryption algorithm for encrypting the digest is an asymmetric key encryption algorithm.
  • the private key in the asymmetric key encryption algorithm is saved by the database update module, and the public key is saved by the database inspection module.
  • the algorithm for encrypting the backup database is a symmetric key encryption algorithm.
  • the symmetric key in the symmetric key encryption algorithm is stored by the database update module and the database inspection module.
  • the database update module is the only legal database writing module, and the legal offline configuration tool and online running program update the database by calling the database update module.
  • the embodiment of the present application provides a database security protection device.
  • the device includes a processor and a memory, and the memory stores a computer program that realizes the following functions:
  • the database update module updates the database, it backs up the updated database, calculates the summary of the updated database at the same time, encrypts and saves the summary, and saves the decryption key to the database inspection module;
  • the database inspection module uses the encrypted digest and decryption key to regularly check whether the database has been tampered with. If the database is tampered with, the backup database is used to replace the tampered database.
  • the database security protection device of the embodiment of the present application can prevent the database from being maliciously tampered with, and improve the security of the database.
  • the processor and memory are also used to cooperate with the database update module and the database inspection module to realize the following functions: when the database update module backs up the updated database, Encrypt and save the backup database, and save the decryption key to the database inspection module; if the database is tampered with, the database inspection module decrypts the backup database and replaces the tampered database with the decrypted backup database.
  • the encryption algorithm for encrypting the digest is an asymmetric key encryption algorithm.
  • the private key in the asymmetric key encryption algorithm is saved by the database update module, and the public key is saved by the database inspection module.
  • the algorithm for encrypting the backup database is a symmetric key encryption algorithm.
  • the symmetric key in the symmetric key encryption algorithm is stored by the database update module and the database inspection module.
  • the database update module is the only legal database writing module, and the legal offline configuration tool and online running program update the database by calling the database update module.
  • FIG. 1 is a schematic flowchart of a database security protection method according to an embodiment of the application
  • Figure 2 is a system module diagram of an embodiment of the application
  • FIG. 3 is a flowchart of database update according to an embodiment of the application.
  • Fig. 4 is a flowchart of database inspection according to an embodiment of the application.
  • first and “second” and other relational terms are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply one of these entities or operations. There is any such actual relationship or order between.
  • the terms “include”, “include” or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes those that are not explicitly listed Other elements of, or also include elements inherent to this process, method, article or equipment. If there are no more restrictions, the element defined by the sentence “including a" does not exclude the existence of other identical elements in the process, method, article, or equipment that includes the element.
  • the database security protection method of this application includes the following steps:
  • Step 101 The database update module updates the database, backs up the updated database, calculates a summary of the updated database, encrypts and saves the summary, and saves the decryption key to the database inspection module;
  • Step 102 During the running of the program, the database inspection module uses the encrypted digest and the decryption key to periodically check whether the database has been tampered with. If the database is tampered with, the backup database is used to replace the tampered database.
  • the database update module updates the database, backs up the updated database, calculates the summary of the updated database, encrypts and saves the summary, and saves the decryption key to the database inspection module; the program runs In the process, the database inspection module uses the encrypted digest and decryption key to periodically check whether the database has been tampered with. If the database is tampered with, the backup database is used to replace the tampered database.
  • the database protection method of this embodiment involves two aspects: database update and database inspection.
  • the database update module can process the database in an encrypted manner to check whether the database has been tampered with during the database inspection.
  • the steps of using encryption to update the database specifically include:
  • the asymmetric key system generates a private key and a public key pair, the private key is delivered to the database update module, and the public key is delivered to the database inspection module; the symmetric key system generates a symmetric key pair, and the symmetric key is generated by the database update module and Database inspection module to save.
  • the database update module updates the database, it first updates the database file, then calculates the abstract of the database file, encrypts the abstract of the database with the private key, generates an encrypted abstract, and saves the encrypted abstract. Save the encrypted summary in a set storage location, the storage location can be set to access permissions, such as access only to the database inspection module, this ensures that only the security protection device itself can obtain it, thereby preventing attackers from discovering and ensuring encryption The abstract will not be tampered with, which further improves the security of the database.
  • the database update module uses the symmetric key to back up the database file.
  • the encrypted backup of the database file in the above step 3 is to prevent the backed up database file from being tampered with and improve security.
  • the backed-up database file may not be encrypted.
  • the private key for digest encryption and the public key for digest decryption are RSA key pairs.
  • the asymmetric key algorithm can also choose Elgamal, knapsack algorithm, Rabin, D-H, ECC (elliptic curve encryption algorithm), etc.
  • the asymmetric key algorithm When generating the encrypted digest, the asymmetric key algorithm is used. Of course, other encryption methods, such as symmetric encryption algorithm, can also be used. When the database is encrypted and backed up, the symmetric key algorithm is used. As other implementations, non-symmetric key algorithms can also be used. Symmetric encryption algorithm, but the efficiency is relatively low.
  • the database inspection module will periodically inspect the database files to check whether they have been tampered with, including:
  • step 3 Compare the digest calculated in step 1 with the decrypted digest in step 2. If they are consistent, the database is considered to have not been tampered with; if they are inconsistent, the database file is considered to have been tampered with, and the operation in step 4 is required;
  • the backed up database file is not encrypted, directly replace the backed up database file with the tampered database file. If the backed up database file is an encrypted file, use the symmetric key to decrypt the backed up database file, and the decrypted backup database The file replaces the tampered database file.
  • the database inspection module will periodically inspect the database files to check whether they have been tampered with.
  • the process includes the following steps:
  • Step 401 Calculate the database summary ABS1.
  • Step 402 Extract the encrypted digest and decrypt it with the public key to obtain ABS2.
  • Step 403 Compare ABS1 and ABS2.
  • Step 404 Whether ABS1 and ABS2 are the same, if not, go to step 405, if yes, go to step 407.
  • Step 405 Use the symmetric secret key to decrypt the encrypted database to obtain the backup database file.
  • Step 406 Restore the database file.
  • Step 407 After the delay, execute step 401.
  • the database update module in the embodiment of the application is the only legal database writing module, and the legal offline configuration tool and online running program update the database by calling the database update module.
  • the database update module adopts a strict access control mechanism to deny illegal access.
  • the offline configuration tool connects to the database update modules of different systems when configuring different systems, and the database update module is responsible for checking the legitimacy of the configuration tool.
  • the database update process steps are:
  • the database inspection module checks the dynamic library every 10 minutes to determine whether the database has been tampered with.
  • the detection steps are as follows:
  • the restoration method is to use the AES symmetric key KEYC to decrypt the backup database file DB8000_BACK to obtain the backup database file. DB8000, and overwrite the file with the database file in the system.
  • the database security protection device of the embodiment of the present application includes a processor and a memory, and the memory stores a computer program that realizes the following functions: 1) After the database update module updates the database, the updated database is backed up and the update is calculated at the same time. After the abstract of the database, encrypt and save the abstract, and save the decryption key to the database inspection module; 2) During the program operation, the database inspection module uses the encrypted abstract and decryption key to regularly check whether the database has been tampered with. If the database is tampered with, use a backup database to replace the tampered database.
  • the processor and the memory may be the processor and memory of the database update module and the database patrol module itself, or may be an additional processor and memory.
  • the database protection method and device proposed in the embodiment of the application can effectively prevent the database from being tampered with.
  • the database update is uniformly operated by the database update module.
  • the abstract of the database is encrypted and saved at the same time, and the database is encrypted and backed up. .
  • the running of the program check whether the database has been tampered with or not. If it is tampered, it will be restored from the backup database to prevent the database from being tampered with during the running of the program.
  • the database update module is the only database writing module, and the private key in the asymmetric encryption algorithm is used for the encrypted storage of the digest and the encrypted backup of the database, so that even if the tampering person understands the database protection scheme and detailed algorithm, if you can’t get it The private key of the system cannot be forged into a legal database. Therefore, the database security protection method and device of the present application improve data security.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Storage Device Security (AREA)

Abstract

一种数据库的安全保护方法及装置,该方法包括:数据库更新模块对数据库进行更新,并对更新后的数据库进行备份,同时计算更新后数据库的摘要,对摘要进行加密并保存,将解密密钥保存至数据库巡检模块(101);在程序运行过程中,数据库巡检模块利用加密摘要及解密密钥,定时检查数据库是否被篡改,若数据库被篡改,采用备份数据库替换被篡改的数据库(102)。该装置包括处理器和存储器,所述存储器存储有用于实现以上数据库的安全保护方法的计算机程序。该数据库安全保护方法及装置能够防止数据库被恶意篡改,提高了数据库的安全性。

Description

一种数据库的安全保护方法及装置
相关申请的交叉引用
本申请基于申请号为201911128903.7、申请日为2019年11月18日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本申请属于嵌入式、工业控制技术领域,特别涉及一种数据库的安全保护方法及装置。
背景技术
随着信息化的发展,对于各种数据库如DB2、Oracle、MySQL等等的使用越来越深入到各行各业当中。尤其在涉及到金融、信息等行业当中,数据库都被用来存储大量的重要数据,如果数据库被恶意篡改,会对系统造成不可估量的影响,因此有必要对数据库的安全性进行保护。
在一种数据库安全保护方法中,接收并解析报文,提取所述报文中的数据库操作信息;对所述数据库操作信息进行统计;根据统计结果生成正常行为模型;根据所述正常行为模型,检测数据库操作是否存在异常。这种数据库保护方法能够有效检测到异常操作,但对直接的数据库文件替换操作无能为力。
发明内容
本申请实施例提供了一种数据库的安全保护方法及装置,用于解决系统中数据库安全性低,易被恶意篡改导致系统异常的问题。
为解决上述技术问题,本申请实施例提供了一种数据库的安全性保护方法,该方法包括:
数据库更新模块对数据库进行更新,并对更新后的数据库进行备份,同时计算更新后数据库的摘要,对摘要进行加密并保存,将解密密钥保存至数据库巡检模块;
在程序运行过程中,数据库巡检模块利用加密摘要及解密密钥,定时检查数据库是否被篡改,若数据库被篡改,采用备份数据库替换被篡改的数据库。
本申请实施例的数据库安全保护方法能够防止数据库被恶意篡改,提高了数据库的安全性。
为了防止备份的数据库文件被篡改,提高安全性,数据库更新模块对更新后的数据库进行备份时,对备份数据库进行加密保存,并将解密密钥保存至数据库巡检模块;若数据库被篡改,数据库巡检模块对备份数据库进行解密,将解密后的备份数据库替换被篡改的数据库。
为了使加密摘要的可靠性更高,对摘要进行加密的加密算法为非对称密钥加密算法,非对称密钥加密算法中的私钥由数据库更新模块保存,公钥由数据库巡检模块保存。
为了使得加密的备份数据库文件可靠性更高,对备份的数据库进行加密的算法为对称密钥加密算法,对称密钥加密算法中的对称密钥由数据库更新模块和数据库巡检模块保存。
为了提高系统的安全性,所述数据库更新模块为唯一合法的数据库写模块,合法的离线配置工具和在线运行程序通过调用数据库更新模块进行数据库更新。
本申请实施例提供了一种数据库的安全性保护装置,该装置包括处理器和存储器,所述存储器存储有实现以下功能的计算机程序:
当数据库更新模块对数据库进行更新后,对更新后的数据库进行备份,同时计算更新后数据库的摘要,对摘要进行加密并保存,将解密密钥保存至数据库巡检模块;
在程序运行过程中,数据库巡检模块利用加密摘要及解密密钥,定时检查数据库是否被篡改,若数据库被篡改,采用备份数据库替换被篡改的数据库。
本申请实施例的数据库安全保护装置能够防止数据库被恶意篡改,提高了数据库的安全性。
为了防止备份的数据库文件被篡改,提高安全性,所述处理器和存储器还用于与数据库更新模块和数据库巡检模块相配合,实现以下功能:数据库更新模块对更新后的数据库进行备份时,对备份数据库进行加密保存,并将解密密钥保存至数据库巡检模块;若数据库被篡改,数据库巡检模块对备份数据库进行解密,将解密后的备份数据库替换被篡改的数据库。
为了使加密摘要的可靠性更高,对摘要进行加密的加密算法为非对称密钥加密算法,非对称密钥加密算法中的私钥由数据库更新模块保存,公钥由数据库巡检模块保存。
为了使得加密的备份数据库文件可靠性更高,对备份的数据库进行加密的算法为对称密钥加密算法,对称密钥加密算法中的对称密钥由数据库更新模块和数据库巡检模块保存。
为了提高系统的安全性,所述数据库更新模块为唯一合法的数据库写模块,合法的离线配置工具和在线运行程序通过调用数据库更新模块进行数据库更新。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
图1为本申请实施例的数据库安全保护方法的流程示意图;
图2为本申请实施例的系统模块图;
图3为本申请实施例的数据库更新流程图;
图4为本申请实施例的数据库巡检流程图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请,即所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本申请实施例的组件可以以各种不同的配置来布置和设计。
因此,以下对在附图中提供的本申请的实施例的详细描述并非旨在限制要求保护的本申请的范围,而是仅仅表示本申请的选定实施例。基于本申请的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。
需要说明的是,术语“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以下结合实施例对本申请的特征和性能作进一步的详细描述。
本申请的数据库安全保护方法实施例
如图1所示,本申请的数据库安全保护方法包括如下步骤:
步骤101:数据库更新模块对数据库进行更新,并对更新后的数据库进行备份,同时计算更新后数据库的摘要,对摘要进行加密并保存,将解密密钥保存至数据库巡检模块;
步骤102:在程序运行过程中,数据库巡检模块利用加密摘要及解密密钥,定时检查数据库是否被篡改,若数据库被篡改,采用备份数据库替换被篡改的数据库。
参照图2,数据库更新模块对数据库进行更新,并对更新后的数据库进行备份,同时计算更新后数据库的摘要,对摘要进行加密并保存,将解密密钥保存至数据库巡检模块;在程序运行过程中,数据库巡检模块利用加密摘要及解密密钥,定时检查数据库是否被篡改,若数据库被篡改,采用备份数据库替换被篡改的数据库。
本实施例的数据库保护方法涉及到数据库更新和数据库巡检两个方面,在进行数据库更新时,数据库更新模块可采用加密的方式对数据库进行处理,以在数据库巡检时检验数据库是否被篡改。
采用加密的方式对数据库进行更新的步骤,如图3所示,具体包括:
1、非对称密钥系统生成私钥和公钥对,私钥交付给数据库更新模块,公钥交给数据库巡检模块;对称密钥系统生成对称密钥对,对称密钥由数据库更新模块和数据库巡检模块进行保存。
2、数据库更新模块更新数据库时,首先更新数据库文件,然后计算数据库文件的摘要,使用私钥对数据库的摘要进行加密,生成加密摘要,并将加密摘要进行保存。将加密摘要保存在一个设定的存储位置,该存储位置可设定访问权限,如仅供数据库巡检模块访问,如此保证了只有安全性保护装置自身能够获取,从而防止攻击者发现,保证加密摘要不会被篡改,进一步提高数据库的安全性。
3、数据库更新模块使用对称密钥对数据库文件进行备份。
上述步骤3中对数据库文件进行加密备份是为了防止备份的数据库文件被篡改,提高安全性,当然,作为其他实施方式,在对数据库文件进行备份时,也可以不对备份的数据库文件进行加密。
为了使得进行摘要加密的私钥和进行摘要解密的公钥可靠性更高,进行摘要加密的私钥和进行摘要解密的公钥为RSA密钥对。当然,非对称密钥算法除了RSA外,还可选取Elgamal、背包算法、Rabin、D-H、ECC(椭圆曲线加密算法)等。
上述生成加密摘要时,是采用非对称密钥算法,当然也可以采用其他的加密方法,如对称加密算法,对数据库进行加密备份时,采用对称密钥算法,作为其他实施方式,也可以采用非对称加密算法,只是效率比较低。
在系统运行过程中,数据库巡检模块会定时对数据库文件进行巡检,以检查其是否被篡改,具体包括:
1、读取数据库文件,计算数据库文件的摘要;
2、读取保存的加密摘要,使用公钥进行解密,得到解密后的摘要;
3、将步骤1中计算得到的摘要与步骤2中解密后的摘要进行对比,如果一致,则认为数据库没有被篡改;如果不一致,则认为数据库文件被篡改了,那么需要进行步骤4的操作;
4、若备份的数据库文件没有加密,则直接将备份的数据库文件替换被篡改的数据库文件,若备份的数据库文件为加密文件,则使用对称密钥解密备份的数据库文件,将解密后的备份数据库文件替换被篡改的数据库文件。
如图4所示,数据库巡检模块会定时对数据库文件进行巡检,以检查其是否被篡改的流程包括以下步骤:
步骤401:计算数据库摘要ABS1。
步骤402:提取加密摘要并用公钥进行解密,获取ABS2。
步骤403:对比ABS1和ABS2。
步骤404:ABS1和ABS2是否相同,若否,则执行步骤405,若是,则执行步骤407。
步骤405:用对称秘钥解密加密数据库,获取备份数据库文件。
步骤406:恢复数据库文件。
步骤407:延时后,执行步骤401。
本申请实施例的数据库更新模块为唯一合法的数据库写模块,合法的离线配置工具和在线运行程序通过调用数据库更新模块进行数据库更新。数据库更新模块采用严格的访问控制机制,拒绝非法访问。
离线配置工具在配置不同系统时连接不同系统的数据库更新模块,数据库更新模块负责对配置工具的合法性进行检查。
1.下面以一个具体的实例来说明数据库更新流程及数据库巡检流程的步骤:
数据库更新流程步骤为:
1、使用OpenSSL库生成RSA密钥对:私钥KEYA和公钥KEYB,私钥KEYA交付给数据库更新模块,公钥KEYB交付给数据库巡检模块;
2、使用OpenSSL库生成AES对称秘钥KEYC;
3、数据库更新模块更新数据库时,更新数据库文件DB8000;
4、使用MD5算法计算数据库文件DB8000摘要ABS,使用私钥KEYA对摘要ABS进行加密,得到加密摘要ABS_ENCRYPT文件,并进行保存;
5、使用AES算法通过对称秘钥KEYC对数据库DB8000进行加密备份,得到加密的备份数据库文件DB8000_BACK,并进行保存。
在程序运行过程中,数据库巡检模块每隔10分钟对动态库检测一次,判断数据库是否被篡改,检测步骤如下:
1、读取数据库文件DB8000,使用MD5算法计算其摘要ABS1;
2、读取保存的加密摘要文件ABS_ENCRYPT,使用公钥KEYB进行解密,得到备份摘要ABS2;
3、比对前两步生成的ABS1和ABS2,如果一致则认为正常,如果不一致则认为被篡改,进行数据库恢复,恢复方法为使用AES对称秘钥KEYC解密备份的数据库文件DB8000_BACK,得到备份数据库文件DB8000,并将该文件覆盖系统中的数据库文件。
本申请实施例的数据库安全保护装置实施例
本申请实施例的数据库安全保护装置包括处理器和存储器,所述存储器存储有实现以下功能的计算机程序:1)当数据库更新模块对数据库进行更新后,对更新后的数据库进行备份,同时计算更新后数据库的摘要,对摘要进行加密并保存,将解密密钥保存至数据库巡检模块;2)在程序运行过程中,数据库巡检模块利用加密摘要及解密密钥,定时检查数据库是否被篡改,若数据库被篡改,采用备份数据库替换被篡改的数据库。
其中,处理器和存储器可以是数据库更新模块和数据库巡检模块自身的处理器和存储器,也可以是另设的处理器和存储器。
本申请实施例装置的其他实施方式是该装置具有与上述方法对应的进程或程序,由于方法的具体实施方式已经在上述实施例中进行了详细的说明,因此,在这里不再赘述。
本申请实施例提出的数据库保护方法及装置能有效的防止数据库被篡改,数据库更新统一采用数据库更新模块进行操作,在进行数据库更新时,同时对数据库的摘要进行加密保存,并对数据库进行加密备份。在程序运行过程中定时检测数据库是否被篡改,若被篡改则从备份的数据库中进行恢复,防止在程序运行过程中数据库被篡改。本方案中数据库更新模块作为唯一的数据库写模块,采用非对称加密算法中的私钥进行摘要的加密保 存和数据库加密备份,这样即使篡改人员了解了数据库的保护方案和详细算法,如果得不到系统的私钥,也不能伪造出合法的数据库。因此,本申请的数据库安全保护方法和装置提高了数据的安全性。
以上所述,仅为本申请的较佳实施例,并不用以限制本申请,本申请的专利保护范围以权利要求书为准,凡是运用本申请的说明书及附图内容所作的等同结构变化,同理均应包含在本申请的保护范围内。

Claims (10)

  1. 一种数据库的安全保护方法,该方法包括:
    数据库更新模块对数据库进行更新,并对更新后的数据库进行备份,同时计算更新后数据库的摘要,对摘要进行加密并保存,将解密密钥保存至数据库巡检模块;
    在程序运行过程中,数据库巡检模块利用加密摘要及解密密钥,定时检查数据库是否被篡改,若数据库被篡改,采用备份数据库替换被篡改的数据库。
  2. 根据权利要求1所述的数据库的安全保护方法,其中,所述方法还包括:数据库更新模块对更新后的数据库进行备份时,对备份数据库进行加密保存,并将解密密钥保存至数据库巡检模块;若数据库被篡改,数据库巡检模块对备份数据库进行解密,将解密后的备份数据库替换被篡改的数据库。
  3. 根据权利要求1所述的数据库的安全保护方法,其中,对摘要进行加密的加密算法为非对称密钥加密算法,非对称密钥加密算法中的私钥由数据库更新模块保存,公钥由数据库巡检模块保存。
  4. 根据权利要求2所述的数据库的安全保护方法,其中,对备份的数据库进行加密的算法为对称密钥加密算法,对称密钥加密算法中的对称密钥由数据库更新模块和数据库巡检模块保存。
  5. 根据权利要求1-4任意一项所述的数据库的安全保护方法,其中,所述数据库更新模块为唯一合法的数据库写模块,合法的离线配置工具和在线运行程序通过调用数据库更新模块进行数据库更新。
  6. 一种数据库的安全保护装置,该装置包括处理器和存储器,所述存储器存储有实现以下功能的计算机程序:
    当数据库更新模块对数据库进行更新后,对更新后的数据库进行备 份,同时计算更新后数据库的摘要,对摘要进行加密并保存,将解密密钥保存至数据库巡检模块;
    在程序运行过程中,数据库巡检模块利用加密摘要及解密密钥,定时检查数据库是否被篡改,若数据库被篡改,采用备份数据库替换被篡改的数据库。
  7. 根据权利要求6所述的数据库的安全保护装置,其中,所述存储器还存储有实现以下功能的计算机程序:
    数据库更新模块对更新后的数据库进行备份时,对备份数据库进行加密保存,并将解密密钥保存至数据库巡检模块;若数据库被篡改,数据库巡检模块对备份数据库进行解密,将解密后的备份数据库替换被篡改的数据库。
  8. 根据权利要求6所述的数据库的安全保护装置,其中,对摘要进行加密的加密算法为非对称密钥加密算法,非对称密钥加密算法中的私钥由数据库更新模块保存,公钥由数据库巡检模块保存。
  9. 根据权利要求7所述的数据库的安全保护装置,其中,对备份的数据库进行加密的算法为对称密钥加密算法,对称密钥加密算法中的对称密钥由数据库更新模块和数据库巡检模块保存。
  10. 根据权利要求6-9任意一项所述的数据库的安全保护装置,其中,所述数据库更新模块为唯一合法的数据库写模块,合法的离线配置工具和在线运行程序通过调用数据库更新模块进行数据库更新。
PCT/CN2020/108288 2019-11-18 2020-08-10 一种数据库的安全保护方法及装置 WO2021098293A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911128903.7A CN111008205A (zh) 2019-11-18 2019-11-18 一种数据库的安全保护方法及装置
CN201911128903.7 2019-11-18

Publications (1)

Publication Number Publication Date
WO2021098293A1 true WO2021098293A1 (zh) 2021-05-27

Family

ID=70113716

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/108288 WO2021098293A1 (zh) 2019-11-18 2020-08-10 一种数据库的安全保护方法及装置

Country Status (2)

Country Link
CN (1) CN111008205A (zh)
WO (1) WO2021098293A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111008205A (zh) * 2019-11-18 2020-04-14 许继集团有限公司 一种数据库的安全保护方法及装置
CN112270019A (zh) * 2020-10-23 2021-01-26 许继集团有限公司 一种数据库关键信息表双重防篡改方法及系统
CN112231694A (zh) * 2020-10-27 2021-01-15 北京人大金仓信息技术股份有限公司 一种数据库的检测方法、装置、设备及介质
CN114338010B (zh) * 2021-12-31 2024-02-20 深圳昂楷科技有限公司 一种数据库密钥交换方法、装置及电子设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101482887A (zh) * 2009-02-18 2009-07-15 北京数码视讯科技股份有限公司 数据库关键数据的防篡改检验方法
CN104268468A (zh) * 2014-09-25 2015-01-07 福建升腾资讯有限公司 一种对Android系统动态链接库保护方法及系统
CN107908962A (zh) * 2017-12-05 2018-04-13 深圳鼎智通讯股份有限公司 应用于Android智能终端的自检方法
CN108076057A (zh) * 2017-12-14 2018-05-25 北京中星仝创科技有限公司 一种基于区块链的数据保全系统及方法
CN109635522A (zh) * 2018-11-13 2019-04-16 许继集团有限公司 一种动态库的防篡改方法及装置
CN111008205A (zh) * 2019-11-18 2020-04-14 许继集团有限公司 一种数据库的安全保护方法及装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102236766B (zh) * 2011-05-10 2014-04-09 桂林电子科技大学 安全的数据项级数据库加密方法
US20130191629A1 (en) * 2012-01-19 2013-07-25 Laconic Security, Llc Secure group-based data storage in the cloud

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101482887A (zh) * 2009-02-18 2009-07-15 北京数码视讯科技股份有限公司 数据库关键数据的防篡改检验方法
CN104268468A (zh) * 2014-09-25 2015-01-07 福建升腾资讯有限公司 一种对Android系统动态链接库保护方法及系统
CN107908962A (zh) * 2017-12-05 2018-04-13 深圳鼎智通讯股份有限公司 应用于Android智能终端的自检方法
CN108076057A (zh) * 2017-12-14 2018-05-25 北京中星仝创科技有限公司 一种基于区块链的数据保全系统及方法
CN109635522A (zh) * 2018-11-13 2019-04-16 许继集团有限公司 一种动态库的防篡改方法及装置
CN111008205A (zh) * 2019-11-18 2020-04-14 许继集团有限公司 一种数据库的安全保护方法及装置

Also Published As

Publication number Publication date
CN111008205A (zh) 2020-04-14

Similar Documents

Publication Publication Date Title
WO2021098293A1 (zh) 一种数据库的安全保护方法及装置
US11849045B2 (en) Controlling verification of key-value stores
US10439804B2 (en) Data encrypting system with encryption service module and supporting infrastructure for transparently providing encryption services to encryption service consumer processes across encryption service state changes
US9256499B2 (en) Method and apparatus of securely processing data for file backup, de-duplication, and restoration
US9122882B2 (en) Method and apparatus of securely processing data for file backup, de-duplication, and restoration
US8621240B1 (en) User-specific hash authentication
CN100449558C (zh) 休眠保护
US9064133B2 (en) Method and apparatus of securely processing data for file backup, de-duplication, and restoration
US20080320263A1 (en) Method, system, and apparatus for encrypting, integrity, and anti-replay protecting data in non-volatile memory in a fault tolerant manner
Muthurajkumar et al. Secured temporal log management techniques for cloud
US20220269807A1 (en) Detecting unauthorized encryptions in data storage systems
CN111737770A (zh) 一种密钥管理方法及应用
CN105678173A (zh) 基于硬件事务内存的vTPM安全保护方法
US9054864B2 (en) Method and apparatus of securely processing data for file backup, de-duplication, and restoration
US11238157B2 (en) Efficient detection of ransomware attacks within a backup storage environment
US20110107109A1 (en) Storage system and method for managing data security thereof
CN112395631B (zh) 基于sgx技术的安全数据库系统、方法及介质
WO2018099157A1 (zh) 一种文件系统加密方法及装置
Nam et al. Secure checkpointing
CN113641694A (zh) 数据库的海量历史数据备份方法和恢复方法
CN112329066A (zh) 一种数据文件加密方法及系统
WO2021098968A1 (en) Device and method for ransomware decryption
WO2021080586A1 (en) Authentication of write requests
US10380354B2 (en) Method and system for safeguarding database relations against unauthorized access
Liu et al. Analysis and design on security of sqlite

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20890051

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20890051

Country of ref document: EP

Kind code of ref document: A1