Home   Site Map   Main Gallery   Quotes   Poetry   Essays   Links


Public Key Cryptography: A Brief Introduction

This essay is a brief run-down on the basics of public-key cryptography. It is in no way a scholarly treatise on this subject; I'm just a beginner myself. I recently installed PGP on my computer, so I am now capable of sending and receiving PGP-encrypted messages. (I've included my public key block at the bottom of this essay so that you can send me an encrypted message if you like.) This essay basically recounts what I've learned lately about this fascinating topic.

If you're not familiar with PGP, it's a brand of software for public-key cryptography. Basically, public-key cryptography is a method of exchanging encrypted messages based around the concept that each person generates a linked pair of keys, one public and one private. The public key is for encrypting messages, so you disseminate it far and wide. The private key is for decrypting messages, so you keep it private. You use other people's public keys to send them messages, and they use your public key to send you messages. And each person uses hir own private key to decrypt incoming messages.

So how do you install and use PGP? Simple! Just follow this procedure:

  1. Acquire some PGP software. Visit http://www.pgp.com/ for info. on the "pay" versions of pgp, or browse http://www.tucows.com/ or http://www.sourceforge.net/ or other freeware sites for info. on free versions. Also try googling "PGP". Or buy some PGP software from your local computer store.
  2. Install it.
  3. Using your PGP software, Make a private/public key pair. You can choose any of three popular key-pair types: RSA, RSA-Legacy, or DH/DSS. I recommend DH/DSS because it gives a good balance between modern features and support for older PGP software. Regardless of which type of key pair you make, you will need to make-up a passphrase. A passphrase is a text string, about 30-60 characters long, that acts as your secret password for decrypting messages. Use an actual phrase, preferably with both small and capital letters, spaces, numbers, and punctuation, such as "Darnby picked up 317 rough sticks.". Don't use single words or names, or common phrases; those are too easy for crackers to guess. Memorize your passphrase. Do not write it down anywhere! And don't forget it! Use it often enough to prevent yourself from forgetting. If you forget your passphrase, your key-pair will become useless, and you'll have to make another.
  4. Send your public key to anyone you want to be able to send encrypted messages to you. Include it at the bottom of your emails. Put it on your web site. Send it to key servers. Disseminate it far and wide. (Don't send your private key or your passphrase to anyone, though! Just your public key!)
  5. To send an encrypted message to someone, obtain their public key, copy-and-paste it (the whole thing, including the "BEGIN" and "END" lines and all lines in between) into a text file, and save that file on your computer. Import that file into your PGP keyring (see the "Help" in your PGP software for how to do this) and use it to encrypt messages to that person.
  6. To decrypt messages to you which people have encrypted using your public key, use your PGP software, your private key, and your secret passphrase.

That's all there is to it!

Here's my current PGP public key (type DH/DSS):

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

mQGiBEK2PNARBADYAgJmEQofWNMgTOkYH/sfwoEVHpv5i06JJiGOm8CDDB0hr2Lw
e2SLBkAZwnUGttc7ElOAYHqw7W1OuVENkjyDmaSzg2zxAw9aCiLaLQtBnW8lUqEj
lMEbR58Ztk+SCSNdfq0PunZ7QhERAP6+iRK32fMSZqGdslEhxmbSDkYHlwCg/0Zi
F/sknFxNZDAJ59zo5nu6dakD/1+t1UrkwSBxFbEXh/16NcN/qRzFRVMF0NmZ6Pdw
kbEvnTxFWy3CClUOhu7rV6BOZQKx8vaDQG82OMqnPOF+7zHdOLVyg6EXNXn9zVpG
r+JRdz/PIP7pNakUcMvdEYP5nWuSjWZBO3a+MisTOB2FfvUDjhrxE0e6Id2oXOpD
uYJ8A/0SjTKvreTBaNKE6C9UwjPfmrjnaFSOVtz5U8YLPG/1Que7hWiJfh+RLUYC
l5CQfAwsLzPMRYe+isA1VYemVIv0cF/KmhxwqYs81Xsx5ge7NdOSzUFToyS5uCqd
k3M/M4jjAv5uHY3V4b1IvQ1pYlthblOMrEbAbNuKd8v1r0bhZrQoUm9iYmllIEhh
dGxleSA8bG9uZXdvbGZpbnRqQHBhY2JlbGwubmV0PokAWAQQEQIAGAUCQrY80AgL
AwkIBwIBCgIZAQUbAwAAAAAKCRCENeAhm25Xe/yvAJ9bGnPh21MwEoIAK9b7939K
xHBQNwCfS/BA/r4LsI9pKfakOQPlc3+sWVq5BAQEQrY/aBAP2QGKVX2da3Iyf8Vt
or1UqWMWAqafAWkKDC610H/1bdDVOr3huv1fPU4rQFQA+xhyaGbIYlXW2n2djHuN
uOJaKRijjBp+niZvA6MwPxr+zj4JPNVytSCSdC5ResmnnPnUl/sWsKZ6KPn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rDJLQ5C96lOUwWh6Q6UyjF2KTsOnvIaGhpD
Ca+Maxsu4ja5BTRqGXLdpraYBfYEgf33ixRHJ/M0i61Wsk4aFwd4ays8HYwySQyZ
LSHQpJO8aIQ5a5VGgWKFAUeStwRgt/sdUVGBlFOKziPz++1abmVE/Kci57968qo/
ookATAQYEQIADAUCQrY/aAUbDAAAAAAKCRCENeAhm25Xe5oNAKD+pRmIFl++SV4A
PN2Xu6G4uaEBsgCeIjMC2S9kLuieUYzVJYx63vzBMao=
=6BMY
-----END PGP PUBLIC KEY BLOCK-----

You can use that to encrypt messages to me, and I'll use my private key to decrypt them. And if you include your public key block in your message, I can use it to encrypt my reply to you, and you can use your private key to decrypt my message.


Written Friday March 18, 2005 by Robbie Hatley.

Last updated Sunday April 22, 2007.

Contact Info   sign my guestbook

Home   Site Map   Main Gallery   Quotes   Poetry   Essays   Links

Valid XHTML 1.0 Valid XHTML 1.0     Valid CSS Valid CSS