Database data encryption and decryption methods and apparatuses
A data encryption and data decryption technology, applied in the database field, can solve problems such as batch loading cannot be realized, and achieve the effect of improving performance
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0043] figure 1 It is a schematic flow chart of the database data encryption method provided by Embodiment 1 of the present invention. This embodiment is applicable to the case of explicit encryption of data in the database. The method can be executed by a database data encryption device, which can be implemented by software / hardware Realized, and can be integrated in the database system.
[0044] see figure 1 , the database data encryption method, comprising:
[0045] S110. When creating a table, check whether the attribute of the table includes an encryption key.
[0046] On the front end, modify the syntax for creating tables to support specifying encryption keywords. Exemplarily, the encryption key is ENCRYPT. The ENCRYPT keyword can appear in table attributes or column attributes, corresponding to table-level and column-level encryption respectively. Save the ENCRYPT attribute to metadata.
[0047] S120. When the attribute of the table includes an encryption key, en...
Embodiment 2
[0068] figure 2 It is a schematic flow chart of the database data decryption method provided by Embodiment 1 of the present invention. This embodiment is applicable to the situation of loading encrypted data in the database. This method can be executed by a database data decryption device, which can be realized by software / hardware , and can be integrated in the database system.
[0069] see figure 2 , the database data decryption method, comprising:
[0070] S210. Receive a storage file.
[0071] Since the encrypted data is a storage file generated after encryption on the user front end, the corresponding storage file needs to be received before writing the data into the database.
[0072] S220, decrypt the data block according to a preset decryption algorithm, and obtain decrypted data.
[0073] The decryption algorithm corresponding to the encryption algorithm is used to decrypt the data blocks in the storage file to obtain the decrypted data.
[0074] S230. Provide ...
Embodiment 3
[0079] image 3 is a schematic structural diagram of the database data encryption device provided in Embodiment 3 of the present invention, as shown in image 3 As shown, the device includes:
[0080] A checking unit 310, configured to check whether the attributes of the table include encrypted keywords when the table is created;
[0081] An encryption unit 320, configured to encrypt data in data blocks when an encryption keyword is included in the attributes of the table;
[0082] The writing unit 330 is configured to write the encrypted data into the storage file.
[0083] Further, the encryption unit is specifically used for:
[0084] Cache data in blocks;
[0085] Compress the data block;
[0086] Encrypt compressed data blocks.
[0087] The database data encryption device provided by the embodiment of the present invention encrypts the data in data blocks according to the attributes of the established table after the data enters the database and before the database ...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 