I tried running my application on my pc, but I keep getting this thing. Is it possible that I'm missing some libraries?
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
Code:
cipher.init(Cipher.DECRYPT_MODE,
new SecretKeySpec(key.getBytes(DEFAULT_CHARSET), ALGORITHM));
Could it be because I'm using RC4
not ARCFOUR
in the ALGORITHM variable?
When I try ARCFOUR I get this:
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
Okay, the problem is not with the code. On server this runs just fine with no errors. However on my pc it throws me that InvalidKeyException exception. So it's something with jvm related.. Any ideas?
Edit: I now see that I'm getting both exceptions. Not at once, but first time the illegal key size and then no installed provider. I've the ALGORITHM set to "ARCFOUR" when running my project.
java -version
– MeBigFatGuy