1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5 This file is generated from xml source: DO NOT EDIT
6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7 --><title>SSL/TLS Strong Encryption: An Introduction - Apache HTTP Server</title><link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /><link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /><link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link href="../images/favicon.ico" rel="shortcut icon" /></head><body id="manual-page"><div id="page-header"><p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p><p class="apache">Apache HTTP Server Version 2.1</p><img alt="" src="../images/feather.gif" /></div><div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div><div id="path"><a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs-project/">Documentation</a> > <a href="../">Version 2.1</a> > <a href="./">SSL/TLS</a></div><div id="page-content"><div id="preamble"><h1>SSL/TLS Strong Encryption: An Introduction</h1>
9 <p>The nice thing about standards is that there are so many to choose
10 from. And if you really don't like all the standards you just have to
11 wait another year until the one arises you are looking for.</p>
13 <p class="cite">-- <cite>A. Tanenbaum</cite>, "Introduction to
14 Computer Networks"</p>
17 <p>As an introduction this chapter is aimed at readers who are familiar
18 with the Web, HTTP, and Apache, but are not security experts. It is not
19 intended to be a definitive guide to the SSL protocol, nor does it discuss
20 specific techniques for managing certificates in an organization, or the
21 important legal issues of patents and import and export restrictions.
22 Rather, it is intended to provide a common background to mod_ssl users by
23 pulling together various concepts, definitions, and examples as a starting
24 point for further exploration.</p>
26 <p>The presented content is mainly derived, with permission by the author,
27 from the article <a href="http://home.earthlink.net/~fjhirsch/Papers/wwwj/article.html">Introducing
28 SSL and Certificates using SSLeay</a> from <a href="http://home.earthlink.net/~fjhirsch/">Frederick J. Hirsch</a>, of The
29 Open Group Research Institute, which was published in <a href="http://www.ora.com/catalog/wjsum97/">Web Security: A Matter of
30 Trust</a>, World Wide Web Journal, Volume 2, Issue 3, Summer 1997.
31 Please send any postive feedback to <a href="mailto:hirsch@fjhirsch.com">Frederick Hirsch</a> (the original
32 article author) and all negative feedback to <a href="mailto:rse@engelschall.com">Ralf S. Engelschall</a> (the
33 <code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code> author).</p>
34 </div><div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#cryptographictech">Cryptographic Techniques</a></li><li><img alt="" src="../images/down.gif" /> <a href="#certificates">Certificates</a></li><li><img alt="" src="../images/down.gif" /> <a href="#ssl">Secure Sockets Layer (SSL)</a></li><li><img alt="" src="../images/down.gif" /> <a href="#references">References</a></li></ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="cryptographictech" id="cryptographictech">Cryptographic Techniques</a></h2>
36 <p>Understanding SSL requires an understanding of cryptographic
37 algorithms, message digest functions (aka. one-way or hash functions), and
38 digital signatures. These techniques are the subject of entire books (see
39 for instance [<a href="#AC96">AC96</a>]) and provide the basis for privacy,
40 integrity, and authentication.</p>
42 <h3><a name="cryptographicalgo" id="cryptographicalgo">Cryptographic Algorithms</a></h3>
44 <p>Suppose Alice wants to send a message to her bank to transfer some
45 money. Alice would like the message to be private, since it will
46 include information such as her account number and transfer amount. One
47 solution is to use a cryptographic algorithm, a technique that would
48 transform her message into an encrypted form, unreadable except by
49 those it is intended for. Once in this form, the message may only be
50 interpreted through the use of a secret key. Without the key the
51 message is useless: good cryptographic algorithms make it so difficult
52 for intruders to decode the original text that it isn't worth their
55 <p>There are two categories of cryptographic algorithms: conventional
59 <dt>Conventional cryptography</dt>
60 <dd>also known as symmetric cryptography, requires the sender and
61 receiver to share a key: a secret piece of information that may be
62 used to encrypt or decrypt a message. If this key is secret, then
63 nobody other than the sender or receiver may read the message. If
64 Alice and the bank know a secret key, then they may send each other
65 private messages. The task of privately choosing a key before
66 communicating, however, can be problematic.</dd>
68 <dt>Public key cryptography</dt>
69 <dd>also known as asymmetric cryptography, solves the key exchange
70 problem by defining an algorithm which uses two keys, each of which
71 may be used to encrypt a message. If one key is used to encrypt a
72 message then the other must be used to decrypt it. This makes it
73 possible to receive secure messages by simply publishing one key
74 (the public key) and keeping the other secret (the private key).</dd>
77 <p>Anyone may encrypt a message using the public key, but only the
78 owner of the private key will be able to read it. In this way, Alice
79 may send private messages to the owner of a key-pair (the bank), by
80 encrypting it using their public key. Only the bank will be able to
84 <h3><a name="messagedigests" id="messagedigests">Message Digests</a></h3>
86 <p>Although Alice may encrypt her message to make it private, there
87 is still a concern that someone might modify her original message or
88 substitute it with a different one, in order to transfer the money
89 to themselves, for instance. One way of guaranteeing the integrity
90 of Alice's message is to create a concise summary of her message and
91 send this to the bank as well. Upon receipt of the message, the bank
92 creates its own summary and compares it with the one Alice sent. If
93 they agree then the message was received intact.</p>
95 <p>A summary such as this is called a <dfn>message digest</dfn>, <em>one-way
96 function</em> or <em>hash function</em>. Message digests are used to create
97 short, fixed-length representations of longer, variable-length messages.
98 Digest algorithms are designed to produce unique digests for different
99 messages. Message digests are designed to make it too difficult to determine
100 the message from the digest, and also impossible to find two different
101 messages which create the same digest -- thus eliminating the possibility of
102 substituting one message for another while maintaining the same digest.</p>
103 <p>Another challenge that Alice faces is finding a way to send the digest to the
104 bank securely; when this is achieved, the integrity of the associated message
105 is assured. One way to to this is to include the digest in a digital
109 <h3><a name="digitalsignatures" id="digitalsignatures">Digital Signatures</a></h3>
110 <p>When Alice sends a message to the bank, the bank needs to ensure that the
111 message is really from her, so an intruder does not request a transaction
112 involving her account. A <em>digital signature</em>, created by Alice and
113 included with the message, serves this purpose.</p>
115 <p>Digital signatures are created by encrypting a digest of the message,
116 and other information (such as a sequence number) with the sender's
117 private key. Though anyone may <em>decrypt</em> the signature using the public
118 key, only the signer knows the private key. This means that only they may
119 have signed it. Including the digest in the signature means the signature is
120 only good for that message; it also ensures the integrity of the message since
121 no one can change the digest and still sign it.</p>
122 <p>To guard against interception and reuse of the signature by an intruder at a
123 later date, the signature contains a unique sequence number. This protects
124 the bank from a fraudulent claim from Alice that she did not send the message
125 -- only she could have signed it (non-repudiation).</p>
127 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="certificates" id="certificates">Certificates</a></h2>
129 <p>Although Alice could have sent a private message to the bank, signed
130 it, and ensured the integrity of the message, she still needs to be sure
131 that she is really communicating with the bank. This means that she needs
132 to be sure that the public key she is using corresponds to the bank's
133 private key. Similarly, the bank also needs to verify that the message
134 signature really corresponds to Alice's signature.</p>
136 <p>If each party has a certificate which validates the other's identity,
137 confirms the public key, and is signed by a trusted agency, then they both
138 will be assured that they are communicating with whom they think they are.
139 Such a trusted agency is called a <em>Certificate Authority</em>, and
140 certificates are used for authentication.</p>
142 <h3><a name="certificatecontents" id="certificatecontents">Certificate Contents</a></h3>
144 <p>A certificate associates a public key with the real identity of
145 an individual, server, or other entity, known as the subject. As
146 shown in <a href="#table1">Table 1</a>, information about the subject
147 includes identifying information (the distinguished name), and the
148 public key. It also includes the identification and signature of the
149 Certificate Authority that issued the certificate, and the period of
150 time during which the certificate is valid. It may have additional
151 information (or extensions) as well as administrative information
152 for the Certificate Authority's use, such as a serial number.</p>
154 <h4><a name="table1" id="table1">Table 1: Certificate Information</a></h4>
158 <td>Distinguished Name, Public Key</td></tr>
160 <td>Distinguished Name, Signature</td></tr>
161 <tr><th>Period of Validity</th>
162 <td>Not Before Date, Not After Date</td></tr>
163 <tr><th>Administrative Information</th>
164 <td>Version, Serial Number</td></tr>
165 <tr><th>Extended Information</th>
166 <td>Basic Contraints, Netscape Flags, etc.</td></tr>
170 <p>A distinguished name is used to provide an identity in a specific
171 context -- for instance, an individual might have a personal
172 certificate as well as one for their identity as an employee.
173 Distinguished names are defined by the X.509 standard [<a href="#X509">X509</a>], which defines the fields, field names, and
174 abbreviations used to refer to the fields (see <a href="#table2">Table
177 <h4><a name="table2" id="table2">Table 2: Distinguished Name Information</a></h4>
179 <table class="bordered">
180 <tr><th>DN Field</th>
183 <th>Example</th></tr>
184 <tr><td>Common Name</td>
186 <td>Name being certified</td>
187 <td>CN=Joe Average</td></tr>
188 <tr><td>Organization or Company</td>
190 <td>Name is associated with this<br />organization</td>
191 <td>O=Snake Oil, Ltd.</td></tr>
192 <tr><td>Organizational Unit</td>
194 <td>Name is associated with this <br />organization unit, such
196 <td>OU=Research Institute</td></tr>
197 <tr><td>City/Locality</td>
199 <td>Name is located in this City</td>
200 <td>L=Snake City</td></tr>
201 <tr><td>State/Province</td>
203 <td>Name is located in this State/Province</td>
204 <td>ST=Desert</td></tr>
207 <td>Name is located in this Country (ISO code)</td>
212 <p>A Certificate Authority may define a policy specifying which
213 distinguished field names are optional, and which are required. It
214 may also place requirements upon the field contents, as may users of
215 certificates. As an example, a Netscape browser requires that the
216 Common Name for a certificate representing a server has a name which
217 matches a wildcard pattern for the domain name of that server, such
218 as <code>*.snakeoil.com</code>.</p>
220 <p>The binary format of a certificate is defined using the ASN.1
221 notation [<a href="#X208">X208</a>] [<a href="#PKCS">PKCS</a>]. This
222 notation defines how to specify the contents, and encoding rules
223 define how this information is translated into binary form. The binary
224 encoding of the certificate is defined using Distinguished Encoding
225 Rules (DER), which are based on the more general Basic Encoding Rules
226 (BER). For those transmissions which cannot handle binary, the binary
227 form may be translated into an ASCII form by using Base64 encoding
228 [<a href="#MIME">MIME</a>]. This encoded version is called PEM encoded
229 (the name comes from "Privacy Enhanced Mail"), when placed between
230 begin and end delimiter lines as illustrated in the following
233 <div class="example"><h3>Example of a PEM-encoded certificate (snakeoil.crt)</h3><pre>-----BEGIN CERTIFICATE-----
234 MIIC7jCCAlegAwIBAgIBATANBgkqhkiG9w0BAQQFADCBqTELMAkGA1UEBhMCWFkx
235 FTATBgNVBAgTDFNuYWtlIERlc2VydDETMBEGA1UEBxMKU25ha2UgVG93bjEXMBUG
236 A1UEChMOU25ha2UgT2lsLCBMdGQxHjAcBgNVBAsTFUNlcnRpZmljYXRlIEF1dGhv
237 cml0eTEVMBMGA1UEAxMMU25ha2UgT2lsIENBMR4wHAYJKoZIhvcNAQkBFg9jYUBz
238 bmFrZW9pbC5kb20wHhcNOTgxMDIxMDg1ODM2WhcNOTkxMDIxMDg1ODM2WjCBpzEL
239 MAkGA1UEBhMCWFkxFTATBgNVBAgTDFNuYWtlIERlc2VydDETMBEGA1UEBxMKU25h
240 a2UgVG93bjEXMBUGA1UEChMOU25ha2UgT2lsLCBMdGQxFzAVBgNVBAsTDldlYnNl
241 cnZlciBUZWFtMRkwFwYDVQQDExB3d3cuc25ha2VvaWwuZG9tMR8wHQYJKoZIhvcN
242 AQkBFhB3d3dAc25ha2VvaWwuZG9tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB
243 gQDH9Ge/s2zcH+da+rPTx/DPRp3xGjHZ4GG6pCmvADIEtBtKBFAcZ64n+Dy7Np8b
244 vKR+yy5DGQiijsH1D/j8HlGE+q4TZ8OFk7BNBFazHxFbYI4OKMiCxdKzdif1yfaa
245 lWoANFlAzlSdbxeGVHoT0K+gT5w3UxwZKv2DLbCTzLZyPwIDAQABoyYwJDAPBgNV
246 HRMECDAGAQH/AgEAMBEGCWCGSAGG+EIBAQQEAwIAQDANBgkqhkiG9w0BAQQFAAOB
247 gQAZUIHAL4D09oE6Lv2k56Gp38OBDuILvwLg1v1KL8mQR+KFjghCrtpqaztZqcDt
248 2q2QoyulCgSzHbEGmi0EsdkPfg6mp0penssIFePYNI+/8u9HT4LuKMJX15hxBam7
249 dUHzICxBVC1lnHyYGjDuAMhe396lYAn8bCld1/L4NMGBCQ==
250 -----END CERTIFICATE-----</pre></div>
253 <h3><a name="certificateauthorities" id="certificateauthorities">Certificate Authorities</a></h3>
255 <p>By first verifying the information in a certificate request
256 before granting the certificate, the Certificate Authority assures
257 the identity of the private key owner of a key-pair. For instance,
258 if Alice requests a personal certificate, the Certificate Authority
259 must first make sure that Alice really is the person the certificate
262 <h4><a name="certificatechains" id="certificatechains">Certificate Chains</a></h4>
264 <p>A Certificate Authority may also issue a certificate for
265 another Certificate Authority. When examining a certificate,
266 Alice may need to examine the certificate of the issuer, for each
267 parent Certificate Authority, until reaching one which she has
268 confidence in. She may decide to trust only certificates with a
269 limited chain of issuers, to reduce her risk of a "bad" certificate
273 <h4><a name="rootlevelca" id="rootlevelca">Creating a Root-Level CA</a></h4>
275 <p>As noted earlier, each certificate requires an issuer to assert
276 the validity of the identity of the certificate subject, up to
277 the top-level Certificate Authority (CA). This presents a problem:
278 Since this is who vouches for the certificate of the top-level
279 authority, which has no issuer? In this unique case, the
280 certificate is "self-signed", so the issuer of the certificate is
281 the same as the subject. As a result, one must exercise extra care
282 in trusting a self-signed certificate. The wide publication of a
283 public key by the root authority reduces the risk in trusting this
284 key -- it would be obvious if someone else publicized a key
285 claiming to be the authority. Browsers are preconfigured to trust
286 well-known certificate authorities.</p>
288 <p>A number of companies, such as <a href="http://www.thawte.com/">Thawte</a> and <a href="http://www.verisign.com/">VeriSign</a>
289 have established themselves as Certificate Authorities. These
290 companies provide the following services:</p>
293 <li>Verifying certificate requests</li>
294 <li>Processing certificate requests</li>
295 <li>Issuing and managing certificates</li>
298 <p>It is also possible to create your own Certificate Authority.
299 Although risky in the Internet environment, it may be useful
300 within an Intranet where the organization can easily verify the
301 identities of individuals and servers.</p>
304 <h4><a name="certificatemanagement" id="certificatemanagement">Certificate Management</a></h4>
306 <p>Establishing a Certificate Authority is a responsibility which
307 requires a solid administrative, technical, and management
308 framework. Certificate Authorities not only issue certificates,
309 they also manage them -- that is, they determine how long
310 certificates are valid, they renew them, and they keep lists of
311 certificates that have already been issued but are no longer valid
312 (Certificate Revocation Lists, or CRLs). Say Alice is entitled to
313 a certificate as an employee of a company. Say too, that the
314 certificate needs to be revoked when Alice leaves the company. Since
315 certificates are objects that get passed around, it is impossible
316 to tell from the certificate alone that it has been revoked. When
317 examining certificates for validity, therefore, it is necessary to
318 contact the issuing Certificate Authority to check CRLs -- this
319 is not usually an automated part of the process.</p>
321 <div class="note"><h3>Note</h3>
322 <p>If you use a Certificate Authority that is not configured into
323 browsers by default, it is necessary to load the Certificate
324 Authority certificate into the browser, enabling the browser to
325 validate server certificates signed by that Certificate Authority.
326 Doing so may be dangerous, since once loaded, the browser will
327 accept all certificates signed by that Certificate Authority.</p>
332 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="ssl" id="ssl">Secure Sockets Layer (SSL)</a></h2>
334 <p>The Secure Sockets Layer protocol is a protocol layer which may be
335 placed between a reliable connection-oriented network layer protocol
336 (e.g. TCP/IP) and the application protocol layer (e.g. HTTP). SSL provides
337 for secure communication between client and server by allowing mutual
338 authentication, the use of digital signatures for integrity, and encryption
341 <p>The protocol is designed to support a range of choices for specific
342 algorithms used for cryptography, digests, and signatures. This allows
343 algorithm selection for specific servers to be made based on legal, export
344 or other concerns, and also enables the protocol to take advantage of new
345 algorithms. Choices are negotiated between client and server at the start
346 of establishing a protocol session.</p>
348 <h3><a name="table4" id="table4">Table 4: Versions of the SSL protocol</a></h3>
350 <table class="bordered">
354 <th>Browser Support</th></tr>
355 <tr><td>SSL v2.0</td>
356 <td>Vendor Standard (from Netscape Corp.) [<a href="#SSL2">SSL2</a>]</td>
357 <td>First SSL protocol for which implementations exists</td>
358 <td>- NS Navigator 1.x/2.x<br />
360 - Lynx/2.8+OpenSSL</td></tr>
361 <tr><td>SSL v3.0</td>
362 <td>Expired Internet Draft (from Netscape Corp.) [<a href="#SSL3">SSL3</a>]</td>
363 <td>Revisions to prevent specific security attacks, add non-RSA
364 ciphers, and support for certificate chains</td>
365 <td>- NS Navigator 2.x/3.x/4.x<br />
366 - MS IE 3.x/4.x<br />
367 - Lynx/2.8+OpenSSL</td></tr>
368 <tr><td>TLS v1.0</td>
369 <td>Proposed Internet Standard (from IETF) [<a href="#TLS1">TLS1</a>]</td>
370 <td>Revision of SSL 3.0 to update the MAC layer to HMAC, add block
371 padding for block ciphers, message order standardization and more
373 <td>- Lynx/2.8+OpenSSL</td></tr>
377 <p>There are a number of versions of the SSL protocol, as shown in
378 <a href="#table4">Table 4</a>. As noted there, one of the benefits in
379 SSL 3.0 is that it adds support of certificate chain loading. This feature
380 allows a server to pass a server certificate along with issuer certificates
381 to the browser. Chain loading also permits the browser to validate the
382 server certificate, even if Certificate Authority certificates are not
383 installed for the intermediate issuers, since they are included in the
384 certificate chain. SSL 3.0 is the basis for the Transport Layer Security
385 [<a href="#TLS1">TLS</a>] protocol standard, currently in development by
386 the Internet Engineering Task Force (IETF).</p>
388 <h3><a name="session" id="session">Session Establishment</a></h3>
390 <p>The SSL session is established by following a handshake sequence
391 between client and server, as shown in <a href="#figure1">Figure 1</a>. This sequence may vary, depending on whether the server
392 is configured to provide a server certificate or request a client
393 certificate. Though cases exist where additional handshake steps
394 are required for management of cipher information, this article
395 summarizes one common scenario: see the SSL specification for the full
396 range of possibilities.</p>
398 <div class="note"><h3>Note</h3>
399 <p>Once an SSL session has been established it may be reused, thus
400 avoiding the performance penalty of repeating the many steps needed
401 to start a session. For this the server assigns each SSL session a
402 unique session identifier which is cached in the server and which the
403 client can use on forthcoming connections to reduce the handshake
404 (until the session identifer expires in the cache of the server).</p>
408 <img src="ssl_intro_fig1.gif" alt="" width="423" height="327" /><br />
409 <a id="figure1" name="figure1"><dfn>Figure 1</dfn></a>: Simplified SSL
410 Handshake Sequence</p>
412 <p>The elements of the handshake sequence, as used by the client and
413 server, are listed below:</p>
416 <li>Negotiate the Cipher Suite to be used during data transfer</li>
417 <li>Establish and share a session key between client and server</li>
418 <li>Optionally authenticate the server to the client</li>
419 <li>Optionally authenticate the client to the server</li>
422 <p>The first step, Cipher Suite Negotiation, allows the client and
423 server to choose a Cipher Suite supportable by both of them. The SSL3.0
424 protocol specification defines 31 Cipher Suites. A Cipher Suite is
425 defined by the following components:</p>
428 <li>Key Exchange Method</li>
429 <li>Cipher for Data Transfer</li>
430 <li>Message Digest for creating the Message Authentication Code (MAC)</li>
433 <p>These three elements are described in the sections that follow.</p>
436 <h3><a name="keyexchange" id="keyexchange">Key Exchange Method</a></h3>
438 <p>The key exchange method defines how the shared secret symmetric
439 cryptography key used for application data transfer will be agreed
440 upon by client and server. SSL 2.0 uses RSA key exchange only, while
441 SSL 3.0 supports a choice of key exchange algorithms including the
442 RSA key exchange when certificates are used, and Diffie-Hellman key
443 exchange for exchanging keys without certificates and without prior
444 communication between client and server.</p>
446 <p>One variable in the choice of key exchange methods is digital
447 signatures -- whether or not to use them, and if so, what kind of
448 signatures to use. Signing with a private key provides assurance
449 against a man-in-the-middle-attack during the information exchange
450 used in generating the shared key [<a href="#AC96">AC96</a>, p516].</p>
453 <h3><a name="ciphertransfer" id="ciphertransfer">Cipher for Data Transfer</a></h3>
455 <p>SSL uses the conventional cryptography algorithm (symmetric
456 cryptography) described earlier for encrypting messages in a session.
457 There are nine choices, including the choice to perform no
461 <li>No encryption</li>
464 <li>RC4 with 40-bit keys</li>
465 <li>RC4 with 128-bit keys</li>
467 <li>CBC Block Ciphers
468 <ul><li>RC2 with 40 bit key</li>
469 <li>DES with 40 bit key</li>
470 <li>DES with 56 bit key</li>
471 <li>Triple-DES with 168 bit key</li>
472 <li>Idea (128 bit key)</li>
473 <li>Fortezza (96 bit key)</li>
477 <p>Here "CBC" refers to Cipher Block Chaining, which means that a
478 portion of the previously encrypted cipher text is used in the
479 encryption of the current block. "DES" refers to the Data Encryption
480 Standard [<a href="#AC96">AC96</a>, ch12], which has a number of
481 variants (including DES40 and 3DES_EDE). "Idea" is one of the best
482 and cryptographically strongest available algorithms, and "RC2" is
483 a proprietary algorithm from RSA DSI [<a href="#AC96">AC96</a>,
487 <h3><a name="digestfuntion" id="digestfuntion">Digest Function</a></h3>
489 <p>The choice of digest function determines how a digest is created
490 from a record unit. SSL supports the following:</p>
493 <li>No digest (Null choice)</li>
494 <li>MD5, a 128-bit hash</li>
495 <li>Secure Hash Algorithm (SHA-1), a 160-bit hash</li>
498 <p>The message digest is used to create a Message Authentication Code
499 (MAC) which is encrypted with the message to provide integrity and to
500 prevent against replay attacks.</p>
503 <h3><a name="handshake" id="handshake">Handshake Sequence Protocol</a></h3>
505 <p>The handshake sequence uses three protocols:</p>
508 <li>The <dfn>SSL Handshake Protocol</dfn>
509 for performing the client and server SSL session establishment.</li>
510 <li>The <dfn>SSL Change Cipher Spec Protocol</dfn> for actually
511 establishing agreement on the Cipher Suite for the session.</li>
512 <li>The <dfn>SSL Alert Protocol</dfn> for conveying SSL error
513 messages between client and server.</li>
516 <p>These protocols, as well as application protocol data, are
517 encapsulated in the <dfn>SSL Record Protocol</dfn>, as shown in
518 <a href="#figure2">Figure 2</a>. An encapsulated protocol is
519 transferred as data by the lower layer protocol, which does not
520 examine the data. The encapsulated protocol has no knowledge of the
521 underlying protocol.</p>
524 <img src="ssl_intro_fig2.gif" alt="" width="428" height="217" /><br />
525 <a id="figure2" name="figure2"><dfn>Figure 2</dfn></a>: SSL Protocol Stack
528 <p>The encapsulation of SSL control protocols by the record protocol
529 means that if an active session is renegotiated the control protocols
530 will be transmitted securely. If there were no session before, then
531 the Null cipher suite is used, which means there is no encryption and
532 messages have no integrity digests until the session has been
536 <h3><a name="datatransfer" id="datatransfer">Data Transfer</a></h3>
538 <p>The SSL Record Protocol, shown in <a href="#figure3">Figure 3</a>,
539 is used to transfer application and SSL Control data between the
540 client and server, possibly fragmenting this data into smaller units,
541 or combining multiple higher level protocol data messages into single
542 units. It may compress, attach digest signatures, and encrypt these
543 units before transmitting them using the underlying reliable transport
544 protocol (Note: currently all major SSL implementations lack support
545 for compression).</p>
548 <img src="ssl_intro_fig3.gif" alt="" width="423" height="323" /><br />
549 <a id="figure3" name="figure3"><dfn>Figure 3</dfn></a>: SSL Record Protocol
553 <h3><a name="securehttp" id="securehttp">Securing HTTP Communication</a></h3>
555 <p>One common use of SSL is to secure Web HTTP communication between
556 a browser and a webserver. This case does not preclude the use of
557 non-secured HTTP. The secure version is mainly plain HTTP over SSL
558 (named HTTPS), but with one major difference: it uses the URL scheme
559 <code>https</code> rather than <code>http</code> and a different
560 server port (by default 443). This mainly is what <code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code> provides to you for the Apache webserver...</p>
562 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="references" id="references">References</a></h2>
565 <dt><a id="AC96" name="AC96">[AC96]</a></dt>
566 <dd>Bruce Schneier, <q>Applied Cryptography</q>, 2nd Edition, Wiley,
567 1996. See <a href="http://www.counterpane.com/">http://www.counterpane.com/</a> for various other materials by Bruce
570 <dt><a id="X208" name="X208">[X208]</a></dt>
571 <dd>ITU-T Recommendation X.208, <q>Specification of Abstract Syntax Notation
572 One (ASN.1)</q>, 1988. See for instance <a href="http://www.itu.int/rec/recommendation.asp?type=items&lang=e&parent=T-REC-X.208-198811-I">http://www.itu.int/rec/recommendation.asp?type=items&lang=e&parent=T-REC-X.208-198811-I</a>.
575 <dt><a id="X509" name="X509">[X509]</a></dt>
576 <dd>ITU-T Recommendation X.509, <q>The Directory - Authentication
577 Framework</q>. See for instance <a href="http://www.itu.int/rec/recommendation.asp?type=folders&lang=e&parent=T-REC-X.509">http://www.itu.int/rec/recommendation.asp?type=folders&lang=e&parent=T-REC-X.509</a>.
580 <dt><a id="PKCS" name="PKCS">[PKCS]</a></dt>
581 <dd><q>Public Key Cryptography Standards (PKCS)</q>,
582 RSA Laboratories Technical Notes, See <a href="http://www.rsasecurity.com/rsalabs/pkcs/">http://www.rsasecurity.com/rsalabs/pkcs/</a>.</dd>
584 <dt><a id="MIME" name="MIME">[MIME]</a></dt>
585 <dd>N. Freed, N. Borenstein, <q>Multipurpose Internet Mail Extensions
586 (MIME) Part One: Format of Internet Message Bodies</q>, RFC2045.
587 See for instance <a href="http://ietf.org/rfc/rfc2045.txt">http://ietf.org/rfc/rfc2045.txt</a>.</dd>
589 <dt><a id="SSL2" name="SSL2">[SSL2]</a></dt>
590 <dd>Kipp E.B. Hickman, <q>The SSL Protocol</q>, 1995. See <a href="http://www.netscape.com/eng/security/SSL_2.html">http://www.netscape.com/eng/security/SSL_2.html</a>.</dd>
592 <dt><a id="SSL3" name="SSL3">[SSL3]</a></dt>
593 <dd>Alan O. Freier, Philip Karlton, Paul C. Kocher, <q>The SSL Protocol
594 Version 3.0</q>, 1996. See <a href="http://www.netscape.com/eng/ssl3/draft302.txt">http://www.netscape.com/eng/ssl3/draft302.txt</a>.</dd>
596 <dt><a id="TLS1" name="TLS1">[TLS1]</a></dt>
597 <dd>Tim Dierks, Christopher Allen, <q>The TLS Protocol Version 1.0</q>,
598 1999. See <a href="http://ietf.org/rfc/rfc2246.txt">http://ietf.org/rfc/rfc2246.txt</a>.</dd>
600 </div></div><div id="footer"><p class="apache">Maintained by the <a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</a></p><p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div></body></html>