Page 1 of 1

Encrypting a file

Posted: Wed Feb 18, 2009 11:02 am
by ClarenceC
Well no one in the security section seems to have any advice so I will post this here. I have a simple file upload form allows my clients to upload the file on the server. Then through the admin section I can download it. How can I make the file get encrypted when the clients upload it, then decrypt when I download it????

Re: Encrypting a file

Posted: Wed Feb 18, 2009 11:40 am
by jason.carter
Try this

?php
$gpg = '/usr/bin/gpg';
$recipient = 'john@doe.com';
$secret_file = 'secret_file.txt';

echo shell_exec("$gpg -e -r $recipient $secret_file");
?>

See http://devzone.zend.com/node/view/id/1265