Wednesday, December 12, 2012

Re: [android-developers] Cipher.wrap() not working in Android 4.2?

On Thu, Dec 13, 2012 at 11:55 AM, Matthew Fleming <mgflem@gmail.com> wrote:
> I use the following code to encrypt a SecretKey with password-based
> encryption:
>
> Cipher pbeEncryptCipher = Cipher.getInstance("PBEWithMD5AndDES");

Try Cipher.getInstance("PBEWithMD5AndDES", "BC");

Also probably not a good idea to use both DES and MD5 in this day and age...

>

>
> In Android 4.2, but not in any previous version as far as I can tell, this
> throws a java.lang.UnsupportedOperationException. My understanding is that
> this is the result of something missing from the cryptographic service
> provider in Android 4.2, which was not missing in previous versions, ie an
> Android bug.
>

This is probably due to the shift to using OpenSSL (backed classes) as
the default
provider for pretty much everything. Depending on how you look at it,
it's not really
a bug, but you might want to file it at http://b.android.com().

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate