使用AES/CBC/ISO7816d4Padding 对称加密报错
Jiekee opened this issue · 0 comments
ToolsFx版本及构建日期(如v1.15.1.beta2 2022-12-13):
v1.16.0
系统版本及位数(Windows/OSX/ Linux /x86/x64/ arm):
x64
Java版本(jdk 1.8.0 x86 oracle/openjdk):
openjdk
操作步骤(如运行ToolsFx.bat):
ToolsFx.bat
问题现象(如闪退):
选择 AES/CBC/ISO7816d4Padding 加密,报错
报错信息(命令行运行ToolsFx.bat/ToolsFx):
encrypt error: java.security.NoSuchAlgorithmException: Cannot find any provider supporting AES/CBC/ISO7816d4Padding
at java.base/javax.crypto.Cipher.getInstance(Unknown Source)
at me.leon.ext.crypto.SymmetricCryptoKt.makeCipher(SymmetricCrypto.kt:30)
at me.leon.ext.crypto.SymmetricCryptoKt.encrypt(SymmetricCrypto.kt:14)
at me.leon.controller.SymmetricCryptoController.encrypt(SymmetricCryptoController.kt:52)
at me.leon.controller.SymmetricCryptoController.access$encrypt(SymmetricCryptoController.kt:11)
at me.leon.controller.SymmetricCryptoController$encrypt$2.invoke(SymmetricCryptoController.kt:30)
at me.leon.controller.SymmetricCryptoController$encrypt$2.invoke(SymmetricCryptoController.kt:23)
at me.leon.ext.ExceptionKt.catch(Exception.kt:10)
at me.leon.controller.SymmetricCryptoController.encrypt(SymmetricCryptoController.kt:23)
at me.leon.view.SymmetricCryptoView$doCrypto$1.invoke(SymmetricCryptoView.kt:272)
at me.leon.view.SymmetricCryptoView$doCrypto$1.invoke(SymmetricCryptoView.kt:256)
at tornadofx.FXTask.call(Async.kt:457)
at javafx.concurrent.Task$TaskCallable.call(Task.java:1426)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: javax.crypto.NoSuchPaddingException: Padding ISO7816d4Padding unknown.
at org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher.engineSetPadding(Unknown Source)
at java.base/javax.crypto.Cipher$Transform.setModePadding(Unknown Source)
... 17 more