What is SSL / TLS? Transport Layer Security protocol, ver 1.0 –De facto standard for Internet security –“The primary goal of the TLS protocol is to provide privacy and data integrity between two communicating applications” –In practice, used to protect information transmitted between browsers and Web servers Based on Secure Sockets Layers protocol, ver 3.0 –Same protocol design, different algorithms Deployed in nearly every web browser
History of the Protocol The SSL protocol was originally developed by Netscape. Version 1.0 was never publicly released. Version 2.0 was released in 1994 but "contained a number of security flaws which ultimately led to the design of SSL version 3.0", which was released in 1996. This later served as the basis for TLS version 1.0, an IETF standard protocol first defined in RFC 2246 in January 1999.
History of the Protocol SSL 1.0 –Internal Netscape design, early 1994? –Lost in the mists of time SSL 2.0 –Published by Netscape, November 1994 –Badly broken SSL 3.0 –Designed by Netscape and Paul Kocher, November 1996 TLS 1.0 –Internet standard based on SSL 3.0, January 1999 –Not interoperable with SSL 3.0 TLS 1.1 –Update of TLS 1.0, April 2006 –Basically added protection to some attacks (IV, padding) TLS 1.2 –August 2008 (refined 2011 – no SSL 2.0 compatibility) –AES support, replacement of MD5/SHA1 with SHA256
Flaws of SSL v2 Identical cryptographic keys are used for message authentication and encryption. SSL v2 has a weak MAC construction that uses the MD5 hash function with a secret prefix, making it vulnerable to length extension attacks. SSL v2 does not have any protection for the handshake, meaning a man-in- the-middle downgrade attack can go undetected. SSL v2 uses the TCP connection close to indicate the end of data. This means that truncation attacks are possible: the attacker simply forges a TCP FIN, leaving the recipient unaware of an illegitimate end of data message (SSL v3 fixes this problem by having an explicit closure alert). SSL v2 assumes a single service, and a fixed domain certificate, which clashes with the standard feature of virtual hosting in webservers. This means that most websites are practically impaired from using SSL..
TLS 1.0 – BEAST attack On September 23, 2011 researchers Thai Duong and Juliano Rizzo demonstrated a "proof of concept" called BEAST ("Browser Exploit Against SSL/TLS") using a Java applet to violate same origin policy constraints, for a long-known Cipher block chaining (CBC) vulnerability in TLS 1.0. Practical exploits had not been previously demonstrated for this vulnerability, which was originally discovered by Phillip Rogaway in 2002. Mozilla updated the development versions of their NSS libraries to mitigate BEAST-like attacks. NSS is used by Mozilla Firefox and Google Chrome to implement SSL. Some web servers that have a broken implementation of the SSL specification may stop working as a result. Microsoft released Security Bulletin MS12-006 on January 10, 2012, which fixed the BEAST vulnerability by changing the way that the Windows Secure Channel (SChannel) component transmits encrypted network packets.
TLS 1.0 – BEAST attack CBC chaining (above) IV for each block depends from previous encrypted value, so there is a practical attack provided that there is a reliable “oracle” reporting padding errors. As it seems attack can be used to recover information from encrypted cookies. TLS 1.1+ uses “explicit IV” for each block.
A third-party authentication protocol designed for TCP/IP networks. Developed at MIT. Not in public domain, but in principle it is possible to obtain it for free.
SSL/TLS Some modifications of HTTP still required though - HTTPS (Hypertext Transfer Protocol Secure )
Kerberos A third-party authentication protocol designed for TCP/IP networks Developed at MIT Uses Needham-Schroeder’s trusted third party protocol Not in public domain, but in principle it is possible to obtain it for free
TLS Basics TLS consists of two protocols Handshake protocol –Use public-key cryptography to establish a shared secret key between the client and the server Record protocol –Use the secret key established in the handshake protocol to protect communication between the client and the server
TLS architecure HANDLES COMMUNICATION WITH THE APPLICATION Protocols INITIALIZES COMMUNCATION BETWEEN CLIENT & SERVER INITIALIZES SECURE COMMUNICATION HANDLES DATA COMPRESSION ERROR HANDLING
TLS Handshake Protocol Two parties: client and server Negotiate version of the protocol and the set of cryptographic algorithms to be used –Interoperability between different implementations of the protocol Authenticate client and server (optional) –Use digital certificates to learn each other’s public keys and verify each other’s identity Use public keys to establish a shared secret
Handshake Phases Hello messages Certificate and Key Exchange messages Change CipherSpec and Finished messages
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
RC4 Ron Rivest (RSA Security) 1987 Widely used in SSL, WEP etc 104-bit RC4 used in WEP can be cracked in less than a minute for i=0,…,N-1 S[i]=i j=0 for i=0…N-1 j=j+S[i]+Key[i mod l] Swap[S[i], S[j]] i=i+1 j=j+S[i] Swap(S[i],S[j]) Output z =S[S[i]+S[j]]
RC4 Easy computation –Fast –Can use large bit blocks and keys Stream based encryption Key can be made to change at regular intervals using fancy programming Implementation in Popular languages (C, perl) well documented. Vulnerable to brute force attacks Require a large data structure Proven Breakable by researchers at ATT and Rice Univ. (August, 2001) –“One hour of brute force computation to break standard WEP” Once Key is broken all messages are easily readable.
RC2 RC2 is a block cipher designed by Ron Rivest in 1987. RC2 is a 64-bit block cipher with a variable size key. Its 18 rounds are arranged as a source-heavy Feistel network, with 16 rounds of one type (MIXING) punctuated by two rounds of another type (MASHING). A MIXING round consists of four applications of the MIX transformation (shown in the diagram). RC2 is vulnerable to related-key attack using 2 34 chosen plaintexts.
Fortezza The Fortezza card is becoming wider in use in Government and Military applications due to the fact that the cards are interchangeable within the many types of equipment that support Fortezza. Likewise, this means that the parties that program the Fortezza cards are able to program the cards and ship them out so organizations may use them in whatever equipment they need to use it for. This simplifies the process of rekeying equipment for Crypto changes: instead of requiring an expensive Fill device, a technician is able to put a new Fortezza card in the device's PCMCIA slot.
Skipjack Skipjack was proposed as the encryption algorithm in a US government-sponsored scheme of key escrow, and the cipher was provided for use in the Clipper chip, implemented in tamperproof hardware. Skipjack is used only for encryption, the key escrow is achieved through the use of a separate mechanism known as the Law Enforcement Access Field (LEAF). The design was initially secret, and was regarded with considerable suspicion by many in the public cryptography community for that reason. It was declassified on 24 June 1998.
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: A client can be used to send an oversized master key to an SSLv2 server, enabling denial of service or malicious code execution on the server.
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
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 Standard was developed starting from 1988. Standard defined in RFC 5280 (Public Key Infrastructure Certificate)
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)
Sample certificate This picture shows how Internet Explorer shows the contents of a certificate. Note that the CN field contains the host name of the server.
Certificate authorities Worldwide, the certificate authority business is fragmented, with national or regional providers dominating their home market. This is because many uses of digital certificates, such as for legally binding digital signatures, are linked to local law, regulations, and accreditation schemes for certificate authorities. However, the market for SSL certificates (used for website security) supports a number of multinational companies. A 2007 market share report from Security Space as of September of that year determined that Symantec (owns VeriSign, Thawte and Geotrust) have a 42.9% share of the certificate authority market, followed by Comodo (26%), GoDaddy (14%), GlobalSign (7.7%). (% updated as of Nov. 2012)
Certificate authorities Currently there are at least four providers issuing digital certificates to the public at no cost: CAcert.org - The Root CA is not included in Mozilla and Microsoft CA ring. Comodo "Free SSL Certificates provide full Secure Sockets Layer functionality for 90 days.“ (Options apparently still exist, but information above is likely out of date.)
Certificate authorities Currently there are at least four providers issuing digital certificates to the public at no cost: Thawte offers personal e-mail certificates that "can be used indefinitely at no cost"; it isn't stated whether the certificates never expire, or they do expire but can be renewed for free. (Thawte has issued certificates in the past that expire on an annual basis but can be renewed at no charge.) Thawte also offers 21-day free trial SSL certificates. StartCom - Microsoft has not included the Root CA in Explorer ring.
Abstract syntax notation (ASN.1) In telecommunications and computer networking, Abstract Syntax Notation One (ASN.1) is a standard and flexible notation that describes data structures for representing, encoding, transmitting, and decoding data. It provides a set of formal rules for describing the structure of objects that are independent of machine-specific encoding techniques and is a precise, formal notation that removes ambiguities. Eric Recorla: Falls in category of “highly unpleasant things that it is sometimes necessary to know”
Abstract syntax notation (ASN.1) ASN.1 defines the abstract syntax of information but does not restrict the way the information is encoded. Various ASN.1 encoding rules provide the transfer syntax (a concrete representation) of the data values whose abstract syntax is described in ASN.1. The standard ASN.1 encoding rules include: Basic Encoding Rules (BER) Canonical Encoding Rules (CER) Distinguished Encoding Rules (DER) XML Encoding Rules (XER) Packed Encoding Rules (PER) Generic String Encoding Rules (GSER)
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
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
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
Record Protocol (cont’d) Max. record length 2 14 – 1 MAC –Data –Headers –Sequence number To prevent replay and reordering attack Not included in the record
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)
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
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
IPsec – what protocols/algorithms does it provide? U AH/ESP looks more like just more like standards for packet formats, not really protocol. Generally support for hashing and symmetric algorithms. IKE – Key Exchange Algorithm (typically Diffie –Hellman scheme, maybe RSA). Doesn’t provide initial authetication(?) Apparently relies on external authentication protocols (X.509 certificates, keys stored on smartcards etc) (???) Any of these will require some kind of PKI.