tech-invite   World Map     

IETF     RFCs     Groups     SIP     ABNFs    |    3GPP     Specs     Gloss.     Arch.     IMS     UICC    |    Misc.    |    search     info

RFC 4346


The Transport Layer Security (TLS) Protocol Version 1.1

Part 4 of 4, p. 64 to 87
Prev RFC Part


prevText      Top      Up      ToC       Page 64 
Appendix B. Glossary

   Advanced Encryption Standard (AES)
      AES is a widely used symmetric encryption algorithm.  AES is a
      block cipher with a 128, 192, or 256 bit keys and a 16 byte block
      size. [AES] TLS currently only supports the 128 and 256 bit key

   application protocol
      An application protocol is a protocol that normally layers
      directly on top of the transport layer (e.g., TCP/IP).  Examples
      include HTTP, TELNET, FTP, and SMTP.

   asymmetric cipher
      See public key cryptography.

      Authentication is the ability of one entity to determine the
      identity of another entity.

   block cipher
      A block cipher is an algorithm that operates on plaintext in
      groups of bits, called blocks. 64 bits is a common block size.

   bulk cipher
      A symmetric encryption algorithm used to encrypt large quantities
      of data.

   cipher block chaining (CBC)
      CBC is a mode in which every plaintext block encrypted with a
      block cipher is first exclusive-ORed with the previous ciphertext
      block (or, in the case of the first block, with the initialization
      vector).  For decryption, every block is first decrypted, then
      exclusive-ORed with the previous ciphertext block (or IV).

Top      Up      ToC       Page 65 
      As part of the X.509 protocol (a.k.a. ISO Authentication
      framework), certificates are assigned by a trusted Certificate
      Authority and provide a strong binding between a party's identity
      or some other attributes and its public key.

      The application entity that initiates a TLS connection to a
      server.  This may or may not imply that the client initiated the
      underlying transport connection.  The primary operational
      difference between the server and client is that the server is
      generally authenticated, while the client is only optionally

   client write key
      The key used to encrypt data written by the client.

   client write MAC secret
      The secret data used to authenticate data written by the client.

      A connection is a transport (in the OSI layering model definition)
      that provides a suitable type of service.  For TLS, such
      connections are peer-to-peer relationships.  The connections are
      transient.  Every connection is associated with one session.

   Data Encryption Standard
      DES is a very widely used symmetric encryption algorithm.  DES is
      a block cipher with a 56 bit key and an 8 byte block size.  Note
      that in TLS, for key generation purposes, DES is treated as having
      an 8 byte key length (64 bits), but it still only provides 56 bits
      of protection.  (The low bit of each key byte is presumed to be
      set to produce odd parity in that key byte.)  DES can also be
      operated in a mode where three independent keys and three
      encryptions are used for each block of data; this uses 168 bits of
      key (24 bytes in the TLS key generation method) and provides the
      equivalent of 112 bits of security.  [DES], [3DES]

   Digital Signature Standard (DSS)
      A standard for digital signing, including the Digital Signing
      Algorithm, approved by the National Institute of Standards and
      Technology, defined in NIST FIPS PUB 186, "Digital Signature
      Standard," published May 1994 by the U.S. Dept. of Commerce.

Top      Up      ToC       Page 66 
   digital signatures
      Digital signatures utilize public key cryptography and one-way
      hash functions to produce a signature of the data that can be
      authenticated, and is difficult to forge or repudiate.

      An initial negotiation between client and server that establishes
      the parameters of their transactions.

   Initialization Vector (IV)
      When a block cipher is used in CBC mode, the initialization vector
      is exclusive-ORed with the first plaintext block prior to

      A 64-bit block cipher designed by Xuejia Lai and James Massey.

   Message Authentication Code (MAC)
      A Message Authentication Code is a one-way hash computed from a
      message and some secret data.  It is difficult to forge without
      knowing the secret data.  Its purpose is to detect if the message
      has been altered.

   master secret
      Secure secret data used for generating encryption keys, MAC
      secrets, and IVs.

      MD5 is a secure hashing function that converts an arbitrarily long
      data stream into a digest of fixed size (16 bytes).  [MD5]

   public key cryptography
      A class of cryptographic techniques employing two-key ciphers.
      Messages encrypted with the public key can only be decrypted with
      the associated private key.  Conversely, messages signed with the
      private key can be verified with the public key.

   one-way hash function
      A one-way transformation that converts an arbitrary amount of data
      into a fixed-length hash.  It is computationally hard to reverse
      the transformation or to find collisions.  MD5 and SHA are
      examples of one-way hash functions.

      A block cipher developed by Ron Rivest at RSA Data Security, Inc.
      [RSADSI] described in [RC2].

Top      Up      ToC       Page 67 
      A stream cipher invented by Ron Rivest.  A compatible cipher is
      described in [SCH].

      A very widely used public-key algorithm that can be used for
      either encryption or digital signing.  [RSA]

      The server is the application entity that responds to requests for
      connections from clients.  See also under client.

      A TLS session is an association between a client and a server.
      Sessions are created by the handshake protocol.  Sessions define a
      set of cryptographic security parameters that can be shared among
      multiple connections.  Sessions are used to avoid the expensive
      negotiation of new security parameters for each connection.

   session identifier
      A session identifier is a value generated by a server that
      identifies a particular session.

   server write key
      The key used to encrypt data written by the server.

   server write MAC secret
      The secret data used to authenticate data written by the server.

      The Secure Hash Algorithm is defined in FIPS PUB 180-2.  It
      produces a 20-byte output.  Note that all references to SHA
      actually use the modified SHA-1 algorithm.  [SHA]

      Netscape's Secure Socket Layer protocol [SSL3].  TLS is based on
      SSL Version 3.0

   stream cipher
      An encryption algorithm that converts a key into a
      cryptographically strong keystream, which is then exclusive-ORed
      with the plaintext.

   symmetric cipher
      See bulk cipher.

Top      Up      ToC       Page 68 
   Transport Layer Security (TLS)
      This protocol; also, the Transport Layer Security working group of
      the Internet Engineering Task Force (IETF).  See "Comments" at the
      end of this document.

Appendix C. CipherSuite Definitions

CipherSuite                           Key Exchange   Cipher      Hash

TLS_NULL_WITH_NULL_NULL               NULL           NULL        NULL
TLS_RSA_WITH_NULL_MD5                 RSA            NULL         MD5
TLS_RSA_WITH_NULL_SHA                 RSA            NULL         SHA
TLS_RSA_WITH_RC4_128_MD5              RSA            RC4_128      MD5
TLS_RSA_WITH_RC4_128_SHA              RSA            RC4_128      SHA
TLS_RSA_WITH_IDEA_CBC_SHA             RSA            IDEA_CBC     SHA
TLS_RSA_WITH_DES_CBC_SHA              RSA            DES_CBC      SHA
TLS_DH_anon_WITH_RC4_128_MD5          DH_anon        RC4_128      MD5
TLS_DH_anon_WITH_DES_CBC_SHA          DH_anon        DES_CBC      SHA

      Algorithm     Description                        Key size limit

      DHE_DSS       Ephemeral DH with DSS signatures   None
      DHE_RSA       Ephemeral DH with RSA signatures   None
      DH_anon       Anonymous DH, no signatures        None
      DH_DSS        DH with DSS-based certificates     None
      DH_RSA        DH with RSA-based certificates     None
                                                       RSA = none
      NULL          No key exchange                    N/A
      RSA           RSA key exchange                   None

Top      Up      ToC       Page 69 
                         Key      Expanded     IV    Block
    Cipher       Type  Material Key Material   Size   Size

    NULL         Stream   0          0         0     N/A
    IDEA_CBC     Block   16         16         8      8
    RC2_CBC_40   Block    5         16         8      8
    RC4_40       Stream   5         16         0     N/A
    RC4_128      Stream  16         16         0     N/A
    DES40_CBC    Block    5          8         8      8
    DES_CBC      Block    8          8         8      8
    3DES_EDE_CBC Block   24         24         8      8

      Indicates whether this is a stream cipher or a block cipher
      running in CBC mode.

   Key Material
      The number of bytes from the key_block that are used for
      generating the write keys.

   Expanded Key Material
      The number of bytes actually fed into the encryption algorithm.

   IV Size
      The amount of data needed to be generated for the initialization
      vector.  Zero for stream ciphers; equal to the block size for
      block ciphers.

   Block Size
      The amount of data a block cipher enciphers in one chunk; a block
      cipher running in CBC mode can only encrypt an even multiple of
      its block size.

         Hash      Hash      Padding
       function    Size       Size
         NULL       0          0
         MD5        16         48
         SHA        20         40

Appendix D. Implementation Notes

   The TLS protocol cannot prevent many common security mistakes.  This
   section provides several recommendations to assist implementors.

Top      Up      ToC       Page 70 
D.1. Random Number Generation and Seeding

   TLS requires a cryptographically secure pseudorandom number generator
   (PRNG).  Care must be taken in designing and seeding PRNGs.  PRNGs
   based on secure hash operations, most notably MD5 and/or SHA, are
   acceptable, but cannot provide more security than the size of the
   random number generator state.  (For example, MD5-based PRNGs usually
   provide 128 bits of state.)

   To estimate the amount of seed material being produced, add the
   number of bits of unpredictable information in each seed byte.  For
   example, keystroke timing values taken from a PC compatible's 18.2 Hz
   timer provide 1 or 2 secure bits each, even though the total size of
   the counter value is 16 bits or more.  Seeding a 128-bit PRNG would
   thus require approximately 100 such timer values.

   [RANDOM] provides guidance on the generation of random values.

D.2 Certificates and Authentication

   Implementations are responsible for verifying the integrity of
   certificates and should generally support certificate revocation
   messages.  Certificates should always be verified to ensure proper
   signing by a trusted Certificate Authority (CA).  The selection and
   addition of trusted CAs should be done very carefully.  Users should
   be able to view information about the certificate and root CA.

D.3 CipherSuites

   TLS supports a range of key sizes and security levels, including some
   that provide no or minimal security.  A proper implementation will
   probably not support many cipher suites.  For example, 40-bit
   encryption is easily broken, so implementations requiring strong
   security should not allow 40-bit keys.  Similarly, anonymous Diffie-
   Hellman is strongly discouraged because it cannot prevent man-in-
   the-middle attacks.  Applications should also enforce minimum and
   maximum key sizes.  For example, certificate chains containing 512-
   bit RSA keys or signatures are not appropriate for high-security

Top      Up      ToC       Page 71 
Appendix E. Backward Compatibility with SSL

   For historical reasons and in order to avoid a profligate consumption
   of reserved port numbers, application protocols that are secured by
   TLS 1.1, TLS 1.0, SSL 3.0, and SSL 2.0 all frequently share the same
   connection port.  For example, the https protocol (HTTP secured by
   SSL or TLS) uses port 443 regardless of which security protocol it is
   using.  Thus, some mechanism must be determined to distinguish and
   negotiate among the various protocols.

   TLS versions 1.1 and 1.0, and SSL 3.0 are very similar; thus,
   supporting both is easy.  TLS clients who wish to negotiate with such
   older servers SHOULD send client hello messages using the SSL 3.0
   record format and client hello structure, sending {3, 2} for the
   version field to note that they support TLS 1.1. If the server
   supports only TLS 1.0 or SSL 3.0, it will respond with a downrev 3.0
   server hello; if it supports TLS 1.1 it will respond with a TLS 1.1
   server hello.  The negotiation then proceeds as appropriate for the
   negotiated protocol.

   Similarly, a TLS 1.1  server that wishes to interoperate with TLS 1.0
   or SSL 3.0 clients SHOULD accept SSL 3.0 client hello messages and
   respond with a SSL 3.0 server hello if an SSL 3.0 client hello with a
   version field of {3, 0} is received, denoting that this client does
   not support TLS.  Similarly, if a SSL 3.0 or TLS 1.0 hello with a
   version field of {3, 1} is received, the server SHOULD respond with a
   TLS 1.0 hello with a version field of {3, 1}.

   Whenever a client already knows the highest protocol known to a
   server (for example, when resuming a session), it SHOULD initiate the
   connection in that native protocol.

   TLS 1.1 clients that support SSL Version 2.0 servers MUST send SSL
   Version 2.0 client hello messages [SSL2].  TLS servers SHOULD accept
   either client hello format if they wish to support SSL 2.0 clients on
   the same connection port.  The only deviations from the Version 2.0
   specification are the ability to specify a version with a value of
   three and the support for more ciphering types in the CipherSpec.

  Warning: The ability to send Version 2.0 client hello messages will be
       phased out with all due haste.  Implementors SHOULD make every
       effort to move forward as quickly as possible.  Version 3.0
       provides better mechanisms for moving to newer versions.

Top      Up      ToC       Page 72 
       The following cipher specifications are carryovers from SSL
       Version 2.0. These are assumed to use RSA for key exchange and

        V2CipherSpec TLS_RC4_128_WITH_MD5          = { 0x01,0x00,0x80 };
        V2CipherSpec TLS_RC4_128_EXPORT40_WITH_MD5 = { 0x02,0x00,0x80 };
        V2CipherSpec TLS_RC2_CBC_128_CBC_WITH_MD5  = { 0x03,0x00,0x80 };
        V2CipherSpec TLS_RC2_CBC_128_CBC_EXPORT40_WITH_MD5
                                                   = { 0x04,0x00,0x80 };
        V2CipherSpec TLS_IDEA_128_CBC_WITH_MD5     = { 0x05,0x00,0x80 };
        V2CipherSpec TLS_DES_64_CBC_WITH_MD5       = { 0x06,0x00,0x40 };
        V2CipherSpec TLS_DES_192_EDE3_CBC_WITH_MD5 = { 0x07,0x00,0xC0 };

       Cipher specifications native to TLS can be included in Version
       2.0 client hello messages using the syntax below.  Any
       V2CipherSpec element with its first byte equal to zero will be
       ignored by Version 2.0 servers.  Clients sending any of the above
       V2CipherSpecs SHOULD also include the TLS equivalent (see
       Appendix A.5):

        V2CipherSpec (see TLS name) = { 0x00, CipherSuite };

   Note: TLS 1.1 clients may generate the SSLv2 EXPORT cipher suites in
       handshakes for backward compatibility but MUST NOT negotiate them
       in TLS 1.1 mode.

E.1. Version 2 Client Hello

   The Version 2.0 client hello message is presented below using this
   document's presentation model.  The true definition is still assumed
   to be the SSL Version 2.0 specification.  Note that this message MUST
   be sent directly on the wire, not wrapped as an SSLv3 record

     uint8 V2CipherSpec[3];

     struct {
         uint16 msg_length;
         uint8 msg_type;
         Version version;
         uint16 cipher_spec_length;
         uint16 session_id_length;
         uint16 challenge_length;
         V2CipherSpec cipher_specs[V2ClientHello.cipher_spec_length];
         opaque session_id[V2ClientHello.session_id_length];
         opaque challenge[V2ClientHello.challenge_length;
     } V2ClientHello;

Top      Up      ToC       Page 73 
      This field is the length of the following data in bytes.  The high
      bit MUST be 1 and is not part of the length.

      This field, in conjunction with the version field, identifies a
      version 2 client hello message.  The value SHOULD be one (1).

      The highest version of the protocol supported by the client
      (equals ProtocolVersion.version; see Appendix A.1).

      This field is the total length of the field cipher_specs.  It
      cannot be zero and MUST be a multiple of the V2CipherSpec length

      This field MUST have a value of zero.

      The length in bytes of the client's challenge to the server to
      authenticate itself.  When using the SSLv2 backward compatible
      handshake the client MUST use a 32-byte challenge.

      This is a list of all CipherSpecs the client is willing and able
      to use.  There MUST be at least one CipherSpec acceptable to the

      This field MUST be empty.

   challenge The client challenge to the server for the server to
      identify itself is a (nearly) arbitrary-length random.  The TLS
      server will right-justify the challenge data to become the
      ClientHello.random data (padded with leading zeroes, if
      necessary), as specified in this protocol specification.  If the
      length of the challenge is greater than 32 bytes, only the last 32
      bytes are used.  It is legitimate (but not necessary) for a V3
      server to reject a V2 ClientHello that has fewer than 16 bytes of
      challenge data.

      Note: Requests to resume a TLS session MUST use a TLS client

Top      Up      ToC       Page 74 
E.2. Avoiding Man-in-the-Middle Version Rollback

   When TLS clients fall back to Version 2.0 compatibility mode, they
   SHOULD use special PKCS #1 block formatting.  This is done so that
   TLS servers will reject Version 2.0 sessions with TLS-capable

   When TLS clients are in Version 2.0 compatibility mode, they set the
   right-hand (least significant) 8 random bytes of the PKCS padding
   (not including the terminal null of the padding) for the RSA
   encryption of the ENCRYPTED-KEY-DATA field of the CLIENT-MASTER-KEY
   to 0x03 (the other padding bytes are random).  After decrypting the
   ENCRYPTED-KEY-DATA field, servers that support TLS SHOULD issue an
   error if these eight padding bytes are 0x03.  Version 2.0 servers
   receiving blocks padded in this manner will proceed normally.

Appendix F. Security Analysis

   The TLS protocol is designed to establish a secure connection between
   a client and a server communicating over an insecure channel.  This
   document makes several traditional assumptions, including that
   attackers have substantial computational resources and cannot obtain
   secret information from sources outside the protocol.  Attackers are
   assumed to have the ability to capture, modify, delete, replay, and
   otherwise tamper with messages sent over the communication channel.
   This appendix outlines how TLS has been designed to resist a variety
   of attacks.

F.1. Handshake Protocol

   The handshake protocol is responsible for selecting a CipherSpec and
   generating a Master Secret, which together comprise the primary
   cryptographic parameters associated with a secure session.  The
   handshake protocol can also optionally authenticate parties who have
   certificates signed by a trusted certificate authority.

F.1.1. Authentication and Key Exchange

   TLS supports three authentication modes: authentication of both
   parties, server authentication with an unauthenticated client, and
   total anonymity.  Whenever the server is authenticated, the channel
   is secure against man-in-the-middle attacks, but completely anonymous
   sessions are inherently vulnerable to such attacks.  Anonymous
   servers cannot authenticate clients.  If the server is authenticated,
   its certificate message must provide a valid certificate chain
   leading to an acceptable certificate authority.  Similarly,
   authenticated clients must supply an acceptable certificate to the

Top      Up      ToC       Page 75 
   server.  Each party is responsible for verifying that the other's
   certificate is valid and has not expired or been revoked.

   The general goal of the key exchange process is to create a
   pre_master_secret known to the communicating parties and not to
   attackers.  The pre_master_secret will be used to generate the
   master_secret (see Section 8.1).  The master_secret is required to
   generate the finished messages, encryption keys, and MAC secrets (see
   Sections 7.4.8, 7.4.9, and 6.3).  By sending a correct finished
   message, parties thus prove that they know the correct

F.1.1.1. Anonymous Key Exchange

   Completely anonymous sessions can be established using RSA or Diffie-
   Hellman for key exchange.  With anonymous RSA, the client encrypts a
   pre_master_secret with the server's uncertified public key extracted
   from the server key exchange message.  The result is sent in a client
   key exchange message.  Since eavesdroppers do not know the server's
   private key, it will be infeasible for them to decode the

   Note: No anonymous RSA Cipher Suites are defined in this document.

   With Diffie-Hellman, the server's public parameters are contained in
   the server key exchange message and the client's are sent in the
   client key exchange message.  Eavesdroppers who do not know the
   private values should not be able to find the Diffie-Hellman result
   (i.e., the pre_master_secret).

   Warning: Completely anonymous connections only provide protection
            against passive eavesdropping.  Unless an independent
            tamper-proof channel is used to verify that the finished
            messages were not replaced by an attacker, server
            authentication is required in environments where active
            man-in-the-middle attacks are a concern.

F.1.1.2. RSA Key Exchange and Authentication

   With RSA, key exchange and server authentication are combined.  The
   public key either may be contained in the server's certificate or may
   be a temporary RSA key sent in a server key exchange message.  When
   temporary RSA keys are used, they are signed by the server's RSA
   certificate.  The signature includes the current ClientHello.random,
   so old signatures and temporary keys cannot be replayed.  Servers may
   use a single temporary RSA key for multiple negotiation sessions.

   Note: The temporary RSA key option is useful if servers need large

Top      Up      ToC       Page 76 
         certificates but must comply with government-imposed size
         limits on keys used for key exchange.

   Note that if ephemeral RSA is not used, compromise of the server's
   static RSA key results in a loss of confidentiality for all sessions
   protected under that static key.  TLS users desiring Perfect Forward
   Secrecy should use DHE cipher suites.  The damage done by exposure of
   a private key can be limited by changing one's private key (and
   certificate) frequently.

   After verifying the server's certificate, the client encrypts a
   pre_master_secret with the server's public key.  By successfully
   decoding the pre_master_secret and producing a correct finished
   message, the server demonstrates that it knows the private key
   corresponding to the server certificate.

   When RSA is used for key exchange, clients are authenticated using
   the certificate verify message (see Section 7.4.8).  The client signs
   a value derived from the master_secret and all preceding handshake
   messages.  These handshake messages include the server certificate,
   which binds the signature to the server, and ServerHello.random,
   which binds the signature to the current handshake process.

F.1.1.3. Diffie-Hellman Key Exchange with Authentication

   When Diffie-Hellman key exchange is used, the server can either
   supply a certificate containing fixed Diffie-Hellman parameters or
   use the server key exchange message to send a set of temporary
   Diffie-Hellman parameters signed with a DSS or RSA certificate.
   Temporary parameters are hashed with the hello.random values before
   signing to ensure that attackers do not replay old parameters.  In
   either case, the client can verify the certificate or signature to
   ensure that the parameters belong to the server.

   If the client has a certificate containing fixed Diffie-Hellman
   parameters, its certificate contains the information required to
   complete the key exchange.  Note that in this case the client and
   server will generate the same Diffie-Hellman result (i.e.,
   pre_master_secret) every time they communicate.  To prevent the
   pre_master_secret from staying in memory any longer than necessary,
   it should be converted into the master_secret as soon as possible.
   Client Diffie-Hellman parameters must be compatible with those
   supplied by the server for the key exchange to work.

   If the client has a standard DSS or RSA certificate or is
   unauthenticated, it sends a set of temporary parameters to the server
   in the client key exchange message, then optionally uses a
   certificate verify message to authenticate itself.

Top      Up      ToC       Page 77 
   If the same DH keypair is to be used for multiple handshakes, either
   because the client or server has a certificate containing a fixed DH
   keypair or because the server is reusing DH keys, care must be taken
   to prevent small subgroup attacks.  Implementations SHOULD follow the
   guidelines found in [SUBGROUP].

   Small subgroup attacks are most easily avoided by using one of the
   DHE ciphersuites and generating a fresh DH private key (X) for each
   handshake.  If a suitable base (such as 2) is chosen, g^X mod p can
   be computed very quickly, therefore the performance cost is
   minimized.  Additionally, using a fresh key for each handshake
   provides Perfect Forward Secrecy.  Implementations SHOULD generate a
   new X for each handshake when using DHE ciphersuites.

F.1.2. Version Rollback Attacks

   Because TLS includes substantial improvements over SSL Version 2.0,
   attackers may try to make TLS-capable clients and servers fall back
   to Version 2.0. This attack can occur if (and only if) two TLS-
   capable parties use an SSL 2.0 handshake.

   Although the solution using non-random PKCS #1 block type 2 message
   padding is inelegant, it provides a reasonably secure way for Version
   3.0 servers to detect the attack.  This solution is not secure
   against attackers who can brute force the key and substitute a new
   ENCRYPTED-KEY-DATA message containing the same key (but with normal
   padding) before the application specified wait threshold has expired.
   Parties concerned about attacks of this scale should not use 40-bit
   encryption keys.  Altering the padding of the least-significant 8
   bytes of the PKCS padding does not impact security for the size of
   the signed hashes and RSA key lengths used in the protocol, since
   this is essentially equivalent to increasing the input block size by
   8 bytes.

F.1.3. Detecting Attacks against the Handshake Protocol

   An attacker might try to influence the handshake exchange to make the
   parties select different encryption algorithms than they would
   normally chooses.

   For this attack, an attacker must actively change one or more
   handshake messages.  If this occurs, the client and server will
   compute different values for the handshake message hashes.  As a
   result, the parties will not accept each others' finished messages.
   Without the master_secret, the attacker cannot repair the finished
   messages, so the attack will be discovered.

Top      Up      ToC       Page 78 
F.1.4. Resuming Sessions

   When a connection is established by resuming a session, new
   ClientHello.random and ServerHello.random values are hashed with the
   session's master_secret.  Provided that the master_secret has not
   been compromised and that the secure hash operations used to produce
   the encryption keys and MAC secrets are secure, the connection should
   be secure and effectively independent from previous connections.
   Attackers cannot use known encryption keys or MAC secrets to
   compromise the master_secret without breaking the secure hash
   operations (which use both SHA and MD5).

   Sessions cannot be resumed unless both the client and server agree.
   If either party suspects that the session may have been compromised,
   or that certificates may have expired or been revoked, it should
   force a full handshake.  An upper limit of 24 hours is suggested for
   session ID lifetimes, since an attacker who obtains a master_secret
   may be able to impersonate the compromised party until the
   corresponding session ID is retired.  Applications that may be run in
   relatively insecure environments should not write session IDs to
   stable storage.

F.1.5. MD5 and SHA

   TLS uses hash functions very conservatively.  Where possible, both
   MD5 and SHA are used in tandem to ensure that non-catastrophic flaws
   in one algorithm will not break the overall protocol.

F.2. Protecting Application Data

   The master_secret is hashed with the ClientHello.random and
   ServerHello.random to produce unique data encryption keys and MAC
   secrets for each connection.

   Outgoing data is protected with a MAC before transmission.  To
   prevent message replay or modification attacks, the MAC is computed
   from the MAC secret, the sequence number, the message length, the
   message contents, and two fixed character strings.  The message type
   field is necessary to ensure that messages intended for one TLS
   Record Layer client are not redirected to another.  The sequence
   number ensures that attempts to delete or reorder messages will be
   detected.  Since sequence numbers are 64 bits long, they should never
   overflow.  Messages from one party cannot be inserted into the
   other's output, since they use independent MAC secrets.  Similarly,
   the server-write and client-write keys are independent, so stream
   cipher keys are used only once.

Top      Up      ToC       Page 79 
   If an attacker does break an encryption key, all messages encrypted
   with it can be read.  Similarly, compromise of a MAC key can make
   message modification attacks possible.  Because MACs are also
   encrypted, message-alteration attacks generally require breaking the
   encryption algorithm as well as the MAC.

   Note: MAC secrets may be larger than encryption keys, so messages can
         remain tamper resistant even if encryption keys are broken.

F.3. Explicit IVs

   [CBCATT] describes a chosen plaintext attack on TLS that depends on
   knowing the IV for a record.  Previous versions of TLS [TLS1.0] used
   the CBC residue of the previous record as the IV and therefore
   enabled this attack.  This version uses an explicit IV in order to
   protect against this attack.

F.4. Security of Composite Cipher Modes

   TLS secures transmitted application data via the use of symmetric
   encryption and authentication functions defined in the negotiated
   ciphersuite.  The objective is to protect both the integrity and
   confidentiality of the transmitted data from malicious actions by
   active attackers in the network.  It turns out that the order in
   which encryption and authentication functions are applied to the data
   plays an important role for achieving this goal [ENCAUTH].

   The most robust method, called encrypt-then-authenticate, first
   applies encryption to the data and then applies a MAC to the
   ciphertext.  This method ensures that the integrity and
   confidentiality goals are obtained with ANY pair of encryption and
   MAC functions, provided that the former is secure against chosen
   plaintext attacks and that the MAC is secure against chosen-message
   attacks.  TLS uses another method, called authenticate-then-encrypt,
   in which first a MAC is computed on the plaintext and then the
   concatenation of plaintext and MAC is encrypted.  This method has
   been proven secure for CERTAIN combinations of encryption functions
   and MAC functions, but it is not guaranteed to be secure in general.
   In particular, it has been shown that there exist perfectly secure
   encryption functions (secure even in the information-theoretic sense)
   that combined with any secure MAC function, fail to provide the
   confidentiality goal against an active attack.  Therefore, new
   ciphersuites and operation modes adopted into TLS need to be analyzed
   under the authenticate-then-encrypt method to verify that they
   achieve the stated integrity and confidentiality goals.

Top      Up      ToC       Page 80 
   Currently, the security of the authenticate-then-encrypt method has
   been proven for some important cases.  One is the case of stream
   ciphers in which a computationally unpredictable pad of the length of
   the message, plus the length of the MAC tag, is produced using a
   pseudo-random generator and this pad is xor-ed with the concatenation
   of plaintext and MAC tag.  The other is the case of CBC mode using a
   secure block cipher.  In this case, security can be shown if one
   applies one CBC encryption pass to the concatenation of plaintext and
   MAC and uses a new, independent, and unpredictable IV for each new
   pair of plaintext and MAC.  In previous versions of SSL, CBC mode was
   used properly EXCEPT that it used a predictable IV in the form of the
   last block of the previous ciphertext.  This made TLS open to chosen
   plaintext attacks.  This version of the protocol is immune to those
   attacks.  For exact details in the encryption modes proven secure,
   see [ENCAUTH].

F.5. Denial of Service

   TLS is susceptible to a number of denial of service (DoS) attacks.
   In particular, an attacker who initiates a large number of TCP
   connections can cause a server to consume large amounts of CPU doing
   RSA decryption.  However, because TLS is generally used over TCP, it
   is difficult for the attacker to hide his point of origin if proper
   TCP SYN randomization is used [SEQNUM] by the TCP stack.

   Because TLS runs over TCP, it is also susceptible to a number of
   denial of service attacks on individual connections.  In particular,
   attackers can forge RSTs, thereby terminating connections, or forge
   partial TLS records, thereby causing the connection to stall.  These
   attacks cannot in general be defended against by a TCP-using
   protocol.  Implementors or users who are concerned with this class of
   attack should use IPsec AH [AH-ESP] or ESP [AH-ESP].

F.6. Final Notes

   For TLS to be able to provide a secure connection, both the client
   and server systems, keys, and applications must be secure.  In
   addition, the implementation must be free of security errors.

   The system is only as strong as the weakest key exchange and
   authentication algorithm supported, and only trustworthy
   cryptographic functions should be used.  Short public keys, 40-bit
   bulk encryption keys, and anonymous servers should be used with great
   caution.  Implementations and users must be careful when deciding
   which certificates and certificate authorities are acceptable; a
   dishonest certificate authority can do tremendous damage.

Top      Up      ToC       Page 81 
Normative References

   [AES]      National Institute of Standards and Technology,
              "Specification for the Advanced Encryption Standard (AES)"
              FIPS 197.  November 26, 2001.

   [3DES]     W. Tuchman, "Hellman Presents No Shortcut Solutions To
              DES," IEEE Spectrum, v. 16, n. 7, July 1979, pp. 40-41.

   [DES]      ANSI X3.106, "American National Standard for Information
              Systems-Data Link Encryption," American National Standards
              Institute, 1983.

   [DSS]      NIST FIPS PUB 186-2, "Digital Signature Standard,"
              National Institute of Standards and Technology, U.S.
              Department of Commerce, 2000.

   [HMAC]     Krawczyk, H., Bellare, M., and R. Canetti, "HMAC:  Keyed-
              Hashing for Message Authentication", RFC 2104, February

   [IDEA]     X. Lai, "On the Design and Security of Block Ciphers," ETH
              Series in Information Processing, v. 1, Konstanz:
              Hartung-Gorre Verlag, 1992.

   [MD5]      Rivest, R., "The MD5 Message-Digest Algorithm ", RFC 1321,
              April 1992.

   [PKCS1A]   B. Kaliski, "Public-Key Cryptography Standards (PKCS) #1:
              RSA Cryptography Specifications Version 1.5", RFC 2313,
              March 1998.

   [PKCS1B]   J. Jonsson, B. Kaliski, "Public-Key Cryptography Standards
              (PKCS) #1: RSA Cryptography Specifications Version 2.1",
              RFC 3447, February 2003.

   [PKIX]     Housley, R., Polk, W., Ford, W., and D. Solo, "Internet
              X.509 Public Key Infrastructure Certificate and
              Certificate Revocation List (CRL) Profile", RFC 3280,
              April 2002.

   [RC2]      Rivest, R., "A Description of the RC2(r) Encryption
              Algorithm", RFC 2268, March 1998.

   [SCH]      B. Schneier. "Applied Cryptography: Protocols, Algorithms,
              and Source Code in C, 2ed", Published by John Wiley &
              Sons, Inc. 1996.

Top      Up      ToC       Page 82 
   [SHA]      NIST FIPS PUB 180-2, "Secure Hash Standard," National
              Institute of Standards and Technology, U.S. Department of
              Commerce., August 2001.

   [REQ]      Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119, March 1997.

   [RFC2434]  Narten, T. and H. Alvestrand, "Guidelines for Writing an
              IANA Considerations Section in RFCs", BCP 26, RFC 2434,
              October 1998.

   [TLSAES]   Chown, P., "Advanced Encryption Standard (AES)
              Ciphersuites for Transport Layer Security (TLS)", RFC
              3268, June 2002.

   [TLSEXT]   Blake-Wilson, S., Nystrom, M., Hopwood, D., Mikkelsen, J.,
              and T. Wright, "Transport Layer Security (TLS)
              Extensions", RFC 3546, June 2003.

   [TLSKRB]   Medvinsky, A. and M. Hur, "Addition of Kerberos Cipher
              Suites to Transport Layer Security (TLS)", RFC 2712,
              October 1999.

Informative References

   [AH-ESP]   Kent, S., "IP Authentication Header", RFC 4302, December

              Eastlake 3rd, D., "Cryptographic Algorithm Implementation
              Requirements for Encapsulating Security Payload (ESP) and
              Authentication Header (AH)", RFC 4305, December 2005.

   [BLEI]     Bleichenbacher D., "Chosen Ciphertext Attacks against
              Protocols Based on RSA Encryption Standard PKCS #1" in
              Advances in Cryptology -- CRYPTO'98, LNCS vol. 1462,
              pages:  1-12, 1998.

   [CBCATT]   Moeller, B., "Security of CBC Ciphersuites in SSL/TLS:
              Problems and Countermeasures",

   [CBCTIME]  Canvel, B., "Password Interception in a SSL/TLS Channel",
    , 2003.

   [ENCAUTH]  Krawczyk, H., "The Order of Encryption and Authentication
              for Protecting Communications (Or: How Secure is SSL?)",
              Crypto 2001.

Top      Up      ToC       Page 83 
   [KPR03]    Klima, V., Pokorny, O., Rosa, T., "Attacking RSA-based
              Sessions in SSL/TLS",,
              March 2003.

   [PKCS6]    RSA Laboratories, "PKCS #6: RSA Extended Certificate
              Syntax Standard," version 1.5, November 1993.

   [PKCS7]    RSA Laboratories, "PKCS #7: RSA Cryptographic Message
              Syntax Standard," version 1.5, November 1993.

   [RANDOM]   Eastlake, D., 3rd, Schiller, J., and S. Crocker,
              "Randomness Requirements for Security", BCP 106, RFC 4086,
              June 2005.

   [RSA]      R. Rivest, A. Shamir, and L. M. Adleman, "A Method for
              Obtaining Digital Signatures and Public-Key
              Cryptosystems," Communications of the ACM, v. 21, n. 2,
              Feb 1978, pp.  120-126.

   [SEQNUM]   Bellovin, S., "Defending Against Sequence Number Attacks",
              RFC 1948, May 1996.

   [SSL2]     Hickman, Kipp, "The SSL Protocol", Netscape Communications
              Corp., Feb 9, 1995.

   [SSL3]     A. Frier, P. Karlton, and P. Kocher, "The SSL 3.0
              Protocol", Netscape Communications Corp., Nov 18, 1996.

   [SUBGROUP] Zuccherato, R., "Methods for Avoiding the "Small-Subgroup"
              Attacks on the Diffie-Hellman Key Agreement Method for
              S/MIME", RFC 2785, March 2000.

   [TCP]      Hellstrom, G. and P. Jones, "RTP Payload for Text
              Conversation", RFC 4103, June 2005.

   [TIMING]   Boneh, D., Brumley, D., "Remote timing attacks are
              practical", USENIX Security Symposium 2003.

   [TLS1.0]   Dierks, T. and C. Allen, "The TLS Protocol Version 1.0",
              RFC 2246, January 1999.

   [X501]     ITU-T Recommendation X.501: Information Technology - Open
              Systems Interconnection - The Directory: Models, 1993.

   [X509]     ITU-T Recommendation X.509 (1997 E): Information
              Technology - Open Systems Interconnection - "The Directory
              - Authentication Framework". 1988.

Top      Up      ToC       Page 84 
   [XDR]      Srinivasan, R., "XDR: External Data Representation
              Standard", RFC 1832, August 1995.

Authors' Addresses

   Working Group Chairs

   Win Treese


   Eric Rescorla



   Tim Dierks


   Eric Rescorla
   RTFM, Inc.


Other Contributors

   Christopher Allen (co-editor of TLS 1.0)
   Alacrity Ventures

   Martin Abadi
   University of California, Santa Cruz

   Ran Canetti

Top      Up      ToC       Page 85 
   Taher Elgamal

   Anil Gangolli

   Kipp Hickman

   Phil Karlton (co-author of SSLv3)

   Paul Kocher (co-author of SSLv3)
   Cryptography Research

   Hugo Krawczyk
   Technion Israel Institute of Technology

   Robert Relyea
   Netscape Communications

   Jim Roskind
   Netscape Communications

   Michael Sabin

   Dan Simon
   Microsoft, Inc.

   Tom Weinstein

Top      Up      ToC       Page 86 

   The discussion list for the IETF TLS working group is located at the
   e-mail address <>. Information on the
   group and information on how to subscribe to the list is at

   Archives of the list can be found at:

Top      Up      ToC       Page 87 
Full Copyright Statement

   Copyright (C) The Internet Society (2006).

   This document is subject to the rights, licenses and restrictions
   contained in BCP 78, and except as set forth therein, the authors
   retain all their rights.

   This document and the information contained herein are provided on an

Intellectual Property

   The IETF takes no position regarding the validity or scope of any
   Intellectual Property Rights or other rights that might be claimed to
   pertain to the implementation or use of the technology described in
   this document or the extent to which any license under such rights
   might or might not be available; nor does it represent that it has
   made any independent effort to identify any such rights.  Information
   on the procedures with respect to rights in RFC documents can be
   found in BCP 78 and BCP 79.

   Copies of IPR disclosures made to the IETF Secretariat and any
   assurances of licenses to be made available, or the result of an
   attempt made to obtain a general license or permission for the use of
   such proprietary rights by implementers or users of this
   specification can be obtained from the IETF on-line IPR repository at

   The IETF invites any interested party to bring to its attention any
   copyrights, patents or patent applications, or other proprietary
   rights that may cover technology that may be required to implement
   this standard.  Please address the information to the IETF at


   Funding for the RFC Editor function is provided by the IETF
   Administrative Support Activity (IASA).