具体异常信息如下:
2024-01-29 08:57:34,710 ERROR [main] com.shun.test.TestDynamicService (TestDynamicService.java:93) - 异常信息
javax.crypto.BadPaddingException: Decryption error
at sun.security.rsa.RSAPadding.unpadV15(RSAPadding.java:369) ~[?:?]
at sun.security.rsa.RSAPadding.unpad(RSAPadding.java:282) ~[?:?]
at com.sun.crypto.provider.RSACipher.doFinal(RSACipher.java:362) ~[?:?]
at com.sun.crypto.provider.RSACipher.engineDoFinal(RSACipher.java:405) ~[?:?]
at javax.crypto.Cipher.doFinal(Cipher.java:2260) ~[?:?]
at com.baomidou.dynamic.datasource.toolkit.CryptoUtils.decrypt(CryptoUtils.java:199) ~[dynamic-datasource-creator-4.3.0.jar:?]
at com.baomidou.dynamic.datasource.toolkit.CryptoUtils.decrypt(CryptoUtils.java:71) ~[dynamic-datasource-creator-4.3.0.jar:?]
at com.shun.test.TestDynamicService.testDyDecrypt(TestDynamicService.java:89) ~[test-classes/:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
其中加密的明文为:root。
在没有使用分组加解密的版本,能够正常进行加解密。请老师帮忙看一下。
If there is an exception,or aop invalid,please attach the exception trace:
Please fill it out carefully, or it will be closed. 请认真填写,不然会直接关闭。
Enviroment
JDK Version(required): 11.02
SpringBoot Version(required): 2.7.15
dynamic-datasource-spring-boot-starter Version(required):4.3.0
druid Version(optional):
Describe what happened
数据库配置用户名、密码、URL时通过加密进行处理,自定义公私钥,但是再解密的过程出现异常。
具体异常信息如下: 2024-01-29 08:57:34,710 ERROR [main] com.shun.test.TestDynamicService (TestDynamicService.java:93) - 异常信息 javax.crypto.BadPaddingException: Decryption error at sun.security.rsa.RSAPadding.unpadV15(RSAPadding.java:369) ~[?:?] at sun.security.rsa.RSAPadding.unpad(RSAPadding.java:282) ~[?:?] at com.sun.crypto.provider.RSACipher.doFinal(RSACipher.java:362) ~[?:?] at com.sun.crypto.provider.RSACipher.engineDoFinal(RSACipher.java:405) ~[?:?] at javax.crypto.Cipher.doFinal(Cipher.java:2260) ~[?:?] at com.baomidou.dynamic.datasource.toolkit.CryptoUtils.decrypt(CryptoUtils.java:199) ~[dynamic-datasource-creator-4.3.0.jar:?] at com.baomidou.dynamic.datasource.toolkit.CryptoUtils.decrypt(CryptoUtils.java:71) ~[dynamic-datasource-creator-4.3.0.jar:?] at com.shun.test.TestDynamicService.testDyDecrypt(TestDynamicService.java:89) ~[test-classes/:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
其中加密的明文为:root。
在没有使用分组加解密的版本,能够正常进行加解密。请老师帮忙看一下。
If there is an exception,or aop invalid,please attach the exception trace:
Steps to reproduce
Step 1
Step 2
Step 3