File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Security and the fly likes Decryption trouble (Blowfish?). Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "Decryption trouble (Blowfish?)." Watch "Decryption trouble (Blowfish?)." New topic

Decryption trouble (Blowfish?).

felix fixanoid

Joined: Oct 21, 2009
Posts: 1
Hi! I'm hoping somebody here knows more about JCE and blowfish than me...

I get a remotely encrypted string: 53616c7465645f5f455ef6aa94807b56335681813d25923fc2790a11e152a9f7ecc72ad8641b84c438e63fdee2561ee6 -- which is supposed to be blowfish encryption in a hex string.
However, when I unhex it, I get another cryptic string:

Here is my unhexer:

Still, if I take that cryptic string and run through blowfish decryption, I get: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher

Any thoughts? Am I missing something essential? I've done this kind of encryption before tho I always relied on base64 encoded strings instead of hex/dehex....
greg stark
Ranch Hand

Joined: Aug 10, 2006
Posts: 220
You need to be working with byte [] arrays internally, not Strings. You can attempt to do the conversions yourself by modifying your unhexer method, or you can use someone else's class. I often recommend the apache commons codec package for this and similar operations. See the javadocs for the Hex class

Nice to meet you.
I agree. Here's the link:
subject: Decryption trouble (Blowfish?).
It's not a secret anymore!