cipher = Cipher.getInstance("Blowfish");
This throws a java.security.NoSuchAlgorithmException: Cipher Blowfish implementation not found.
I checked both local_policy.jar and US_export_policy.jar and they have not been changed since the installation of java. What can cause this problem?
Edit:
Object[] o = Security.getAlgorithms("Cipher").toArray(); for (int i=0; i<o.length; i++) { System.out.println((String)o[i]); }
When I run this code, I get a list without "Blowfish", but among the names of the algorithms, such as DES or RSA, there are some unknown names, such as "1.2.840.113549.1.1.7" and the like. Why is there no Blowfish or is it hidden in these numbers?
Yeap, I could not find a solution and just used the GNU cryptographic library. It works great.
cipher = Cipher.getInstance("Blowfish")
Android 2.3 , , Android 2.3?
EDIT: 2.3 , , 4.0 ICS, , - Manifest.xml:
<uses-sdk android:minSdkVersion="3" /> <uses-sdk android:targetSdkVersion="14" />
, Blowfish , ( /greyed out) , 2.3, . ! SDK. !
, , - , .
Android BouncyCastle. , .
, BouncyCastle , Android .
, , - SpongyCastle. , , , .
: JON Spongy JAR Android?
local_policy.jar US_export_policy.jar Android. Android, . , Android JCE Bouncy Castle, . lib , . Spongy Castle, . , , , , - "SC":
Cipher c = Cipher.getInstance("Blowfish", "SC");
blowfish Android. , , blowfish .
I had to download sophisticated sources of the lock, I changed the provider name from BC to BC2 and renamed the package name to bouncycastle2 to avoid a conflict with the one that was already on the sdk Android server. Then I added this regular Bouncy Castle jar to my application as a new jar, and it works great!