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?
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
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.
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.
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!
$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!
ASKER
Further clarification:
Database is > 500k & <20mb
Database is > 500k & <20mb
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I've contacted the author of dcpcrypt and have a solution.
Could you post the solution here for everyone?
As long as you stick to the same encryption method within both PHP and Delphi I wouldnt have thought there would be an issue.