spring boot jasypt

spring boot jasypt用于配置文件中的配置项加密。

需要引入的依赖

<dependency>
    <groupId>com.github.ulisesbocchio</groupId>
    <artifactId>jasypt-spring-boot-starter</artifactId>
    <version>2.0.0</version>
</dependency>

相关配置

jasypt:
  encryptor:
    password: 加密密码
    algorithm: 加密算法
    iv-generator-classname: org.jasypt.iv.NoIvGenerator

 在配置文件中就可以使用加密后的字符串:

spring.datasource.username=ENC(加密后的字符串)
作者:冯亮
         
能力有限,水平一般。如有错误,欢迎指正
原文地址:https://www.cnblogs.com/fengliang/p/14443221.html