1. 导入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>2.1.0</version>
</dependency>

2.添加配置, 生成密文

  ①.在配置文件中新增配置

    jasypt.encryptor.password = jasyptTest

  ②.生成密文

    java -cp jasypt-1.9.2.jar org.jasypt.intf.cli.JasyptPBEStringEncryptionCLI input="123456" password=jasyptTest algorithm=PBEWithMD5AndDES

    springboot 集成 jasypt 配置文件加密

 

 

  ③. 用密文替换明文

    springboot 集成 jasypt 配置文件加密

 

 

 

3.在springboot启动Application.java加上注解

@EnableEncryptableProperties

相关文章:

  • 2021-12-05
  • 2021-10-14
  • 2021-07-16
  • 2021-12-05
  • 2022-02-06
  • 2021-07-03
  • 2022-02-14
猜你喜欢
  • 2021-12-28
  • 2022-02-08
  • 2021-10-15
  • 2022-01-27
  • 2021-08-05
相关资源
相似解决方案