Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "Decryption trouble (Blowfish?)." Watch "Decryption trouble (Blowfish?)." New topic
Author

Decryption trouble (Blowfish?).

felix fixanoid
Greenhorn

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:
Salted__E^öª”€{V3V=%’?Ây
áR©÷ìÇ*Ød„Ä8æ?ÞâVæ

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Decryption trouble (Blowfish?).
 
Similar Threads
Blowfish Encryption Using Jakarta Commons Codec 1.2
AES SecretKeySpec object varies in two instances with same passphrase.
Special characters in the decrypted text in servle, jce provider using Bouncy Castlte
How to use AES DECRYPT_MODE?
any suggestiong for encrypting password(String)?