利用MYSQL的加密解密办法应对三级安全等级保护

-- 创建测试表

drop table if EXISTS t_passwd_2;

create table t_passwd_2(pass1 varchar(64));

-- 对身份证号加密
insert into t_passwd_2 values (hex(aes_encrypt('22230119771011001X', 'dsideal4r5t6y7u!@#')));

-- 数据库中存储的样子
select * from t_passwd_2;


-- 解密
select aes_decrypt(unhex(pass1), '***************') as pass1 from t_passwd_2;


原文地址:https://www.cnblogs.com/littlehb/p/9042853.html