{emayili} Sending Encrypted Email

In a previous post I documented what I had learned while trying to understand the structure of encrypted emails. I then took an informal Twitter poll to gauge how many people are using encrypted email messages.

It’s by no means a statistically representative sample, but I’ll go out on a limb and state that not many people are actually encrypting their email. I have a few hypotheses which might explain this:

  • Maybe they feel it’s unnecessary?
  • Perhaps they find it inconvenient or difficult to set up?
  • Possibly they didn’t even know that it was possible?

I think that securing your personal communications is becoming progressively more important. So I’m going to be using GnuPG to encrypt and sign emails in future.

In this post I’m going to demonstrate a new feature in {emayili}, which makes it possible to easily send encrypted messages from R. This feature leans heavily on the excellent {gpg} package developed by Jeroen Ooms.

Load Emayili

First let’s load {emayili}.

library(emayili)
#
# And {dplyr} because I use this everywhere!
#
library(dplyr)

packageVersion("emayili")

The encryption feature is only available from version 0.7.0. At present you’ll need to install this from GitHub because it’s not on CRAN yet.

You don’t need to explicitly load {gpg} to use encryption with {emayili}, but we’ll do so just to check on the version of GPG and create some keys to play with.

library(gpg)

gpg_version()
gpg (GnuPG) 2.2.19
libgcrypt 1.8.5
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /home/wookie/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

Creating Keys

We’ll set the scene by creating a few keys in a temporary location so that we don’t clobber our existing keyring.

gpg_restart(home = tempdir(), silent = TRUE)

For entertainment we’ll simulate encrypted communications around the D-Day landings. We’ll need some (obviously fictitious) email addresses and keys.

FLOTILLA  <- "flotilla@kriegsmarine.gov"
BORCHERS  <- "borchers-276@kriegsmarine.gov"
SCHUNK  <- "schunk-348@kriegsmarine.gov"
gpg_keygen(name = "Flotilla", email = FLOTILLA)
gpg_keygen(name = "U 276 Borchers", email = BORCHERS)
gpg_keygen(name = "U 348 Schunk", email = SCHUNK)

Now take a look at our keyring.

gpg_list_keys() %>% select(id, fingerprint, name)
                id                              fingerprint           name
1 A54509CACB0F295E CE08B765CA067CAA57764F5EA54509CACB0F295E       Flotilla
2 0897DF3055C00B2F AAA3971869729272BBD61F730897DF3055C00B2F U 276 Borchers
3 0665C3E83FBB901B EF5AA9E78B78836AD16399180665C3E83FBB901B   U 348 Schunk

Publishing Keys

Publishing those keys could be done as follows (although we won’t actually publish the keys for obvious reasons!):

gpg --keyserver keyserver.ubuntu.com --send-key CE08B765CA067CAA57764F5EA54509CACB0F295E
gpg --keyserver pgp.mit.edu --send-key AAA3971869729272BBD61F730897DF3055C00B2F
gpg --keyserver keys.openpgp.org --send-key 0665C3E83FBB901B

The keys can be referenced by id or fingerprint.

Creating a Message

What about a message body? The message below was intercepted at 04:30 UTC on 6 June 1944 and subsequently decrypted by the codebreakers at Bletchley Park.

SUBJECT <- "Attention"
TEXT <- "Immediate readiness. There are indications that the invasion has begun."

Create an {emayili} message object.

msg <- envelope(
  from = FLOTILLA,
  to = c(BORCHERS, SCHUNK),
  subject = SUBJECT,
  text = TEXT
)
Date:                        Sun, 09 Jan 2022 05:29:40 GMT
X-Mailer:                    {emayili}-0.7.1
MIME-Version:                1.0
To:                          borchers-276@kriegsmarine.gov,
                              schunk-348@kriegsmarine.gov
From:                        flotilla@kriegsmarine.gov
Subject:                     Attention
Content-Type:                text/plain;
                              charset=utf-8;
                              format=flowed
Content-Disposition:         inline
Content-Transfer-Encoding:   7bit
Content-MD5:                 HvL4qIrj5lMuW+E5BW4APA==

Immediate readiness. There are indications that the invasion has begun.

This is a simple, unsecured text massage.

Sign a Message

To add a digital signature to the message use the encrypt() function and set encrypt = FALSE but sign = TRUE. It’s also possible to enable a signature using the sign option to envelope().

msg %>% encrypt(encrypt = FALSE, sign = TRUE)
Date:                        Sun, 09 Jan 2022 05:29:40 GMT
X-Mailer:                    {emayili}-0.7.1
MIME-Version:                1.0
To:                          borchers-276@kriegsmarine.gov,
                              schunk-348@kriegsmarine.gov
From:                        flotilla@kriegsmarine.gov
Subject:                     Attention
Content-Type:                multipart/signed;
                              micalg="{micalg}";
                              protocol="application/pgp-signature";
                              boundary="7e48e108"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156).
--7e48e108
Content-Type:                multipart/mixed;
                              boundary="1f5fc77b"

--1f5fc77b
Content-Type:                text/plain;
                              charset=utf-8;
                              format=flowed
Content-Disposition:         inline
Content-Transfer-Encoding:   7bit
Content-MD5:                 HvL4qIrj5lMuW+E5BW4APA==

Immediate readiness. There are indications that the invasion has begun.
--1f5fc77b
Content-Type:                application/pgp-keys;
                              name="keys.asc"
Content-Description:         OpenPGP public key
Content-Disposition:         attachment; filename="keys.asc"
Content-Transfer-Encoding:   quoted-printable
Content-MD5:                 LN8KrpFEFJHLpXPCFgIMVw==

-----BEGIN PGP PUBLIC KEY BLOCK-----

mQGNBGHacsABDADGqgcNyL6QW9J3f0tdiaR1Ht9wq2Wxy0D/IuN0oyglyXcwT4EB
MckJB6lhSt6Fykd3cAQ/CXlRPJAJdNIhYAi73fUja5I4Q/RrpFogIkhlPF1avP7/
5GmMK58tPXhQEs6zbgBXRMVVoz2rJSkIvpX69+2oMFll62JKT7X/zMBg6T/HvjeU
Z2nRXHsLf4pLISw7aFeikxnhBHSkx7gQ6h213ruI/8Av24r1iwODG0r4wa/P4/0Q
SWIkjbwkW+xFrYvuFTcmhqef5Kom+RsyTZUSptMxuHfBfag6Wd4gLWDZz+sgjdQS
/Az2dhubcnlZcYhXMFuS8K/0uJPuEHrfgzL5qvC8tDfsVaYgu9IiUnIVykFfznFq
aMGA7wzmfene3EwmE0MmrFgp4BI6OJ5kaGzTsHGezJtpsp/Kvr8zCaaZ8JaeKrNG
2M1Jb9xzXRyDqAgCJcgIxKV65U1IiIWkdzFl/M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b
1fSyZj1UVl/I4H9p+YS2Oi0xGp3JzNHZWBa/7dHa1A9DgAG+WF07IRObJn5shLO/
fQnxNBFmDY2j70ZwsU8xNYGdpscDxLtKR+3NWht/Z7lEGamWcwg4BbUPRyw+Ht9u
7teVGVf0VieCKyC4NiGHZu5tIRyRKj8lw8ydOqWqj0ACzaYgZgRSEmtzKfbeUN0s
Y7gKm+DnaIUAEQEAAYkBtgQYAQoAIBYhBLj3yNhEayAvSDvYnMktao4RhHgCBQJh
2nLAAhsMAAoJEMktao4RhHgCSJ4L/jFpWtb+Ztphn9mtFTXlfiBZIyB5nnkvhqEq
gKrIgxPIf0Sd13u9nLgVAZRuTxlXpvlnm0Cljk8M27i3Ovtr1avPWaT8S8qWZPnz
v0QsoyUV5GARMuS57Yd3KgQ0kisqfq9A4PDZUk49vAWblL/eyNC/rPDbBXggS5Vz
DLi66QaJEzQY80s9pIs6X/EX2K3OIui6BHhUvQH+66v/Fwml5qAvZ4nF8NyJ9bXu
QLbItn5HBsPWaqFG4sIrcAPDNCHXlxUTYpUBWl8lPFExaT9xRrLNoAkFk1UiDqZq
WUOZiH9kpXnCf+jFesrKqMQj5zMn+J1fYS8JisrmxUZ5mGe7GKSBZpQMRzaTpaFM
3wR08CC5li5fCx1o75/T08LTu6EKR3EMgC5k/XNaPQZ0/EqE2O9h6G1j8QJNaJK+
v8mgQ4X0HZdq8hGxDDUaGL8J00l999to1cSpbtJDln/vJgPoY0oevR6O0U3tr1h0
Qi1EWVrQKe8JrHOSgM95qs8OwACEvw=3D=3D
=3DMCxH
-----END PGP PUBLIC KEY BLOCK-----

--1f5fc77b--
--7e48e108
Content-Type:                application/pgp-signature;
                              name="signature.asc"
Content-Description:         OpenPGP digital signature
Content-Disposition:         attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQGzBAABCgAdFiEEuPfI2ERrIC9IO9icyS1qjhGEeAIFAmHacsQACgkQyS1qjhGE
eAJTBgv9F8yp+4/Kvoic0LZrbeQgEUfdiQj7V9XUzPWg/ym7m+pUC0mflVpjFUeK
iTYMzWuaUsRbpofLcycVwLfI5/Rha3642h9RImTiD9g/FQuKnzMh9VPhI1/RkiVd
OIj/y7XcYXJ7Q8h8ZjyGA+4HguqdhyvaTKVXXFH4m+r0BHtLYf3xIv8/nGdLgVtZ
4DFEiKNb0JQ9pOcy9q8ihm4NIriO0gM1hpoDroXM72RZhoftBj7znj7GXx1uLZWy
sUsT4vGjvor/uhUbwTGPSQbnliNlzZKQm7lL/uMKcUZZXsxYjmJvWLWTcSzBfjyT
Cql2q/OZAu1N6DabScjTWXjhydgRJThANbBSKj5rhX0dAKtCAe9Xg4quOUEJcBft
bYBKEbc1/U1bweFgyqK10pwd8qVsbw2EtQDv8QM+bPTfSL5KVagibcz8C9EPPKyh
mNZ8nIuyaIb6ZnHavgyL08McoDH7lr51F51A92TnSf2xlhVBNlEnbB11uh+yse3x
54qvg0nH
=dr01
-----END PGP SIGNATURE-----

--7e48e108--

The resulting message now includes:

  • the public key for the sender (PGP PUBLIC KEY) and
  • a digital signature (PGP SIGNATURE).

The structure of the MIME message is such that the signature covers both the message and the public key. In this way the sender is also authenticating the validity of the public key that they are sharing. For brevity you can omit the public key by setting the public_key = FALSE option to encrypt().

The commanders of U 276 and U 348 could validate the authenticity of the message by using the published public key for flotilla@kriegsmarine.gov.

Encrypt a Message

Signing a message establishes its authenticity, but for secure communications you’d want to encrypt the contents of the message too. Again, use the encrypt() function with encrypt = TRUE (this is the default). It’s also possible to enable encryption using the encrypt option to envelope().

msg %>% encrypt(encrypt = TRUE)
Date:                        Sun, 09 Jan 2022 05:29:40 GMT
X-Mailer:                    {emayili}-0.7.1
MIME-Version:                1.0
To:                          borchers-276@kriegsmarine.gov,
                              schunk-348@kriegsmarine.gov
From:                        flotilla@kriegsmarine.gov
Subject:                     Attention
Content-Type:                multipart/encrypted;
                              protocol="application/pgp-encrypted";
                              boundary="e5e4858c"

This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156).
--e5e4858c
Content-Type:                application/pgp-encrypted
Content-Description:         PGP/MIME version identification

Version: 1
--e5e4858c
Content-Type:                application/octet-stream;
                              name="encrypted.asc"
Content-Description:         OpenPGP encrypted message
Content-Disposition:         inline; filename="encrypted.asc"

-----BEGIN PGP MESSAGE-----

hQGLA7JCyeWrB8oMAQv42PnGWFNlWcV1bzxozabBgFKo47CtAAPF5YirLXomQsmv
PfTPsa5wnlZf5rOeXQgegGTGB8UF6bkmaF6YkzvK3tajmRY11a78LqyBaI+CpgBG
mnb8qqA7mUpdUaIoJIPM/HB3G8aQ7yU0cRSW+2wMNU6BU0Etld+at8bxHhvkHGym
lQMzW7yGUwneZaKMWHShQPUor+hhFf8ZRiGqTJwdpDTsmV/PVC0b8O0361fPabHX
p1k0hZbkUP3nJ8hwqdzJZuUUoiUXuIoXHRdgiJ7aPeoYGUnOutt+CH3ydsQYg/5n
iQe1KstBPncqO4FPgXDsZL22Pc/I3AZUeZl0lxOWmvuXlCqZlyqOJLBb9jFDbhGz
fXo6zeBH6sRP6GZkrSWdzqWrLimKUYyNfEYtz6r2P2MQru7AYH7D1b66O8d9ijCV
77vTo483lr4qHiIyNaEGg10YmP/rhIHIVRGI5dQ2iN3psodrietVdaG5KkdUzIl4
RTPWX/BvQr/Ga756I6mFAYwDd0xm4Ovhd6cBC/9pMi8Bm5PSD3GN6M8hIANSnmsp
PUkOPEPfQloAIEDhoLR7Ivnpin2CQ7rdt66qB7rhQBk6scyuN+EkJrEvUiSp4cg1
qbpFvXozOTKXCv3ObNW2BHmXIdQRDfkT2uF2KS4F82l0O46oBg/oXGInc0buWAZx
rkL9sUeUTcQanYacgMnMu961tiazLedK/TxyzCF7IfYoGnU8sj0sEHNw4uBUX4QE
lOxBjUur9zFYkBz6NEkvq8nj1w0M4xu/eS8vcto+rfynwBOVfQ5XCaqqaFfuuM+D
xW9gfi7JVsr+caT01Y6PsRHwOLIP1fyB6JZUrw+9Ccti2BSZZrkzq+HsEsd0UHey
fPTmXk81zfoDr3W/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Amp4kcB92Pp
E80/tp8Am90w8JcXO/WSQN1t/895+4EiBAYR+67D9vzmdRrsMmuXxeyBB5KGkTpO
bBoXoBz76AUUoqMAlbhI9hZXBrKkTXYDcAhHaBXfrjpGY7wMwmnWZCdGcUDH/Jtm
2TXP3q10s8M7nIa4ZY3XmgQa1YxMZuHsJsD7cIFlG6nu/qrIdLHwtGkZml9eBn2o
/ZWwkDC3kZW+MAXqmZRnn1pAYxwBlgwhRGkly8X27MBYkUXqcKR87T9Y7cgxial5
UJ68IcVV/JUA5en8PjBdWvKeAVFswK/nPahVCT75Y8ywKQzDOVPf+DqG9boz7TS7
WdR/ndSNDKZAJTuIuIgOLepZvwkEKCOnEEgZ0Fnp9xZoKGeuw9M1UkI2A+UCu4xW
wJftoKdPIg8+hn56Vi6Ep+aMhciwk5Sb6ublybyf2ZDLfmE/Twv5qkDOGk5qiMGd
9eej+fT+HLArclfwN50H55LsAXSAp74lppF58AcIAnouk1tfruqzo15WuqvjGpVe
dBSMSVBWGoA9BWrRw1rE9B6Rj10xZQrWi0SUjEELYnpR+05O+2Cp8RhIpucLeNZW
tMBw5PFTjGrc7H+5WLAp0OJPDzdgZGNlI56HIooTvXDfPDan8XthU72SBJDtw5fb
BX0Eoo0/50au8FmZv4vN8shnq5XFEmCXoc1k+2ooE6yX/6zJU1d31EXp9PxJC/Fn
3Qc0NYoNjTBt6jjmGvCrKwm1oHEddmV4niyKvtz7wtViE0clx0L0S+k/0z7WCHfh
IRUiVv8eTQRRcrsZKLYDjJMCLfWIJ8If3EXRIowfUECz2VNh0kwMJS51ndc7GjOa
B6qEdvoBhxij
=s4Os
-----END PGP MESSAGE-----

--e5e4858c--

The resulting message is now essentially opaque. It’s been encrypted using the public keys of the recipients. All of the useful information (the public key of the sender, the signature and the message content) are encrypted. A recipient would use their private key to decrypt the contents.

Conclusion

At Fathom Data we routinely use {emayili} for sending messages from R. This forms a core component of many of our automated workflows. Being able to encrypt those messsages, ensuring that the data we’re sending is secure, is going to be very useful indeed.

I’m very interested in feedback on this new feature. Please give it a try and let me know if there are any issues. If you find this useful, please tweet about and don’t forget to tag @datawookie and @fathomdata.


The `{emayili}` package is developed & supported by [Fathom Data](https://www.fathomdata.dev).