Chapter 4: Securing TCP connections

Similar documents
CSCE 715: Network Systems Security

Transport Layer Security

Computer Networks 1 (Mạng Máy Tính 1) Lectured by: Dr. Phạm Trần Vũ

COSC4377. Chapter 8 roadmap

Internet security and privacy

The World Wide Web is widely used by businesses, government agencies, and many individuals. But the Internet and the Web are extremely vulnerable to

E-commerce security: SSL/TLS, SET and others. 4.1

Cryptography (Overview)

Chapter 8 Network Security

Chapter 8 Web Security

Transport Level Security

Transport Layer Security

Security Protocols and Infrastructures. Winter Term 2010/2011

Security Protocols. Professor Patrick McDaniel CSE545 - Advanced Network Security Spring CSE545 - Advanced Network Security - Professor McDaniel

Network Security: TLS/SSL. Tuomas Aura T Network security Aalto University, Nov-Dec 2010

Encryption. INST 346, Section 0201 April 3, 2018

CS 393 Network Security. Nasir Memon Polytechnic University Module 12 SSL

CS 356 Internet Security Protocols. Fall 2013

Secure Socket Layer. Security Threat Classifications

Overview. SSL Cryptography Overview CHAPTER 1

Cryptography and secure channel. May 17, Networks and Security. Thibault Debatty. Outline. Cryptography. Public-key encryption

Network Security: TLS/SSL. Tuomas Aura T Network security Aalto University, Nov-Dec 2014

Universität Hamburg. SSL & Company. Fachbereich Informatik SVS Sicherheit in Verteilten Systemen. Security in TCP/IP. UH, FB Inf, SVS, 18-Okt-04 2

WAP Security. Helsinki University of Technology S Security of Communication Protocols

Chapter 7. WEB Security. Dr. BHARGAVI H. GOSWAMI Department of Computer Science Christ University

Lecture 9a: Secure Sockets Layer (SSL) March, 2004

MTAT Applied Cryptography

Security Protocols and Infrastructures. Winter Term 2015/2016

Protocols, Technologies and Standards Secure network protocols for the OSI stack P2.1 WLAN Security WPA, WPA2, IEEE i, IEEE 802.1X P2.

SSL/TLS & 3D Secure. CS 470 Introduction to Applied Cryptography. Ali Aydın Selçuk. CS470, A.A.Selçuk SSL/TLS & 3DSec 1

Transport Layer Security

Crypto meets Web Security: Certificates and SSL/TLS

SSL/TLS. Pehr Söderman Natsak08/DD2495

Security Protocols and Infrastructures

Internet Security. - IPSec, SSL/TLS, SRTP - 29th. Oct Lee, Choongho

COSC 301 Network Management. Lecture 15: SSL/TLS and HTTPS

MTAT Applied Cryptography

Lehrstuhl für Netzarchitekturen und Netzdienste Fakultät für Informatik Technische Universität München. ilab. Lab 8 SSL/TLS and IPSec

CS 161 Computer Security

IPsec and SSL/TLS. Applied Cryptography. Andreas Hülsing (Slides mostly by Ruben Niederhagen) Dec. 1st, /43

14. Internet Security (J. Kurose)

Securing Internet Communication: TLS

Kurose & Ross, Chapters (5 th ed.)

Distributed Systems. 25. Authentication Paul Krzyzanowski. Rutgers University. Fall 2018

Computer Networking. What is network security? Chapter 7: Network security. Symmetric key cryptography. The language of cryptography

Computer Security. 10r. Recitation assignment & concept review. Paul Krzyzanowski. Rutgers University. Spring 2018

Chapter 5. Transport Level Security

Securing IoT applications with Mbed TLS Hannes Tschofenig Arm Limited

SSL/TLS. How to send your credit card number securely over the internet

CS November 2018

Ref:

Chapter 5: Network Layer Security

CS Computer Networks 1: Authentication

Real-time protocol. Chapter 16: Real-Time Communication Security

TLS. RFC2246: The TLS Protocol. (c) A. Mariën -

ecure Sockets Layer, or SSL, is a generalpurpose protocol for sending encrypted

CS 494/594 Computer and Network Security

Chapter 12 Security Protocols of the Transport Layer

Computer Security 3e. Dieter Gollmann. Security.di.unimi.it/sicurezza1415/ Chapter 16: 1

Computer Networks. Wenzhong Li. Nanjing University

Security Engineering. Lecture 16 Network Security Fabio Massacci (with the courtesy of W. Stallings)

Securely Deploying TLS 1.3. September 2017

ח'/סיון/תשע "א. RSA: getting ready. Public Key Cryptography. Public key cryptography. Public key encryption algorithms

SSL/TLS CONT Lecture 9a

CIS 5373 Systems Security

Information Security CS 526

Managing and Securing Computer Networks. Guy Leduc. Chapter 7: Securing LANs. Chapter goals: security in practice: Security in the data link layer

Auth. Key Exchange. Dan Boneh

UNIT - IV Cryptographic Hash Function 31.1

Data Security and Privacy. Topic 14: Authentication and Key Establishment

Performance Implications of Security Protocols

Network Security. Computer Networking: A Top Down Approach Featuring the Internet, 2 nd edition. Jim Kurose, Keith Ross Addison-Wesley, July 2002.

SharkFest 17 Europe. SSL/TLS Decryption. uncovering secrets. Wednesday November 8th, Peter Wu Wireshark Core Developer

L13. Reviews. Rocky K. C. Chang, April 10, 2015

Lecture 33. Firewalls. Firewall Locations in the Network. Castle and Moat Analogy. Firewall Types. Firewall: Illustration. Security April 15, 2005

Overview of SSL/TLS. Luke Anderson. 12 th May University Of Sydney.

TRANSPORT-LEVEL SECURITY

Understand the TLS handshake Understand client/server authentication in TLS. Understand session resumption Understand the limitations of TLS

Introduction and Overview. Why CSCI 454/554?

AIR FORCE INSTITUTE OF TECHNOLOGY

SEEM4540 Open Systems for E-Commerce Lecture 03 Internet Security

White Paper for Wacom: Cryptography in the STU-541 Tablet

Computer Networks II

Secure Sockets Layer (SSL) / Transport Layer Security (TLS)

Security: Focus of Control. Authentication

Lecture 1 Applied Cryptography (Part 1)

Network Security Chapter 8

Security: Focus of Control

Security issues: Encryption algorithms. Threats Methods of attack. Secret-key Public-key Hybrid protocols. CS550: Distributed OS.

Gestion et sécurité des réseaux informatiques. Guy Leduc. Chapter 3: Securing applications. Chapter goals: security in practice:

TLS Extensions Project IMT Network Security Spring 2004

Chapter 8. Network Security. Cryptography. Need for Security. An Introduction to Cryptography 10/7/2010

Computer Security. 08r. Pre-exam 2 Last-minute Review Cryptography. Paul Krzyzanowski. Rutgers University. Spring 2018

INF3510 Information Security University of Oslo Spring Lecture 9 Communication Security. Audun Jøsang

Outline. 0 Topic 4.1: Securing Real-Time Communications 0 Topic 4.2: Transport Layer Security 0 Topic 4.3: IPsec and IKE

(2½ hours) Total Marks: 75

Authentication and Secure Communication. Jeff Chase Duke University

Network Security - ISA 656 IPsec IPsec Key Management (IKE)

Authentication and Secure Communication. Exhibit A. The First Axiom of Security. Trusted vs. Trustworthy (NSA) technology. people

Datasäkerhetsmetoder föreläsning 7

Transcription:

Managing and Securing Computer Networks Guy Leduc Chapter 5: Securing TCP connections Computer Networking: A Top Down Approach, 6 th edition. Jim Kurose, Keith Ross Addison-Wesley, March 2012. (section 8.6) Network Security - PRIVATE Communication in a PUBLIC World C. Kaufman, R. Pearlman, M. Speciner Pearson Education, 2002. (chapter 19) Computer Networks, 4th edition Andrew S. Tanenbaum Pearson Education, 2003. (section 8.9.3) 5: Securing TCP connections 1 Chapter 4: Securing TCP connections Chapter goals: security in practice: Security in the transport layer (versus other layers) SSL / TLS 5: Securing TCP connections 2 1

Chapter Roadmap Security in the transport layer SSL - The big picture SSL - A more complete picture 5: Securing TCP connections 3 SSL: Secure Sockets Layer Widely deployed security protocol Supported by almost all browsers and web servers https Tens of billions spent per year over SSL Mechanisms: [Woo 1994], Implementation: Netscape Number of variations: TLS: transport layer security, RFC 2246 Provides Confidentiality Integrity Authentication Original goals: Had Web e-commerce transactions in mind Encryption (especially credit-card numbers) Web-server authentication Optional client authentication Minimum hassle in doing business with new merchant Available to all TCP applications Secure socket interface 5: Securing TCP connections 4 2

SSL and TCP/IP Application TCP IP Normal Application Application SSL TCP IP Application with SSL SSL provides application programming interface (API) to applications C and Java SSL libraries/classes readily available 5: Securing TCP connections 5 Relative Location of Security Facilities in the TCP/IP Stack HTTP FTP SMTP SSL / TLS TCP IP Security at transport level HTTP FTP SMTP TCP / UDP IP / IPsec Security at network level Both are general-purpose (i.e. application independent) solutions But SSL is specific to TCP Does not work with UDP, contrary to IPsec But makes SSL simpler (no worry about loss and retransmission of data) SSL only protects the TCP payload Traffic analysis is thus possible 5: Securing TCP connections 6 3

Secure Socket Layer - SSL SSLv2 was originated by Netscape in 1995 Later came SSLv3 IETF then introduced the TLS (Transport Layer Security) standard Kind of SSLv3.1 Only minor changes, but not interoperable Session key made stronger (harder to cryptanalyse) More secure SSL/TLS is designed to make use of TCP to provide a reliable end-to-end secure service 5: Securing TCP connections 7 Chapter Roadmap Security in the transport layer SSL - The big picture SSL - A more complete picture 5: Securing TCP connections 8 4

Could do something like PGP: m K A - H(. - ) K A (. ) - K A (H(m)) + K S (.) K S m K S + K B (. ) K+ B + + K B (K S ) Internet But want to send byte streams & interactive data Want a set of secret keys for the entire connection Want certificate exchange part of protocol: handshake phase 5: Securing TCP connections 9 Toy SSL : a simple secure channel Handshake: Alice and Bob use their certificates and private keys to authenticate each other and exchange shared secret Key Derivation: Alice and Bob use shared secret to derive set of keys Data Transfer: Data to be transferred is broken up into a series of records Connection Closure: Special messages to securely close connection 5: Securing TCP connections 10 5

Toy SSL: three phases 1. Handshake: Alice establishes TCP connection to Bob authenticates Bob via CA signed certificate creates, encrypts (using Bob s public key), sends pre-master secret key to Bob nonce exchange not create Pre-Master shown Secret (PMS) TCP SYN TCP SYNACK SSL hello certificate K B+ (PMS) TCP ACK decrypt using K B - to get PMS 5: Securing TCP connections 11 Toy SSL: three phases 2. Key Derivation: Considered bad to use same key for more than one cryptographic operation Use different keys for message authentication code (MAC) and encryption 4 keys: E B : Bob->Alice data encryption key E A : Alice->Bob data encryption key M B : Bob->Alice MAC key M A : Alice->Bob MAC key Keys derived from key derivation function (KDF) Takes master secret and (possibly) some additional random data and creates the keys 5: Securing TCP connections 12 6

Toy SSL: three phases 3. Data transfer Why not encrypt data in constant stream as we write it to TCP? Where would we put the MAC? If at end, no message integrity until all data processed For example, with instant messaging, how can we do integrity check over all bytes sent before displaying? Instead, break stream in series of records Each record carries a MAC Receiver can act on each record as it arrives Issue: in record, receiver needs to distinguish MAC from data Want to use variable-length records length data MAC 5: Securing TCP connections 13 Toy SSL data transfer TCP byte stream. Compression can take place block n bytes together b 1 b 2 b 3 b n d d H(d) Useful to ensure integrity of the whole byte stream. seq # not sent, just used in the hash H(.) K(.) M B SSL seq. # E B compute MAC encrypt d + MAC d H(d) SSL record format Type Ver Len d H(d) unencrypted encrypted using E B but integrity-protected 5: Securing TCP connections 14 7

Sequence Numbers Problem: Attacker can capture and replay record or re-order records Solution: Put sequence number into MAC: MAC = MAC(M x, sequence data) Note: no sequence number field Problem: Attacker could still replay all records Solution: Add nonces in handshake, and use them to build keys, e.g. M x see detailed protocol 5: Securing TCP connections 15 Control information Problem: Truncation attack: Attacker forges TCP connection close segment One or both sides thinks there is less data than there actually is Solution: record types, with one type for closure type 0 for data; type 1 for closure MAC = MAC(M x, sequence type data) length type data MAC 5: Securing TCP connections 16 8

Toy SSL: summary hello certificate, nonce K B+ (PMS) = EMS Encrypted and authenticated type 0, data, MAC(seq1 type0 data) type 0, data, MAC(seq2 type0 data) type 0, data, MAC(seq1 type0 data) type 0, data, MAC(seq3 type0 data) type 1, close, MAC(seq4 type1) bob.com type 1, close, MAC(seq2 type1) 5: Securing TCP connections 17 Toy SSL isn t complete How long are fields? Which encryption protocols? Want negotiation? Allow client and server to support different encryption algorithms Allow client and server to choose together specific algorithm before data transfer 5: Securing TCP connections 18 9

Chapter Roadmap Security in the transport layer SSL - The big picture SSL - A more complete picture 5: Securing TCP connections 19 Secure Socket Layer - SSL SSL is composed of 2 sublayers The lower layer is the SSL Record Protocol: Provides Integrity and Confidentiality The main protocol of the upper layer is the SSL Handshake Protocol, that we will study in more detail SSL Handshake Protocol SSL Change Cipher Spec Protocol SSL Alert Protocol Application SSL Record Protocol TCP IP 5: Securing TCP connections 20 10

SSL Record Protocol data data fragment MAC data fragment MAC record header encrypted data and MAC record header encrypted data and MAC record header: content type; version; length MAC: also includes sequence number, type and MAC key M x Fragment: each SSL fragment 2 14 bytes (~16 Kbytes) 5: Securing TCP connections 21 SSL Record Format 1 byte 2 bytes 3 bytes content type SSL version length data MAC Data and MAC encrypted (symmetric algo) 5: Securing TCP connections 22 11

SSL Handshake Protocol The most complex part of SSL Purpose 1. Server authentication 2. Negotiation: agree on crypto algorithms 3. Establish keys 4. Client authentication (optional) This mechanism is called session creation a session defines the set of cryptographic security parameters to be used multiple secure TCP connections between a client and a server can share the same session less computation cost This handshake protocol is used before any application data is transmitted 5: Securing TCP connections 23 The four phases of the SSL Handshake Protocol 1. Establish Security Capabilities 2. Server Authentication (and key exchange) 3. (Client Authentication and) key exchange 4. Finish 5: Securing TCP connections 24 12

Phase 1 of SSL Handshake: Establish Security Capabilities Client Server client_hello (cipher_suite, R A ) server_hello (cipher, session_id, R B ) Client_hello contains the combinations of cryptographic algorithms supported by the client, in decreasing order of preference Server_hello is the selection by the server Assign a session_id Select the CipherSpec The client_hello can contain a session_id To resume a previous session Both messages have nonces 5: Securing TCP connections 25 Why the two random nonces? Suppose Trudy sniffs all messages between Alice & Bob Next day, Trudy sets up TCP connection with Bob, sends the exact same sequence of records Bob (Amazon) thinks Alice made two separate orders for the same thing Solution: Bob sends different random nonce for each connection. This causes encryption and MAC keys to be different on the two days Trudy s messages will fail Bob s integrity check 5: Securing TCP connections 26 13

CipherSpecs The CipherSpec contains fields like: Cipher Algorithm (DES, 3DES, RC4, AES) MAC Algorithm (based on MD5, SHA-1) Public-key algorithm (RSA) 5: Securing TCP connections 27 Phase 2 of SSL Handshake: Server Authentication (and Key Exchange) We first consider the most classical key exchange protocol: RSA Client check certificate (server_key_exchange) certificate_request server_hello_done Server All these messages are usually combined with the previous server_hello message Certificate RSA certificate Client software comes configured with public keys of various trusted organizations (CAs) to check certificate (chains) Security threat! (Server_key_exchange) With RSA: not used Certificate_request Server may request client certificate Usually not done Server_hello_done 5: Securing TCP connections 28 14

Phase 3 of SSL Handshake: (Client Authentication and) Key Exchange Client certificate client_key_exchange certificate_verify Server Certificate Only if requested by server Client_key_exchange For RSA: It s the pre-master secret (PMS) encrypted with the server s public key Also sent is a hash of (PMS, R A, R B ) Certificate_verify If certificate sent by client Used by the client to prove he has the private key associated with its certificate (in case someone is misusing the client's certificate) Basically, the client signs a hash of the previous messages 5: Securing TCP connections 29 Phase 4 of SSL: Handshake Finish Client Server change_cipher_spec finished change_cipher_spec finished Change_cipher_spec Its purpose is to cause the pending state to be copied into the current state From now on, all records are encrypted and integrityprotected Is part of the Change Cipher Spec protocol Finished Verifies that the key exchange and authentication processes were successful It is the concatenation of 2 hash values calculated from the previous messages 5: Securing TCP connections 30 15

Role of the Finish phase Counter the downgrade attack: An attacker could have removed the cipher suites with strong encryption from the client_hello message, causing the entities to agree upon a weaker cipher Counter the truncation attack: An attacker could close the underlying connection (by sending a TCP close message) which, in SSLv2, would have terminated the SSL session abnormally Note: The truncation attack can also occur later during the data transfer: The solution is to indicate in the type field of the SSL record whether it is the last record In normal operations, the TCP connection cannot be closed before these type fields have been exchanged over the SSL connection 5: Securing TCP connections 31 Real Connection After TCP SYN and SYNACK handshake: ClientHello handshake: ServerHello handshake: Certificate handshake: ServerHelloDone handshake: ClientKeyExchange ChangeCipherSpec handshake: Finished Everything henceforth is encrypted ChangeCipherSpec handshake: Finished application_data application_data TCP FIN follows Alert: warning, close_notify 5: Securing TCP connections 32 16

Main Key exchange methods based on RSA RSA The classical method shown in previous slides Client sends a PMS encrypted with the server's certified RSA public key: K B+ (PMS) Server needs a certified encryption public key RSA with signature-only key Encryption with a RSA key longer than 512 bits was not exportable Server first generates a temporary pair of RSA (short) keys (k B-, k B +) and sends the public one to the client, signed by its RSA (long-term) key: K B- (k B+,B) Client sends a PMS encrypted with the server's temporary RSA public key: k B+ (PMS) Note: this scheme designed for exportability actually enhances security because it allows (weak-key) perfect forward secrecy: Breaking or stealing the temporary private key does not allow Trudy to decrypt previous SSL connections 5: Securing TCP connections 33 Phases 2 and 3: RSA with signature-only Client Server certificate server_key_exchange certificate_request server_hello_done certificate client_key_exchange Server_key_exchange With RSA signature-only : it is the temporary public key, signed by the server s long-term key Client_key_exchange It s the PMS encrypted with the server s temporary public key + hash of (PMS, R A, R B ) certificate_verify 5: Securing TCP connections 34 17

Other key exchange methods (DH) Anonymous Diffie-Hellman (DH) Public DH parameters (Y A and Y B ) are sent in server_key_exchange and client_key_exchange messages The pre-master secret is the shared key computed with DH No need to send it No protection against man-in-the-middle attack, as DH parameters are not authenticated Fixed Diffie-Hellman The DH public (key) parameters are fixed and signed by a CA Resists to man-in-the-middle attack, but allows an attacker to use brute force on long-standing DH public-key parameters Ephemeral Diffie-Hellman Ephemeral DH public-key parameters are exchanged They can vary from session to session. More robust to brute force. They are signed using the sender's private RSA key Resists to man-in-the-middle thanks to this authentication of public-key parameters Sender should have a secret RSA key to sign So, client needs a certified RSA key too! 5: Securing TCP connections 35 Master secret and keys The previous phases have generated a pre-master secret Key chosen and sent encrypted to the server (with RSA) Or, the DH secret key The master secret is generated (via pseudo randomnumber generator) from The pre-master secret The two nonces (R A and R B ) exchanged in the client_hello and server_hello messages Makes it possible to use the same pre-master secret for several sessions (useful for Anonymous and Fixed DH, for example) Six keys are derived from this master secret: Secret key used with MAC (for data sent by server) Secret key used with MAC (for data sent by client) Secret key and IV used for encryption (by server) Secret key and IV used for encryption (by client) 5: Securing TCP connections 36 18

Server Gated Cryptography (SGC) The US allows an exported client to use strong crypto when talking to some servers doing financial transactions Those servers have an SGC certificate signed by Verisign (trusted by the Government, which turns out to be the real matter!) This is wired in the implementation Other trust authorities can be modified by the user Start with weak (exportable) cryptography, and then upgrade to strong cryptography if the server has an SGC certificate The SGC certificate is discovered in phase 2 only The client continues with a second handshake protected by the first master secret Use Change_Cipher_Spec to switch to strong crypto This does not require the server to run any special SGC code From From Network Computer Security, Networking, by Kaufman by et al. Kurose&Ross Pearsons 5: Securing TCP connections 37 SSL Alert Protocol This protocol is used to report errors Examples Unexpected message Bad record MAC Decompression failure Handshake failure (i.e. security parameters negotiation failed) Illegal parameters It is also used for other purposes Examples To notify closure of the TCP connection To notify the absence of certificate (when requested) To notify that a bad or unknown certificate was received To notify that a certificate is revoked or has expired 5: Securing TCP connections 38 19

Pros and Cons of Transport Layer Security Pros Transport Layer Security is transparent to applications Server is authenticated (if client s browser correctly configured with trusted CAs to check server s certificate) Application layer headers are hidden OK for direct client to server communication More fine-grained than IPSec (see later) because it works at the transport connection level Cons TCP/IP headers are in clear Only applicable to secure TCP-based applications (not UDP) Not enough to secure applications using intermediate servers and a chain of TCP connections (e.g. email) Nonrepudiation not provided by SSL Client authentication, if needed, must be implemented above SSL (e.g. username and password sent over the SSL connection) or client must have a certificate too 5: Securing TCP connections 39 20