Menu

#29 issue with javax.crypto.BadPaddingException

open
None
5
2017-09-13
2017-09-13
FunkiPunki
No

To store keys in our company we use your service.
But we are faced with such a problem, when we change the decryption key, we can not download attachments.
Here is a piece of log with an error:
2017-09-13 19:30:12,471 [http-12543-1] ERROR StackTrace - Sanitizing stacktrace:
javax.crypto.BadPaddingException: Given final block not properly padded
at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:811)
at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:676)
at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:313)
at javax.crypto.Cipher.doFinal(Cipher.java:2131)
at SecureBytesCodec$clinitclosure2.doCall(SecureBytesCodec.groovy:51)
at VsAttachment.getData(VsAttachment.groovy:30)
at VsAttachmentController$_closure9.doCall(VsAttachmentController.groovy:181)
at VsAttachmentController$_closure9.doCall(VsAttachmentController.groovy)
at java.lang.Thread.run(Thread.java:745)

If you attach a new attachment, then there is no problem with it.
I ask you to help us deal with this problem.

Here's what I found on the Internet for this error:
https://stackoverflow.com/questions/29607500/padding-exception-given-final-block-not-properly-padded
https://stackoverflow.com/questions/3954611/encrypt-and-decrypt-with-aes-and-base64-encoding
https://stackoverflow.com/questions/1220751/how-to-choose-an-aes-encryption-mode-cbc-ecb-ctr-ocb-cfb

Discussion


Log in to post a comment.