javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
  at java.base/com.sun.crypto.provider.CipherCore.unpad(
  at java.base/com.sun.crypto.provider.CipherCore.fillOutputBuffer(
  at java.base/com.sun.crypto.provider.CipherCore.doFinal(
  at java.base/com.sun.crypto.provider.AESCipher.engineDoFinal(
  at java.base/javax.crypto.Cipher.doFinal(            

Could arise if you've Base64 encoded the string when encrypting it, but have forgotten to do so when decrypting it.

Licensed under CC BY Creative Commons License ~ ✉ torstein.k.johansen @ gmail ~ 🐘 ~ 🐦 @torsteinkrause