配置文件配置暴露一些密码问题处理:
jasypt 是一个简单易用的加解密Java库
相关可以参考的国外大神写的源码的github地址
github:https://github.com/ulisesbocchio/jasypt-spring-boot
https://github.com/gxing19/Spring-Boot-Example/tree/master/spring-boot-password-encrypt
以下是修改步骤(我用的是springboot框架):
1、添加依赖:在pom.xml添加如下依赖
<!-- jasypt加密 -->
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>2.1.0</version>
</dependency>
2、配置文件设置 jasypt 密钥如:
#jasypt加密的盐值
jasypt.encryptor.password=erp
3、编写测试代码生成密文