Encrypting Web Forms

James Thompson jamest@math.ksu.edu
Tue, 20 Jul 1999 08:28:26 -0500 (CDT)


On Tue, 20 Jul 1999, Michael Roth wrote:


> Hello,
>
> to use GnuPG to encrypt in a pipeline called from a webserver, CGI, or
> something else use:
>
> gpg --no-default-keyring --keyring /somewhere/keyring.gpg \
> --always-trust --encrypt --recipient bla@foobar.org
>
> However, it isn't a good idea to sign the message because you must store
> the secret key on a public maschine and/or store the passphrase somewhere
> in the script. This is highly insecure.
>
What I did was create a private/public key combination for a mythical user. I then place the public key to that user in the public keyring of the user the web server runs as. Then when the form is submitted I encrypt the form using the public key of that user like this (in php) passthru("echo \" $reginfo \" | /usr/local/bin/gpg --textmode --quiet --home /someones/home/.gnupg --batch -ear _MTE_ | mail -s \"$timestamp \" jamest@math.ksu.edu"); Which works fine. The person that needs to decrypt the messages keeps the secret key in a secure(? ;-) location and uses it to decrypt. This way I was able to keep the private key unavailable to the web server user. This seems like a pretty decent, secure method to me. What do you think? ->->->->->->->->->->->->->->->->->->---<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-< James Thompson 138 Cardwell Hall Manhattan, Ks 66506 785-532-0561 Kansas State University Department of Mathematics ->->->->->->->->->->->->->->->->->->---<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<