Input length must be multiple of 8 when decrypting with padded cipher

版权声明:苝花向暖丨楠枝向寒 https://blog.csdn.net/weixin_40247263/article/details/79821582

今天给数据库的用户和密码加密的时候 报错 Input length must be multiple of 8 when decrypting with padded cipher

原因   : 自己在红色箭头的位置 加了个分号,导致无论怎样都会执行




分析: 报这个 错误,应该是 将未被加密过的字符串解密。  

比如root 被加密成 WMYfCpui1FY=,调用自己写的deCode(WMYfCpui1FY=) ,但由于我if加了分号,导致驱动和url也被解码了。

展开阅读全文

String length must be a multiple of four

10-29

保存和查询数据的时候都会报这么个错误。。。。这是什么问题?rn数据库编码是UTF-8mb4rnrnCaused by: java.lang.IllegalArgumentException: Failed to decrypt.rn at com.alibaba.druid.filter.config.ConfigFilter.decrypt(ConfigFilter.java:212)rn at com.alibaba.druid.filter.config.ConfigFilter.init(ConfigFilter.java:124)rn at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:345)rn at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:622)rn at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:618)rn at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:79)rn at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)rn at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)rn at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:81)rn at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:67)rn at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:279)rn at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:72)rn at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:47)rn at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:105)rn at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:152)rn ... 40 morernCaused by: java.lang.IllegalArgumentException: String length must be a multiple of four.rn at com.alibaba.druid.util.Base64.base64ToByteArray(Base64.java:128)rn at com.alibaba.druid.util.Base64.base64ToByteArray(Base64.java:110)rn at com.alibaba.druid.filter.config.ConfigTools.decrypt(ConfigTools.java:126)rn at com.alibaba.druid.filter.config.ConfigFilter.decrypt(ConfigFilter.java:204) 论坛

没有更多推荐了,返回首页