SSL: Secure Sockets Layer

Slides:



Advertisements
Similar presentations
Web security: SSL and TLS
Advertisements

Internet and Intranet Protocols and Applications Lecture 9a: Secure Sockets Layer (SSL) March, 2004 Arthur Goldberg Computer Science Department New York.
1 Lecture 17: SSL/TLS history, architecture basic handshake session initiation/resumption key computation negotiating cipher suites application: SET.
1 Lecture 12 SSL/TLS (Secure Sockets Layer / Transport Layer Security) CIS CIS 5357 Network Security.
Lecture 6: Web security: SSL
TLS Introduction 14.2 TLS Record Protocol 14.3 TLS Handshake Protocol 14.4 Summary.
SMUCSE 5349/49 SSL/TLS. SMUCSE 5349/7349 Layers of Security.
Cryptography and Network Security
Secure Socket Layer.
SSL CS772 Fall Secure Socket layer Design Goals: SSLv2) SSL should work well with the main web protocols such as HTTP. Confidentiality is the top.
Lecture 7: Transport Level Security – SSL/TLS CS 336/536: Computer Network Security Fall 2013 Nitesh Saxena Adopted from previous lecture by Tony Barnard.
Socket Layer Security. In this Presentation: need for web security SSL/TLS transport layer security protocols HTTPS secure shell (SSH)
Web Security (SSL / TLS)
Working Connection Computer and Network Security - SSL, IPsec, Firewalls – (Chapter 17, 18, 19, and 23)
7-1 Chapter 7 – Web Security Use your mentality Wake up to reality —From the song, "I've Got You under My Skin“ by Cole Porter.
An Introduction to Secure Sockets Layer (SSL). Overview Types of encryption SSL History Design Goals Protocol Problems Competing Technologies.
1 SSL/TLS 2 Web security Security requirements Secrecy to prevent eavesdroppers to learn sensitive information Entity authentication Message authentication.
COMP043-Cryptology Week 4 – Certs and Sigs. Digital Signatures Digital signatures provide –Integrity –Authenticity and –Non-repudiation How do they work?
Transport Layer Security (TLS) Protocol Introduction to networks and communications(CS555) Prof : Dr Kurt maly Student:Abhinav y.
8-1 Chapter 8 Security Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
BASIC CRYPTOGRAPHY CONCEPT. Secure Socket Layer (SSL)  SSL was first used by Netscape.  To ensure security of data sent through HTTP, LDAP or POP3.
Lecture 24 Secure Communications CPE 401 / 601 Computer Network Systems Slides are modified from Jim Kurose & Keith Ross.
Mar 19, 2002Mårten Trolin1 This lecture On the assignment Certificates and key management SSL/TLS –Introduction –Phases –Commands.
Apr 2, 2002Mårten Trolin1 Previous lecture On the assignment Certificates and key management –Obtaining a certificate –Verifying a certificate –Certificate.
0 SSL3.0 / TLS1.0 Secure Communication over Insecure Line.
Chapter 8 Web Security.
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.
11 Secure Sockets Layer (SSL) Protocol (SSL) Protocol Saturday, University of Palestine Applied and Urban Engineering College Information Security.
SSL and https for Secure Web Communication CSCI 5857: Encoding and Encryption.
Secure Socket Layer (SSL)
SSL / TLS in ITDS Arun Vishwanathan 23 rd Dec 2003.
Behzad Akbari Spring 2012 (These slides are based on lecture slides by Lawrie Brown)
Introduction to Secure Sockets Layer (SSL) Protocol Based on:
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
Cryptography and Network Security (CS435) Part Fourteen (Web Security)
Web Security : Secure Socket Layer Secure Electronic Transaction.
Secure Sockets Layer (SSL) and Transport layer security (TLS)
8-1 Chapter 8 Security Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 part 3: Securing TCP.
1 Security Protocols in the Internet Source: Chapter 31 Data Communications & Networking Forouzan Third Edition.
SARVAJANIK COLLEGE OF ENGINEERING & TECHNOLOGY. Secure Sockets Layer (SSL) Protocol Presented By Shivangi Modi Presented By Shivangi ModiCo-M(Shift-1)En.No
SSL (TLS) Part 2 Generating the Premaster and Master Secrets + Encryption.
SMUCSE 5349/7349 SSL/TLS. SMUCSE 5349/7349 Layers of Security.
Secure Sockets Layer (SSL) Protocol by Steven Giovenco.
1 SSL/TLS. 2 Web security Security requirements Secrecy to prevent eavesdroppers to learn sensitive information Entity authentication Message authentication.
Mar 28, 2003Mårten Trolin1 This lecture Certificates and key management Non-interactive protocols –PGP SSL/TLS –Introduction –Phases –Commands.
1 Secure Socket Layer Originally by Yu Yang and Lilly Wang Originally by Yu Yang and Lilly Wang Modified by T. A. Yang Modified by T. A. Yang.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
8-1 CSE 4707/5850 Network Security (2) SSL/TLS. 8-2 Think about Google or YouTube  Desired properties  Indeed the other side is Google or YouTube server.
@Yuan Xue CS 285 Network Security Secure Socket Layer Yuan Xue Fall 2013.
Cryptography CSS 329 Lecture 13:SSL.
Page 1 of 17 M. Ufuk Caglayan, CmpE 476 Spring 2000, SSL and SET Notes, March 29, 2000 CmpE 476 Spring 2000 Notes on SSL and SET Dr. M. Ufuk Caglayan Department.
Chapter 8 Security Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these ppt.
8: Network Security8-1 Chapter 8 Network Security (some reviews and security protocols) These ppt slides are originally from the Kurose and Ross’s book.
Apr 1, 2003Mårten Trolin1 Previous lecture Certificates and key management Non-interactive protocols –PGP SSL/TLS –Introduction –Phases –Commands.
Real Security Protocols 1. Securing 2. Securing TCP connections: SSL 3. Network layer security: IPsec 4. Securing wireless LANs Computer Networking:
Public Key Cryptography
Secure Sockets Layer (SSL)
CSCE 715: Network Systems Security
Originally by Yu Yang and Lilly Wang Modified by T. A. Yang
CSE 4095 Transport Layer Security TLS, Part II
CSE 4095 Transport Layer Security TLS
Encryption INST 346, Section 0201 April 3, 2018.
Security at the Transport Layer
Presentation transcript:

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 Originally designed by Netscape in 1993 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

SSL and TCP/IP Application Application SSL TCP TCP IP IP Normal Application Application SSL TCP IP with SSL SSL provides application programming interface (API) to applications C and Java SSL libraries/classes readily available

Could do something like PGP: KA - H( ) . KA( ) . - KA(H(m)) - m KS KS( ) . + + m Internet KB( ) . + KS KB(KS ) + KB + 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

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

Toy: A simple handshake hello certificate KB+(MS) = EMS MS = master secret EMS = encrypted master secret

RECALL: Certification Authorities When Alice wants Bob’s public key: gets Bob’s certificate (Bob or elsewhere). apply CA’s public key to Bob’s certificate, get Bob’s public key K B + digital signature (decrypt) Bob’s public key K B + Bob’s Certificate CA public key + K CA

Toy: Key derivation Considered bad to use same key for more than one cryptographic operation Use different keys for message authentication code (MAC) and encryption Four keys: Kc = encryption key for data sent from client to server Mc = MAC key for data sent from client to server Ks = encryption key for data sent from server to client Ms = MAC key for data sent from server to client Keys derived from key derivation function (KDF) Takes master secret and (possibly) some additional random data and creates the keys

Recall MAC s = shared secret s message compare H( ) Recall that HMAC is a standardized MAC algorithm SSL uses a variation of HMAC TLS uses HMAC

Toy: Data Records 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

Toy: Sequence Numbers Attacker can capture and replay record or re-order records Solution: put sequence number into MAC: MAC = MAC(Mx, sequence||data) Note: no sequence number field Attacker could still replay all of the records Use random nonce

Toy: Control information 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(Mx, sequence||type||data) length type data MAC

Short Question: In the SSL record, there is a field for SSL seq. numbers? True or False? False. Both sides maintain Seq. no independently.

Toy SSL: summary hello certificate, nonce KB+(MS) = EMS type 0, seq 1, data type 0, seq 2, data type 0, seq 3, data type 1, seq 4, close type 1, seq 2, close bob.com encrypted

Question Suppose Seq. number is NOT used. Question: In an SSL session, Can Trudy (woman-in-the-middle) delete a TCP segment? Question: What effect will it have?

Question Suppose Seq. number is USED. In an SSL session, an attacker inserts a bogus TCP segment into a packet stream with correct TCP checksum and seq. no. Question: Will SSL at the receiving side accept bogus packet and pass the payload to upper-level? FALSE, Mx is used for MAC calculation.

Question. KDC KDC (Key Distribution Center): a server that shares a unique secret symmetric key with each registered user. KA-KDC, KB-KDC Can session key be distributed using KDC? S 1. KA-KDC(A,B) 2. KA-KDC(S, KB-KDC(A,S)) 3. KB-KDC(A,S) A B

Toy SSL isn’t complete How long are the fields? What encryption protocols? No negotiation Allow client and server to support different encryption algorithms Allow client and server to choose together specific algorithm before data transfer

Most common symmetric ciphers in SSL DES – Data Encryption Standard: block 3DES – Triple strength: block RC2 – Rivest Cipher 2: block RC4 – Rivest Cipher 4: stream Public key encryption RSA

SSL Cipher Suite Cipher Suite SSL supports a variety of cipher suites Public-key algorithm Symmetric encryption algorithm MAC algorithm SSL supports a variety of cipher suites Negotiation: client and server must agree on cipher suite Client offers choice; server picks one

Real SSL: Handshake (1) Purpose Server authentication Negotiation: agree on crypto algorithms Establish keys Client authentication (optional)

Real SSL: Handshake (2) Client sends list of algorithms it supports, along with client nonce Server chooses algorithms from list; sends back: choice + certificate + server nonce Client verifies certificate, extracts server’s public key, generates pre_master_secret, encrypts with server’s public key, sends to server Client and server independently compute encryption and MAC keys from pre_master_secret and nonces Client sends a MAC of all the handshake messages Server sends a MAC of all the handshake messages

Real SSL: Handshaking (3) Last 2 steps protect handshake from tampering Client typically offers range of algorithms, some strong, some weak Man-in-the middle could delete the stronger algorithms from list Last 2 steps prevent this Last two messages are encrypted

Real SSL: Handshaking (4) 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 keys to be different on the two days. Trudy’s messages will fail Bob’s integrity check.

Handshake types All handshake messages (with SSL header) have 1 byte type field: Types ClientHello ServerHello Certificate ServerKeyExchange CertificateRequest ServerHelloDone CertificateVerify ClientKeyExchange Finished

SSL Protocol Stack

SSL Record Protocol data MAC fragment encrypted data and MAC header record header: content type; version; length MAC: includes sequence number, MAC key Mx Fragment: each SSL fragment 214 bytes (~16 Kbytes)

SSL Record Format content type SSL version length MAC data 1 byte 2 bytes 3 bytes Data and MAC encrypted (symmetric algo)

Content types in record header application_data (23) alert (21) signaling errors during handshake handshake (22) initial handshake messages are carried in records of type “handshake” Hankshake messages in turn have their own “sub” types change_cipher_spec (20) indicates change in encryption and authentication algorithms

Real Connection Everything henceforth is encrypted TCP Fin follow handshake: ClientHello handshake: ServerHello handshake: Certificate handshake: ServerHelloDone handshake: ClientKeyExchange ChangeCipherSpec handshake: Finished application_data Alert: warning, close_notify Everything henceforth is encrypted TCP Fin follow

Short Question In which step of SSL handshake, can Alice discover that she is not talking with Bob? handshake: ClientHello handshake: ServerHello Bob’s certificate Alice Trudy Bob handshake: ClientKeyExchange ChangeCipherSpec handshake: Finished

P19. Packet 112 sent by client or server? Server IP and port? What is the seq. no of the next TCP segment sent by client? Client 216.75.194.220 443(https) 79 (seq) + 204 (len) = 283

P19. d) Does packet 112 contain a Master Secret? e) Assume HandShake type field is 1 byte, each length field is 3 bytes, what are the values of the first / last bytes of Master Secret? Yes First: bc; Last: 29

Key derivation Client nonce, server nonce, and pre-master secret input into pseudo random-number generator. Produces master secret Master secret and new nonces inputed into another random-number generator: “key block” Because of session resumption: Talk later. Key block sliced and diced: client MAC key server MAC key client encryption key server encryption key client initialization vector (IV) server initialization vector (IV)

RECALL: Cipher Block Chaining (CBC) CBC generates its own random numbers Have encryption of current block depend on result of previous block c(i) = KS( m(i)  c(i-1) ) m(i) = KS( c(i))  c(i-1) How do we encrypt first block? Initialization vector (IV): random block = c(0) IV does not have to be secret Change IV for each message (or session) Guarantees that even if the same message is sent repeatedly, the ciphertext will be completely different each time

Short Question: Suppose an SSL session employs a block cipher with CBC (cipher block chaining). The server sends Initialization Vector (VI) in clear-text? True or False? False. Each side can derive it.

Short Question: What is the purpose of random nonces in SSL handshake? Defend against Playback Attack

SSL Performance Big-number operations in public-key crypto are CPU intensive Server handshake Typically over half SSL handshake CPU time goes to RSA decryption of the encrypted pre_master_secret Client handshake Public key encryption is less expensive Server is handshake bottleneck Data transfer Symmetric encryption MAC calculation Neither as CPU intensive as public-key decryption

Session resumption Full handshake is expensive: CPU time and number of RTTs If the client and server have already communicated once, they can skip handshake and proceed directly to data transfer For a given session, client and server store session_id, master_secret, negotiated ciphers Client sends session_id in ClientHello Server then agrees to resume in ServerHello New key_block computed from master_secret and client and server random numbers

Client authentication SSL can also authenticate client Server sends a CertificateRequest message to client