On Wed, Nov 27, 2013 at 1:10 AM, Pent <supp...@apps.dinglisch.net> wrote:
> I forgot: if I pad initVector up to 16 bytes, and using the code I posted in
> the first post, I get this from the cipher init() call:
>
>
> java.security.InvalidKeyException: invalid parameter passed to AES init -
> com.android.org.bouncycastle.crypto.params.ParametersWithIV

The reason it worked before is that it was probably falling back to using the
IV included with the key (Cf. the class name). PBE algorithms can derive
both the key and the IV from the password.

>
> So it seems that PBEWITHSHA-256AND256BITAES-CBC-BC in the BC provider is not
> usable at all now ?!
>

Convert your key to a 'plain' key with something like this and is should work

SecretKey sk1  = new SecretKeySpec(sk.getEncoded(), "AES");

Then pass sk1 to Cipher.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to