Java encryption issue

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

+3
source share
3 answers

, " ". 100% . , PKCS # 5 ( ) 0,4% . - , , - , . , - - : ( 0,4% , ) , . SSL-.

+4

, , BadPaddingException - , , /.

: , , , . , .

-1

Source: https://habr.com/ru/post/1737363/


All Articles