views:

733

answers:

2

I'm trying to use a blowfish cipher inside an Android application.
It appears that the Android platform supports blowfish (it appears to be in the source code), but when I try to get a cipher using:

Cipher.getInstance("blowfish"); 

I get a "java.security.NoSuchAlgorithmException"
A: 

Based on a quick Google search, try a capital B in "Blowfish", and see if that helps.

CommonsWare
I checked that too, sadly, no joy
haseman
Ah, it looks like it was commented out as a provider. See http://bit.ly/dyUAOa -- all occurrences of Blowfish are commented out as "android-removed". I'm not quite sure why, as a cursory glance suggests the source is actually there, so it's not a space issue...
CommonsWare
Do you know of a good stand-alone blowfish cipher out there? I've tried pulling in bouncy castle, but my dex step chokes on all the extra code.
haseman
Yeah, your Bouncy Castle will conflict with the built-in Bouncy Castle -- too much bouncing will screw up the accelerometer. :-) The GNU Crypto project has a Blowfish implementation http://www.gnu.org/software/gnu-crypto/ -- it's GPL with the library exception, so I think you're OK to include it in your app without having to go GPL for the whole thing.
CommonsWare
Marked as the answer because your comment was insightful, not because "Blowfish" worked ;-)
haseman
A: 

Is there another standalone Blowfish implmentation/jar for Java?

thanks

john