devxtec Posted August 13, 2008 Share Posted August 13, 2008 I am looking to learn how to do two way encryption with PHP. What I am looking for is an encryption algorithm which can be encoded and then decoded but at the same time provides strong security against unauthorized viewers (Will be encrypting perscription information). This encryption method must be able to be encrypted by a PHP script and decrypted by a program written in C & C++. So I was thinking Blowfish encryption. (If you have any other suggestions let me know.) Anyway could someone point me in the right direction of a tutorial or something on how to do something of this nature? I would use mcrypt but the production server doesn't have this feature compiled into the PHP and as of right now I am not authorized by my supervisor to install mcrypt. Could something like PEAR help in this situation? Any and all help is greatly appreciated. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 13, 2008 Share Posted August 13, 2008 I actually think that you'd NEED mcrypt() for this. Quote Link to comment Share on other sites More sharing options...
devxtec Posted August 13, 2008 Author Share Posted August 13, 2008 Well I'm setting up a test box just like the production server. It's running the same PHP 4.3.9 and MySQL 4.x. How easy is it to compile mcrypt into the 4.3.9 version? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 13, 2008 Share Posted August 13, 2008 I haven't used 4.3 for AGES. Why can't you upgrade to PHP5 and MySQL5 on the production server? Most companies have at LEAST PHP5 installed. >_< I never installed mcrypt into php4 to be honest. Quote Link to comment Share on other sites More sharing options...
devxtec Posted August 13, 2008 Author Share Posted August 13, 2008 I haven't used 4.3 for AGES. Why can't you upgrade to PHP5 and MySQL5 on the production server? Most companies have at LEAST PHP5 installed. >_< I never installed mcrypt into php4 to be honest. We haven't fully upgraded all servers to PHP5 yet as not all of our code has been converted to be PHP5 compatible. So there is no way to do encryption without the use of mcrypt? I find that hard to believe. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 13, 2008 Share Posted August 13, 2008 All you can do is md5 and sha1, both of which are one-way encryption. The mcrypt library gives PHP access to other algorithms. Quote Link to comment Share on other sites More sharing options...
mikeschroeder Posted August 13, 2008 Share Posted August 13, 2008 If you have the openSSL library you could use that to do two-way encryption, but I'm sure would sacrifice some processor overhead vs mcrypt. http://www.mobilefish.com/developer/php/php_quickguide_openssl.html Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.