I use PBE encryption to encrypt and decrypt some text in an Android application, but I get a BadPaddingException: with the message "pad block corrupted" when I use the wrong private key to decrypt the text. My question, since I am not good at Java encryption, is the normal behavior of the encryption API, because I need to do some logic in case of entering the wrong key, but I don’t know the private one and do not store it anywhere (keeping only the encrypted and decrypted verification text).
Thanks Mihai
source
share