Transport Layer
   Security
   Mrinal Wadhwa




   http://www.mrinalwadhwa.com
SSL v1
before 1995, internal to Netscape, never released
SSL v2
           draft published in FEB 1995




          SSL 0.2 PROTOCOL SPECIFICATION
http://www.mozilla.org/projects/security/pki/nss/ssl/draft02.html
SSL v3
           draft published in NOV 1996




                 The SSL Protocol Version 3.0
http://www.mozilla.org/projects/security/pki/nss/ssl/draft302.txt
TLS 1.0
RFC 2446 - in Jan 1999




   The TLS Protocol Version 1.0
 http://tools.ietf.org/html/rfc2246
TLS 1.1
     RFC 4346 - in April 2006




The Transport Layer Security (TLS) Protocol Version 1.1
          http://tools.ietf.org/html/rfc4346
TLS 1.2
     RFC 5246 - in August 2008




The Transport Layer Security (TLS) Protocol Version 1.2
          http://tools.ietf.org/html/rfc5246
"The TLS protocol provides communications security
  over the Internet. The protocol allows client/server
applications to communicate in a way that is designed to
  prevent eavesdropping, tampering, or message forgery."

                   - The Transport Layer Security (TLS) Protocol Version 1.2
Record Protocol
 http://tools.ietf.org/html/rfc5246#section-6
The Record Protocol takes messages to be transmitted, fragments the
   data into manageable blocks, optionally compresses the data, applies
      a MAC, encrypts, and transmits the result. Received data is
   decrypted, verified, decompressed, reassembled, and then delivered to
                           higher-level clients.
struct {
           ConnectionEnd         entity;
           PRFAlgorithm           prf_algorithm;
           BulkCipherAlgorithm   bulk_cipher_algorithm;
           CipherType             cipher_type;
           uint8                 enc_key_length;
           uint8                 block_length;
           uint8                 fixed_iv_length;
           uint8                 record_iv_length;
           MACAlgorithm            mac_algorithm;
           uint8                 mac_length;
           uint8                 mac_key_length;
           CompressionMethod      compression_algorithm;
           opaque                master_secret[48];
           opaque                client_random[32];
           opaque                server_random[32];
      } SecurityParameters;
Change Cipher Spec
     Protocol
  http://tools.ietf.org/html/rfc5246#section-7.1
Alert Protocol
http://tools.ietf.org/html/rfc5246#section-7.2
Handshake Protocol
             a simplified discussion

  http://tools.ietf.org/html/rfc5246#section-7.3
Hello Request

http://tools.ietf.org/html/rfc5246#section-7.4.1.1




            struct { } HelloRequest;
Client Hello

      http://tools.ietf.org/html/rfc5246#section-7.4.1.2



struct {
           ProtocolVersion client_version;
           Random random;
           SessionID session_id;
           CipherSuite cipher_suites<2..2^16-2>;
           CompressionMethod compression_methods<1..2^8-1>;
           select (extensions_present) {
                case false:
                    struct {};
                case true:
                    Extension extensions<0..2^16-1>;
           };
      } ClientHello;
CIPHER SUITES

             TLS_RSA_WITH_AES_128_CBC_SHA



     "The connection is encrypted using AES_128_CBC, with SHA1 for
       message authentication and RSA as the key exchange mechanism."




Mandatory Cipher Suites - http://tools.ietf.org/html/rfc5246#section-9
Cipher Suite Definitions - http://tools.ietf.org/html/rfc5246#appendix-C
CIPHER SUITES

TLS_RSA_WITH_AES_128_CBC_SHA




      Key Exchange - RSA
      Cipher - AES_128_CBC
      Mac - SHA (HMAC-SHA1)
Server Hello

      http://tools.ietf.org/html/rfc5246#section-7.4.1.3


struct {
           ProtocolVersion server_version;
           Random random;
           SessionID session_id;
           CipherSuite cipher_suite;
           CompressionMethod compression_method;
           select (extensions_present) {
                case false:
                    struct {};
                case true:
                    Extension extensions<0..2^16-1>;
           };
      } ServerHello;
Server Certificate

http://tools.ietf.org/html/rfc5246#section-7.4.2




       opaque ASN.1Cert<1..2^24-1>;


       struct {
           ASN.1Cert certificate_list<0..2^24-1>;
       } Certificate;
Server Hello Done

http://tools.ietf.org/html/rfc5246#section-7.4.5




           struct { } ServerHelloDone;
Client Key Exchange Message

http://tools.ietf.org/html/rfc5246#section-7.4.7



 struct {
            select (KeyExchangeAlgorithm) {
                case rsa:
                    EncryptedPreMasterSecret;
                case dhe_dss:
                case dhe_rsa:
                case dh_dss:
                case dh_rsa:
                case dh_anon:
                    ClientDiffieHellmanPublic;
            } exchange_keys;
       } ClientKeyExchange;
Finished

http://tools.ietf.org/html/rfc5246#section-7.4.9



   struct {
              opaque verify_data[verify_data_length];
         } Finished;
?
- mrinalwadhwa.com
- email@mrinalwadhwa.com
- @mrinal
- github.com/mrinalwadhwa

Transport Layer Security - Mrinal Wadhwa

  • 1.
    Transport Layer Security Mrinal Wadhwa http://www.mrinalwadhwa.com
  • 2.
    SSL v1 before 1995,internal to Netscape, never released
  • 3.
    SSL v2 draft published in FEB 1995 SSL 0.2 PROTOCOL SPECIFICATION http://www.mozilla.org/projects/security/pki/nss/ssl/draft02.html
  • 4.
    SSL v3 draft published in NOV 1996 The SSL Protocol Version 3.0 http://www.mozilla.org/projects/security/pki/nss/ssl/draft302.txt
  • 5.
    TLS 1.0 RFC 2446- in Jan 1999 The TLS Protocol Version 1.0 http://tools.ietf.org/html/rfc2246
  • 6.
    TLS 1.1 RFC 4346 - in April 2006 The Transport Layer Security (TLS) Protocol Version 1.1 http://tools.ietf.org/html/rfc4346
  • 7.
    TLS 1.2 RFC 5246 - in August 2008 The Transport Layer Security (TLS) Protocol Version 1.2 http://tools.ietf.org/html/rfc5246
  • 8.
    "The TLS protocolprovides communications security over the Internet. The protocol allows client/server applications to communicate in a way that is designed to prevent eavesdropping, tampering, or message forgery." - The Transport Layer Security (TLS) Protocol Version 1.2
  • 9.
  • 10.
    The Record Protocoltakes messages to be transmitted, fragments the data into manageable blocks, optionally compresses the data, applies a MAC, encrypts, and transmits the result. Received data is decrypted, verified, decompressed, reassembled, and then delivered to higher-level clients.
  • 11.
    struct { ConnectionEnd entity; PRFAlgorithm prf_algorithm; BulkCipherAlgorithm bulk_cipher_algorithm; CipherType cipher_type; uint8 enc_key_length; uint8 block_length; uint8 fixed_iv_length; uint8 record_iv_length; MACAlgorithm mac_algorithm; uint8 mac_length; uint8 mac_key_length; CompressionMethod compression_algorithm; opaque master_secret[48]; opaque client_random[32]; opaque server_random[32]; } SecurityParameters;
  • 12.
    Change Cipher Spec Protocol http://tools.ietf.org/html/rfc5246#section-7.1
  • 13.
  • 14.
    Handshake Protocol a simplified discussion http://tools.ietf.org/html/rfc5246#section-7.3
  • 15.
  • 16.
    Client Hello http://tools.ietf.org/html/rfc5246#section-7.4.1.2 struct { ProtocolVersion client_version; Random random; SessionID session_id; CipherSuite cipher_suites<2..2^16-2>; CompressionMethod compression_methods<1..2^8-1>; select (extensions_present) { case false: struct {}; case true: Extension extensions<0..2^16-1>; }; } ClientHello;
  • 17.
    CIPHER SUITES TLS_RSA_WITH_AES_128_CBC_SHA "The connection is encrypted using AES_128_CBC, with SHA1 for message authentication and RSA as the key exchange mechanism." Mandatory Cipher Suites - http://tools.ietf.org/html/rfc5246#section-9 Cipher Suite Definitions - http://tools.ietf.org/html/rfc5246#appendix-C
  • 18.
    CIPHER SUITES TLS_RSA_WITH_AES_128_CBC_SHA Key Exchange - RSA Cipher - AES_128_CBC Mac - SHA (HMAC-SHA1)
  • 19.
    Server Hello http://tools.ietf.org/html/rfc5246#section-7.4.1.3 struct { ProtocolVersion server_version; Random random; SessionID session_id; CipherSuite cipher_suite; CompressionMethod compression_method; select (extensions_present) { case false: struct {}; case true: Extension extensions<0..2^16-1>; }; } ServerHello;
  • 20.
    Server Certificate http://tools.ietf.org/html/rfc5246#section-7.4.2 opaque ASN.1Cert<1..2^24-1>; struct { ASN.1Cert certificate_list<0..2^24-1>; } Certificate;
  • 21.
  • 22.
    Client Key ExchangeMessage http://tools.ietf.org/html/rfc5246#section-7.4.7 struct { select (KeyExchangeAlgorithm) { case rsa: EncryptedPreMasterSecret; case dhe_dss: case dhe_rsa: case dh_dss: case dh_rsa: case dh_anon: ClientDiffieHellmanPublic; } exchange_keys; } ClientKeyExchange;
  • 23.
    Finished http://tools.ietf.org/html/rfc5246#section-7.4.9 struct { opaque verify_data[verify_data_length]; } Finished;
  • 24.
  • 25.
    - mrinalwadhwa.com - email@mrinalwadhwa.com -@mrinal - github.com/mrinalwadhwa