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));

posted @ 2022-03-21 09:23  _titleInfo  阅读(357)  评论(0编辑  收藏  举报
//雪花飘落效果