Spring Boot 注解加密隐私信息
作者:互联网
1、注解字段:
@Column(name = "phone", length = 100)
@ColumnTransformer(read = "AES_DECRYPT(UNHEX(phone), 'aes_phone')", write = "HEX(AES_ENCRYPT(?, 'aes_phone'))")
private String phone;
2、原生SQL 查询加密数据:
SELECT AES_DECRYPT(UNHEX(s.phone),'aes_phone') FROM TABLSE s
标签:UNHEX,AES,加密,Spring,Boot,aes,phone,DECRYPT 来源: https://blog.51cto.com/7218743/2473269