blowfish convert from php to C with openssl

I have a very simple PHP script decrypting strings the way I need it to. It is as follows:

$p="password.sample" ;
$i="MCtwzLQuwdQdhwhciKlhORtKO5K8g8HhA7JGMfpxs41Wtct7lVwHKw==" ;
$blowfish = new Crypt_Blowfish($p);
$output = $blowfish->decrypt(base64_decode($i));

I am trying to accomplish the above in C using openssl/blowfish but I am not able to get the correct combination of arguments set to make this happen. What would be the proper way to accomplish the above in C (linux) and openssl?
merimaxAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fridomCEO/ProgrammerCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
fridomCEO/ProgrammerCommented:
0
btanExec ConsultantCommented:
this is another ref, do note blowfish need blocks of 8bytes or 64bits.

http://www.faqs.org/docs/gazette/encryption.html
0
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

ravenplCommented:
This Q is duplicate(rather renew) of http://www.experts-exchange.com/Security/Encryption/Q_26932519.html
The comments You proposed to accept are merely C encryption tutorials, but do not explain the PHP - C differences in algo.
I would advise to delete it instead of forcing accept.
0
fridomCEO/ProgrammerCommented:
There is but one difference. PHP used an Object interface whereas you have to use the C interface on the C side. However AFAIKT all bigger c packages often used an opaque data pointer as first parameter and IIRC this is done in OpenSSL also.

Regards
Friedrich
0
ravenplCommented:
fridom: I tried to decrypt the message with openssl  and mcrypt - failed at all combinations. I also googled somewhere the information, that the incompatibility is because of different padding (and possibly IV calculation) used by php and openssl.
IMHO answer to this Q is showing the implementation differences, hence I gave up on that.
0
TolomirAdministratorCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C

From novice to tech pro — start learning today.