<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>3.0.2</version>
</dependency>
@EnableEncryptableProperties
jasypt: encryptor: algorithm: PBEWithHmacSHA512AndAES_128
@Autowired
private StringEncryptor stringEncryptor;
public void test() {
String encrypt = stringEncryptor.encrypt("需要加密的信息"); //会返回一个密文
}