• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Decryption trouble (Blowfish?).

 
felix fixanoid
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic