Re: [android-developers] javax.crypto.BadPaddingException: pad block corrupted (only failing on Android 4.x)

2013-01-08 Thread David Asta
PBEWITHMD5ANDDES is also common and with exact name. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+u

Re: [android-developers] javax.crypto.BadPaddingException: pad block corrupted (only failing on Android 4.x)

2013-01-08 Thread David Asta
Thanks a lot Nikolay! I can see the list from 2.2 and 4.2 differs quite a lot. The one you mention is indeed in the list. Funny enough in 2.2 is named as PBEWITHSHA256AND256BITAES-CBCBC and in 4.2 as PBEWITHSHA256AND256BITAES-CBC*-*BC, though I guess is exactly the same, but then I'll have to

Re: [android-developers] javax.crypto.BadPaddingException: pad block corrupted (only failing on Android 4.x)

2013-01-08 Thread David Asta
Hmm, interesting; using* SecretKeyFactory keyFactory = SecretKeyFactory .getInstance("PBKDF2WithHmacSHA1");* (taken from http://nelenkov.blogspot.jp/2012/04/using-password-based-encryption-on.html) gives and exception *NoSuchAlgorithmException* on Android 2.2, but not on 4.2. So I guess I cann

Re: [android-developers] javax.crypto.BadPaddingException: pad block corrupted (only failing on Android 4.x)

2013-01-08 Thread David Asta
Thanks very very much to all people that has replied me so quickly. You have all helped me in different ways. I have yet to implement a new encryption method, but I understand now that my code wasn't very good (thanks Nikolay for pointing it out). It's a bit shocking though, that Android isn't

[android-developers] javax.crypto.BadPaddingException: pad block corrupted (only failing on Android 4.x)

2013-01-07 Thread David Asta
I have this piece of code that I use to encrypt/decrypt password that are stored on a sqlite3 database. Up until now, I've been using my app on my HTC Desire (Android 2.2.2) without any problems. Recently I got a Nexus 7 and to my surprise, my app didn't work. When trying to decrypt the passwor