Agenda What is a secure channel? Short theoretical interlude

Slides:



Advertisements
Similar presentations
IP Security have considered some application specific security mechanisms –eg. S/MIME, PGP, Kerberos, SSL/HTTPS however there are security concerns that.
Advertisements

Internet Protocol Security (IP Sec)
Block Cipher Modes of Operation and Stream Ciphers
Cryptography and Network Security Chapter 16
CS470, A.SelcukIPsec – AH & ESP1 CS 470 Introduction to Applied Cryptography Instructor: Ali Aydin Selcuk.
Umut Girit  One of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer.
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.
Socket Layer Security. In this Presentation: need for web security SSL/TLS transport layer security protocols HTTPS secure shell (SSH)
BASIC CRYPTOGRAPHY CONCEPT. Secure Socket Layer (SSL)  SSL was first used by Netscape.  To ensure security of data sent through HTTP, LDAP or POP3.
Information System Security AABFS-Jordan Summer 2006 IP Security Supervisor :Dr. Lo'ai Ali Tawalbeh Done by: Wa’el Musa Hadi.
ECE 454/CS 594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall.
1 Lecture 15: IPsec AH and ESP IPsec introduction: uses and modes IPsec concepts –security association –security policy database IPsec headers –authentication.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
16-1 Last time Internet Application Security and Privacy Authentication Security controls using cryptography Link-layer security: WEP.
Guide to Network Defense and Countermeasures Second Edition
SSH: An Internet Protocol By Anja Kastl IS World Wide Web Standards.
K. Salah 1 Chapter 31 Security in the Internet. K. Salah 2 Figure 31.5 Position of TLS Transport Layer Security (TLS) was designed to provide security.
Lesson 11-Virtual Private Networks. Overview Define Virtual Private Networks (VPNs). Deploy User VPNs. Deploy Site VPNs. Understand standard VPN techniques.
Encapsulation Security Payload Protocol Lan Vu. OUTLINE 1.Introduction and terms 2.ESP Overview 3.ESP Packet Format 4.ESP Fields 5.ESP Modes 6.ESP packet.
Securing TCP/IP Chapter 6. Introduction to Transmission Control Protocol/Internet Protocol (TCP/IP) TCP/IP comprises a suite of four protocols The protocols.
K. Salah1 Security Protocols in the Internet IPSec.
Faten Yahya Ismael.  It is technology creates a network that is physically public, but virtually it’s private.  A virtual private network (VPN) is a.
What is in Presentation What is IPsec Why is IPsec Important IPsec Protocols IPsec Architecture How to Implement IPsec in linux.
8: Network Security8-1 Security in the layers. 8: Network Security8-2 Secure sockets layer (SSL) r Transport layer security to any TCP- based app using.
SYSTEM ADMINISTRATION Chapter 13 Security Protocols.
Secure Socket Layer (SSL)
Chapter 13 – Network Security
Behzad Akbari Spring 2012 (These slides are based on lecture slides by Lawrie Brown)
Cosc 4765 SSL/TLS and VPN. SSL and TLS We can apply this generally, but also from a prospective of web services. Multi-layered: –S-http (secure http),
CSCE 715: Network Systems Security
Network Security Essentials Chapter 5
Cryptography and Network Security (CS435) Part Fourteen (Web Security)
IPSec IPSec provides the capability to secure communications across a LAN, across private and public wide area networks (WANs) and across the Internet.
Lecture 11 Page 1 Advanced Network Security Cryptography and Networks: IPSec and SSL/TLS Advanced Network Security Peter Reiher August, 2014.
1 Security Protocols in the Internet Source: Chapter 31 Data Communications & Networking Forouzan Third Edition.
Karlstad University IP security Ge Zhang
1 Plaintext Recovery Attacks Against SSH Kenny Paterson Information Security Group Royal Holloway, University of London Joint.
IPsec IPsec (IP security) Security for transmission over IP networks –The Internet –Internal corporate IP networks –IP packets sent over public switched.
IPsec Introduction 18.2 Security associations 18.3 Internet Security Association and Key Management Protocol (ISAKMP) 18.4 Internet Key Exchange.
11 SECURING NETWORK COMMUNICATION Chapter 9. Chapter 9: SECURING NETWORK COMMUNICATION2 OVERVIEW  List the major threats to network communications. 
IPSec ● IP Security ● Layer 3 security architecture ● Enables VPN ● Delivers authentication, integrity and secrecy ● Implemented in Linux, Cisco, Windows.
IP Security: Security Across the Protocol Stack. IP Security There are some application specific security mechanisms –eg. S/MIME, PGP, Kerberos, SSL/HTTPS.
1 CMPT 471 Networking II Authentication and Encryption © Janice Regan,
IP security Ge Zhang Packet-switched network is not Secure! The protocols were designed in the late 70s to early 80s –Very small network.
INFORMATION SECURITY MANAGEMENT P ROTECTION M ECHANISMS - C RYPTOGRAPHY.
Template vertLeftWhite2 Authenticated Encryption Attacking non-atomic decryption Online Cryptography Course Dan Boneh.
Network and Internet Security Prepared by Dr. Lamiaa Elshenawy
IPSec is a suite of protocols defined by the Internet Engineering Task Force (IETF) to provide security services at the network layer. standard protocol.
INFORMATION SECURITY MANAGEMENT P ROTECTION M ECHANISMS - C RYPTOGRAPHY.
K. Salah1 Security Protocols in the Internet IPSec.
Securing Access to Data Using IPsec Josh Jones Cosc352.
Lecture 6 (Chapter 16,17,18) Network and Internet Security Prepared by Dr. Lamiaa M. Elshenawy 1.
@Yuan Xue CS 285 Network Security Secure Socket Layer Yuan Xue Fall 2013.
8-1Network Security Virtual Private Networks (VPNs) motivation:  institutions often want private networks for security.  costly: separate routers, links,
IP Security (IPSec) Encapsulating Security Payload (ESP) Dr Milan Marković.
IPSec Detailed Description and VPN
CSE 4905 IPsec.
Encryption and Network Security
Chapter 18 IP Security  IP Security (IPSec)
Secure Sockets Layer (SSL)
Originally by Yu Yang and Lilly Wang Modified by T. A. Yang
Outline Using cryptography in networks IPSec SSL and TLS.
Cryptography Lecture 11.
Lecture 36.
Lecture 36.
Presentation transcript:

Cryptography And Secure Channels Kenny Paterson Information Security Group Royal Holloway, University of London 05/22/09 | Cryp-203

Agenda What is a secure channel? Short theoretical interlude Why encryption alone is not enough Why ad hoc approaches to building secure channels may be dangerous Why the order of encryption and integrity protection matters Conclusions

What is a secure channel?

The Secure Channel Concept We often want to guarantee the confidentiality and integrity of data travelling over insecure networks. Applications: Branch office connectivity. Connecting to business partners at remote site. Remote access for employees. Remote administration of network devices and servers. E-commerce: protecting credit card numbers in transactions. Secure file transfers. …

The Secure Channel Concept Achieved by building a secure channel. Typically this secure channel will offer: Data origin authentication Data integrity Confidentiality Anti-replay But usually not: Non-repudiation Any security services once data has been received

The Secure Channel Concept Secure channels are usually constructed as follows: An authenticated key establishment protocol. During this one or both parties is authenticated and a fresh, shared secret is established. Using asymmetric (public key) or symmetric cryptography, or a combination of the two. A key derivation phase. MAC and encryption keys are derived from the shared secret established during protocol. And then further traffic protected using derived keys. MAC gives data integrity mechanism and data origin authentication. Encryption gives confidentiality. Using symmetric cryptography for speed.

IPsec, SSL/TLS and SSH Three commonly used protocols for building secure channels All three use an authenticated key establishment protocol followed by key derivation. IKE and IKEv2 in IPsec. Handshake Protocol in SSL/TLS. Authentication Protocol in SSH. All three then use these keys with symmetric algorithms to build a secure channel. With subtle but important differences in the approaches taken.

This Talk In this talk, we will: Examine how each of IPsec, SSL/TLS and SSH use symmetric key cryptography to provide secure channels. Key establishment and key derivation are out of scope for this talk. Discuss each in relation to our current theoretical knowledge. Highlight some of the pitfalls in the design and implementation of these protocol families. Identify open research problems for the design of secure channels.

Short Theoretical Interlude

Short Theoretical Interlude Security models for symmetric encryption are well established. IND-CPA security: Attacker has no access to decryption oracle, but has access to encryption oracle. Attacker has to decide which one of two selected messages was encrypted by the challenger. Easy to achieve with, e.g. block cipher in CBC mode with random IVs, or block cipher in CTR mode. See Bellare et al., FOCS’97. IND-CCA security: Attacker now has access to encryption and decryption oracles. All basic modes of operation are insecure in this model.

Short Theoretical Interlude IND-CCA security from generic constructions (Bellare and Namprempre): Encrypt-then-MAC: SECURE As used by IPsec ESP enc+auth. Encrypt-and-MAC: INSECURE MAC can leak plaintext information. But specific instantiations may be provably secure, e.g. as used in SSH (Bellare, Kohno and Namprempre) or Kerberos (Boldyreva and Kumar). MAC-then-Encrypt: INSECURE But MAC followed by CBC mode encryption or stream cipher is IND-CCA secure (Krawczyk). As used by SSL/TLS. Also available: dedicated authenticated encryption algorithms – e.g. CCM, EAX, GCM, OCB.

Why encryption alone is not enough – IPsec

Encryption in IPsec IPsec provides security at the IP layer. Cryptographic protection of IP packets and their payloads. Widely used in VPNs and remote access systems. ESP = Encapsulating Security Protocol. v1, v2, v3 in IETF RFCs 1827, 2406, 4303. IPsec’s “encryption workhorse”. ESP provides one or both of: Confidentiality for packet/payload (v1, v2, v3). Integrity protection for packet/payload (v2, v3). ESP uses symmetric encryption and MACs. Usually CBC mode of block cipher for encryption. HMAC-SHA1 and HMAC-MD5 for integrity protection.

ESP in Tunnel Mode Encrypt MAC Original IP packet Inner IP header ESP trailer Inner payload Encrypt Encrypted inner packet ESP header MAC MAC tag Outer IP header ESP header Encrypted inner packet Encrypt-then-MAC construction, generically secure. ESP trailer contains padding, pad length and next header field. ESP commonly uses a block cipher in CBC mode for encryption. CINS/F1-01

CBC Mode – Reminder Typical block size n: 64 bits (DES, triple DES) or 128 bits (AES). Typical key size: 56 bits (DES), 168 bits (triple DES), 128, 192 or 256 bits (AES). eK eK Ci-1 Ci Ci-1 Ci Pi-1 Pi dK

Integrity Protection and ESPv1 ESPv1 (RFC 1827) provided no integrity protection. Reliant on separate AH protocol to provide this. Original IP packet Inner IP header ESP trailer Inner payload Encrypt Encrypted inner packet Outer IP header ESP header

Integrity Protection and ESPv1 Bellovin-Wagner attack on ESPv1 without AH: Limited plaintext recovery: One byte of plaintext from each TCP segment. Requires ciphertexts matching 224 chosen plaintexts. Requires receiver to ignore encryption padding format. Attack fails if padding check carried out upon decryption. Requirements can be reduced to 28 chosen plaintexts if variable length padding acceptable.

Integrity Protection and ESPv2 IETF response to Bellovin-Wagner: ESPv2 (RFC 2406) recommends receiver should check format of encryption padding. Sufficient to stop Bellovin-Wagner attack. Also includes integrity protection as an option. But implementations MUST still support “encryption-only” mode. ESPv2 represents a compromise between improving security and maintaining backwards-compatibility.

Integrity Protection and ESPv3 ESPv3 (RFC 4303): Still allows encryption-only ESP: “ESP allows encryption-only … because this may offer considerably better performance and still provide adequate security, e.g., when higher layer authentication/integrity protection is offered independently.” Implying a MAC-then-encrypt construction. But no longer requires support for encryption-only modes. Gives strong warnings about Bellovin-Wagner attack and refers to theoretical cryptography literature to motivate need to use integrity protection.

Encryption-only ESP in the Real World The theoretical cryptography community is well aware of the need to carefully combine integrity protection with encryption. To achieve IND-CCA security and so prevent active attacks against confidentiality. It is also well-known amongst IPsec experts that encryption-only configurations should be avoided. Clear warnings against their use in the RFCs. So is there really any problem if encryption-only modes continue to be allowed in the RFCs?

Encryption-only ESP in the Real World Developers are required by RFC 2406 to support encryption-only ESP. Developers rarely pass RFC warnings to end users. Developers don’t properly implement RFCs. End users don’t read RFCs or technical papers. End users might reasonably assume that encryption on its own gives confidentiality. On-line tutorials sometimes do not highlight the dangers of encryption-only IPsec…

Encryption-only ESP in the Real World From the IPsec Tunnel Implementation administrator's guide of a well-known vendor (until very recently): “If you require data confidentiality only in your IPSec tunnel implementation, you should use ESP without authentication. By leaving off the authentication service, you gain some performance speed but lose the authentication service.”

Attacking Encryption-only ESP Paterson and Yau (Eurocrypt 2006): Efficient ciphertext-only, active attacks against encryption-only ESP. Implemented in a realistic lab setting against the Linux implementation. Attacks do not work for implementation strictly following the RFCs. Degabriele and Paterson (IEEE S&P 2007) Ciphertext-only attacks against encryption-only ESP. Less efficient than Linux attacks. But attacks should work for any implementation strictly following the RFCs. Implemented against OpenSolaris implementation.

Bit Flipping in CBC Mode Flipping bits in ciphertext block Ci-1 leads to controlled changes in plaintext block Pi upon decryption. But block Pi-1 is randomised. Flipping bits here Ci-1 Ci dK dK Pi-1 Pi And randomised block here Leads to bit flips here

Attacking Linux ESP Paterson and Yau (Eurocrypt 2006): Exploit bit flipping weakness of CBC mode encryption. Modify headers for inner packets so they produce error messages when processed by IP. Error messages are carried by ICMP and reveal partial plaintext data. Modify headers so that error messages are sent outside of IPsec tunnel. In some variants, straight to attacker’s machine.

Example: Protocol Field Manipulation for 128-bit Blocks Encrypted inner packet IV C1 C2 C3 dK dK dK Flip bits here Dest addr Payload Payload PF Csum Src addr To change protocol field and source address here Inner packet Correction of checksum via further IV bit flips

Example (ctd.) End-host generates ICMP “protocol unreachable” message in response to modified protocol field in header. In Linux, ICMP payload carries inner packet header and up to 528 bytes of inner packet’s payload. Payload now in plaintext form. ICMP message is sent to host indicated in source address. And we have modified this so ICMP message does not pass through IPsec tunnel. Attacker intercepts ICMP message to get plaintext bytes.

Characteristics of Linux Attacks The attacks: Recover complete contents of IPsec-protected datagrams. But not encryption keys. Are efficient. Can be run in near real-time against an IPsec tunnel. Do not require special operating conditions. Attacker needs to capture packets from network, inject packets into network, and monitor gateway for ICMP messages. Work in practice against Linux implementation of IPsec. But not against implementations strictly compliant with the RFCs.

Attacking Linux ESP – Reactions Some reactions to the Linux ESP attacks: “…the possibility of active attacks on unauthenticated but encrypted ESP packets is well known, and we advise against such use in the most recent set of IPsec documents. These documents have been approved for publication by the IESG and are in the queue to be published as RFCs. As a result, no further, substantiative changes will be made.” “This is all very well understood among the IPSec community, and is not news.” “I think the spec is clear about the dangers of encryption without authentication. If anyone built implementations that negotiate encryption without authentication, then maybe they weren't paying attention closely enough.”

Attacking the RFCs – Main Ideas Degabriele and Paterson (IEEE S&P 2007): Extension of Vaudenay’s padding oracle attacks on CBC mode (Eurocrypt 2002) combined with Paterson-Yau techniques. Attack should work if (and only if) implementor has followed all the advice in IPsec RFCs: Check correctness of padding format, as per RFCs 2406, 4303. Post-processing policy checks (omitted in Linux). Resulting attack is less efficient than Linux attack, but still recovers all plaintext. About 216 packet injections to decrypt each block. So are any implementations strict enough?

Implementing the RFC Attack We examined 10 different open-source IPsec implementations: Linux kernel, KAME, OpenBSD, FreeBSD, NetBSD, MacOS X, Openswan, strongSwan, FreeS/WAN, OpenSolaris. All except one (OpenSolaris) failed to follow some of the advice to implementors given in the RFCs. But variants of our attacks could still extract some plaintext data in each case. OpenSolaris closely followed the RFCs but had a bug in the padding check implementation. Once the bug was fixed (Release 55) we were able to break this implementation.

Summary of ESP Attacks We produced a range of attacks against encryption-only ESP that work: Against any implementation strictly following the RFCs, e.g. OpenSolaris. Against many implementations not following the RFCs, e.g. Linux. The attacks that work in practice shouldn’t work against the RFCs. The attacks that work against the RFCs often don’t work in practice.

Final Remarks on IPsec The attacks show that encryption-only ESP is dangerously weak in a practical sense. There are not so many real-world examples where the lack of integrity protection has such devastating consequences. This kind of attack seems necessary to convince practitioners. No security is gained from the provision of upper layer integrity protection, despite claims to the contrary in ESPv3. An appropriate combination of encryption and integrity protection is needed. As provided, for example, by ESP with encryption and integrity protection (Encrypt-then-MAC construction).

Final Remarks on IPsec We cannot view cryptography in isolation. Our ESP attacks arose from interaction between cryptographic processing and network protocols. Sometimes called reaction attacks. Attacks in theory versus attacks in practice. Implementations often deviate from standards (RFCs) in small ways that turn out to be important for security. These deviations can result in big differences between attacks on paper and attacks that work in practice. Our attacker is incomparable with the IND-CPA attacker that is considered in theoretical work.

Why ad hoc approaches to building secure channels may be dangerous – SSH

SSH Secure Shell or SSH is a network protocol that allows data to be exchanged using a secure channel between two networked devices. Used primarily on Linux and Unix based systems to access shell accounts, SSH was designed as a replacement for TELNET and other insecure remote shells, which send information, notably passwords, in plaintext, leaving them open for interception. The encryption used by SSH provides confidentiality and integrity of data over an insecure network, such as the Internet. – Wikipedia CINS/F1-01

SSH SSHv1 had several security flaws. Worst ones arising from use of CRC algorithm to provide integrity. Enabling, for example, traffic injection attacks. SSHv2 was standardised in 2006 by the IETF in RFCs 4251-4254. RFC 4253 specifies the SSH Binary Packet Protocol (BPP). SSHv2 is widely regarded as providing strong security. It is widely used to secure remote administration of sensitive systems. But one minor flaw in the BPP that in theory allows distinguishing attacks (Dai; Bellare, Kohno and Namprempre). Several minor variants of the SSH BPP were proven secure by Bellare, Kohno and Namprempre. E.g. SSH-$NPC: SSH using randomised padding and CBC mode encryption with explicit IVs. This formal security analysis was not integrated with the design phase. CINS/F1-01

The SSH BPP Sequence Number 4 Packet Length Pad Len 1 Padding ≥4 Payload Encrypt MAC Ciphertext MAC tag Encode-then-Encrypt&MAC construction, not generically secure. Packet length field measures the total size of the packet on the wire in bytes and is encrypted to hide the true length of SSH packets. CINS/F1-01

CBC Mode in SSH Pi-1 Pi RFC 4253 mandates 3DES-CBC and recommends AES-CBC. In fact, all originally specified optional configurations involve CBC mode, and ARCFOUR was the only optional stream cipher. SSH uses a chained IV in CBC mode: IV for current packet is the last ciphertext block from the previous packet. Effectively creates a single stream of data from multiple SSH packets. eK eK Ci-1 Ci Ci-1 Ci Pi-1 Pi dK

Attacking the SSH BPP We (Albrecht, Paterson and Watson, IEEE S&P 2009) have recently developed plaintext recovering attacks against SSH. These new attacks exploit the interaction of the following BPP features: The packet length field encodes how much data needs to be received before the MAC is checked. So this field must be decrypted before the MAC is checked, and the amount of data needed to trigger the MAC check depends on the content of this field. The attacker can send data on an SSH connection in small chunks (TCP). CBC mode is mandated. A MAC failure is visible on the network.

Attacking the SSH BPP (Theory) The attacker intercepts a target ciphertext block Ci* from the SSH connection. Ci* = eK(Ci-1*  Pi*), i.e. Pi* = Ci-1*  dK(Ci*) The attacker injects Ci* as the first block of a new SSH packet on the connection. The recipient will treat the first 32 bits of the corresponding plaintext block P0’ as the packet length field. Here: P0’ = IV  dK(Ci*). The attacker then feeds random ciphertext blocks into the SSH connection. One block at a time, waiting to see what happens with each new block.

Attacking the SSH BPP (Theory) Once enough data has arrived, the recipient checks the MAC. This check will fail with overwhelming probability. Consequently the connection is terminated with an error message. How much is enough? The number of random blocks required to trigger this behaviour reveals the content of the 32-bit packet length field, i.e. the first 32 bits of: P0’ = IV  dK(Ci*). Because of CBC mode, this in turn reveals 32 bits of the target plaintext block: Pi* = Ci-1*  dK(Ci*) = Ci-1*  IV  P0’

Attack Performance As described, the attack would succeed in recovering 32 bits of plaintext with probability 1. But would require the injection of about 227 random blocks to trigger the MAC check. And would lead to an SSH connection tear-down. The attack still works if a fresh IV is used for each new SSH packet. Breaking SSH-$NPC that was proven secure by Bellare, Kohno and Namprempre. In practice, things are a bit more complicated….

Attacking OpenSSH OpenSSH is the most popular implementation of the SSH RFCs. Open-source, distributed as part of OpenBSD. OpenSSH webpages state that OpenSSH accounts for more than 80% of all deployed SSH servers. www.openssh.org/usage/index.html We worked with OpenSSH 5.1. Version 5.2 released 23/2/09 partly as a consequence of our work. Main file of interest is packet.c.

Attacking OpenSSH In the OpenSSH implementation, two sanity checks are carried out on the length field after first block is decrypted. When each of the checks fails, the SSH connection is terminated in subtly different ways. If the length checks pass, then when the MAC check fails, a third type of connection termination is seen.

Attacking OpenSSH The manner in which OpenSSH behaves on failure allows: A first attack verifiably recovering 14 bits of plaintext with probability 2-14. A second attack verifiably recovering 32 bits of plaintext with probability 2-18 (for a 128-bit block cipher). Both attacks result in termination of the SSH connection with high probability. The attacks can be iterated to boost success probability if a fixed plaintext is repeated at a fixed position in SSH packets over multiple connections. We implemented the attacks. And they worked.

Impact of the Attacks The attacks recover small amounts of plaintext and have low success probabilities. The attacks are easily circumvented by switching to CTR mode or by modifying error handling in CBC mode. Countermeasures now adopted in OpenSSH release 5.2. So the attacks are of limited practical significance. Yet SSH is meant to be a “bullet-proof” protocol. The fact that quite simple attacks are possible against such an important protocol is troubling.

Theoretical Impact Various flavours of SSH were proven secure by Bellare, Kohno and Namprempre. Including SSH-$NPC – randomised, per-packet IV with random padding field – to which our attacks apply. So what went wrong with the theory? The security model does model errors during the BPP decryption process. Even so, there is a probability 1 distinguishing attack against SSH-$NPC that exploits these errors! But it fails to reflect the fact that the decryption process depends on the content of the length field. In fact, the length field does not appear at all in the security model, and all operations on data are atomic rather than block-wise.

Theoretical Impact From Bellare, Kohno and Namprempre: “…in the modern era of strong cryptography it would seem counterintuitive to voluntarily use a protocol with low security when it is possible to fix the security of SSH at low cost.” Provable security is one of the best tools we currently have. But how do we know that “fixing” SSH actually improves security? We need more comprehensive security models. Capturing the on-line nature of decryption process and the potential for error-based side channels. We need to integrate security analysis with the design process. And we need to persuade designers that this is worthwhile.

Why the order of encryption and integrity protection matters – SSL/TLS

SSL/TLS Overview SSL = Secure Sockets Layer. unreleased v1, flawed but useful v2, good v3. TLS = Transport Layer Security. IETF-standardised version of SSL. TLS1.0 = SSL3.0 with minor tweaks, RFC 2246. TLS1.1=TLS1.0 with tweaks, RFC 4346 (2006). TLS1.2=TLS1.1 with yet more tweaks, RFC 5246 (2008). SSL/TLS provides security ‘at TCP layer’. Runs over TCP, using TCP to provide reliable, end-to-end transport. Widely deployed in Web browsers and servers to support ‘secure e-commerce’ over HTTP.

SSL/TLS Record Protocol SSL/TLS Record Protocol provides: Data origin authentication, integrity, anti-replay using a MAC and sequence number. Algorithms supported in TLS1.2 are NULL, HMAC-MD5, HMAC-SHA1, HMAC-SHA256. Confidentiality using symmetric algorithm. Algorithms supported in TLS1.2 are NULL; 3DES, AES-128, AES-256 block ciphers, all in CBC mode; RC4-128 stream cipher. Earlier versions of SSL/TLS will support different sets of algorithms.

SSL/TLS Record Protocol (Simplified) Sequence Number Payload MAC MAC tag Padding Payload Encrypt Header Ciphertext MAC-then-pad-then-encrypt construction, not generically secure. Basic MAC-then-encrypt construction proven secure by Krawczyk for CBC mode encryption or stream cipher. Padding has a particular format, e.g. 01, 02 02, 03 03 03,… CINS/F1-01

Attacking OpenSSL Decryption process: Decrypt ciphertext Remove padding (checking format as part of process). Check the MAC field. Padding check or MAC failure may result in an error message on the SSL channel. Potential differences in timing of these error messages leads to a padding oracle attack (Vaudenay). Padding oracle tells adversary whether underlying plaintext was correctly padded or not. Such an oracle can be “leveraged” to build a decryption oracle! Canvel et al. (Crypto 2003) showed how to exploit this to obtain a plaintext recovery attack against OpenSSH. OpenSSH was subsequently patched to ensure uniform timing of error messages, thus preventing the attack.

Theoretical Impact The attack of Canvel et al. shows the importance of looking beyond the basic encryption and MAC algorithm components of secure channels. Security depends in a delicate way on the details of something as innocuous as padding and the timing of error messages. It also shows that the order of operations matters. Pad-then-encrypt-then-MAC preferable to SSL/TLS’s MAC-then-pad-then-encrypt construction. Krawczyk’s result, while valuable, is not the whole story about SSL/TLS record protocol security. In fact, his security proof needs all messages to be “block-aligned” and assumes that no padding is used. Recent work of Paterson and Watson has looked at provable security of CBC mode in the presence of padding oracles. But open problems remain for the security of MAC-then-PAD-then-encrypt construction used by SSL/TLS.

Conclusions

Conclusions We have studied how IPsec, SSL/TLS and SSH use symmetric cryptographic components to build secure channels. The security of these cryptographic components is now very well-understood. But combining these components in a secure way is still a challenging task with many potential pitfalls. Don’t try this at home!

Conclusions Major open problem: How to model and reason about the security of secure channels in a way that captures all significant cryptographic attacks? How do we even know what system features should be included in a security model? What is the right amount of abstraction? How close to the implementation level do we need to go? How do we model interactions between cryptographic components and the overall system?

Thank You Last Words A (mis)quote from Eugene Spafford: “Using encryption on the Internet is the equivalent of arranging an armored car to deliver credit-card information from someone living in a cardboard box to someone living on a park bench.” Thank You