GNuPG Newb

Sven Radde email at
Thu Nov 1 12:45:49 CET 2007


jramro schrieb:
>  I'm trying to send a php mail form and not able to get it to encrypt or do
> much of anything. 

First of all, make sure that you have access to the gpg executable from
your php script and that safe mode and similar restrictions do not cause
Make also sure that the necessary keys are imported, set to trustworthy
on the machine you are running GnuPG and the like.

>  I was a bit confused because i heard that PGP can intercept a mail form
> through SMTP and encrypt it , but that GnuPG can not? 

What is confusing about the fact that different softwares can have a
different set of features?
It should however be reasonably easy to write a wrapper around GnuPG
that works as an SMTP proxy if this is really necessary. Maybe someone
can point you to an existing solution, I would be surprised if there
wasn't one already.
A quick look at <>
turned up Anubis <> but I have no
idea about the quality of that project (last update 2004 - either it's
very stable or very abandoned or both).

>  Do i have to first output my mail form into a temp folder as a .txt file,
> and then encrypt the .txt file? 

You could do that, but gpg can also be used to handle piped standard
in-/output. I think, this would be the preferred way.

The command line would be roughly like:
gpg --armor --recipient KEYID --encrypt
--> write text to GnuPG stdin, terminate with EOF
<-- read "PGP MESSAGE" from GnuPG stdout

You can easily try this in the console.

>  When reaching last page, the mail form is assembled and populated and sent. 

So, at this point, before passing the assembled mail body string to the
PHP mail()-function, you could just pipe it through a call to gpg.

HTH, Sven

More information about the Gnupg-users mailing list