The Internet is like an open book. Information that you send from one computer to another can pass through numerous other computers before it reaches its destination. Normally, the users of these intermediary computers don't monitor the Internet traffic that routes through them, but someone determined can intercept and eavesdrop on your private conversations or credit card exchanges. Worse still, they might replace your information with their own and send it back on its way. Due to the architecture of the Internet and intranets, there will always be ways for unscrupulous people to intercept and replace data in transit.
So is there any way to ensure privacy over the Internet? Thankfully, there is. You encrypt, or disguise, your information before you send it over the Internet. That way, if someone intercepts it, the data is meaningless, and impossible to change without the alteration being known to the intended recipient.
Internet security threats
Without security precautions, you might encounter three types of problems when you send information over the Internet or an intranet.
Decryption reverses the process, turning the ciphertext back into the original message. The recipient is the only one who can do this because only the recipient has a key. This is at the heart of encryption: only someone with the correct key can "unlock" a message. (To see how encryption is able to resist "brute force" attacks by someone without the key, see "How does encryption work?" on page 90.)
In fact, both the encryption and the decryption processes require keys, and sometimes use the same key. Like a combination lock protecting a safe--the same combination is used to secure and retrieve something. This is known as symmetric encryption.
One problem with symmetric encryption is that anyone who uncovers the key can decrypt your messages, as well as encrypt new messages so they would appear as authentic as yours. This same person could edit or replace messages in transit from you to your intended recipient.
You can avoid this problem by using different keys for encryption and decryption. Then you would have a system like the one described in the following section.
Public-key encryption
In public-key encryption, you use two keys: one for encrypting data and the other for decrypting. The encryption key is called the public key, and the decryption key is the private key. Public-key encryption is one of the processes that the server uses to exchange data with clients. Here's how public-key encryption works with a server.
As with any encryption process, as long as you actually keep your private key private, your encrypted messages are safe from tampering. Even an eavesdropper who gets both the public key and the ciphertext can't work backwards and discover either your private key or your original message. In Netscape servers and clients, you have the additional safeguard of password protection before your private key can be used by the application. Note that this is only required when you start your server, not every time a secure connection is requested by a client. What keeps public-key encryption secure is that you never share your private key with anyone, so no one can ever decrypt your messages. If your private key is ever compromised, you must immediately create a new public/private key pair. (See "Generating a key pair" on page 100 for more information.)
Public-key encryption takes longer than symmetric encryption. However, client-server communication with SSL uses both types of encryption together to maximize their strengths. Here's how these processes are leveraged. A client and server exchange public keys, and then the client generates a symmetric encryption key that is used only for this transaction. This key is called a session key. The client encrypts the session key with the server's private key and sends it to the server. For the rest of that transaction, the client and the server can use the quicker symmetric encryption. (This is the basis of SSL, as discussed on page 95.)
Your server can perform encryption with a number of different encryption functions, called ciphers. (Refer to "Setting security preferences" on page 106 for more information.) Some ciphers are stronger--that is, more resistant to cracking--than others
During an SSL connection, the client and the server agree to use the strongest cipher they can both communicate with.
Signing files
Public-key encryption also allows you to create a message that anyone can decrypt, that can only have been created by you. You do this by simply reversing the use of the keys: you encrypt a message using your own private key--that way, anyone with your public key can decrypt it. Because only a message encrypted with your private key can be decrypted with your public key, that message is proven to be from you.
You can use this "proof of sender" feature of public key encryption in conjunction with the ability to guarantee message integrity. And you can do this without disguising the contents of a file. This process is called signing a file. When you sign a file, you guarantee message integrity as with normal encryption, but without forcing the recipient to decrypt the message to read it. If you were to look at a signed message, it would appear as a normal unencrypted message with a section of encrypted text after it. Even though the message itself isn't encrypted, you still run the decryption process on it to make sure that the digital signature matches the message. If the message has been changed since the file was signed, the signature will not decrypt correctly.
When you sign a file with your private key, you are sending out a public message, readable by anyone, that can be proven to be your note because it can only be decrypted with your public key. (File signing is used in SSL, as described on page 95.)
How does encryption work?
This section explains technically how encryption works. You don't need to know these facts to operate an SSL-enabled server, but if you want to know about the mathematical underpinnings of this system, this section will introduce them to you.
It might seem odd that you can give an eavesdropper both your public key and a sample of your ciphertext and still be sure that your original message and private key can't be discovered. This is the case, though. Here's why.
The encryption keys discussed in the previous sections are complex mathematical functions that are easy to compute in one direction, and extremely difficult to compute in the reverse. That is, it's easy for a computer to figure out the ciphertext when presented with the original message and the encryption key, but very difficult to figure out the original message, with only the ciphertext and the encryption key. Because all data stored in computers can ultimately be expressed numerically, you can perform mathematical functions on any information on your computer.
An example of a simple mathematical function is
m+3=c
This is an easy equation to reverse. If you know c (the ciphertext), you can figure out m (the message). In fact, even if you kept this equation (that is, the key) secret, someone could figure it out relatively quickly by examining your ciphertext for patterns.
The types of functions used in public-key encryption are vastly more complex than the previous example. They are, also, resistant to pattern searches because they use prime numbers in their calculations. (A prime number is divisible only by itself and one.) The first ten prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23, and 29. The number 6 is not prime, because it can also be divided by 2 and 3. There are no patterns for determining prime numbers, so if you use an encryption key that uses prime numbers in the right manner, examining the ciphertext for patterns does no good. In fact, the SSL protocol uses a number of different types of encryption keys throughout its sequence.
If it is next-to-impossible to determine the original message once it's in ciphertext, how is the private key holder able to uncover it? It's because the private key is also a complex mathematical function, one that is incorporated into the function of the public key as a built-in shortcut to "solving" the public key function (or turning the ciphertext back into the original message). And, even if someone gets your public key, it's as impossible to determine what that corresponding private key is as it is to determine the original message from the ciphertext and the public key.
How secure is encryption?
Technically, it's not impossible to "crack" ciphertext and determine the content of the original message--it just takes a lot of time and money. For example, to crack the 128-bit encryption of a single SSL message, it would take a single pentium-based computer a greater amount of time than the age of the Earth.
Of course, you could use several computers in conjunction. For example, if you dedicated 10 computers to cracking that same encryption, it would take you one-tenth the time. Even then, only the single message in question would be deciphered because SSL generates a new encryption key for every exchange. (For more details, see "Putting all the pieces together: SSL" on page 95.)
The precise level of security a key offers is measured by the size of certain numbers used in creating the key. These numbers are measured in bits. The greater the number of bits, the more secure the key. The key used in the previous paragraph's example is a 128-bit key, which is so strong that the United States government doesn't allow products containing it to be exported. International versions of Netscape products are limited to 40-bit encryption keys. This is still strong enough to stop most criminals. However, it is conceivable that someone could use 100 dedicated computers working together to crack it more quickly. Of course, the cost of making such powerful machines unavailable for other tasks for that amount of time would be very high indeed--probably millions dollars.Finally, keep in mind that new computing power tends to double every 18 months. The encryption that keeps you safe today may not hold up to cracking ten years from now.
When considering encryption, remember that the trade-off is the value of the information versus the cost or time to crack the encryption. If the information is worth less than what it would cost to crack the encryption protecting it, then you are probably safe. Still, it's always a good idea to use the strongest encryption possible. Inadequate encryption is like no encryption at all--arguably worse, since it lulls you into a false sense of security.
Now that security is increased when passing information back and forth, how can you be sure the recipient is who they claim to be? The same as in real life--you ask for identification, which is covered in the following section.
Authentication and certificates
Over the Internet and smaller internal intranets, identification takes the form of an authentication certificate, or simply, a certificate. It is a non-transferable, non-forgeable, digital file issued from a third party that both communicating parties already trust. This third party is known as a Certification Authority, or CA. You decide which CAs you trust enough to serve as verifiers of other people's identities. (This is described in "Choosing Certification Authorities" on page 95.)
Both clients and servers can have certificates. Also, they can have multiple certificates, much like a person might have several different pieces of identification. When a web site sends its certificate to a client, the process is called server authentication. When a client sends a certificate to a server, the process is called client authentication. The Netscape FastTrack Server supports server authentication. For example, if you visit a web site called www.danishfurniture.com, you might find it possesses a certificate issued from a company named CertSafe, assuring you that this site is the one true www.danishfurniture.com. If you trust CertSafe's judgment, then you can trust that www.danishfurniture.com is the site it claims to be. When SSL is enabled, server authentication is accomplished with these steps.
NoteServer authentication is not essential to an SSL connection--you can still exchange encrypted information--but it does give extra assurance to the client that they are sending encrypted information to the correct party. Also, although a client and server can communicate without authentication, if your server requires client authentication for access control, the client will be rejected. (See "Restricting access" on page 79 for more information.)
Note
As a client, you may find that your company might also have a department that functions as a CA for all internal communications. However, you might find that your company's certificate isn't accepted at any external sites you visit. In this case, you might want to purchase a certificate from an outside CA company. See "Choosing Certification Authorities" on page 95.
Warning!On the client side of the transaction, though, be careful--these extra fields are not used in every certificate. Unless you are presented with a certificate using such fields, you don't always have complete confidence that the party you send information to is reliable. The best Internet security won't help you if you send your private information to a criminal. As with any certificate, whether or not you believe this information depends on whether or not you trust the CA. It is important to understand that certificates don't prove conclusively that people or computers are who they claim to be. It merely proves that a CA has some degree of trust in the person. When you exchange information with a certificate holder, it means that you trust the CA who issued the certificate. If you choose to purchase a certificate, buy it from a CA with a good reputation, or your investment may be wasted.
Essentially, SSL is symmetric encryption nested within public-key encryption, authenticated through the use of certificates. An SSL connection can only occur between an SSL-enabled client and an SSL-enabled server. In fact, when a server is running in SSL mode, it can only communicate through SSL.
TCP/IP is Transmission Control
Protocol/Internet
Protocol, the basic
language of the
Internet, and HTTP
is Hypertext Transfer
Protocol, the basic
language of the
graphical World
Wide Web, a subset
of the Internet.
Technically speaking, SSL is a protocol that runs above TCP/IP and below HTTP or other top-level protocols. This is shown in the following figure.
How SSL relates to TCP/IP and application protocols.
Choose good passwords
You use a number of passwords with your server--the administrative password, the private key password, database passwords, and so on. Your administrative password is the most important password of all, since anyone with that password can configure any and all servers on your computer. Most important after that is your private key password. If someone gets your private key and your private key password, they can create a fake server that appears to be yours, or intercept and change communications to and from your server.
For these reasons, it's very important that you choose passwords that are difficult to guess and that you never reveal them to anyone. Your most important passwords should never contain words from any language because numerous password-cracking programs exist that can run through millions of possible word combinations in seconds. Your important passwords also should be at least eight characters long, and contain a mix of upper- and lower-case letters, punctuation marks, or mathematical characters, and numerals.
A good password is one you'll remember but others won't guess. For example, MBi12!mo could be remembered as "My Baby is twelve months old!" A bad password would be your child's name or birthdate.
It's not a good idea to write your passwords anywhere, but if you feel you must, store them in a very safe place, perhaps even stored in a safe or other locked box that has limited access.
Secure your private key
Make sure your private key file is protected. Store the key file in a directory that only you or authorized administrators have access to. It's also important to know if the file is stored on backup tapes or is otherwise available for someone to intercept. If this is so, you must protect your backups with the same level of security that you protect your server.
Limit other applications on the server machine
Carefully consider all applications that run on the same machine as the server. It's possible to circumvent your server's security by exploiting holes in other programs running on your server. Disable all unnecessary programs and services. For example, the sendmail daemon is difficult to configure securely and it can be programmed to run other possibly detrimental programs on the server machine.
Carefully choose the processes started from initab and rc scripts. Don't run telnet or rlogin from the server machine. You also shouldn't have rdist on the server machine (this can distribute files but it can also be used to update files on the server machine).
Similarly, you should be very careful about what CGI, Java, and JavaScript programs you put on your server or allow other people to upload to your server. Other people's programs might have security holes. Worst of all, someone might upload a malicious program that is designed specifically to subvert your security. Always examine programs carefully before you allow them on your server.
Limit ports
Disable any ports not used on the machine. Use routers or firewall configurations to prevent incoming connections to anything other than the absolute minimum set of ports. This means that the only way to get a shell on the machine is to physically use the server's machine, which should be in a restricted area already.
Know your server's limits
The server offers secure connections between the server and the client. It can't control the security of information once the client has it, nor can it control access to the server machine itself and its directories and files.
Being aware of these limitations helps you know what situations to avoid. For example, you might acquire credit card numbers over an SSL connection, but are those numbers stored in a secure file on the server machine? What happens to those numbers after the SSL connection is terminated? You should be responsible for securing any information clients send to you through SSL.
Enabling SSL on your server
To enable SSL on your server, you must complete these four steps:
For more information on public and private keys, see page 88 and page 95.You need to generate a key-pair file that holds the public and private keys for your server. These keys are used during SSL communications. The private key is stored in encrypted form on the server machine using a password you specify.
bin/httpd/admin/bin/sec-key
NoteYou should periodically change your key file password. If you forget your password, you will have to regenerate your key-pair file. This means you must also obtain another certificate (there are usually additional costs to do this).
Warning!Don't change your key file password if you are administering your server over a non-SSL connection. Anyone can intercept the information and activate or disable your SSL. To change your key file password,
For information on what a certificate is, refer to "Authentication and certificates" on page 92.After you generate a key pair, you can request a certificate from a Certification Authority, or CA. Note that not everyone who requests a certificate is given one. This is because many CAs require information proving your identity before they issue a certificate. Also, it can take anywhere from a day to two months or more to approve a certificate. You are responsible for promptly providing all the necessary information to the CA. Before you request a certificate, you should choose a CA and contact them regarding the specific format of the information they require. (For more information on what some CAs require, see the next section.) To request a certificate,
NoteMost of the time, you want your server to run with SSL enabled. You might, at other times, want to disable it. If you temporarily disable SSL, make sure you re-enable it before processing transactions that require confidentiality, authentication, or data integrity. Now that SSL is enabled on your server, you can configure your overall SSL preferences (page 106), and specify different strengths of encryption for different parts of your server (page 108).
When a client initiates an SSL connection with a server, it lets the server know what ciphers it prefers to use to encrypt information. In any two-way encryption process, both parties must use the same ciphers. Since there are a number of ciphers available, your server needs to be able to use the most popular ones.
You can choose ciphers from the SSL 2 protocol, as well as from SSL 3. To specify which ciphers your server can use, check them in the list. Unless you have a compelling reason why you don't want to use a specific cipher, you should check them all.
Warning!
You might not want to check No Encryption, only MD5 message authentication. If no other ciphers are available on the client side, the server will use this, and no encryption will occur.
Another reason you might not want to enable all ciphers is to prevent SSL connections with less than optimal encryption. That is, United States law prohibits the export of products with 128-bit encryption, so overseas clients might only be using 40-bit encryption, which is not as difficult to crack as 128-bit. Unchecking all 40-bit ciphers effectively restricts access to browsers available only in the United States.
The SSL 2.0 ciphers are:
<meta http-equiv="pragma" content="no-cache">
https://[servername].[domain].[dom]/[pathname]/[document]
Note
Browsers not enabled with SSL can't communicate with an SSL-enabled server because they can't enter an SSL transaction. However, they can communicate with the server when the server isn't using SSL.)
The secure log
Once SSL is enabled, a new log file, (secure.log) is created in the normal log directory. Entries in the log look like:
198.93.92.99: [02/Nov/1994:23:51:46 -0800] using keysize 40
where the IP address is first, followed by the date and time of access, and then the key size. The key size represents a level of security. Generally, the bigger the key size, the higher the level of security. See page 107 for a list of supported key sizes.
Unprotected server document directory
If you want to have both secure and unsecure servers, you should operate the unsecure server on a different machine from the secure server. If your resources are limited and you must run an unsecure server on the same machine as your secure server follow these guidelines.
Syntax
Security value
value specifies if SSL is on or off. Security on enables SSL; Security off disables SSL.
Syntax
SSL2 value
value
specifies if SSL version 2 is enabled or disabled. SSL2 on
enables SSL 2. SSL2 off
disables SSL 2.
Syntax
SSL3 value
value
specifies if SSL version 3 is enabled or disabled. SSL3 on
enables SSL 3. SSL3 off
disables SSL 3.
Syntax
ServerKey keyfile
keyfile is the server's key file, specified as a relative path from the server root or as an absolute path.
Syntax
ServerCert certfile
certfile is the server's certificate file, specified as a relative path from the server root or as an absolute path.
Syntax
Ciphers +rc4 +rc4export -rc2 -rc2export +idea +des +desede3
A + means the cipher is active, and a - means the cipher is inactive. Any cipher with export
as part of its name is not stronger than 40 bits.
SSL3Ciphers
The SSL3Ciphers directive specifies the SSL 3 ciphers enabled for your server. For a discussion of the pros and cons of these ciphers, refer to "Setting security preferences" on page 106.
Syntax
SSL3Ciphers +rsa_rc4_128_md5 +rsa_3des_sha +rsa_des_sha +rsa_rc4_40_md5 +rsa_rc2_40_md5 -rsa_null_md5
A + means the cipher is active, and a - means the cipher is inactive. Any cipher with 40
as part of its name is 40 bits.
Further reading
The following resources will give you a broad view of the many different issues and perspectives concerning Internet security and encryption.