I give up trying to figure this out. Any help would be apppreciated.
I am using this class to encrypt/decrypt:
http://www.infinity-design.com/code/Blowfish.java
Occaionally the decrypted data will contain garbled characters, occuring 8 in a row. It seems to depend on what key data is used.
Try this code and you will see what I mean:
try{
Security.addProvider(new com.sun.crypto.provider.SunJCE());
String data = "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789";
String keydata = "BW6v589SIg3i3zaEW47RcMZ+I+M=";
System.out.println("Encrypting data: " + data);
String encrypted = Blowfish.encrypt(data,keydata);
String decrypted = Blowfish.decrypt(encrypted,keydata);
System.out.println("Decrypted data: " + decrypted);
}catch(Exception ex){
System.out.println(ex.getMessage());
}
If the key changes the garbage chars go away and everything works.
Any ideas?