You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BaseCipher ignores supplied IV when PBEParameterSpec used #1846
There appears to be a bug when attempting to use PBKDF2 with AES encryption in approved only mode, where the PBEWITH* Cipher/SecretKeyFactory algorithm family is unavailable.
The above produced the following exception on decryption:
javax.crypto.BadPaddingException: Error finalising cipher data: pad block corrupted
The reason for this is because in BaseCipher.doEngineInit() it's ignoring the IV specified in parameterSpec and generates a new, random IV.
The bug can be fixed easily enough by pulling the IvParamterSpec out of PBEParameterSpec with getParameterSpec() either in BaseCipher or in the ParametersCreator that BaseCipher calls.
So, it's going to take a bit of work to add this, but probably a lot more time to certify it. I'll put it on the list, but in the meanwhile, you can also do what you want with:
Activity
dghgit commentedon Dec 26, 2024
So, it's going to take a bit of work to add this, but probably a lot more time to certify it. I'll put it on the list, but in the meanwhile, you can also do what you want with:
PBE support in the JCE was a bit ill-defined in the early days, so the other advantage of the above is it should be fairly portable.
added support for the nested form of PBEParameterSpec. Relates to git…
expanded PBE support - relates to github #1846