SlideShare a Scribd company logo
1 of 41
SMU CSE 5349/49
SSL/TLS
SMU CSE 5349/7349
Layers of Security
SMU CSE 5349/7349
SSL History
• 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/
SMU CSE 5349/7349
Overview
• Establish a session
– Agree on algorithms
– Share secrets
– Perform authentication
• Transfer application data
– Ensure privacy and integrity
SMU CSE 5349/7349
Architecture
• Record Protocol to transfer application and
TLS information
• A session is established using a Handshake
Protocol
TLS Record Protocol
Handshake
Protocol
Alert
Protocol
Change
Cipher Spec
SMU CSE 5349/7349
Architecure (cont’d)
HANDLES COMMUNICATION
WITH THE APPLICATION
Protocols
INITIALIZES COMMUNCATION
BETWEEN CLIENT & SERVER
INITIALIZES SECURE
COMMUNICATION
HANDLES DATA
COMPRESSION
ERROR HANDLING
SMU CSE 5349/7349
Handshake
• Negotiate Cipher-Suite Algorithms
– Symmetric cipher to use
– Key exchange method
– Message digest function
• Establish and share master secret
• Optionally authenticate server and/or
client
SMU CSE 5349/7349
Handshake Phases
• Hello messages
• Certificate and Key Exchange messages
• Change CipherSpec and Finished messages
SMU CSE 5349/7349
SSL Messages
OFFER CIPHER SUITE
MENU TO SERVER
SELECT A CIPHER SUITE
SEND CERTIFICATE AND
CHAIN TO CA ROOT
CLIENT SIDE SERVER SIDE
SEND PUBLIC KEY TO
ENCRYPT SYMM KEY
SERVER NEGOTIATION
FINISHED
SEND ENCRYPTED
SYMMETRIC KEY
SOURCE: THOMAS, SSL AND TLS ESSENTIALS
ACTIVATE
ENCRYPTION
CLIENT PORTION
DONE
( SERVER CHECKS OPTIONS )
ACTIVATESERVER
ENCRYPTION
SERVER PORTION
DONE
( CLIENT CHECKS OPTIONS )
NOW THE PARTIES CAN USE SYMMETRIC ENCRYPTION
SMU CSE 5349/7349
Client Hello
– Protocol version
• SSLv3(major=3, minor=0)
• TLS (major=3, minor=1)
– Random Number
• 32 bytes
• First 4 bytes, time of the day in seconds, other 28 bytes
random
• Prevents replay attack
– Session ID
• 32 bytes – indicates the use of previous cryptographic
material
– Compression algorithm
SMU CSE 5349/7349
Client Hello - Cipher Suites
INITIAL (NULL) CIPHER SUITE
PUBLIC-KEY
ALGORITHM
SYMMETRIC
ALGORITHM
HASH
ALGORITHM
CIPHER SUITE CODES USED
IN SSL MESSAGES
SSL_NULL_WITH_NULL_NULL = { 0, 0 }
SSL_RSA_WITH_NULL_MD5 = { 0, 1 }
SSL_RSA_WITH_NULL_SHA = { 0, 2 }
SSL_RSA_EXPORT_WITH_RC4_40_MD5 = { 0, 3 }
SSL_RSA_WITH_RC4_128_MD5 = { 0, 4 }
SSL_RSA_WITH_RC4_128_SHA = { 0, 5 }
SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = { 0, 6 }
SSL_RSA_WITH_IDEA_CBC_SHA = { 0, 7 }
SSL_RSA_EXPORT_WITH_DES40_CBC_SHA = { 0, 8 }
SSL_RSA_WITH_DES_CBC_SHA = { 0, 9 }
SSL_RSA_WITH_3DES_EDE_CBC_SHA = { 0, 10 }
SMU CSE 5349/7349
Server Hello
• Version
• Random Number
– Protects against handshake replay
• Session ID
– Provided to the client for later resumption of the session
• Cipher suite
– Usually picks client’s best preference – No obligation
• Compression method
SMU CSE 5349/7349
Certificates
• Sequence of X.509 certificates
– Server’s, CA’s, …
• X.509 Certificate associates public key with
identity
• Certification Authority (CA) creates certificate
– Adheres to policies and verifies identity
– Signs certificate
• User of Certificate must ensure it is valid
SMU CSE 5349/7349
Validating a Certificate
• Must recognize accepted CA in certificate
chain
– One CA may issue certificate for another CA
• Must verify that certificate has not been
revoked
– CA publishes Certificate Revocation List (CRL)
SMU CSE 5349/7349
Client Key Exchange
• Premaster secret
– Created by client; used to “seed” calculation of
encryption parameters
– 2 bytes of SSL version + 46 random bytes
– Sent encrypted to server using server’s public
key
This is where the attack
happened in SSLv2
SMU CSE 5349/7349
Change Cipher Spec &
Finished Messages
• Change Cipher Spec
– Switch to newly negotiated algorithms and key material
• Finished
– First message encrypted with new crypto parameters
– Digest of negotiated master secret, the ensemble of
handshake messages, sender constant
– HMAC approach of nested hashing
SMU CSE 5349/7349
SSL Encryption
• Master secret
– Generated by both parties from premaster
secret and random values generated by both
client and server
• Key material
– Generated from the master secret and shared
random values
• Encryption keys
– Extracted from the key material
SMU CSE 5349/7349
Generating the Master Secret
SOURCE: THOMAS, SSL AND TLS ESSENTIALS
SERVER’S PUBLIC KEY
IS SENT BY SERVER IN
ServerKeyExchange
CLIENT GENERATES THE
PREMASTER SECRET
ENCRYPTS WITH PUBLIC
KEY OF SERVER
CLIENT SENDS PREMASTER
SECRET IN ClientKeyExchange
SENT BY CLIENT
IN ClientHello
SENT BY SERVER
IN ServerHello
MASTER SECRET IS 3 MD5
HASHES CONCATENATED
TOGETHER = 384 BITS
SMU CSE 5349/7349
Generation of Key Material
SOURCE: THOMAS, SSL AND TLS ESSENTIALS
JUST LIKE FORMING
THE MASTER SECRET
EXCEPT THE MASTER
SECRET IS USED HERE
INSTEAD OF THE
PREMASTER SECRET
. . .
SMU CSE 5349/7349
Obtaining Keys from the Key Material
SOURCE: THOMAS, SSL AND TLS ESSENTIALS
SECRET VALUES
INCLUDED IN MESSAGE
AUTHENTICATION CODES
INITIALIZATION VECTORS
FOR DES CBC ENCRYPTION
SYMMETRIC KEYS
SMU CSE 5349/7349
SSL Record Protocol
SMU CSE 5349/7349
Record Header
• Three pieces of information
– Content type
• Application data
• Alert
• Handshake
• Change_cipher_spec
– Content length
• Suggests when to start processing
– SSL version
• Redundant check for version agreement
SMU CSE 5349/7349
Protocol (cont’d)
• Max. record length 214 – 1
• MAC
– Data
– Headers
– Sequence number
• To prevent replay and reordering attack
• Not included in the record
SMU CSE 5349/7349
Alerts and Closure
• Alert the other side of exceptions
– Different levels
– Terminate and session cannot be resumed
• Closure notify
– To prevent truncation attack (sending a TCP
FIN before the sender is finished)
SMU CSE 5349/7349
SSL Sessions
• Sessions vs. Connections
– Multiple connections within a sessions
– One negotiation/session
• Session Resumption
– Through session IDs
– Clients use server IP address or name as index
– Servers use the session IDs provide by the clients
– Use of random numbers in resumed session key
calculation ensures different keys
• Session Re-handshake
– Client can initiate a new handshake within a session
– Use of Server Gated Cryptography (SGC) for added
security
SMU CSE 5349/7349
SSL Overhead
• 2-10 times slower than a TCP session
• Where do we lose time
– Handshake phase
• Client does public-key encryption
• Server does private-key encryption (still public-key
cryptography)
• Usually clients have to wait on servers to finish
– Data Transfer phase
• Symmetric key encryption
SMU CSE 5349/7349
SSL Applications
• HTTP – original application
• Secure mail
– Server to client connection
– SMTP/SSL?
• Telnet, ftp ..
• Resources:
http://www.openssl.org/related/apps.html
SMU CSE 5349/49
WTLS
SMU CSE 5349/7349
WAP Gateway Architecture
WTLS
HTTP/SSL
HTTP/SSL
Wireless
Gateway
Application
Servers
SMU CSE 5349/7349
WAP Stack Configuration
SMU CSE 5349/7349
Wireless Transport Layer Security (WTLS)
• Provides security services between the
mobile device (client) and the WAP
gateway
– Data integrity
– Privacy (through encryption)
– Authentication (through certificates)
– Denial-of-service protection (detects and
rejects messages that are replayed)
SMU CSE 5349/7349
WTLS Protocol Stack
SMU CSE 5349/7349
WTLS Record Protocol
• Takes info from the next higher level and
encapsulates them into a PDU
– Payload is compressed
– A MAC is computed
– Compressed message plus MAC code are
encrypted using symmetric encryption
– Record protocol adds a header to the
beginning to encrypted payload
SMU CSE 5349/7349
Record Protocol Operation
SMU CSE 5349/7349
SMU CSE 5349/7349
Alert Protocol
• Convey WTLS-related alerts to the peer
entity
• Alert messages are compressed and
encrypted
• A fatal warning terminates the connection
(i.e. incorrect MAC, unacceptable set of
security parameters in the handshake
• Certificate problems usually cause a non-
fatal error
SMU CSE 5349/7349
WTLS Handshake Protocol
First Phase
The Handshake Protocol allows the server and client to
authenticate each other and negotiate an encryption
and MAC
SMU CSE 5349/7349
Second Phase
SMU CSE 5349/7349
Third Phase
SMU CSE 5349/7349
Fourth Phrase
SMU CSE 5349/7349
SSL vs. WTLS
• Datagram support ( UDP)
• Expanded set of alerts
• Optimized handshake – 3 levels of client/server
authentication
• New Certificate Format – WTLS certificates
are small in size and simple to parse
• Support client identities
• Additional cipher suites – RC5, short hashes

More Related Content

Similar to ssl.ppt

BAIT1103 Chapter 4
BAIT1103 Chapter 4BAIT1103 Chapter 4
BAIT1103 Chapter 4
limsh
 
SECURE SOCKET LAYER(SSL)_LECTURE SLIDES.pdf
SECURE SOCKET LAYER(SSL)_LECTURE SLIDES.pdfSECURE SOCKET LAYER(SSL)_LECTURE SLIDES.pdf
SECURE SOCKET LAYER(SSL)_LECTURE SLIDES.pdf
NiharikaDubey17
 

Similar to ssl.ppt (20)

Secure socket layer
Secure socket layerSecure socket layer
Secure socket layer
 
Secure socket layer
Secure socket layerSecure socket layer
Secure socket layer
 
BAIT1103 Chapter 4
BAIT1103 Chapter 4BAIT1103 Chapter 4
BAIT1103 Chapter 4
 
All you need to know about transport layer security
All you need to know about transport layer securityAll you need to know about transport layer security
All you need to know about transport layer security
 
SIP over TLS
SIP over TLSSIP over TLS
SIP over TLS
 
wolfSSL and TLS 1.3
wolfSSL and TLS 1.3wolfSSL and TLS 1.3
wolfSSL and TLS 1.3
 
Network Security_Module_2_Dr Shivashankar
Network Security_Module_2_Dr ShivashankarNetwork Security_Module_2_Dr Shivashankar
Network Security_Module_2_Dr Shivashankar
 
Securing TCP connections using SSL
Securing TCP connections using SSLSecuring TCP connections using SSL
Securing TCP connections using SSL
 
email.ppt
email.pptemail.ppt
email.ppt
 
Email2
Email2Email2
Email2
 
Network Security_Module_2.pdf
Network Security_Module_2.pdfNetwork Security_Module_2.pdf
Network Security_Module_2.pdf
 
SSL Secure Socket Layer
SSL Secure Socket LayerSSL Secure Socket Layer
SSL Secure Socket Layer
 
Unit -- 5.ppt
Unit -- 5.pptUnit -- 5.ppt
Unit -- 5.ppt
 
SECURE SOCKET LAYER(SSL)_LECTURE SLIDES.pdf
SECURE SOCKET LAYER(SSL)_LECTURE SLIDES.pdfSECURE SOCKET LAYER(SSL)_LECTURE SLIDES.pdf
SECURE SOCKET LAYER(SSL)_LECTURE SLIDES.pdf
 
Sequere socket Layer
Sequere socket LayerSequere socket Layer
Sequere socket Layer
 
Network Security Applications
Network Security ApplicationsNetwork Security Applications
Network Security Applications
 
Secure Socket Layer.pptx
Secure Socket Layer.pptxSecure Socket Layer.pptx
Secure Socket Layer.pptx
 
Secure socket layer working
Secure socket layer workingSecure socket layer working
Secure socket layer working
 
Cryptography by Afroz haider mir
Cryptography by Afroz haider mirCryptography by Afroz haider mir
Cryptography by Afroz haider mir
 
Webservice security considerations and measures
Webservice security considerations and measuresWebservice security considerations and measures
Webservice security considerations and measures
 

Recently uploaded

valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Chandigarh Call girls 9053900678 Call girls in Chandigarh
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
@Chandigarh #call #Girls 9053900678 @Call #Girls in @Punjab 9053900678
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
Diya Sharma
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
imonikaupta
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 

Recently uploaded (20)

valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
 
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceReal Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
 
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
 

ssl.ppt

  • 3. SMU CSE 5349/7349 SSL History • 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/
  • 4. SMU CSE 5349/7349 Overview • Establish a session – Agree on algorithms – Share secrets – Perform authentication • Transfer application data – Ensure privacy and integrity
  • 5. SMU CSE 5349/7349 Architecture • Record Protocol to transfer application and TLS information • A session is established using a Handshake Protocol TLS Record Protocol Handshake Protocol Alert Protocol Change Cipher Spec
  • 6. SMU CSE 5349/7349 Architecure (cont’d) HANDLES COMMUNICATION WITH THE APPLICATION Protocols INITIALIZES COMMUNCATION BETWEEN CLIENT & SERVER INITIALIZES SECURE COMMUNICATION HANDLES DATA COMPRESSION ERROR HANDLING
  • 7. SMU CSE 5349/7349 Handshake • Negotiate Cipher-Suite Algorithms – Symmetric cipher to use – Key exchange method – Message digest function • Establish and share master secret • Optionally authenticate server and/or client
  • 8. SMU CSE 5349/7349 Handshake Phases • Hello messages • Certificate and Key Exchange messages • Change CipherSpec and Finished messages
  • 9. SMU CSE 5349/7349 SSL Messages OFFER CIPHER SUITE MENU TO SERVER SELECT A CIPHER SUITE SEND CERTIFICATE AND CHAIN TO CA ROOT CLIENT SIDE SERVER SIDE SEND PUBLIC KEY TO ENCRYPT SYMM KEY SERVER NEGOTIATION FINISHED SEND ENCRYPTED SYMMETRIC KEY SOURCE: THOMAS, SSL AND TLS ESSENTIALS ACTIVATE ENCRYPTION CLIENT PORTION DONE ( SERVER CHECKS OPTIONS ) ACTIVATESERVER ENCRYPTION SERVER PORTION DONE ( CLIENT CHECKS OPTIONS ) NOW THE PARTIES CAN USE SYMMETRIC ENCRYPTION
  • 10. SMU CSE 5349/7349 Client Hello – Protocol version • SSLv3(major=3, minor=0) • TLS (major=3, minor=1) – Random Number • 32 bytes • First 4 bytes, time of the day in seconds, other 28 bytes random • Prevents replay attack – Session ID • 32 bytes – indicates the use of previous cryptographic material – Compression algorithm
  • 11. SMU CSE 5349/7349 Client Hello - Cipher Suites INITIAL (NULL) CIPHER SUITE PUBLIC-KEY ALGORITHM SYMMETRIC ALGORITHM HASH ALGORITHM CIPHER SUITE CODES USED IN SSL MESSAGES SSL_NULL_WITH_NULL_NULL = { 0, 0 } SSL_RSA_WITH_NULL_MD5 = { 0, 1 } SSL_RSA_WITH_NULL_SHA = { 0, 2 } SSL_RSA_EXPORT_WITH_RC4_40_MD5 = { 0, 3 } SSL_RSA_WITH_RC4_128_MD5 = { 0, 4 } SSL_RSA_WITH_RC4_128_SHA = { 0, 5 } SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = { 0, 6 } SSL_RSA_WITH_IDEA_CBC_SHA = { 0, 7 } SSL_RSA_EXPORT_WITH_DES40_CBC_SHA = { 0, 8 } SSL_RSA_WITH_DES_CBC_SHA = { 0, 9 } SSL_RSA_WITH_3DES_EDE_CBC_SHA = { 0, 10 }
  • 12. SMU CSE 5349/7349 Server Hello • Version • Random Number – Protects against handshake replay • Session ID – Provided to the client for later resumption of the session • Cipher suite – Usually picks client’s best preference – No obligation • Compression method
  • 13. SMU CSE 5349/7349 Certificates • Sequence of X.509 certificates – Server’s, CA’s, … • X.509 Certificate associates public key with identity • Certification Authority (CA) creates certificate – Adheres to policies and verifies identity – Signs certificate • User of Certificate must ensure it is valid
  • 14. SMU CSE 5349/7349 Validating a Certificate • Must recognize accepted CA in certificate chain – One CA may issue certificate for another CA • Must verify that certificate has not been revoked – CA publishes Certificate Revocation List (CRL)
  • 15. SMU CSE 5349/7349 Client Key Exchange • Premaster secret – Created by client; used to “seed” calculation of encryption parameters – 2 bytes of SSL version + 46 random bytes – Sent encrypted to server using server’s public key This is where the attack happened in SSLv2
  • 16. SMU CSE 5349/7349 Change Cipher Spec & Finished Messages • Change Cipher Spec – Switch to newly negotiated algorithms and key material • Finished – First message encrypted with new crypto parameters – Digest of negotiated master secret, the ensemble of handshake messages, sender constant – HMAC approach of nested hashing
  • 17. SMU CSE 5349/7349 SSL Encryption • Master secret – Generated by both parties from premaster secret and random values generated by both client and server • Key material – Generated from the master secret and shared random values • Encryption keys – Extracted from the key material
  • 18. SMU CSE 5349/7349 Generating the Master Secret SOURCE: THOMAS, SSL AND TLS ESSENTIALS SERVER’S PUBLIC KEY IS SENT BY SERVER IN ServerKeyExchange CLIENT GENERATES THE PREMASTER SECRET ENCRYPTS WITH PUBLIC KEY OF SERVER CLIENT SENDS PREMASTER SECRET IN ClientKeyExchange SENT BY CLIENT IN ClientHello SENT BY SERVER IN ServerHello MASTER SECRET IS 3 MD5 HASHES CONCATENATED TOGETHER = 384 BITS
  • 19. SMU CSE 5349/7349 Generation of Key Material SOURCE: THOMAS, SSL AND TLS ESSENTIALS JUST LIKE FORMING THE MASTER SECRET EXCEPT THE MASTER SECRET IS USED HERE INSTEAD OF THE PREMASTER SECRET . . .
  • 20. SMU CSE 5349/7349 Obtaining Keys from the Key Material SOURCE: THOMAS, SSL AND TLS ESSENTIALS SECRET VALUES INCLUDED IN MESSAGE AUTHENTICATION CODES INITIALIZATION VECTORS FOR DES CBC ENCRYPTION SYMMETRIC KEYS
  • 21. SMU CSE 5349/7349 SSL Record Protocol
  • 22. SMU CSE 5349/7349 Record Header • Three pieces of information – Content type • Application data • Alert • Handshake • Change_cipher_spec – Content length • Suggests when to start processing – SSL version • Redundant check for version agreement
  • 23. SMU CSE 5349/7349 Protocol (cont’d) • Max. record length 214 – 1 • MAC – Data – Headers – Sequence number • To prevent replay and reordering attack • Not included in the record
  • 24. SMU CSE 5349/7349 Alerts and Closure • Alert the other side of exceptions – Different levels – Terminate and session cannot be resumed • Closure notify – To prevent truncation attack (sending a TCP FIN before the sender is finished)
  • 25. SMU CSE 5349/7349 SSL Sessions • Sessions vs. Connections – Multiple connections within a sessions – One negotiation/session • Session Resumption – Through session IDs – Clients use server IP address or name as index – Servers use the session IDs provide by the clients – Use of random numbers in resumed session key calculation ensures different keys • Session Re-handshake – Client can initiate a new handshake within a session – Use of Server Gated Cryptography (SGC) for added security
  • 26. SMU CSE 5349/7349 SSL Overhead • 2-10 times slower than a TCP session • Where do we lose time – Handshake phase • Client does public-key encryption • Server does private-key encryption (still public-key cryptography) • Usually clients have to wait on servers to finish – Data Transfer phase • Symmetric key encryption
  • 27. SMU CSE 5349/7349 SSL Applications • HTTP – original application • Secure mail – Server to client connection – SMTP/SSL? • Telnet, ftp .. • Resources: http://www.openssl.org/related/apps.html
  • 29. SMU CSE 5349/7349 WAP Gateway Architecture WTLS HTTP/SSL HTTP/SSL Wireless Gateway Application Servers
  • 30. SMU CSE 5349/7349 WAP Stack Configuration
  • 31. SMU CSE 5349/7349 Wireless Transport Layer Security (WTLS) • Provides security services between the mobile device (client) and the WAP gateway – Data integrity – Privacy (through encryption) – Authentication (through certificates) – Denial-of-service protection (detects and rejects messages that are replayed)
  • 32. SMU CSE 5349/7349 WTLS Protocol Stack
  • 33. SMU CSE 5349/7349 WTLS Record Protocol • Takes info from the next higher level and encapsulates them into a PDU – Payload is compressed – A MAC is computed – Compressed message plus MAC code are encrypted using symmetric encryption – Record protocol adds a header to the beginning to encrypted payload
  • 34. SMU CSE 5349/7349 Record Protocol Operation
  • 36. SMU CSE 5349/7349 Alert Protocol • Convey WTLS-related alerts to the peer entity • Alert messages are compressed and encrypted • A fatal warning terminates the connection (i.e. incorrect MAC, unacceptable set of security parameters in the handshake • Certificate problems usually cause a non- fatal error
  • 37. SMU CSE 5349/7349 WTLS Handshake Protocol First Phase The Handshake Protocol allows the server and client to authenticate each other and negotiate an encryption and MAC
  • 41. SMU CSE 5349/7349 SSL vs. WTLS • Datagram support ( UDP) • Expanded set of alerts • Optimized handshake – 3 levels of client/server authentication • New Certificate Format – WTLS certificates are small in size and simple to parse • Support client identities • Additional cipher suites – RC5, short hashes