4.1 Keys


4.1 Keys

One of the most common terms heard when discussing cryptography is the term "key." A key is nothing more than a special type of password. If you and I agreed that our code (algorithm) used in the encryption of notes between the two of us would be an alphabetic shift, our key would be the number of letters we shift. For example, normally we can assume "A, B, C, etc." to mean A and B and C. But if we agreed that our shift is one to the right, then "A" really means B and "B" really means C, etc. The "shift 1 to the right" is the key that I would use to convert my plaintext to ciphertext. The same key would be the one that you would use to convert my cipher-text to plaintext to be able to ready my original message. This type of key is known as a symmetric key. You and I both need to know what the key is in order to encrypt and decrypt messages to each other. If anyone else knows what the key is, they would be able to read what our messages are, so it is important that we keep this key secret. It should be no surprise then that this type of key is also known as a secret key.

The problem with a secret key is as noted above; if someone else were to have access to the key, our code is broken. The question then becomes: how do we make sure that nobody knows what that key is? Between you and me, we could agree to meet at a public caf and surreptitiously exchange briefcases under the table. In the briefcase I give you is the key. We could then run back to our secret bases and begin encoding messages to our hearts' content. Or I could just call you up and tell you the key over the phone and hope that nobody is listening in on the conversation. In either case, the ability to exchange the secret key securely is crucial.

Meeting in person, this is not that difficult. When we attempt to do this over the Internet, however, we have a chicken-and-egg-type problem. I have to assume that someone is listening to our packet conversation. Otherwise, why would I go through the trouble of encrypting the data? But if someone is listening, how do I get the secret key to you without them knowing about it so I can then start encrypting data?

To work around this quandary, public key cryptography was introduced. The idea of public key cryptography is that anyone can know one of the keys (called the public key). As long as they knew the public key, they could encrypt messages but the other participant in the conversations would need the other key to be able to decrypt messages. Because there are two different keys in use here, public key cryptography is also known as asymmetric cryptography. One of the two keys is known as the public key, which anyone is allowed to know; and the other key is known as the private key, which is used to decrypt messages. It is important that the private key be kept just that — private.

To better understand how public key cryptography is used to enable the secure transfer of secret keys, the following analogy is commonly used.

I want to send you a letter (the metaphor for the secret key) but I cannot trust the post office or anyone else to not read the letter between you and me. To make sure nobody can open the letter, I am going to put my letter in a box and padlock it shut. I have the only key to the padlock. The box with the letter inside is then shipped to you. Once you get it, you of course cannot open the box without the key I have. Instead of shipping the key separately (after all, someone could hold on to the box and then wait for me to ship the key or just pretend to be you and ask for the key), you will then take your own padlock and key and put your padlock on the box. Now the box has two locks on it. Yours and mine. Because you cannot open the box with my lock on it, you ship the box back to me and I remove my lock with my key. Now there is only one lock on the box — yours. I ship the box back to you and you use your key to open the box. You can then read the letter I sent about our luncheon plans for last Tuesday.

Clearly, if I were going to send a number of letters to you, we could shorten the back and forth process quite a bit if you just shipped me a bunch of extra locks. That way, whenever I wanted to send you a letter, I could just grab one of your locks, lock the box and send it. Because it is your lock, once I fasten that lock, even I cannot open the box to change the letter I just placed in there. If you had so much fun with this and liked getting secure letters, you could get big crates full of your padlocks and just leave them lying around. That way anyone who wanted to send you a secure letter could just pick up a lock at the gas station or the post office. In fact, it does not matter who picks up your lock because the only thing they could do with the lock is secure a letter to you.

Above, the lock you left lying around was the public key. The key to that lock that you safeguarded on a chain around your neck was the private key. The letter that I was sending you was the secret key.

You may be wondering at this point why introduce two types of keys — symmetric and asymmetric? After all, why not just use the public key (asymmetric) technology to send encrypted information? If you can use it to send a secret key, why not use it for all data? That is a good question and it really comes down to security and performance.

We have already established that, in general, the longer a key is, the more secure it is. To ensure that our asymmetric keys are as secure as possible, they are normally quite long (in the range of 1024 to 4096 bits long). The price of longer keys, however, is speed. Encrypting and decrypting data with keys that long is cumbersome and slow. To compensate, we will use short secret keys on the order of 128 bits to 256 bits that we will use for a single communication session and send them encrypted with the larger key space of the public key. These shorter keys are designed not only for security, but also for the ability of hardware and software to operate on them quickly. The rationale is that all keys can be broken in time. Because public keys can be used for periods of a year or more, they need to be long to increase the difficulty in breaking them. And because the secret keys are used only for relatively short communications, their length is sufficient for the need. Do not forget, however, that 128 bits is still a big, secure key.

Before going any further, let us do a quick review.

  • Secret key cryptography = symmetric key = both sides use the same key to encrypt and decrypt data. Commonly used for the actual encryption of data.

  • Public key cryptography = asymmetric keys = one key used to encrypt, another used to decrypt. Commonly used to send secret keys.




Network Perimeter Security. Building Defense In-Depth
Network Perimeter Security: Building Defense In-Depth
ISBN: 0849316286
EAN: 2147483647
Year: 2004
Pages: 119
Authors: Cliff Riggs

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net