JDK-8150530 : Improve javax.crypto.BadPaddingException messages
  • Type: Enhancement
  • Component: security-libs
  • Sub-Component: javax.crypto
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • CPU: generic
  • Submitted: 2016-02-24
  • Updated: 2018-05-23
  • Resolved: 2016-08-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9 Other
8u171Fixed 9 b134Fixed openjdk7uFixed
Description
"javax.crypto.BadPaddingException: Given final block not properly padded" is a vague message.

more often than not, a bad key or password is responsible for the exception. We should hint at this in the exception message. 

See also :  http://stackoverflow.com/questions/8049872/given-final-block-not-properly-padded