I am using the Bouncy Castle Java cryptographic algorithm implementation.
I am getting an IllegalKeySizeException
. To overcome this I have even changed my java security jars (local_policy.jar
and US_Export_policy.jar
), but I am still getting the same problem.
Can anyone suggest a solution for this (I am usin开发者_Python百科g centos operating system)?
For it runs on some machines but not on others, the cause can be a missing 'unlimited strength policy file' - found the hint here. Good luck!
Some encryption algorithms expect a fixed key size (or a key that is a multiple of, say, 16 bytes). Pad the key with 0 bytes until it's big enough or truncate it accordingly.
精彩评论