2021-11-08 Searching GPG keys

Lunch break, or nearly so. One side of the table is full of my mess; the other side is full of her mess. My private laptop is somewhere in the middle. I just answered some mail.

Sometimes people send me encrypted mail but they don’t send me their key. Easy, right? I just ignore that, write up my answer, and then gpg will retrieve the missing key using Web Key Directory (WKD). Well, most people still don’t have that set up. My default keyserver is hkps://keys.openpgp.org – but there are others. So today I finally broke down and wrote the following little shell script called “gpg-search-key”:

#!/bin/bash
if test -z "$1"; then
    echo "No email provided"
    exit;
fi

gpg --keyserver hkps://keys.openpgp.org --search-key "$1"
gpg --keyserver hkps://hkps.pool.sks-keyservers.net --search-key "$1"
gpg --keyserver hkps://api.protonmail.ch --search-key "$1"

Bucolic! 😆

Notice how it works for ProtonMail, too!

What is a Web Key Directory?

Replacing Keybase, section “Searching for emails”

​#Cryptography