A public key and a private key are different; they're related, though.

The most common form of encryption today is a type of encryption called "public key encryption." It solves the biggest problem of any kind of code or cipher: how to get the key to another person.

With conventional codes or ciphers, if I want to share an encrypted message with you, I have to give you the key. If it is difficult or dangerous for me to talk to you, which it presumably is or we wouldn't need encryption, then it is difficult for me to give you the key, because if the key is intercepted or falls into the wrong hands, then all our messages can be read. And I cant encrypt the key and then give it to you, because without knowing wha the key is, you can't decrypt it! In wartime, this is especially bad, because if you're in the field and you are captured, then the keys you have with you are now known by the enemy.

"Public key encryption" works by taking an encryption key and doing a lot of math on it, so that you end up with TWO keys: one that is "public" and one that is "private." You take something and encrypt it with the public key, but the public key can not be used to READ it; once it's encrypted, only the private key can be used to DECRYPT it.

So if I want to talk to you secretly, I create a public key and a private key. I keep the private key secret; nobody except me knows it. I give you the public key. it doesn't matter how; I can broadcast it on the radio or put it on a bulletin board in the town square. Because it can not be used to read messages, it's OK if everyone knows what it is.

Then if you want to say something to me, you take the public key and use it to encrypt the message. Nobody except me can decrypt it; not even you can, once it's encrypted, only the private key can decrypt it.

If I want to send a message to you that's encrypted, you give me your public key. i use it to encrypt the message,a nd now only you private key--which only you know--can read it.

Mac OS X exchanges login passwords that way. If I connect to your computer, what happens is that your computer sends me its public key. My computer encrypts my login password using its public key, then sends your computer the encrypted password. That way, people listening in on WiFi or whatever can't get the password. Your computer uses its private key to decrypt the password and then check to make sure the password is valid.

SSL security certificates for the Web work the same way. Your computer, when it makes a secure connection to a Web site, asks the Web site for its public key. Then your computer encrypts everything it sends to the Web site (like your account name or your credit card or whatever) using the public key. The information is sent to the Web site, where only the private key can be used it read it.


Photo gallery, all about me, and more: www.xeromag.com/franklin.html