How to use PGP on DreamHost?

Hi there,

I’m just getting the idea of PGP, and am wondering if anyone has some code examples of how to use PGP on DreamHost to encrypt a message? I’ve found some examples, but it looks like you need to put public keys on your key ring, and I don’t know how to do that.


If it’s for email, it’s fully dependent on your mail client, and DreamHost has nothing to do with it.

If it’s for encrypting a web-generated (i.e. formmail) message, then I don’t know. I suppose you’d have to install PHP in your account.

[edit]The part about putting public keys on your keyring is if you want to send an encrypted message to someone. You get their public key, put it on your keyring, then use that key to encrypt the message. They have their private key which is needed to decrypt the message.


Well, this would be sending e-mail from a PHP script on DreamHost to me, encrypted using PGP or GnuPGP. I’m wondering how to encrypt the message with PHP on a DreamHost server.

Here’s a link with some instructions on how to do this:


Thanks, Scott, I gave that one a try but I get an “It failed” message. I know I need to get the public key in there somewhere, but there is not place for it in that script… Any ideas?

The public key should be in pubring file. Did you do the gpg --import command? Once that’s done, the $recp user should be that public key you created and then imported.

I also expect you made all the necessary changes in the script, such as the gpg location in /usr/bin (not /usr/local/bin).

Hopefully some script tweaking will get it working for you.


Hey there, I got it to work, thank you! I didn’t know how to get the public keys in there, it looks like you have to do it via command line.

Thanks again!

Cool. It’s always a good feeling when something works.