CN114629625A - 一种数据库数据加解密方法 - Google Patents

一种数据库数据加解密方法 Download PDF

Info

Publication number
CN114629625A
CN114629625A CN202210284535.0A CN202210284535A CN114629625A CN 114629625 A CN114629625 A CN 114629625A CN 202210284535 A CN202210284535 A CN 202210284535A CN 114629625 A CN114629625 A CN 114629625A
Authority
CN
China
Prior art keywords
database
algorithm
encryption
data
decryption
Prior art date
Legal status (The legal status 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 status listed.)
Withdrawn
Application number
CN202210284535.0A
Other languages
English (en)
Inventor
王军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Anhui Safebetter Information Technology Co ltd
Original Assignee
Anhui Safebetter Information Technology Co ltd
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 Anhui Safebetter Information Technology Co ltd filed Critical Anhui Safebetter Information Technology Co ltd
Priority to CN202210284535.0A priority Critical patent/CN114629625A/zh
Publication of CN114629625A publication Critical patent/CN114629625A/zh
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0631Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0625Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation with splitting of the data block into left and right halves, e.g. Feistel based algorithms, DES, FEAL, IDEA or KASUMI
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3006Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters
    • H04L9/302Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters involving the integer factorization problem, e.g. RSA or quadratic sieve [QS] schemes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3006Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters
    • H04L9/3033Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters details relating to pseudo-prime or prime number generation, e.g. primality test

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Storage Device Security (AREA)

Abstract

本发明提供一种数据库数据加解密方法,包括以下步骤:步骤一:将数据库分解为多个数据库页面,并相对每个数据库页面建立相对应的数据库特征码;步骤二:建立加密算法,加密算法包括对称分组密码系统算法中的IDEA算法和非对称公钥密码算法中的RSA算法;步骤三:根据数据库特征码采用加密算法对数据库页面和明文数据进行加密;本发明提高了数据库内数据的安全性和加解密的效率。

Description

一种数据库数据加解密方法
技术领域
本发明涉及数据安全技术领域,具体为一种数据库数据加解密方法。
背景技术
数据库是存放数据的仓库。它的存储空间很大,可以存放百万条、千万条、上亿条数据。但是数据库并不是随意地将数据进行存放,是有一定的规则的,否则查询的效率会很低。当今世界是一个充满着数据的互联网世界,充斥着大量的数据。即这个互联网世界就是数据世界。数据的来源有很多,比如出行记录、消费记录、浏览的网页、发送的消息等等。除了文本类型的数据,图像、音乐、声音都是数据。数据库是一个按数据结构来存储和管理数据的计算机软件系统。
从事数据加密研究的人称为密码编码者(Cryptographer),而从事对密码解密的专业人士称为密码分析者(Cryptanalyst)。如今数据加密技术被广泛地应用与国民经济各个领域,特别是政府机关和国防情报部门,此外才是科学研究机关、商业部门、新闻出版、金融证券、交通管制与电力输送等部门。公开密钥密码体制尽管加密技术被首先使用在军事通信领域,但是人们或许出于安全的考量,开始逐渐对于商业机密、政府文件等重要信息实施加密手段。数据加密应运而生。
现有数据库内文件的安全不能保证,普通的加密算法,容易被破解,对于数据库设置的密码没有唯一性,设置的密码经过异或其他简单的操作就能看到密钥;当数据库文件很大时,每次加解密都需要较大的开销,不利较大数据级别时的存储。
发明内容
针对上述技术问题,本发明提供一种数据库数据加解密方法,提高了数据库内数据的安全性和加解密的效率。
为实现上述目的,本发明提供如下技术方案:一种数据库数据加解密方法,包括以下步骤:
步骤一:将数据库分解为多个数据库页面,并相对每个所述数据库页面建立相对应的数据库特征码;
步骤二:建立加密算法,所述加密算法包括对称分组密码系统算法中的IDEA算法和非对称公钥密码算法中的RSA算法;
步骤三:根据所述数据库特征码采用加密算法对数据库页面和明文数据进行加密。
优选的,所述数据库数据解密过程如下:
第一步:获取数据库特征码,所述数据库特征码包括数据库页面位置信息和解密密钥信息;
第二步:根据所述数据库特征码确定数据库页面及解密密钥;
第三步:通过所述数据库特征码和所述解密密钥对对应的数据库页面和加密数据进行解密,获取明文数据。
优选的,所述步骤三中数据库页面的加密和所述明文数据的加密根据数据库特征码通过对称分组密码系统算法中的IDEA算法和非对称公钥密码算法中的RSA算法进行混合加密。
优选的,所述数据库页面的加密和所述明文数据的加密的方式包括第一种均通过IDEA算法对数据库页面加密和明文数据加密;第二种均通过RSA算法对数据库页面加密和明文数据加密;第三种通过IDEA算法对数据库页面加密,通过RSA算法对明文数据加密;第四种通过RSA算法对数据库页面加密,通过IDEA算法对明文数据加密。
优选的,所述IDEA算法为分组长度是64比特的分组密码算法,密钥长度为128比特,由8轮迭代操作实现,每个迭代都由3种函数:mod(216)加法、mod(216)乘法和逐位异或算法组成。
优选的,所述RSA算法如下:
(1)选取两个保密且在同一数量级上并且都要有100到200位或更长的大素数p和q;
(2)计算n=p×q,φ(n)=(p-1)(q-1),其中φ(n)是n的欧拉函数值;
(3)选取一个整数e,满足1<e<φ(n)且φ(n)与e互素;
(4)创建解密密钥d如下:
(e×d)modφ(n)=1
加密:c=me mod n
解密:m=ce mod n,其中:e和n是加密密钥;m为需要加密的密文;c为得到的密文;(e,n)为公钥;(d,n)构成私钥;素数p和d丢弃。
本发明的有益效果:通过将数据库分解为多个数据库页面,并同时对数据库页面及明文数据进行加密,提高了数据库内数据的安全性和加解密的效率。
附图说明
附图用来提供对本发明的进一步理解,并且构成说明书的一部分,与本发明的实施例一起用于解释本发明,并不构成对本发明的限制,在附图中:
图1为本发明提出的数据库数据加密方法简易结构示意图。
图2为本发明提出的数据库数据解密方法简易结构示意图。
具体实施方式
为了使本发明实现的技术手段、创作特征、达成目的与功效易于明白了解,下面结合具体实施例和附图,进一步阐述本发明,但下述实施例仅为本发明的优选实施例,并非全部。基于实施方式中的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得其它实施例,都属于本发明的保护范围。
请参阅图1-2,一种数据库数据加解密方法,包括以下步骤:
步骤一:将数据库分解为多个数据库页面,可以保证各个数据库页面的准确性,提升了数据库被破解的难度和访问文件时的安全性,并相对每个数据库页面建立相对应的数据库特征码;
步骤二:建立加密算法,加密算法包括对称分组密码系统算法中的IDEA算法和非对称公钥密码算法中的RSA算法;
步骤三:根据数据库特征码采用加密算法对数据库页面和明文数据进行加密。
随着计算机技术和网络技术的发展,越来越多的业务系统将数据集中起来,利用功能强大的数据库系统来存储和管理业务数据、客户资料等重要的商业机密信息;目前对数据库保护的最有效方法是对敏感数据进行加密处理,将明文数据以密文方式保存,访问时再进行解密操作,这样即使能够通过非法途径得到数据库内的数据,没有相应的密钥也得不到明文形式.;数据库加密之后的密文数据由用户用自己的用户密钥来进行访问,不同的用户只能访问自己权限以内的数据,这样就大大提高了数据库的安全性,其中数据加密的核心是加密算法,本发明中通过采用加密算法包括对称分组密码系统算法中的IDEA算法和非对称公钥密码算法中的RSA算法,提高了加密过程中的高效性及易实现性和在密钥管理方面的便捷性,提高了数据库内数据的安全性和加解密的效率。
数据库数据解密过程如下:
第一步:获取数据库特征码,数据库特征码包括数据库页面位置信息和解密密钥信息;
第二步:根据数据库特征码确定数据库页面及解密密钥;
第三步:通过数据库特征码和解密密钥对对应的数据库页面和加密数据进行解密,获取明文数据。
步骤三中数据库页面的加密和明文数据的加密根据数据库特征码通过对称分组密码系统算法中的IDEA算法和非对称公钥密码算法中的RSA算法进行混合加密。
数据库页面的加密和明文数据的加密的方式包括第一种均通过IDEA算法对数据库页面加密和明文数据加密;第二种均通过RSA算法对数据库页面加密和明文数据加密;第三种通过IDEA算法对数据库页面加密,通过RSA算法对明文数据加密;第四种通过RSA算法对数据库页面加密,通过IDEA算法对明文数据加密。
其中通过不同数据库页面及内部明文数据采用不同的加密方法,降低了数据丢失的可能性,也减少了密码被破解的可能性,提高了数据的安全。
其中,通过生成多个数据库页面提高了数据库内文件的安全,避免了由于普通的加密算法导致容易被破解的情况出现,避免了数据库设置的密码没有唯一性,设置的密码经过异或其他简单的操作就能看到密钥的情况出现;通过将数据库分解为多个数据库页面,也避免了当数据库文件很大时,每次加解密都需要较大的开销,不利较大数据级别存储的情况出现,降低了加解密时的开销,以便于对大数据级别进行储存。
IDEA算法为分组长度是64比特的分组密码算法,密钥长度为128比特,由8轮迭代操作实现,每个迭代都由3种函数:mod(216)加法、mod(216)乘法和逐位异或算法组成。
RSA算法如下:
(1)选取两个保密且在同一数量级上并且都要有100到200位或更长的大素数p和q;
(2)计算n=p×q,φ(n)=(p-1)(q-1),其中φ(n)是n的欧拉函数值;
(3)选取一个整数e,满足1<e<φ(n)且φ(n)与e互素;
(4)创建解密密钥d如下:
(e×d)modφ(n)=1
加密:c=me mod n
解密:m=ce mod n,其中:e和n是加密密钥;m为需要加密的密文;c为得到的密文;(e,n)为公钥;(d,n)构成私钥;素数p和d丢弃。
以上显示和描述了本发明的基本原理、主要特征和本发明的优点。本行业的技术人员应该了解,本发明不受上述实施例的限制,上述实施例和说明书中描述的仅为本发明的优选例,并不用来限制本发明,在不脱离本发明精神和范围的前提下,本发明还会有各种变化和改进,这些变化和改进都落入要求保护的本发明范围内。本发明要求保护范围由所附的权利要求书及其等效物界定。

Claims (6)

1.一种数据库数据加解密方法,其特征在于,包括以下步骤:
步骤一:将数据库分解为多个数据库页面,并相对每个所述数据库页面建立相对应的数据库特征码;
步骤二:建立加密算法,所述加密算法包括对称分组密码系统算法中的IDEA算法和非对称公钥密码算法中的RSA算法;
步骤三:根据所述数据库特征码采用加密算法对数据库页面和明文数据进行加密。
2.根据权利要求1所述的一种数据库数据加解密方法,其特征在于:所述数据库数据解密过程如下:
第一步:获取数据库特征码,所述数据库特征码包括数据库页面位置信息和解密密钥信息;
第二步:根据所述数据库特征码确定数据库页面及解密密钥;
第三步:通过所述数据库特征码和所述解密密钥对对应的数据库页面和加密数据进行解密,获取明文数据。
3.根据权利要求1所述的一种数据库数据加解密方法,其特征在于:所述步骤三中数据库页面的加密和所述明文数据的加密根据数据库特征码通过对称分组密码系统算法中的IDEA算法和非对称公钥密码算法中的RSA算法进行混合加密。
4.根据权利要求3所述的一种数据库数据加解密方法,其特征在于:所述数据库页面的加密和所述明文数据的加密的方式包括第一种均通过IDEA算法对数据库页面加密和明文数据加密;第二种均通过RSA算法对数据库页面加密和明文数据加密;第三种通过IDEA算法对数据库页面加密,通过RSA算法对明文数据加密;第四种通过RSA算法对数据库页面加密,通过IDEA算法对明文数据加密。
5.根据权利要求1所述的一种数据库数据加解密方法,其特征在于:所述IDEA算法为分组长度是64比特的分组密码算法,密钥长度为128比特,由8轮迭代操作实现,每个迭代都由3种函数:mod(216)加法、mod(216)乘法和逐位异或算法组成。
6.根据权利要求1所述的一种数据库数据加解密方法,其特征在于:所述RSA算法如下:
(1)选取两个保密且在同一数量级上并且都要有100到200位或更长的大素数p和q;
(2)计算n=p×q,φ(n)=(p-1)(q-1),其中φ(n)是n的欧拉函数值;
(3)选取一个整数e,满足1<e<φ(n)且φ(n)与e互素;
(4)创建解密密钥d如下:
(e×d)modφ(n)=1
加密:c=memod n
解密:m=cemod n,其中:e和n是加密密钥;m为需要加密的密文;c为得到的密文;(e,n)为公钥;(d,n)构成私钥;素数p和d丢弃。
CN202210284535.0A 2022-03-22 2022-03-22 一种数据库数据加解密方法 Withdrawn CN114629625A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210284535.0A CN114629625A (zh) 2022-03-22 2022-03-22 一种数据库数据加解密方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210284535.0A CN114629625A (zh) 2022-03-22 2022-03-22 一种数据库数据加解密方法

Publications (1)

Publication Number Publication Date
CN114629625A true CN114629625A (zh) 2022-06-14

Family

ID=81904050

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210284535.0A Withdrawn CN114629625A (zh) 2022-03-22 2022-03-22 一种数据库数据加解密方法

Country Status (1)

Country Link
CN (1) CN114629625A (zh)

Similar Documents

Publication Publication Date Title
US9355271B2 (en) System and method for dynamic, non-interactive, and parallelizable searchable symmetric encryption
Jayaprakash et al. Cloud data encryption and authentication based on enhanced Merkle hash tree method.
Yuan et al. Secure cloud data deduplication with efficient re-encryption
EP2103032B1 (en) Privacy enhanced comparison of data sets
Ahmad et al. Hybrid cryptography algorithms in cloud computing: A review
CN114338038B (zh) 区块链数据保密查询的存储系统及不经意传输方法
Hui-Min et al. A cryptographic implementation for dynamic access control in a user hierarchy
WO1998036520A1 (en) Cryptographic key split combiner
Awais et al. A novel searchable encryption scheme to reduce the access pattern leakage
Pavani et al. Data Security and Privacy Issues in Cloud Environment
Chang A flexible hierarchical access control mechanism enforcing extension policies
CN114629625A (zh) 一种数据库数据加解密方法
CN112332989A (zh) 一种基于相关方的电子票据的加密、解密方法和装置
Al-Attab et al. Hybrid data encryption technique for data security in cloud computing
Yeh et al. Integrity coded databases-protecting data integrity for outsourced databases
Rahouma Reviewing and applying security services with non-english letter coding to secure software applications in light of software trade-offs
Lin et al. A confused Document Encrypting Scheme and its implementation
Berger Privacy protection for public directory services
Shaik et al. A compatible hexadecimal encryption-booster algorithm for augmenting security in the advanced encryption standard
Uddin et al. Development of An Effective Cryptographic Algorithm Using Random Matrix Shared Key
Indakholasy et al. Security of Employee Salary Data Using the ElGamal Algorithm By Utilizing the Diffie-Hellman Algorithm Key Generator
Hanash Homomorphic encryption of text documents
Zabian et al. Multi-layer encryption algorithm for data integrity in cloud computing
Rezapour et al. Efficient common prefix search on encrypted data as an additional service on the top of the storage providers
Gangadharaiah et al. Dynamic and Secure Public Auditing of User Data in Cloud by Using IRSAC.

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20220614