Signing all pages with GnuPG

So, two posts and already changed them twice. These ~tildzitens are teaching me more stuff that I expected. In a previous version of this post, I was self-publishing my public key (and using pgp.mit.edu for distribution), but now I’ll use a different public key (global, if you will), managed under Keybase.io (thanks dlowe for the invite!)

The general idea is to sign all posted pages in this blog using GnuPG. Not that I doubt my root (if fact I wouldn’t be here if I did), but there’s always a good practice in a shared host to add an extra layer of security. Thus, I’m signing all pages with my GnuPG key, also available on my Keybase account.

All pages get signed at render time, and a .asc file accompanies every HTML and XML feed in this blog. So, let’s say you wish to verify http://tildesare.cool/~imt/index.html. First, you’ll have to fetch my GnuPG public key from a known key server:

$ gpg --keyserver pgp.mit.edu --recv-key C5241360
gpg: requesting key C5241360 from hkp server pgp.mit.edu
gpg: key C5241360: public key "keybase.io/imt <imt@keybase.io>" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)

Next, download the page and the corresponding .asc signature file.

$ wget -q http://tildesare.cool/~imt/index.html http://tildesare.cool/~imt/index.html.asc

Last, but not least, run gpg --verify. Remember, the first argument is the .asc file (GnuPG ASCII signature armor)

$ gpg --verify index.html.asc index.html
gpg: Signature made Mon 08 Dec 2014 18:57:28 UTC using RSA key ID C5241360
gpg: Good signature from "keybase.io/imt <imt@keybase.io>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 185B EA37 4F1D E4BC F3F7  8A36 8A0E 8807 C524 1360

The phrase Good signature from “keybase.io/imt imt@keybase.io indicates the HTML page was not altered since it was signed with my GnuPG key.

In a next episode, how to get rid of the warning message This key is not certified with a trusted signature!.

PS. Here’s my GPG public key:

  -----BEGIN PGP PUBLIC KEY BLOCK-----
  Version: GnuPG v1
  
  mQINBFSF8iYBEADMhCpfvGvlY9yCcVtW9eA3rAb8kePtL5DSSmdjQ3/ooD1g3LQH
  kz0ccJuAs0BIAHSnGtv/Glj/5NoKZGEAAOxO+DP529mN93ogoVoV54s0qExBcdOE
  g5PA5xIUspylQvpuy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