Link to home
Start Free TrialLog in
Avatar of hibbidiji
hibbidiji

asked on

php encryption thats unencryptable in delphi

I think the question title says it all.   I need to encrypt something in PHP that can be unencrypted in delphi.  Any ideas?

Avatar of Mike Littlewood
Mike Littlewood
Flag of United Kingdom of Great Britain and Northern Ireland image

What are you trying to encrypt in PHP?
As long as you stick to the same encryption method within both PHP and Delphi I wouldnt have thought there would be an issue.
Avatar of BlackTigerX
BlackTigerX

as mikelittlewood says, if you provide the method you are using to encrypt in PHP, some one can come up with an algorithm to decrypt or point out some resources of already built solutions for such algorithm
Avatar of Eddie Shipman
He must be talking about the PHP crypt function.

crypt -- One-way string encryption (hashing)

crypt() will return an encrypted string using the standard Unix DES-based
encryption algorithm or alternative algorithms that may be available on the system.

No way to decrypt it, however. It is a one-way hash like MD5.
I think the OP needs to further define his requirements.
Avatar of hibbidiji

ASKER

Pardon me folks.   I will write a code example of how i USUALLY encrypt in php.

$data = $datatemp;
$key = "keyhere";
$td = MCRYPT_RIJNDAEL_256;

$encrypted_data = @mcrypt_encrypt($td, $key, $data, MCRYPT_MODE_CBC);


This has its disadvantages.   Here is my application:

Delphi 2005 applicaiton  reads encrypted database from web server and writes an encrypted temp file to disc.   App decrypts it at runtime in memory, leaving the temp file encrypted for mild security.   (I know that people can do memory dumps and get my db, its not THAT important, just mild encryption or obfuscation is needed)

The downsides with my above example are that it requires either mcrypt or similar bloat to the delphi app, and that it generates a binary file that is not as easily transferred with http over the net.   I can happily zip the file for transfer (I have a zip componenet for delphi) or use FTP if you folks think my existing idea is best.   Just looking for options.  Thanks!


Further clarification:

Database is > 500k & <20mb

ASKER CERTIFIED SOLUTION
Avatar of Eddie Shipman
Eddie Shipman
Flag of United States of America 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
I've contacted the author of dcpcrypt and have a solution.

Could you post the solution here for everyone?