Skip to content Skip to sidebar Skip to footer

Keystore Operation Failed :incompatible Padding Mode

I am using AndroidKeystore to generate RSA Keypair and doing encryption and decryption using this keypair My keypair generation code looks like this var keypairGen:KeyPairG

Solution 1:

Try putting this before you decrypt

 stringEncrypt = stringEncrypt.replace("/n","");
valdecryptedBytes= cipher1.doFinal(Base64.decode(stringEncrypt,Base64.DEFAULT));
valdecrypted= String(decryptedBytes);

Either the key is wrong or the Base64 encoding is adding stuff if your keys to long. So its seeing mismatched sizes.

Post a Comment for "Keystore Operation Failed :incompatible Padding Mode"