Link to home
Start Free TrialLog in
Avatar of merimax
merimax

asked on

Blowfish decryption in C

In C (linux), I am pulling a Blowfish encoded string from the database. I know the "passphrase" and obviously I have the encoded string. Can I use the crypto libraries to decode this string?

I've tried decrypting from the command line using openssl but I have been unsuccessful. Strangely enough, I found an online tool which uses the the crypt_blowfish class of the PEAR project and this does decode my string successfully. That tool is: http://thom-patterson.com/Toys/Encryption/index.php

A little guidance would be greatly appreciated.
Avatar of F. Dominicus
F. Dominicus
Flag of Germany image

Sure you can use libssl for decryption. Have you seen the examples? Have you written some code to try out?
ASKER CERTIFIED SOLUTION
Avatar of F. Dominicus
F. Dominicus
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of merimax
merimax

ASKER

Well, at this point I can't even get the openssl command line routines to decrypt the string. Since I can get the tool http://thom-patterson.com/Toys/Encryption/index.php to decrypt the string then I realize I am missing something pretty obvious.
Avatar of merimax

ASKER

Ok. I am able to get this to work the way I want in PHP. Could someone offer some suggestions on how to convert this to C using the openssl blowfish libraries. I have tried several different combinations of openssl blowfish routines and I keep going around in circles. Anyway this is how I got it to work in PHP....

$p="password.sample" ;
$i="MCtwzLQuwdQdhwhciKlhORtKO5K8g8HhA7JGMfpxs41Wtct7lVwHKw==" ;
$blowfish = new Crypt_Blowfish($p);
$output = $blowfish->decrypt(base64_decode($i));
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.