I am trying to encrypt and decrypt some simple text. But for some reason I am getting a strange error: javax.crypto.BadPaddingException. Why would JCE generates byt
javax.crypto.BadPaddingException
You can forgo the calls to update and just pass the byte[] data directly to doFinal performing the operation of encrypting or decrypting in one step.
update
byte[]
doFinal