Unit 4
Unit 4
Unit 4
18CSE354T
Unit 4 Notes
Prepared by:
Sonam Singh
(Course Cordinator)
• Evolved through
– Unreleased v1 (Netscape)
– Flawed-but-useful v2
– Version 3 from scratch
– Standard TLS1.0
» SSL3.0 with minor tweaks, hence Version field is 3.1
• Defined in RFC2246,
http://www.ietf.org/rfc/rfc2246.txt
• Open-source implementation at
http://www.openssl.org/
• Establish a session
– Agree on algorithms
– Share secrets
– Perform authentication
• Transfer application data
– Ensure privacy and integrity
Architecture(1)
• SSL vs. TLS
– Layered on top of TCP to provide a
reliable end-to-end secure service
– SSL versions 1.0, 2.0, 3.0, 3.1
– Netscape protocol
– Later refitted as IETF standard TLS
– TLS 1.0 very close to SSLv3.1
• uses TCP to provide a reliable
end-to-end service. SSL is not
single protocol but, Two layers
of protocol
– SSL Record Protocol
– Three higher layer
» SSL Handshake protocol
» SSL Change Cipher Spec protocol
» SSL Alert protocol
18CSE354T – NETWORK SECURITY S-1 / UNIV - IV
Secure Socket Layer
Architecture(3)-States parameters
• There are actually a number of states associated with each
session
• Once session is established, there is a current operating
state for both read and write
• In addition, during the Handshake Protocol, pending read
and write states are created
• Upon successful conclusion of the Handshake Protocol, the
pending states become the current states
• Session state parameters
– Session Identifier ( server to identify an active or resumable session state)
– Peer Certificate ( X509.v3 certificate, may be null)
– Compression Method - Cipher spec ( hash size)
– Master secret ( 48 byte secret shared by client and server)
– Is resumable ( flag indicates , session can be used to initiate new conntections)
• Connection state parameters
– Server and client random (byte sequence chosen by server and client for each conntection)
– Server write MAC secret ( secret key used MAC operations sent by the server)
– Client write MAC secret( …by client) -
– Server write key ( conventional encry . Key by server and decry. by client)
– Client write key ( encry. Client and decry. Server) - Initialization vectors (IV)
– Sequence numbers ( Each party maintain a sequence number)
18CSE354T – NETWORK SECURITY S-1 / UNIV - IV
Secure Socket Layer
• 1st : Fragmentation
– 214 bytes(16384 bytes)
or less
• 2nd : Compression
– Optionally applied
– Must be losses
– May not increase the content length by more than 1024bytes
– In SSLv3, no compression algorithm is specified, so the default
compression algorithm is null
• 4th : Encryption
– Symmetric encryption
– Algorithm used
» Stream cipher
• The compressed message plus
the MAC are encrypted
• RC4-40, RC4-128
» Block cipher
• Padding may be added
• IDEA, RC2-40, DES-40, DES, 3DES,Fortezza
• The total amount of padding is the smallest amount such that the total
size of the data to be encrypted is a multiple of the cipher’s block
length
ex) Plain text : 58 bytes with a MAC of 20 bytes that is encrypted using
a block length of 8 bytes = padding.length byte(1) + 1 byte padding
• Alert Protocol
– Used to convey SSL-related alerts to the peer
entity
– Consists of two bytes
» Level : conveys the severity of the message
• Warning(1)
• Fatal(2) – immed. terminates the connection, other
connection may continue, but no new connection
may be established.
» Alert : a code that indicates the specific
alert
18CSE354T – NETWORK SECURITY S-8 / UNIV - IV
Secure Socket Layer
Alert Protocol(2)
• Codes for alerts
– Alerts that are always fatal
» unexpected_message : An in appropriate message was received
» bad_record_mac : An incorrect MAC was received
» decompression_failure : The decompression function received improper
input
» handshake_failure : Sender was unable to negotiate an acceptable set of
security parameters given the options available
» illegal_parameter : A field in a handshake message was out of range or
inconsistent with other fields
– The remainder of alerts
» close_notify :Notifies the recipient that the sender will not send any more
messages on this connection
» no_certificate : May be sent in response to a certificate request if no
appropriate certificate is available
» bad_certificate : A received certificate was corrupt
» unsupported_certificate :The type of the received certificate is not
supported
» certificate_revoked : revoked by its signer
» certificate_expired : has expired
» certificate_unknown : Some other unspecified issue arose in processing the
certificate, rendering it unacceptable
18CSE354T – NETWORK SECURITY S-8 / UNIV - IV
Secure Socket Layer
Handshake Protocol(1)
• The most complex part of SSL
• Allows sever and client
– To authenticate each other
– To negotiate an encryption and MAC algorithm and cryptographic keys
to be used to protect data sent in an SSL record
• Used before any application data is transmitted
• Consists of a series of messages exchanged by client
and server
• Three fields
– Type(1byte) : one of 10 messages
– Length(3byte)
– Content(>=1 byte) : parameters associated with this message
Handshake Protocol(2)
Phase 1
Phase 2
Phase 3
Phase 4
Handshake Protocol(3)
• Phase 1 –Establish Security Capabilities
– To initiate a logical connection and to establish the security capabilities
that will be associated with it
– The exchange is initiated by the client, which sends a “client_hello”
message
» Version :The highest SSL version
» Random : 32bit timestamp & 28bytes Secure Random Number
» SessionID : Variable-length session identifier
» Cipher Suite : A list that contains the combinations of cryptographic
algorithms supported by client, in decreasing order of preference
» Compression Method : The list of compression methods supported by client
– Server sends “server_hello” message with the same parameters
» Version : The lower of the version suggested by the client and the highest
supported by the server
» Random : Generated by server
» SessionID : If client is non-zero then,the same with the client. Otherwise,
the value for new session
» Cipher Suite : Single cipher suite selected by the server
» Compression Method : The one supported by server
Handshake Protocol(4)
• Phase 1 –(continues)
– Cipher Suite
» Key exchange methods supported
• RSA : The secret key is encrypted with the receiver’s public key. A
public key certificate for the receiver’s key should be available
• Fixed Diffie-Hellman (DH): Server’s certificate contains DH public
parameters signed by CA. Client provides its DH public key parameters
either in certificate or in a key exchange message
• Ephemeral DH : DH public keys are exchanged, signed using sender’s
private RSA or DSS key. The receiver can use the corresponding public
key to verify the signature
• Anonymous DH : The base DH algo is used with no authentication.
Vulnerable to man-in-the-middle attack
• Fortezza
» CipherSpec
• CipherAlgorithm : RC4, RC2, DES, 3DES, DES40, IDEA, Fortezza
• MACAlgorithm : MD5, 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 used in generating the write key
• IV Size : The size of IV for CBC
18CSE354T – NETWORK SECURITY S-8 / UNIV - IV
Secure Socket Layer
Handshake Protocol(5)
• Phase 2 –Server Authentication and Key Exchange
– The server begins by sending its certificate
– Certificate(X.509) : except anonymous Diffie-Hellman
– Server_key_exchange()
» Anonymous DH : prime + primitive root
» Ephemeral DH : prime + primitive root + signature
» RSA key exchange, in which the server is using RSA but has a signature-
only RSA key: temporary RSA public key + signature
» Fixed DH or RSA key exchange : No need
» Signature is created by taking the hash of a message and encrypting it
with the sender’s private key
• hash(ClientHello.random||ServerHello.random||ServerParams)
– Certificate request : Non-anonymous server(server not using
anonymous DH) can request certificate from the client
» Certificate_type : includes public key algorithm and its use
» Certificate_authorities : a list of the distinguished names of acceptable
certificate authorities
– Server_hello_done (no parameter)
• Introduction
• Building Blocks
• Certificates
• Organization
• Conclusions
KA,KS KB,KS
• Cryptographic tools
• Putting them together
• Names
• Time
• A secure communication session
• Digital Signatures
– Sign: PEK-(H(M)) = S
– Verify: PDK+(S) = H(M)
– Reliable as long as only the signer knows K-
– Having K- allows one to sign, having K+ only
allows one to verify the signature
– Slow to calculate
– K’s + and - could just be a user’s public and
private keys
• What is “Trust”?
• How do we organize a PKI to disseminate trust?
Root CA
Small CA
Root CA
Small CA
Smaller CA
Super Root CA
• Integrity of data
– Type of data : Order information, personal data, payment instructions.
– RSA digital signatures using SHA-1 or HMAC using SHA-1.
• Interoperability
– SET uses specific protocols and message formats.
• Merchant registration
– Merchants must register with a CA before they can exchange SET
messages with customers and payment gateways.
• Purchase request
– Message from customer to merchant containing OI for merchant and
PI for bank.
• Payment authorization
– Exchange between merchant and payment gateway to authorize a
given amount for a purchase on a given credit card account.
• Payment capture
– Allows the merchant to request payment from the payment gateway.