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

发布时间:2023年12月29日

引用代码库

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

配置启动

@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

文章来源:https://blog.csdn.net/wxb880114/article/details/135286414
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。