Pad block corrupted means the wrong key was used to decrypt or the data was altered between encryption and decryption.
If I had to guess, I suspect you are creating a key in the wrong manner. Instead of calling getBytes()
, I'm guessing you should have done a hex conversion.
See Convert hex string to byte [] for example Android code for performing this task.
Side note: don't just specify "DESede"
for a cipher. Specify the mode and padding as well. E.g. "DESede/CBC/PKCS5Padding"
. That ensures you get exactly what you want, rather than crypto provider defaults (which may vary across phones).