记一次安全测试记录
敏感数据加密存储
配置文件敏感数据加密存储
SpringBoot使用jasypt加解密密码。
1
2
3
4
5
6<!--jasypt-->
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>2.0.0</version>
</dependency>
配置文件
1
2
3
4
5
6
7
8# 加密的密钥
jasypt:
encryptor:
password: Hzzxj
# 格式:ENC()
spring.datasource.username=ENC(EROfZyZxd9F0CYgarXQGtLGFKGzOyD+k)
spring.datasource.password=ENC(X02b/D0sOY81kkSV7v4g2/tLw8Ynq6wQ)
1 | # 获取密文 |