#!/bin/bash # # Run with "bash visual-keys.sh" FILE="/home/users/a/atoponce/public_html/art/index.html" # First, remove the old images rm *.png 2> /dev/null # Get fingerprints wget --quiet -O /tmp/top_50.html http://pgp.cs.uu.nl/doc/top_50.html grep -oE '[A-F0-9]{8}' /tmp/top_50.html | sort -u > /tmp/top_50.txt : > /home/users/a/atoponce/top50.gpg while read LINE; do gpg --quiet --no-default-keyring --keyring=/home/users/a/atoponce/top50.gpg --keyserver pgp.surfnet.nl --recv-keys $LINE done < /tmp/top_50.txt gpg --no-default-keyring --keyring=/home/users/a/atoponce/top50.gpg --no-options --with-colons --fingerprint | awk -F ':' '/fpr/ {print $10}' > /tmp/keys.txt gpg --import /home/users/a/atoponce/top50.gpg sort /tmp/keys.txt > /tmp/keys.tmp mv /tmp/keys.tmp /tmp/keys.txt # Start creating HTML echo -n '' > $FILE echo -n "
Below is a visual representation of the top 50 PGP keys in the Strong Set, sorted by fingerprint. Source code here. Each algorithm uses a deterministic algorithm on the fingerprint to draw the art. See this PDF for more information. In the case of old PGP fingerprints that are based on MD5 digests, the honeycomb and flag art will be incomplete, as they expect 160-bit digests, rather than 128-bit. Scanning the QR Code with an OpenPGP compatible application will import the PGP key from a key server. Check OpenKeychain for Android as an example.
" >> $FILE # Start creating massive table echo -n "Primary email Fingerprint | " >> $FILE
echo -n "QR Code | " >> $FILE
echo -n "ASCII | " >> $FILE
echo -n "Flag | " >> $FILE
echo -n "Honeycomb | " >> $FILE
echo -n "Inkblot | " >> $FILE
echo -n "Fractal | " >> $FILE
echo -n "Keyhole | " >> $FILE
echo -n "|
---|---|---|---|---|---|---|---|---|
${EMAIL} ${FINGER} | " >> $FILE
# Print QR code
echo -n "" >> $FILE # create fingerprint ascii art # Source code at https://github.com/atoponce/keyart echo -n " | " >> $FILE
echo -n "" >> $FILE /home/users/a/atoponce/keyart/keyart -f "$LINE" | /usr/local/bin/ansi2html -i >> $FILE echo -n "" >> $FILE echo -n " | " >> $FILE
# Create fingerprint flag
echo -n "" >> $FILE
echo -n "
| " >> $FILE
# Create the honeycomb art
echo -n "" >> $FILE
echo -n " " >> $FILE
echo -n " " >> $FILE
echo -n "" >> $FILE
echo -n "" >> $FILE
echo -n " " >> $FILE
echo -n "" >> $FILE
echo -n "" >> $FILE
echo -n " " >> $FILE
echo -n "" >> $FILE
echo -n "" >> $FILE
echo -n " " >> $FILE
echo -n "" >> $FILE
echo -n "" >> $FILE
echo -n " " >> $FILE
echo -n "" >> $FILE
echo -n "" >> $FILE
echo -n " " >> $FILE
echo -n "" >> $FILE
echo -n "" >> $FILE
echo -n " " >> $FILE
echo -n "" >> $FILE
echo -n "" >> $FILE
echo -n " " >> $FILE
echo -n "" >> $FILE
echo -n "" >> $FILE
echo -n " " >> $FILE
echo -n "" >> $FILE
echo -n "" >> $FILE
echo -n " " >> $FILE
echo -n " | " >> $FILE
# Create the Inkblot
echo -n "" >> $FILE echo -n "" >> $FILE echo -n " | " >> $FILE # Create fingerprint fractal # Source code at http://www.tastyrabbit.net/visprint/#download echo -n "" >> $FILE echo -n "$LINE" | ~/visprint -r 200 > /home/users/a/atoponce/public_html/art/${EMAIL}.png echo -n "" >> $FILE echo -n " | " >> $FILE # Create keyhole # Source code at https://github.com/mailpile/Mailpile/blob/master/scripts/colorprints.py echo -n "" >> $FILE /home/users/a/atoponce/colorprints.py "$LINE" >> $FILE echo -n " | " >> $FILE # Finish table row echo -n "