SpringBoot入门到精通-使用Jasypt对数据库账号密码加解密

引用代码库


            com.github.ulisesbocchio
            jasypt-spring-boot-starter
            3.0.5
        

配置启动

@EnableEncryptableProperties
public class CephS3TransferApplication {

配置文件

jasypt:
  encryptor:
    algorithm: PBEWithMD5AndDES
    password: 1111111
    iv-generator-classname: org.jasypt.iv.NoIvGenerator # 一定要配置不然报错

Failed to bind properties under 'key' to java.lang.String:
Reason: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'spring.datasource.password' to java.lang.String
Unable to decrypt property: ENC(LPlBnj/3sx) resolved to: ENC(LPlBnj/xx==). Decryption of Properties failed, make sure encryption/decryption passwords match

你可能感兴趣的:(spring,boot,数据库,后端)