mysql:数据库加解密查询
解密:
SELECT
CONVERT (AES_DECRYPT(UNHEX( column_name), '密钥') USING utf8) AS column_name,
from table_name ;
加密:
SET @sk = '密钥';
INSERT INTO table_name(column_name1, column_name2)
VALUES (
hex(AES_ENCRYPT(column_value1, @sk)),
hex(AES_ENCRYPT(column_value2, @sk));