Module 2
Module 2
Session
Connection
Secure Socket Layer – SSL
• TCP – Reliable end-to-end secure service
• Two SSL concepts are:
Connection:
• Provides type of service
• Peer-to-peer relationships
• Transient
• Every connection associated with one session
Session:
• Association between client & server
• Created by Handshake protocols
• Cryptographic security parameter – multiple connections
Connection State is defined by
• Server & Client random – byte sequence chosen by server &
client
• Server write MAC secret – Secret key – on data sent by the
server
• Client write MAC secret – on data sent by the client
• Server write key – secret encryption key – for data encrypted
by server and decrypted by client
• Client write key – symmetric encryption key – for data enc
by client & decrypted by server
• Initialization vectors – block cipher in CBC mode is used, IV is
maintained for each key. Field is initialized by SSL Handshake
protocol
• Sequence numbers – When a party sends or receives a
change cipher spec msg, appropriate sequence no. is set to
zero. May not exceed 2 ^(64) -1
Secure Socket Layer – SSL
• TCP – Reliable end-to-end secure service
• Two SSL concepts are:
Connection:
• Provides type of service
• Peer-to-peer relationships
• Transient
• Every connection associated with one session
Session:
• Association between client & server
• Created by Handshake protocols
• Cryptographic security parameter – multiple connections
SSL Record Protocol
• Two services – Confidentiality and Message integrity
• Two SSL concepts are:
Connection:
• Provides type of service
• Peer-to-peer relationships
• Transient
• Every connection associated with one session
Session:
• Association between client & server
• Created by Handshake protocols
• Cryptographic security parameter – multiple connections
A session state is defined by the following parameters
1. Session identifier
2. Peer certificate
3. Compression method
4. Cipher spec
5. Master secret
6. Is resumable
• Cipher Suite: This is a list that contains the cryptographic algorithms (key
exchange, encryption, and MAC) supported by the client - decreasing order of
preference.
• Compression Method: This is a list of the compression methods the client
supports.
• After sending the client _ hello message, the client waits for the server _ hello
message, which contains the same parameters as the client _ hello message.
• The parameters contain the values which client had sent to the server and the
server has chosen to use.
Phase 2: Server Authentication and Key Exchange
• Record _ overflow: A TLS record was received with a payload (cipher text)
whose length exceeds 214 + 2048 bytes, or the cipher text decrypted to a
length of greater than 214 + 1024 bytes.
• Unknown _ ca: A valid certificate chain or partial chain was received, but
the certificate was not accepted - CA certificate could not be located or
could not be matched with a known, trusted CA.
• Access _ denied: A valid certificate was received, but when access control
was applied, the sender decided not to proceed with the negotiation.
• For SSLv3, the hash calculation also included the master secret and
pads.
• The pre _ master _secret for TLS is calculated in the same way as in SSLv3.
• As in SSLv3, the master _secret in TLS is calculated as a hash function of
the pre_ master _secret and the two hello random numbers.
• The form of the TLS calculation is different from that of SSLv3 and is
defined as
• Master _secret = PRF (pre _master _secret, "master secret", Client
Hello.random ‖ Server Hello.random)
• In TLS, the padding can be any amount that results in a total that is a
multiple of the cipher’s block length, up to a maximum of 255 bytes.
• For example,
• if the plaintext (or compressed text if compression is used) plus MAC plus
padding.
• Length byte is 79 bytes long, then the padding length (in bytes) can be 1,
9,17, and so on, up to 249.
• A variable padding length may be used to frustrate attacks based on an
analysis of the lengths of exchanged messages.
HTTPS
• The client initiates a connection to the server on the appropriate port and
then sends the TLS Client Hello to begin the TLS handshake.
• The client may then initiate the first HTTP request. All HTTP data is to be sent
as TLS application data. Retained connections should be followed.
• At the level of TLS, a session is established between a TLS client and a TLS
server - session can support one or more connections at any time.
•Type (1 byte): Indicates one of 10 messages. Table lists the defined message
types.
•Content ( 0 bytes): The parameters associated with this message; these are
listed in Table.
PHASES
Phase 1. Establish Security Capabilities
Phase 2. Server Authentication and Key Exchange
Phase 3. Client Authentication and Key Exchange
Phase 4. Finish
Phase 1. Establish Security Capabilities
•Version: The highest SSL version understood by the client.
•Random: A client-generated random structure, consisting of a 32-bit timestamp
and 28 bytes generated by a secure random number generator. These values
serve as nonces and are used during key exchange to prevent replay attacks.
•Session ID: A variable-length session identifier. A nonzero value indicates that
the client wishes to update the parameters of an existing connection or create a
new connection on this session. A zero value indicates that the client wishes to
establish a new connection on a new session.
•CipherSuite: This is a list that contains the combinations of cryptographic
algorithms supported by the client, in decreasing order of preference. Each
element of the list (each cipher suite) defines both a key exchange algorithm and
a CipherSpec; these are discussed subsequently.
•Compression Method: This is a list of the compression methods the client
supports.
CipherSuite
Key exchange method
•RSA
•Fixed Diffie-Hellman
•Ephemeral Diffie-Hellman
•Anonymous Diffie-Hellman
•Fortezza
Cipher Spec
CipherAlgorithm: Any of the algorithms mentioned earlier: RC4, RC2, DES, 3DES,
DES40, IDEA, Fortezza
MACAlgorithm: MD5 or SHA-1
CipherType: Stream or Block
IsExportable: True or False
HashSize: 0, 16 (for MD5), or 20 (for SHA-1) bytes
Key Material: A sequence of bytes that contain data used in generating the write
keys
IV Size: The size of the Initialization Value for Cipher Block Chaining (CBC)
encryption
Phase 2. Server Authentication and Key Exchange
RSA key exchange, in which the server is using RSA but has a signature-
only RSA key: Accordingly, the client cannot simply send a secret key
encrypted with the server's public key. Instead, the server must create a
temporary RSA public/private key pair and use the server_key_exchange
message to send the public key. The message content includes the two
parameters of the temporary RSA public key (exponent and modulus) plus a
signature of those parameters.
Fortezza
Phase 3. Client Authentication and Key Exchange
RSA: The client generates a 48-byte pre-master secret and encrypts with the public key
from the server's certificate or temporary RSA key from a server_key_exchange message.
Its use to compute a master secret is explained later.
Ephemeral or Anonymous Diffie-Hellman: The client's public Diffie-Hellman parameters
are sent.
Fixed Diffie-Hellman: The client's public Diffie-Hellman parameters were sent in a
certificate message, so the content of this message is null.
Fortezza: The client's Fortezza parameters are sent.
Phase 4. Finish
Change Cipher Spec Protocol
This protocol consists of a single message, which consists of a single byte with
the value 1. The sole purpose of this message is to cause the pending state to
be copied into the current state, which updates the cipher suite to be used on
this connection.
Alert Protocol
unexpected_message bad_record_mac
decompression_failure handshake_failure
illegal_parameter close_notify
no_certificate bad_certificate
unsupported_certificate certificate_revoked
certificate_expired certificate_unknown
Transport Layer Security
Message Authentication Code
HMAC_hash(MAC_write_secret, seq_num ||
TLSCompressed.type ||
TLSCompressed.version
|| TLSCompressed.length ||
TLSCompressed.fragment)
Pseudorandom Function