##使用
https://blog.youkuaiyun.com/cts529269539/article/details/79024436
maven引入jar
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>1.14</version>
</dependency>
使用jasypt.jar工具加解密
//解密
java -cp jasypt-1.9.2.jar org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI input="bWgq4JW/jLTBJ5kuUrR0e3s0JWEt5E7W" password=ACMP10171215 algorithm=PBEWithMD5AndDES
//加密
java -cp jasypt-1.9.2.jar org.jasypt.intf.cli.JasyptPBEStringEncryptionCLI input="bWgq4JW/jLTBJ5kuUrR0e3s0JWEt5E7W" password=ACMP10171215 algorithm=PBEWithMD5AndDES
配置文件中将原信息替换为ENC(加密后信息),例如:
password: ENC(0V5vWSDDVLxTXEmQLNDB0CahCc+gL/Dm)
运行
运行时配置解密秘钥
-Djasypt.encryptor.password=
在idea中运行


命令行启动和docker中运行参见
https://www.cnblogs.com/zz0412/p/jasypt-001.html
本文介绍如何通过Maven引入jasypt-spring-boot-starter进行数据加密和解密。详细展示了使用jasypt.jar工具的具体命令,并提供了配置文件中加密信息的使用方式。
1105





