java.lang.IllegalStateException

Unable to invoke Cipher due to bad padding

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web11426

  • via Spring JIRA by Jasvinder Bahra, 1 year ago
    Unable to invoke Cipher due to bad padding
  • Unable to invoke Cipher due to bad padding
  • Unable to invoke Cipher due to bad padding
  • Stack trace

    • java.lang.IllegalStateException: Unable to invoke Cipher due to bad padding at org.springframework.security.crypto.encrypt.CipherUtils.doFinal(CipherUtils.java:142) at org.springframework.security.crypto.encrypt.AesBytesEncryptor.decrypt(AesBytesEncryptor.java:128) at com.test.encryption.MyTest.crypt(MyTest.java:45) at com.test.encryption.MyTest.decryptFile(MyTest.java:31) at com.test.encryption.MyTest.main(MyTest.java:21) Caused by: 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:2087) at org.springframework.security.crypto.encrypt.CipherUtils.doFinal(CipherUtils.java:135) ... 4 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    3 times, 8 months ago
    Unknown user
    7 times, 8 months ago
    Unknown user
    Once, 1 month ago
    Unknown user
    Once, 1 month ago
    Unknown user
    Once, 1 month ago
    12 more bugmates