1 database field Encryption:
2 4.20. Data encryption
3 There are many sensitive fields in the database that are not allowed to be viewed at will, such as developers, operations personnel, or even DBA database administrators. In addition, the main encryption is to prevent hackers to take off the library (stolen)
4 Sensitive data Encryption There are many ways, you can use the database internal encryption function, you can also write to the database after external processing. There are many kinds of encryption algorithms, but usually two kinds are commonly used, one is decrypted by key encryption, the other is decrypted by certificate encryption.
5 Usually the programmer is responsible for writing the program, the program to the operation and maintenance configuration, operation and maintenance of the key set up, operations can not have database permissions, DBA can only log in the database, no key permissions.
6 4.20.1. Aes_encrypt/aes_decrypt
7 Introduction to AES encryption and decryption simple usage
8 CREATE TABLE Encryption (
9 UserID int unsigned not NULL auto_increment,
User_password varchar (+) not NULL,
User_name varchar (+) not NULL,
PRIMARY KEY (UserID)
13);
INSERT into encryption (User_name,user_password) VALUES (' TestName ', Aes_encrypt (' 123qwe ', ' Encrypt_key '));
SELECT aes_decrypt (User_password, ' Encrypt_key ') from encryption WHERE user_name= ' testname ';
16
17 here it is convenient to demonstrate that the key is written to the database, and the actual application key should be stored in the application configuration file. Usually the person who gets the key should not use database permissions.
This article is from the "I am a Little bird" blog, please make sure to keep this source http://2242558.blog.51cto.com/2232558/1716462
Mysql database field Encryption