Generating a Vanity PGP Signature

Here’s a quick bash script I used to generated a “vanity” PGP key with the last two bytes (four characters) set to FFFF.

#!/usr/bin/env bash

while:
do
gpg --batch --gen-key << EOF
Key-Type: RSA
Key-Length: 1024
Name-Email: name@domain.com
Passphrase: ******
EOF

if gpg --list-keys | head -4 | tail -c 5 | grep FFFF
then
	echo Break
exit 1
else
	rm -rf .gnupg

fi
done

I used insecure randomness on two different CPU cores, so it only took about 3 hours 🙂

Leave a Reply