使用jasypt对springboot的datasource密码加密
2017-12-05 10:53
351 查看
maven依赖
<!-- https://mvnrepository.com/artifact/com.github.ulisesbocchio/jasypt-spring-boot-starter --> <dependency> <groupId>com.github.ulisesbocchio</groupId> <artifactId>jasypt-spring-boot-starter</artifactId> <version>1.8</version> </dependency>
配置加密参数
可以理解为加密的saltjasypt: encryptor: password: 123456
使用加密
这里需要注意 EbfYkitulv73I2p0mXI50JMXoaxZTKJ7 为加密后的字符串 需要放到ENC里面spring: jpa: show-sql: true hibernate: ddl-auto: update datasource: url: jdbc:postgresql://localhost:5432/postgres driver-class-name: org.postgresql.Driver username: postgres password: ENC(EbfYkitulv73I2p0mXI50JMXoaxZTKJ7) validation-query: SELECT 1 test-while-idle: true test-on-borrow: true
加密密码
@Autowired StringEncryptor stringEncryptor; @Test public void encryptPwd() { String result = stringEncryptor.encrypt("yourpassword"); System.out.println(result); }
相关文章推荐
- 使用jasypt对springboot的datasource密码加密
- 使用jasypt对springboot的datasource密码加密
- 使用jasypt对springboot的datasource密码加密
- 使用jasypt对springboot的datasource密码加密
- springboot使用jasypt对的datasource密码加密
- 使用jasypt对spring boot的datasource中数据库密码加密
- Spring 中使用jasypt对配置文件(.properties)中密码加密
- Spring 中使用jasypt对配置文件(.properties)中密码加密
- Spring 中使用jasypt对配置文件(.properties)中密码加密
- 使用durid的ConfigFilter对数据库密码加密
- jboss eap 6.2+ 版本中 加密datasource密码等敏感信息
- Android中使用MD5对密码进行加密
- 使用BCrypt算法加密存储登录密码用法及好处
- 使用Shiro1.2中的PasswordService实现密码加密存储和比对
- Spring Security笔记:使用BCrypt算法加密存储登录密码
- 使用 Aircrack-ng 破解 WEP 和 WPA/WPA2 加密的 Wi-Fi 密码。
- 使用主密码对各种账户密码进行加密管理的文件加密工具
- SQLSERVER使用密码加密备份文件以防止未经授权还原数据库
- 在rails中使用bcrypt进行密码的加密
- android使用MD5算法加密密码