• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Encrypting Outgoing Emails With GPG/PGP on WordPress

By Abhishek Ghosh June 24, 2015 2:25 am Updated on June 24, 2015

Encrypting Outgoing Emails With GPG/PGP on WordPress

Advertisement

There Are Two Ways For Encrypting Outgoing Emails With GPG/PGP on WordPress. Either Fully Server Side Or PHP5 Based Way Using WP Plugins. Encrypting Outgoing Emails With GPG/PGP on WordPress is often asked topic and the person who is administering or creating the setup must ensure to have complete knowledge (and assumed to have basic knowledge about unix commands) on the topics we are talking about. Encrypting outgoing emails with GPG/PGP on WordPress is possible only in PaaS, Cloud Computing IaaS/Cloud Server, traditional VPS and dedicated servers. Encrypting outgoing emails With GPG/PGP on shared hosting can either fail or can be synonymous with running nude in the public road assuming wearing an invisible bullet proof dress.

 

Encrypting Outgoing Emails With GPG/PGP on WordPress : Basics Must Be Known

 

  1. UNIX Commands
  2. Determine which method is suitable yourself
  3. Use a Third Party Mail Server for proper SPF. Read this article.
  4. We can use Transactional Email services, we gave example on how to send emails from WordPress using Mandrill.
  5. A computing power is needed for encryption.
  6. Learn about GNU PG.
Encrypting Outgoing Emails With GPG:PGP on WordPress

 

Encrypting Outgoing Emails With GPG/PGP on WordPress From Server Side

 

In this case, we are installing GNU Privacy Guard on server. These should be our steps on SSH for a deb based GNU/Linux like Debian :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
apt-get install gnupg
# we can import our signed key sent to key server
gpg --keyserver pgp.mit.edu  --search-keys me@myemail.tld
gpg --import name_of_public_key_file
# we can generate key sent on server
gpg --gen-key
# we can sign
gpg --sign-key me@myemail.tld
# we can import private key
gpg --allow-secret-key-import --import /path/to/key
# we commonly sign using this format of command
pgp --sign-key "xyzzzd" --signer "######" --sig-type exportable --passphrase "######@##"

This is not the way when you want only WordPress to handle the emails. Setup can vary and usage of the way should be appropriate.

Advertisement

---

 

Encrypting Outgoing Emails With GPG/PGP on WordPress Using PHP-GPG

 

PHP-GPG is a PHP based implementation of GPG.

Vim
1
https://github.com/jasonhinkle/php-gpg

We need to install this :

Vim
1
apt-get install php5-gnupg

Then filer the emails with either theme/child theme’s function.php file or our function.php file replacement plugin :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// This snippet is written by Marcus Povey
// Ask question if you have
// https://www.marcus-povey.co.uk/2015/06/04/extending-wordpress-to-send-pgp-emails/
// you can copy below this line for personal usage
// ask the original creator for pure commercial usage
function find_encryption_key($keys) {
    $fingerprint = null;
    foreach ($keys as $k) {
        
        if ((!$k['expired'])  && ($k['can_encrypt']) && (!$fingerprint) && (isset($k['fingerprint']))) {
            $fingerprint = $k['fingerprint'];
        }
        
        if (!$fingerprint && isset($k['subkeys'])) {
            $fingerprint = find_encryption_key($k['subkeys']);
        }
    }
    
    return $fingerprint;
}
function encryptto($message, $address) {
    $gpg = new gnupg();
    
    if (is_array($address)) {
        $address = $address[0];
    }
    $keys = $gpg->keyinfo($address);
    if ($keys) {
        $fingerprint = find_encryption_key($keys);
        $gpg->addencryptkey($fingerprint);
        
        return $gpg->encrypt($message);
    }
    
    return false;
}
add_filter( 'wp_mail', function ($args) {
    $new_wp_mail = array(
        'to'          => $args['to'],
        'subject'     => $args['subject'],
        'message'     => $args['message'],
        'headers'     => $args['headers'],
        'attachments' => $args['attachments'],
    );
    
    if ($encrypt = encryptto($args['message'], $args['to'])) {
        $new_wp_mail['message'] = $encrypt;
    }
    
    return $new_wp_mail;
}, 1);

There are lot of WordPress Plugins to avoid the Server side steps. There are lot plugins available to encrypt the contact us form.

Tagged With exim encrypt outgoing email with pgp gpg , GnuPG wordpress , NB! Outgoing email servers require prior authorization with your e-mail addr , two ways to encrypt outgoing emails
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Encrypting Outgoing Emails With GPG/PGP on WordPress

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • GNU Privacy Guard (GPG) For Secure Cloud Computing

    GNU Privacy Guard (GPG) is used for code signing in Free Software. For secure Cloud Computing, GPG can be used for Emails and Messaging.

  • How to Sign Git, Github Commits With GPG For Security

    It is Not Safe to Commit All on VPS or Cloud Server Hosted Git Without Signing. Here is How to Sign Git, Github Commits With GPG For Security.

  • Changing Data With cURL for OpenStack Swift (HP Cloud CDN)

    Changing Data With cURL For Object is Quite Easy in OpenStack Swift. Here Are Examples With HP Cloud CDN To Make it Clear. Official Examples Are Bad.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • How to Restrict Certain Posts or Categories In WordPress by CountryJune 6, 2023
  • Influence of Digitization on Procurement : Part 1June 6, 2023
  • How We Can Show Apple Icon, Windows Logo on Website TextJune 5, 2023
  • What is Google Bard? How it WorksJune 5, 2023
  • How to Create a PHP Installer Script to Create Tables in MySQL DatabaseJune 4, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT