## Page 1: Part One: The Obvious and (Not So Obvious) Purpose of Cryptography

<b>Part One: The Obvious and (Not So Obvious) Purpose of Cryptography</b>

In part one of this series I will address the question of why is cryptography needed? The first reason is obvious. We want to keep a message confidential. However, there are two other less obvious reasons for encryption. Using encryption, it becomes fairly easy to verify the integrity of a message and make sure that it has not been either accidentally or purposefully altered. Secondly, with asymmetric key systems it becomes possible to establish non-repudiation-the undeniable fact that you, and only you alone, have sent me a specific message.

There are three basic ways that a message can be encrypted.

The first is to use a hash. A hash takes a variable length string and outputs a fixed length message digest. A good hash algorithm should never output the same digest for different inputs. Common hash algorithms used today are SHA and MD5. SHA is in fact the basis for SSL, or secure sockets layer developed by Netscape for the exchange of encrypted Web site data. Hashs are also used in many instances (especially older and/or simpler systems) to verify a password where a user password is stored as a hash of the password. When a user then attempts to authenticate, the algorithm computes the hash which is compared to the stored value. If a match occurs, the password is correct. If not, the password is wrong. This allows the hash to be sent or stored in clear text without compromising the original password. Hashs are often used to determine the integrity of a file or message by computing a value when the message is created. Then, when the message is received the integrity can verified by running the algorithm again and making sure the hash values match.

The second type of encryption is to use a shared secret or symmetrical encryption. For example, if both you and I know the encryption key is “+3” we could shift an “a” to “d” , “b” to “e” etc. This is a very simple example, but obviously much, much, more complex keys and encryption can be used. The problem is, how do we exchange the shared secret? If key exchange can be done securely or in advance, then symmetric encryption is fast and powerful. Otherwise, we need to consider other tools to allow us to distribute the keys.

One way is to use a unique method developed by Diffie-Hellman that takes advantage of some rather unique mathematical functions to allow two persons to arrive at a shared secret over an insecure media.

Another method of key exchange is to use asymmetric key encryption which consists of two keys. A private key which is only held by one entity and a public key which is available to anyone. Messages can be encrypted or decrypted by either key, but only in a one way process. For example, I can use your public key to encrypt a message to you, but your private key is required to decode it. Likewise, if I send you a message and encrypt it with my private key and then your public key, only you may read it after first decrypting it with your private key and my public key. Since only you have your private key, you know that no one other than you can have read the message. Since I used my private key to encrypt the message, only I can have sent it. Hence, I have accomplished confidentiality and non-repudiation.

RSA is a common public key system. One disadvantage of asymmetric key systems is the infrastructure required to distribute and verify the public keys. Someone needs to vouch that a public key is being provided from the person or organization that it is being claimed and for example in the case of a certificate, that it is valid.

Many companies take advantage of corporations like Verisign or Thawte to help manage, verify and distribute the keys involved in a public key infrastructure.

So, why not use asymmetric cryptography for all encryption? The reason is that it is highly resource demanding. Most systems today will use an asymmetric system for the initial and periodic key exchange and then use the computationally less demanding symmetric encryption techniques such as Triple DES, Blowfish or AES.

In the next part of the series we will look at the history of the popular symmetric algorithms, how they are used today and the future of shared key encryption.

[Editor's Note: A bit about the author. Steve is head of IT at <a href="http://www.supremealarm.com">Supreme Security</a> where he has over twenty years of experience with computers and security. He also holds many different certifications inculding CCNA, Security+, MCSE, and Network+ (and more).]

In part one of this series I will address the question of why is cryptography needed? The first reason is obvious. We want to keep a message confidential. However, there are two other less obvious reasons for encryption. Using encryption, it becomes fairly easy to verify the integrity of a message and make sure that it has not been either accidentally or purposefully altered. Secondly, with asymmetric key systems it becomes possible to establish non-repudiation-the undeniable fact that you, and only you alone, have sent me a specific message.

There are three basic ways that a message can be encrypted.

The first is to use a hash. A hash takes a variable length string and outputs a fixed length message digest. A good hash algorithm should never output the same digest for different inputs. Common hash algorithms used today are SHA and MD5. SHA is in fact the basis for SSL, or secure sockets layer developed by Netscape for the exchange of encrypted Web site data. Hashs are also used in many instances (especially older and/or simpler systems) to verify a password where a user password is stored as a hash of the password. When a user then attempts to authenticate, the algorithm computes the hash which is compared to the stored value. If a match occurs, the password is correct. If not, the password is wrong. This allows the hash to be sent or stored in clear text without compromising the original password. Hashs are often used to determine the integrity of a file or message by computing a value when the message is created. Then, when the message is received the integrity can verified by running the algorithm again and making sure the hash values match.

The second type of encryption is to use a shared secret or symmetrical encryption. For example, if both you and I know the encryption key is “+3” we could shift an “a” to “d” , “b” to “e” etc. This is a very simple example, but obviously much, much, more complex keys and encryption can be used. The problem is, how do we exchange the shared secret? If key exchange can be done securely or in advance, then symmetric encryption is fast and powerful. Otherwise, we need to consider other tools to allow us to distribute the keys.

One way is to use a unique method developed by Diffie-Hellman that takes advantage of some rather unique mathematical functions to allow two persons to arrive at a shared secret over an insecure media.

Another method of key exchange is to use asymmetric key encryption which consists of two keys. A private key which is only held by one entity and a public key which is available to anyone. Messages can be encrypted or decrypted by either key, but only in a one way process. For example, I can use your public key to encrypt a message to you, but your private key is required to decode it. Likewise, if I send you a message and encrypt it with my private key and then your public key, only you may read it after first decrypting it with your private key and my public key. Since only you have your private key, you know that no one other than you can have read the message. Since I used my private key to encrypt the message, only I can have sent it. Hence, I have accomplished confidentiality and non-repudiation.

RSA is a common public key system. One disadvantage of asymmetric key systems is the infrastructure required to distribute and verify the public keys. Someone needs to vouch that a public key is being provided from the person or organization that it is being claimed and for example in the case of a certificate, that it is valid.

Many companies take advantage of corporations like Verisign or Thawte to help manage, verify and distribute the keys involved in a public key infrastructure.

So, why not use asymmetric cryptography for all encryption? The reason is that it is highly resource demanding. Most systems today will use an asymmetric system for the initial and periodic key exchange and then use the computationally less demanding symmetric encryption techniques such as Triple DES, Blowfish or AES.

In the next part of the series we will look at the history of the popular symmetric algorithms, how they are used today and the future of shared key encryption.

[Editor's Note: A bit about the author. Steve is head of IT at <a href="http://www.supremealarm.com">Supreme Security</a> where he has over twenty years of experience with computers and security. He also holds many different certifications inculding CCNA, Security+, MCSE, and Network+ (and more).]