赞
踩
已解决
密码学
是RC4还是ARCFOUR?10
我尝试在我的电脑上运行我的应用程序,但我不断得到这个东西。 我有可能错过了一些图书馆吗?fabsam.crypto.CryptoException: java.security.InvalidKeyException: No installed provider supports this key: javax.crypto.spec.SecretKeySpec
at fabsam.crypto.RC4Decoder.decode(RC4Decoder.java:37) ~[bin/:na]
... (skipped my projects stack trace)
at java.lang.Thread.run(Thread.java:662) [na:1.6.0_25]
Caused by: java.security.InvalidKeyException: No installed provider supports this key: javax.crypto.spec.SecretKeySpec
at javax.crypto.Cipher.a(DashoA13*..) ~[na:1.6]
at javax.crypto.Cipher.init(DashoA13*..) ~[na:1.6]
at javax.crypto.Cipher.init(DashoA13*..) ~[na:1.6]
at fabsam.crypto.RC4Decoder.decode(RC4Decoder.java:27) ~[bin/:na]
... 5 common frames omitted
Caused by: java.security.InvalidKeyException: No installed provider supports this key: javax.crypto.spec.SecretKeySpec
at javax.crypto.Cipher.a(DashoA13*..) ~[na:1.6]
at javax.crypto.Cipher.init(DashoA13*..) ~[na:1.6]
at javax.crypto.Cipher.init(DashoA13*..) ~[na:1.6]
at fabsam.crypto.RC4Decoder.decode(RC4Decoder.java:25) ~[fabsam-08.05.11.jar:na]
... 5 common frames omitted
码:cipher.init(Cipher.DECRYPT_MODE,
new SecretKeySpec(key.getBytes(DEFAULT_CHARSET), ALGORITHM));
可能是因为我在ALGORITHM变量中使用RC4而不是ARCFOUR ? 当我尝试ARCFOUR时,我得到了这个:fabsam.crypto.CryptoException: java.security.InvalidKeyException: Illegal key size or default parameters
at fabsam.crypto.RC4Decoder.decode(RC4Decoder.java:37) ~[bin/:na]
... (skipped my projects stack trace)
at java.lang.Thread.run(Thread.java:662) [na:1.6.0_25]
Caused by: java.security.InvalidKeyException: Illegal key size or default parameters
at javax.crypto.Cipher.a(DashoA13*..) ~[na:1.6]
at javax.crypto.Cipher.a(DashoA13*..) ~[na:1.6]
at javax.crypto.Cipher.a(DashoA13*..) ~[na:1.6]
at javax.crypto.Cipher.init(DashoA13*..) ~[na:1.6]
at javax.crypto.Cipher.init(DashoA13*..) ~[na:1.6]
at fabsam.crypto.RC4Decoder.decode(RC4Decoder.java:27) ~[bin/:na]
... 5 common frames omitted
好的,问题不在于代码。 在服务器上运行正常,没有错误。 但是在我的电脑上它会抛出InvalidKeyException异常。 所以这与jvm有关......有什么想法吗?
编辑:我现在看到我得到两个例外。 不是一次,但第一次非法密钥大小,然后没有安装提供商。 我在运行项目时将ALGORITHM设置为“ARCFOUR”。
vinda
2019.07.28
4199
收藏
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。