SlideShare a Scribd company logo
Announcement
• Final exam: Wed, June 9, 9:30-11:18
• Scope: materials after RSA
• (but you need to know RSA)
• Open books, open notes.
• Calculators allowed.
1
We have learned …
• Symmetric encryption: DES, 3DES, AES, RC4
• Public-key encryption: RSA
• Hash: SHA-1
• MAC: CBC-MAC, CMAC, HMAC
• Digital signature: RSA
• Entity authentication: challenge and response
• Key agreement: Diffie-Hellman, RSA
• Certicificate 2
SSL-Secure Socket Layer
SSL (Secure Socket Layer)
• TCP: provides a reliable end-to-end service.
• TCP & SSL: provides a reliable & secure
end-to-end service.
• HTTPS: HTTP over SSL (or TLS)
– Typically on port 443 (regular http on port 80)
• SSL originally developed by Netscape
• subsequently became Internet standard
known as TLS (Transport Layer Security)
• SSL has two layers of protocols
SSL Architecture
SSL Record Protocol Services
• SSL Record Protocol provides two services.
• Message integrity
– using a MAC with a shared secret key
– similar to HMAC but with different padding
– hash functions: MD5, SHA-1
• Message confidentiality
– using symmetric encryption with a shared
secret key
– Encryption algorithms: AES, IDEA, RC2-40,
DES-40, DES, 3DES, RC4-40, RC4-128
SSL Record Protocol Operation
(optional; default: null)
≤ 214 bytes
 
Similar to HMAC, using MD5 or SHA-1.
HMAC ( ) ( )
The SSL MAC is
MAC_write_secret pa
computed as:
(
(
d_2
MAC_write_sec seq_num
ha
ret pad_
sh hash
has
1
h
hash
SSL MAC
k k opad k ipad
m m




 
SSLCompression.type
SSLCompression.length
SSLCompression.fragmen ))
t
SSL Handshake Protocol
• Allows server & client to:
– authenticate each other
– to negotiate encryption & MAC algorithms and keys
• Comprises a series of messages exchanged in
phases:
1.Establish Security Capabilities (to agree on
encryption, MAC, and key-exchange algorithms)
2.Server Authentication and Key Exchange
3.Client Authentication and Key Exchange
4.Finish
Stallings
Figure 17.6
client_hello
server_hello
Client Server
client_hello: contains a c
Phase1: Establish Security Capabilities





 and
a list of in decreasing order of preference.
server
lient.random
cipher suites
server.rando
_hello: contains a and
a single selected
m
cipher by the s
suit er
e ver.

Each indicates a key exchange algorithm,
a cipher algorithm, and a MAC algorithm.
About 30 cipher suites have been defined,
each represente
cip
d by a 2-octet numbe
her suite
r.
Cipher Suite


 Users can define their own cipher suites.
Downgrade attack: the adversary removes strong cipher
suites from client_hello.

Anonymous Diffie-Hellman
Fixed Diffie-Hellman
Ephemeral Diffie-Hellman
RSA
Server has an RSA encryption key pair
Server has an RSA signature key pair
Es
Key Exchange Algorithms




 Pre_Master_Secret (48 bytes)
Master_Secret (48 bytes)
tablish a
Keys


server_key _exchange ( , , )
server_hello_done
Client Server
Anonymous Diffie-Hellman
s
p  


client_key _exchange ( )
The contains the server's
Diffie
se
-H
rver
ellm
_key_exc
an public key and parameters, ( , ,
hange
).
s
c
p

 




 The client provides its public key in the
client_key_exchange.
A 48-byte pre_master_secret is generated from .
c
cs



certificate ( , , )
server_hello_done
Client Server
Fixed Diffie-Hellman
s
p  


client_key _exchange ( )
certificat
The contains the server's Diffie-Hellman
public key and parameters ( , , ).
The client p
e
rovid
s
c
p

 





 es its public key in the
client_key_exchange.
A 48-byte pre_master_secret is generated from .
c
cs



certificate
serv
Client Server
Ephemeral Diffie-Hellman


er_key _exchange ( , , )
server_hello_done
client_key _exchange ( )
The contains the server's signature
certificate
s
c
p  







 info.
The server_key_exchange contains the server's
, hashed and signed.
The client provides its public key in the
one-time ( , ,
client_key_exchange.
)
s
c
p  



certificate ( , )
server_hello_don
Client Server
RSA Key Exchange with an encryption key
n e


e
client_key _exchange
The message contains the server's
encryption ke
certificate
client_key_excha
y info.
The message contains a 48-byte
e
r
ng
p






( , )
encrypted wi
e_master_secret th RSA .
n e
certificate ( , )
server_key_
Client Server
RSA Key Exchange with a signature key
n e


exchange ( , )
server_hello_done
client_key _exchange
certificat
The contains the server's RSA-signature info.
The serve
e
r ge
n e
 







 nerates a temporary RSA encryption key
pair, and sends the public key info (hashed and signed) to
the client in the server_key_exchange.
Client Authentication
• The server may request a certificate from the
client.
• The client will send a certificate message or a
no_certificate alert.
 
 
 
 
Both sides compute the master_secret as follows:
master_secret =
'A' pms client.r server.r
'BB' pms client.r server
MD5 SHA
SHA
SH
pms
MD5 pms
MD5 pms) A
.r
'
Computing the Master Secret (48 bytes)
 
 
where pms pre_master_secret; and client.r and server.r
are the random num
CCC' pms client.r
bers exchanged
server
in Pha
.
s .
r
e 1

An SSL session needs six keys:
Client write MAC secret
Server write MAC secret
Client write key (for encryption)
Server write key
Generation of Cryptographic Parameters

Client write IV (for CBC)
Server write IV
These parameters are generated from the master_secret
in that order as in the next slide.

 
 
 
 
 
 
SHA 'A' ms client.r serv
Continue the following process until enough bits have been
generated:
MD5 ms
MD5 ms
M
er
D5 ms
wher
.r
SHA 'BB' ms client.r server.r
SHA 'CCC' ms client.r server.r
e

ms master_secret; and client.r and server.r
are the random numbers exchanged in Phase 1.

change_cipher _spec
finished
change_cipher _spec
Client Server
Phase 4: Finish



 
finished
The message indicates that the sender
is putting the negotiated Cipher Spec into use.
Th
change_cipher_spec
finis
e mess
hed age contains MD5





SHA(handshake_messages ||
( ) or
SHA(master_secret
Sender master_secret || pad1)
pad2 ||
).

SSL Session and Connection
• SSL was designed to work with HTTP 1.0
which tended to open a lot of TCP connections
between the same client and server.
• SSL assumes a session is a relatively long-
lived thing from which many (transient)
connections can be cheaply derived.
• 1 session = 1 or more connections
24
SSL Session
• Created by the Handshake Protocol.
• Parameters:
– Session ID
– Compression method
– Cipher spec (encryption and hash algorithm)
– Master secret
– Is resumable
25
SSL Connection
• Based on an underlying TCP connection
• Associated with a session
• Parameters:
– Server and client random
– Server and client write MAC secret
– Server and client write secret
– Server and client IV (if CBC is used)
– Sequence number
• Closed by a close_notify from each side 26
Session Resumption
• In handshaking, the client_hello contains a
session ID:
– If session ID = 0, start a new session
– If session ID = x (and session x is resumable):
• start a new connection of session x
• (or change parameters of a current connection of
session x)
• Skip key exchange
• Use the session’s master secret to generate keys
27
Master secret vs. pre-master secret
• Why?
• Note: even if we use pre_master_secret to
generate keys, each connection will have its
own set of keys.
28
Pre_Master_Secret (48 bytes)
Master_Secret (48 bytes) (session)
Keys (connection)


• Pre_master_secret
– computed for each session during handshaking
– could be the same for all sessions
– is not stored (so safe)
• Master_secret
– is stored for the lifetime of the session
– may be compromised
– If compromised, damage limited to a session
• What if pre_master_secret is used to generate
keys?
29

More Related Content

Similar to 8.SSL encryption.ppt

SSL And TLS
SSL And TLS SSL And TLS
SSL And TLS
Ghanshyam Patel
 
Secure socket layer
Secure socket layerSecure socket layer
Secure socket layer
Nishant Pahad
 
Secure socket layer
Secure socket layerSecure socket layer
Secure socket layer
Nishant Pahad
 
SSL.ppt
SSL.pptSSL.ppt
SSL.ppt
TXCDHRUV
 
Secure Socket Layer (SSL)
Secure Socket Layer (SSL)Secure Socket Layer (SSL)
Secure Socket Layer (SSL)
Samip jain
 
CRYPTOGRAPHY AND NETWORK SECURITY- Transport-level Security
CRYPTOGRAPHY AND NETWORK SECURITY- Transport-level SecurityCRYPTOGRAPHY AND NETWORK SECURITY- Transport-level Security
CRYPTOGRAPHY AND NETWORK SECURITY- Transport-level Security
Jyothishmathi Institute of Technology and Science Karimnagar
 
Web Security
Web SecurityWeb Security
Web Security
Ram Dutt Shukla
 
TLS/SSL Protocol Design 201006
TLS/SSL Protocol Design 201006TLS/SSL Protocol Design 201006
TLS/SSL Protocol Design 201006
Nate Lawson
 
TLS/SSL - Study of Secured Communications
TLS/SSL - Study of Secured  CommunicationsTLS/SSL - Study of Secured  Communications
TLS/SSL - Study of Secured Communications
Nitin Ramesh
 
Secure socket later
Secure socket laterSecure socket later
Secure socket later
Muhammad Ahmad Nazar
 
TLS/SSL Protocol Design
TLS/SSL Protocol DesignTLS/SSL Protocol Design
TLS/SSL Protocol Design
Nate Lawson
 
SSL-image
SSL-imageSSL-image
SSL-image
Rajat Toshniwal
 
Secure Socket Layer
Secure Socket LayerSecure Socket Layer
Secure Socket Layer
Pina Parmar
 
Transport Layer Security (TLS)
Transport Layer Security (TLS)Transport Layer Security (TLS)
Transport Layer Security (TLS)
Arun Shukla
 
ssl
sslssl
ssl
sjyuva
 
Wireless LAN Security Fundamentals
Wireless LAN Security FundamentalsWireless LAN Security Fundamentals
Wireless LAN Security Fundamentals
Aruba, a Hewlett Packard Enterprise company
 
Ssl (Secure Socket Layer)
Ssl (Secure Socket Layer)Ssl (Secure Socket Layer)
Ssl (Secure Socket Layer)
Sandeep Gupta
 
Internet security protocol
Internet security protocolInternet security protocol
Internet security protocol
Mousmi Pawar
 
The Fundamental of Secure Socket Layer (SSL)
The Fundamental of Secure Socket Layer (SSL)The Fundamental of Secure Socket Layer (SSL)
The Fundamental of Secure Socket Layer (SSL)
Vishal Kumar
 
Fundamental of Secure Socket Layer (SSl) | Part - 1
Fundamental of Secure Socket Layer (SSl) | Part - 1Fundamental of Secure Socket Layer (SSl) | Part - 1
Fundamental of Secure Socket Layer (SSl) | Part - 1
Vishal Kumar
 

Similar to 8.SSL encryption.ppt (20)

SSL And TLS
SSL And TLS SSL And TLS
SSL And TLS
 
Secure socket layer
Secure socket layerSecure socket layer
Secure socket layer
 
Secure socket layer
Secure socket layerSecure socket layer
Secure socket layer
 
SSL.ppt
SSL.pptSSL.ppt
SSL.ppt
 
Secure Socket Layer (SSL)
Secure Socket Layer (SSL)Secure Socket Layer (SSL)
Secure Socket Layer (SSL)
 
CRYPTOGRAPHY AND NETWORK SECURITY- Transport-level Security
CRYPTOGRAPHY AND NETWORK SECURITY- Transport-level SecurityCRYPTOGRAPHY AND NETWORK SECURITY- Transport-level Security
CRYPTOGRAPHY AND NETWORK SECURITY- Transport-level Security
 
Web Security
Web SecurityWeb Security
Web Security
 
TLS/SSL Protocol Design 201006
TLS/SSL Protocol Design 201006TLS/SSL Protocol Design 201006
TLS/SSL Protocol Design 201006
 
TLS/SSL - Study of Secured Communications
TLS/SSL - Study of Secured  CommunicationsTLS/SSL - Study of Secured  Communications
TLS/SSL - Study of Secured Communications
 
Secure socket later
Secure socket laterSecure socket later
Secure socket later
 
TLS/SSL Protocol Design
TLS/SSL Protocol DesignTLS/SSL Protocol Design
TLS/SSL Protocol Design
 
SSL-image
SSL-imageSSL-image
SSL-image
 
Secure Socket Layer
Secure Socket LayerSecure Socket Layer
Secure Socket Layer
 
Transport Layer Security (TLS)
Transport Layer Security (TLS)Transport Layer Security (TLS)
Transport Layer Security (TLS)
 
ssl
sslssl
ssl
 
Wireless LAN Security Fundamentals
Wireless LAN Security FundamentalsWireless LAN Security Fundamentals
Wireless LAN Security Fundamentals
 
Ssl (Secure Socket Layer)
Ssl (Secure Socket Layer)Ssl (Secure Socket Layer)
Ssl (Secure Socket Layer)
 
Internet security protocol
Internet security protocolInternet security protocol
Internet security protocol
 
The Fundamental of Secure Socket Layer (SSL)
The Fundamental of Secure Socket Layer (SSL)The Fundamental of Secure Socket Layer (SSL)
The Fundamental of Secure Socket Layer (SSL)
 
Fundamental of Secure Socket Layer (SSl) | Part - 1
Fundamental of Secure Socket Layer (SSl) | Part - 1Fundamental of Secure Socket Layer (SSl) | Part - 1
Fundamental of Secure Socket Layer (SSl) | Part - 1
 

Recently uploaded

SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
harshapolam10
 
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
PIMR BHOPAL
 
Mechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineeringMechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineering
sachin chaurasia
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
ydzowc
 
Supermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdfSupermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdf
Kamal Acharya
 
Bayesian Decision Theory details ML.pptx
Bayesian Decision Theory details ML.pptxBayesian Decision Theory details ML.pptx
Bayesian Decision Theory details ML.pptx
amrita chaturvedi
 
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
PriyankaKilaniya
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
upoux
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
Atif Razi
 
5g-5G SA reg. -standalone-access-registration.pdf
5g-5G SA reg. -standalone-access-registration.pdf5g-5G SA reg. -standalone-access-registration.pdf
5g-5G SA reg. -standalone-access-registration.pdf
devtomar25
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
uqyfuc
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
PreethaV16
 
CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1
PKavitha10
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
Gino153088
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
Prakhyath Rai
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
shadow0702a
 
Introduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.pptIntroduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.ppt
Dwarkadas J Sanghvi College of Engineering
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
ecqow
 
Operational amplifiers and oscillators notes
Operational amplifiers and oscillators notesOperational amplifiers and oscillators notes
Operational amplifiers and oscillators notes
ShachiPGowda
 

Recently uploaded (20)

SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
 
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
 
Mechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineeringMechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineering
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
 
Supermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdfSupermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdf
 
Bayesian Decision Theory details ML.pptx
Bayesian Decision Theory details ML.pptxBayesian Decision Theory details ML.pptx
Bayesian Decision Theory details ML.pptx
 
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
 
5g-5G SA reg. -standalone-access-registration.pdf
5g-5G SA reg. -standalone-access-registration.pdf5g-5G SA reg. -standalone-access-registration.pdf
5g-5G SA reg. -standalone-access-registration.pdf
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
 
CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
 
Introduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.pptIntroduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.ppt
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
 
Operational amplifiers and oscillators notes
Operational amplifiers and oscillators notesOperational amplifiers and oscillators notes
Operational amplifiers and oscillators notes
 

8.SSL encryption.ppt

  • 1. Announcement • Final exam: Wed, June 9, 9:30-11:18 • Scope: materials after RSA • (but you need to know RSA) • Open books, open notes. • Calculators allowed. 1
  • 2. We have learned … • Symmetric encryption: DES, 3DES, AES, RC4 • Public-key encryption: RSA • Hash: SHA-1 • MAC: CBC-MAC, CMAC, HMAC • Digital signature: RSA • Entity authentication: challenge and response • Key agreement: Diffie-Hellman, RSA • Certicificate 2
  • 4. SSL (Secure Socket Layer) • TCP: provides a reliable end-to-end service. • TCP & SSL: provides a reliable & secure end-to-end service. • HTTPS: HTTP over SSL (or TLS) – Typically on port 443 (regular http on port 80) • SSL originally developed by Netscape • subsequently became Internet standard known as TLS (Transport Layer Security) • SSL has two layers of protocols
  • 6. SSL Record Protocol Services • SSL Record Protocol provides two services. • Message integrity – using a MAC with a shared secret key – similar to HMAC but with different padding – hash functions: MD5, SHA-1 • Message confidentiality – using symmetric encryption with a shared secret key – Encryption algorithms: AES, IDEA, RC2-40, DES-40, DES, 3DES, RC4-40, RC4-128
  • 7. SSL Record Protocol Operation (optional; default: null) ≤ 214 bytes
  • 8.   Similar to HMAC, using MD5 or SHA-1. HMAC ( ) ( ) The SSL MAC is MAC_write_secret pa computed as: ( ( d_2 MAC_write_sec seq_num ha ret pad_ sh hash has 1 h hash SSL MAC k k opad k ipad m m       SSLCompression.type SSLCompression.length SSLCompression.fragmen )) t
  • 9. SSL Handshake Protocol • Allows server & client to: – authenticate each other – to negotiate encryption & MAC algorithms and keys • Comprises a series of messages exchanged in phases: 1.Establish Security Capabilities (to agree on encryption, MAC, and key-exchange algorithms) 2.Server Authentication and Key Exchange 3.Client Authentication and Key Exchange 4.Finish
  • 11. client_hello server_hello Client Server client_hello: contains a c Phase1: Establish Security Capabilities       and a list of in decreasing order of preference. server lient.random cipher suites server.rando _hello: contains a and a single selected m cipher by the s suit er e ver. 
  • 12. Each indicates a key exchange algorithm, a cipher algorithm, and a MAC algorithm. About 30 cipher suites have been defined, each represente cip d by a 2-octet numbe her suite r. Cipher Suite    Users can define their own cipher suites. Downgrade attack: the adversary removes strong cipher suites from client_hello. 
  • 13. Anonymous Diffie-Hellman Fixed Diffie-Hellman Ephemeral Diffie-Hellman RSA Server has an RSA encryption key pair Server has an RSA signature key pair Es Key Exchange Algorithms      Pre_Master_Secret (48 bytes) Master_Secret (48 bytes) tablish a Keys  
  • 14. server_key _exchange ( , , ) server_hello_done Client Server Anonymous Diffie-Hellman s p     client_key _exchange ( ) The contains the server's Diffie se -H rver ellm _key_exc an public key and parameters, ( , , hange ). s c p         The client provides its public key in the client_key_exchange. A 48-byte pre_master_secret is generated from . c cs   
  • 15. certificate ( , , ) server_hello_done Client Server Fixed Diffie-Hellman s p     client_key _exchange ( ) certificat The contains the server's Diffie-Hellman public key and parameters ( , , ). The client p e rovid s c p          es its public key in the client_key_exchange. A 48-byte pre_master_secret is generated from . c cs   
  • 16. certificate serv Client Server Ephemeral Diffie-Hellman   er_key _exchange ( , , ) server_hello_done client_key _exchange ( ) The contains the server's signature certificate s c p           info. The server_key_exchange contains the server's , hashed and signed. The client provides its public key in the one-time ( , , client_key_exchange. ) s c p     
  • 17. certificate ( , ) server_hello_don Client Server RSA Key Exchange with an encryption key n e   e client_key _exchange The message contains the server's encryption ke certificate client_key_excha y info. The message contains a 48-byte e r ng p       ( , ) encrypted wi e_master_secret th RSA . n e
  • 18. certificate ( , ) server_key_ Client Server RSA Key Exchange with a signature key n e   exchange ( , ) server_hello_done client_key _exchange certificat The contains the server's RSA-signature info. The serve e r ge n e           nerates a temporary RSA encryption key pair, and sends the public key info (hashed and signed) to the client in the server_key_exchange.
  • 19. Client Authentication • The server may request a certificate from the client. • The client will send a certificate message or a no_certificate alert.
  • 20.         Both sides compute the master_secret as follows: master_secret = 'A' pms client.r server.r 'BB' pms client.r server MD5 SHA SHA SH pms MD5 pms MD5 pms) A .r ' Computing the Master Secret (48 bytes)     where pms pre_master_secret; and client.r and server.r are the random num CCC' pms client.r bers exchanged server in Pha . s . r e 1 
  • 21. An SSL session needs six keys: Client write MAC secret Server write MAC secret Client write key (for encryption) Server write key Generation of Cryptographic Parameters  Client write IV (for CBC) Server write IV These parameters are generated from the master_secret in that order as in the next slide. 
  • 22.             SHA 'A' ms client.r serv Continue the following process until enough bits have been generated: MD5 ms MD5 ms M er D5 ms wher .r SHA 'BB' ms client.r server.r SHA 'CCC' ms client.r server.r e  ms master_secret; and client.r and server.r are the random numbers exchanged in Phase 1. 
  • 23. change_cipher _spec finished change_cipher _spec Client Server Phase 4: Finish      finished The message indicates that the sender is putting the negotiated Cipher Spec into use. Th change_cipher_spec finis e mess hed age contains MD5      SHA(handshake_messages || ( ) or SHA(master_secret Sender master_secret || pad1) pad2 || ). 
  • 24. SSL Session and Connection • SSL was designed to work with HTTP 1.0 which tended to open a lot of TCP connections between the same client and server. • SSL assumes a session is a relatively long- lived thing from which many (transient) connections can be cheaply derived. • 1 session = 1 or more connections 24
  • 25. SSL Session • Created by the Handshake Protocol. • Parameters: – Session ID – Compression method – Cipher spec (encryption and hash algorithm) – Master secret – Is resumable 25
  • 26. SSL Connection • Based on an underlying TCP connection • Associated with a session • Parameters: – Server and client random – Server and client write MAC secret – Server and client write secret – Server and client IV (if CBC is used) – Sequence number • Closed by a close_notify from each side 26
  • 27. Session Resumption • In handshaking, the client_hello contains a session ID: – If session ID = 0, start a new session – If session ID = x (and session x is resumable): • start a new connection of session x • (or change parameters of a current connection of session x) • Skip key exchange • Use the session’s master secret to generate keys 27
  • 28. Master secret vs. pre-master secret • Why? • Note: even if we use pre_master_secret to generate keys, each connection will have its own set of keys. 28 Pre_Master_Secret (48 bytes) Master_Secret (48 bytes) (session) Keys (connection)  
  • 29. • Pre_master_secret – computed for each session during handshaking – could be the same for all sessions – is not stored (so safe) • Master_secret – is stored for the lifetime of the session – may be compromised – If compromised, damage limited to a session • What if pre_master_secret is used to generate keys? 29