Fog Creek Software
Discussion Board




PHP and C++ encryption/bigint libraries

My boss just gave me an assignment today, due tomorrow, to take information that is inputted in a PHP script and encrypt it, then decrypt it in c++... it needs to be encrypted because en route it's getting stored in a database and passed through unencrypted email.

I would appreciate any ideas.

Thanks.

Richard Boehme
Thursday, August 19, 2004

Look into the mcrypt library in PHP, provided you implement it with an algorithm for which there is a commonly available C++ library, like blowfish, and pass the initialisation vector along with the data, and obviously your C++ code will know the key, it shouldn't be too hard...

Andrew Cherry
Thursday, August 19, 2004

Don't go implementing algorthms or even using them directly through a library. Use standard, complete protocols/formats, if you're communicating with the the C++ code via http, use SSL, if you're sending email have a look at S/MIME. In case you don't really know what kind of channels and systems your encrypted information will pass en route, encrypt the file with an external call to something like pgp or gnu-pg and hand around the encrypted file. No chance of creating anything with even halfassed security until tommorrow from scratch, even if you really really know what you're doing.

-tim

a2800276
Friday, August 20, 2004

*  Recent Topics

*  Fog Creek Home