This is my code for AES.
In Gingerbread, I get the following error after encrypting data on 2.2, then trying to decrypt in version 2.3:
Caused by: javax.crypto.BadPaddingException: pad block corrupted
at org.bouncycastle.jce.provider.JCEBlockCipher.engineDoFinal(JCEBlockCipher.java:715)
at javax.crypto.Cipher.doFinal(Cipher.java:1090)
at com.citc.wallet.util.security.SimpleCrypto.decrypt(SimpleCrypto.java:63)
... 21 more
I found several posts that SecureRandomproduce different results on different systems:
BouncyCastle AES error when upgrading to 1.45
How to avoid this problem on 2.3?
Can I somehow force 2.3 to use the same SecureRandom class?
Do I need to use some portable encryption method, and if so, then what?
source
share