README.markdown
file for details on cryptographic implementation and API usage.
Donations for this and my other free software plugins make up a chunk of my income. If you continue to enjoy this plugin, please consider making a donation. :) Thank you for your support!
Plugin features:
Subject
lines).wp-pgp-encrypted-emails
folder to the /wp-content/plugins/
directory of your WordPress installation.<?php print admin_url( 'admin-ajax.php?action=download_pgp_signing_public_key' ); ?>
An OpenPGP-compatible client is simply an app that can read, write, and verify messages encrypted or signed using PGP technology. There are great, free apps for every major platform, including Windows, Mac, Linux, Android, iPhones, iPads, and more. Which app you choose depends largely on which device you already have, and then a bit about your personal tastes. Since there are so many OpenPGP-compatible apps to choose from, I recommend sticking to the ones listed on the PRISM-Break.org website. (Note that PRISM-Break calls it "GPG" instead of "PGP," but the two terms are generally synonymous.) Once you choose an OpenPGP-compatible app for your platform, consider seeking out its help and support documentation to get started using it, or check out some of the generic PGP/GPG guides listed at the end of this plugin's Installation page.
If you have registered a WordPress user account with the same email address as your site's admin email address (in the Settings → General screen), then WP PGP Encrypted Emails will first check for a public key or certificate in the administrative Email Encryption settings (Settings → Email Encryption) before looking at your user's profile settings. If an encryption key or certificate exists in the administrative settings, that key will be used instead of the key or certificate in the user's profile. To resolve this issue, either ensure that you enter encryption keys in only one location (the administrative screen or the user's profile), or ensure these keys are the same. If you still cannot decrypt messages, make absolutely certain you have the matching private key or certificate corresponding to the public key or certificate that was used to encrypt the message. Unfortunately, it is highly infeasible that anyone on Earth will be able to decrypt messages encrypted to a public key or certificate that you do not have the associated private key for. That is, of course, the whole point of this software.
If you have received a "Private" comment, you will need to use an OpenPGP-compatible PGP client to decrypt and read it. There are many free apps that do this. Which one you choose depends on what kind of computer you are already using. If you use Windows, I suggest installing and using GPG4Win since it provides the most features. For Mac OS X users, I suggest MacGPG for the same reason, and Linux users should check their distro's package repository for compatible options. (For Ubuntu users, the Seahorse-Nautilus plugin is popular.) I might also add support for an in-browser client based on OpenPGP.js at some point, but for now you will still need an external program to read encrypted comments. Please consider donating to help resource me work on this if that is a feature you'd like to see.
Make sure the emails the other plugin sends are being addressed to an email account that WordPress knows about and that WordPress knows which OpenPGP public key or S/MIME certificate to use when encrypting email destined for that address.
More specifically, this means the TO:
field of the outgoing email needs to match either your WordPress's "admin email" address or the email address of one of your WordPress user accounts, and you need to provide the OpenPGP public key or S/MIME public certificate you want WordPress to use when encrypting the message and sending email to that address. In many contact form plugins, you can supply an arbitrary email address to send those emails to, but if that email address is not the address of a user on your site, WP PGP Encrypted Emails won't know which OpenPGP public key or S/MIME public certificate to use for encryption.
As a workaround, simply create an unprivileged ("Subscriber" role) new WordPress user account with that email address and enter the OpenPGP public key or S/MIME certificate in that user's profile. (Either accept the automatically generated password, or supply a new very strong passphrase, since you will not need to remember it because you will never need to log in with that user account.)
Issues with character sets, accented characters, different human languages, or content types not appearing correctly are almost always the result of a misconfiguration in the email-sending plugin you are using. Many contact form plugins, for example, allow you to supply custom email headers. WP PGP Encrypted Emails takes great care not to corrupt the email message sent by the underlying plugin that generated the email in the first place. However, this also means that if you do not set up your contact form or email-sending plugin correctly, this plugin won't fix the error. Most often, this is simply a matter of setting the correct Content-Type header in your contact form or email-sending plugin's settings.
Against the NSA? No, probably not. Against a nosy co-worker? Yes, probably. The "realness" of security cannot "really" be measured in abstract, imprecise terms, but rather only based on what real threats you are likely to face and what risks you are vulnerable to if those threats materialize in reality. You have a much better sense of the answers to these things than I do for your situation, because I am not you. Security professionals call this process "threat modeling," and if you are "really" concerned for your security (I encourage you to be!) then learning how to conduct a threat assessment for yourself is a good idea. Learn more about threat modeling from the EFF's Surveillance Self-Defense Guide.
TL;DR: Don't let perfect be the enemy of good. First of all, not everyone's security needs are the same. (See "threat modeling," discussed in the previous question.)
Yes. You can use any OpenPGP public key you generate from any OpenPGP-compatible client.
When generating an OpenPGP signing keypair for your WordPress site, this plugin will create a 2,048-bit RSA OpenPGP keypair. This is considered "okay" (but not "great") by 2018 standards. Unfortunately, many hosts will not allow the plugin to create a stronger keypair because of the computation required. Then again, this key is used only for signing, not encryption. Your own OpenPGP public key is always used for encryption, and you are of course encouraged to make that key as strong as you want. If you want to use a stronger signing keypair, you can generate one yourself (offline), though you will need to load the key into your WordPress database yourself to use it with this plugin. I consider this extra step "paranoid," but you are of course welcome to be as careful as you feel is appropriate. :)
phpseclib
is updated to version 2.0.31 and addresses a moderate severity security vulnerability.Content-Type: text/html
headers that were also S/MIME encrypted now render properly. Props @githubuserx.Content-Type
mail headers are retained.woocommerce-functions.php
file to their theme. Please only do this if you know what you are doing.smime_pem_to_der
.smime_certificate
, smime_certificate_pem_encode
and smime_encrypt
. See S/MIME API for details.S
for signing and C
for certification in GnuPG).openpgp-php
library and dependencies.wp_mail()
with an array no longer cause PHP warnings.print admin_url('admin-ajax.php?action=download_pgp_signing_public_key')
openpgp_enarmor
filter for ASCII-armoring arbitrary OpenPGP data.openpgp_sign
filter for (clear)signing an arbitrary message.openpgp_key
and openpgp_encrypt
so plugin developers and theme authors can encrypt arbitrary data, too.Fatal error
in cases where the public key is set to false
.