Sending PGP Encrypted SMS

by J. Edward Durrett

gpg Twilio SMS

Using a service like Twilio, it is possible for a server to send a text
message to a phone number. Two-factor authentication comes immediately
to mind, but other system events can also be triggers for sending a text
message. Sometimes, this information is sensitive and could be used
maliciously. So, the best thing to do is encrypt. This is actually quite
easy.

Create a signed and encrypted message (hint: ctrl-d gets you out of gpg
and writes the output to the terminal)


gpg -se -a -r [recipient]


Copy and paste it into whatever interface you wrote(or just modified an
api) for Twilio and send it. For decryption, the recipient can copy and
paste the pgp part out or have the message go to another app to handle
decryption. For example, if the message is being sent ultimately to an
email address, adding this to the headers will make the email program,
if it has already been set up correctly, assist in decryption:


Content-Type: text/plain; charset=us-ascii; x-action=pgp-encrypted








Copyright (c) 2019, Jason Edward Durrett - All content on this site, unless otherwise noted, is subject to this license.

Please contact me if any errors, such as erroneous / misleading content or missing / incomplete attribution, are found.