breaking the internet: how cryptography fails in practice€¦ · breaking the internet: how...

267
Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs Dept. of Computer Science Stanford University July 28, 2017

Upload: others

Post on 27-Jun-2020

3 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Breaking the Internet:How Cryptography Fails in PracticeHenry Corrigan-GibbsDept. of Computer ScienceStanford UniversityJuly 28, 2017

Page 2: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Breaking the Internet:How Cryptography Fails in PracticeHenry Corrigan-GibbsDept. of Computer ScienceStanford UniversityJuly 28, 2017

Page 3: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Encryption is becoming ubiquitous

Mozilla Telemetry

Page 4: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Encryption is becoming ubiquitous

Factors

Mozilla Telemetry

Page 5: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Encryption is becoming ubiquitous

Factors

• WiFi

Mozilla Telemetry

Page 6: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Encryption is becoming ubiquitous

Factors

• WiFi

• Intel’s AES hardware

Mozilla Telemetry

Page 7: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Encryption is becoming ubiquitous

Factors

• WiFi

• Intel’s AES hardware

• Coercion by Google

Mozilla Telemetry

Page 8: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Encryption is becoming ubiquitous

Factors

• WiFi

• Intel’s AES hardware

• Coercion by Google

• Better tools-> Let’s encrypt, etc.

Mozilla Telemetry

Page 9: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Encryption is becoming ubiquitous

Factors

• WiFi

• Intel’s AES hardware

• Coercion by Google

• Better tools-> Let’s encrypt, etc.

• Snowden revelations

Mozilla Telemetry

Page 10: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Encryption is becoming ubiquitous

Factors

• WiFi

• Intel’s AES hardware

• Coercion by Google

• Better tools-> Let’s encrypt, etc.

• Snowden revelations

• Cyberattacks?

Mozilla Telemetry

Page 11: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Without encryption

bank.comWeb browser

Page 12: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Without encryption

bank.comWeb browser

GET /accounts.html? user=henrycg&password=money27

Page 13: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Without encryption

bank.comWeb browser

GET /accounts.html? user=henrycg&password=money27

Acct#1341

Page 14: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Without encryption

bank.comWeb browser

GET /accounts.html? user=henrycg&password=money27

• Internet service provider • Person on your WiFi network • Government running fiber link

Acct#1341

Page 15: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

With encryption

bank.comWeb browser

GET /accounts.html? user=henrycg&password=money27

Acct#1341

Page 16: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

With encryption

bank.com

B7ElovVOiqkSu5opJHiXKA

3ONopIEZKHvUxblwEXwzsQWeb

browser?!?

Page 17: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Want an “encrypted pipe” to your bank

bank.com?!?

*Precisely specifying the security property we want is not so easy…

Web browser

Page 18: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Want an “encrypted pipe” to your bank

bank.com

*Precisely specifying the security property we want is not so easy…

Web browser

Can send arbitrary bidirectional streams of data through the pipe

Page 19: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Goals of this talk

1. Explain ideas behind link encryption (TLS).

2. Show why it’s hard to get right.

3. Highlight open problems and research directions.

Page 20: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Goals of this talk

1. Explain ideas behind link encryption (TLS).

2. Show why it’s hard to get right.

3. Highlight open problems and research directions.

Will focus on the concepts, rather than the

protocol specifics.

Page 21: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Goals of this talk

1. Explain ideas behind link encryption (TLS).

2. Show why it’s hard to get right.

3. Highlight open problems and research directions.

Page 22: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Goals of this talk

1. Explain ideas behind link encryption (TLS).

2. Show why it’s hard to get right.

3. Highlight open problems and research directions.

Page 23: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Transport layer security (TLS)

• TLS (formerly SSL) is the primary protocol that implements an “encrypted pipe” abstraction on the Internet

• When you visit https://www.stanford.edu/, your traffic is flowing over TLS

• TLS is used everywhere! Not just in the browser… — Phone apps to backend servers — Mail client (e.g., Outlook) to mail server — ATM to bank — Smart car to telemetry service — Laptop to software update server — Ground station to expensive satellite (?)

Page 24: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Transport layer security (TLS)

• TLS (formerly SSL) is the primary protocol that implements an “encrypted pipe” abstraction on the Internet

• When you visit https://www.stanford.edu/, your traffic is flowing over TLS

• TLS is used everywhere! Not just in the browser… — Phone apps to backend servers — Mail client (e.g., Outlook) to mail server — ATM to bank — Smart car to telemetry service — Laptop to software update server — Ground station to expensive satellite (?)

Page 25: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Transport layer security (TLS)

• TLS (formerly SSL) is the primary protocol that implements an “encrypted pipe” abstraction on the Internet

• When you visit https://www.stanford.edu/, your traffic is flowing over TLS

• TLS is used everywhere! Not just in the browser… — Phone apps to backend servers — Mail client (e.g., Outlook) to mail server — ATM to bank — Smart car to telemetry service — Laptop to software update server — Ground station to expensive satellite (?)

Page 26: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Transport layer security (TLS)

• TLS (formerly SSL) is the primary protocol that implements an “encrypted pipe” abstraction on the Internet

• When you visit https://www.stanford.edu/, your traffic is flowing over TLS

• TLS is used everywhere! Not just in the browser… — Phone apps to backend servers — Mail client (e.g., Outlook) to mail server — ATM to bank — Smart car to telemetry service — Laptop to software update server — Ground station to expensive satellite (?)

Page 27: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Transport layer security (TLS)

• TLS (formerly SSL) is the primary protocol that implements an “encrypted pipe” abstraction on the Internet

• When you visit https://www.stanford.edu/, your traffic is flowing over TLS

• TLS is used everywhere! Not just in the browser… — Phone apps to backend servers — Mail client (e.g., Outlook) to mail server — ATM to bank — Smart car to telemetry service — Laptop to software update server — Ground station to expensive satellite (?)

Page 28: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Transport layer security (TLS)

• TLS (formerly SSL) is the primary protocol that implements an “encrypted pipe” abstraction on the Internet

• When you visit https://www.stanford.edu/, your traffic is flowing over TLS

• TLS is used everywhere! Not just in the browser… — Phone apps to backend servers — Mail client (e.g., Outlook) to mail server — ATM to bank — Smart car to telemetry service — Laptop to software update server — Ground station to expensive satellite (?)

Page 29: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Transport layer security (TLS)

• TLS (formerly SSL) is the primary protocol that implements an “encrypted pipe” abstraction on the Internet

• When you visit https://www.stanford.edu/, your traffic is flowing over TLS

• TLS is used everywhere! Not just in the browser… — Phone apps to backend servers — Mail client (e.g., Outlook) to mail server — ATM to bank — Smart car to telemetry service — Laptop to software update server — Ground station to expensive satellite (?)

Page 30: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Transport layer security (TLS)

• TLS (formerly SSL) is the primary protocol that implements an “encrypted pipe” abstraction on the Internet

• When you visit https://www.stanford.edu/, your traffic is flowing over TLS

• TLS is used everywhere! Not just in the browser… — Phone apps to backend servers — Mail client (e.g., Outlook) to mail server — ATM to bank — Smart car to telemetry service — Laptop to software update server — Ground station to expensive satellite (?)

Page 31: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Transport layer security (TLS)

• TLS (formerly SSL) is the primary protocol that implements an “encrypted pipe” abstraction on the Internet

• When you visit https://www.stanford.edu/, your traffic is flowing over TLS

• TLS is used everywhere! Not just in the browser… — Phone apps to backend servers — Mail client (e.g., Outlook) to mail server — ATM to bank — Smart car to telemetry service — Laptop to software update server — Ground station to expensive satellite (?)

Page 32: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Problem overview

bank.comBrowser

Page 33: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Problem overview

bank.comBrowser

7 MB message

Page 34: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Problem overview

• Endpoints have a shared secret key k (e.g., a 128-bit string)

bank.comBrowser

7 MB message

Page 35: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Problem overview

• Endpoints have a shared secret key k (e.g., a 128-bit string)

bank.comBrowser

k k

7 MB message

Page 36: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Problem overview

• Endpoints have a shared secret key k (e.g., a 128-bit string)

• Have a “block cipher” that encrypts/decrypts 128-bit messages E(k, m) -> c // Encrypt message m D(k, c) -> m // Decrypt ciphertext c

bank.comBrowser

k k

7 MB message

Page 37: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Problem overview

• Endpoints have a shared secret key k (e.g., a 128-bit string)

• Have a “block cipher” that encrypts/decrypts 128-bit messages E(k, m) -> c // Encrypt message m D(k, c) -> m // Decrypt ciphertext c

bank.comBrowser

k k

7 MB message

Fixed size

Page 38: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Problem overview

• Endpoints have a shared secret key k (e.g., a 128-bit string)

• Have a “block cipher” that encrypts/decrypts 128-bit messages E(k, m) -> c // Encrypt message m D(k, c) -> m // Decrypt ciphertext c

bank.comBrowser

k k

7 MB message

Page 39: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Problem overview

• Endpoints have a shared secret key k (e.g., a 128-bit string)

• Have a “block cipher” that encrypts/decrypts 128-bit messages E(k, m) -> c // Encrypt message m D(k, c) -> m // Decrypt ciphertext c

• Want to build a scheme that encrypts arbitrary length messages— Web pages, Netflix movies, software updates, etc.

bank.comBrowser

k k

7 MB message

Page 40: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Block Cipher

128-bit msg

Ek

c

128-bit msg

Dk

c

Page 41: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Block Cipher

Correctness. For all keys k and messages m:D(k, E(k, m)) = m

128-bit msg

Ek

c

128-bit msg

Dk

c

Page 42: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Block Cipher

Correctness. For all keys k and messages m:D(k, E(k, m)) = m

Security. For random key k, for all messages m, c = E(k, m) “looks like random string”

128-bit msg

Ek

c

128-bit msg

Dk

c

Page 43: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

TLS Security Goal[Very informal]

“Adversary learns nothing*about the message being sent.”

Page 44: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

TLS Security Goal[Very informal]

“Adversary learns nothing*about the message being sent.”

• Even if the adversary gets to tamper with network traffic,

Page 45: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

TLS Security Goal[Very informal]

“Adversary learns nothing*about the message being sent.”

• Even if the adversary gets to tamper with network traffic,• Even if the adversary gets to choose a part of the message, and

Page 46: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

TLS Security Goal[Very informal]

“Adversary learns nothing*about the message being sent.”

• Even if the adversary gets to tamper with network traffic,• Even if the adversary gets to choose a part of the message, and• Even if the client sends the same message many times.

Page 47: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

“Transfer $0001”

k

TLS Security Goal[Very informal]

“Adversary learns nothing*about the message being sent.”

• Even if the adversary gets to tamper with network traffic,• Even if the adversary gets to choose a part of the message, and• Even if the client sends the same message many times.

Page 48: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

“Transfer $0001” “Transfer $2500”k k

TLS Security Goal[Very informal]

“Adversary learns nothing*about the message being sent.”

• Even if the adversary gets to tamper with network traffic,• Even if the adversary gets to choose a part of the message, and• Even if the client sends the same message many times.

Page 49: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

“Transfer $0001” “Transfer $2500”

k k

TLS Security Goal[Very informal]

“Adversary learns nothing*about the message being sent.”

• Even if the adversary gets to tamper with network traffic,• Even if the adversary gets to choose a part of the message, and• Even if the client sends the same message many times.

Page 50: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

TLS protocol

Page 51: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

• TLS/SSL has been around since 1995

• It is the backbone of Internet security … important to get right

TLS protocol

Page 52: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

• TLS/SSL has been around since 1995

• It is the backbone of Internet security … important to get right

And yet, many flaws:

TLS protocol

Page 53: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

• TLS/SSL has been around since 1995

• It is the backbone of Internet security … important to get right

And yet, many flaws:

TLS protocol

Page 54: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

• TLS/SSL has been around since 1995

• It is the backbone of Internet security … important to get right

And yet, many flaws:

TLS protocol

Page 55: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Goals of this talk

1. Explain ideas behind link encryption (TLS).

2. Show why it’s hard to get right. — Warm-up: ECB mode — Padding-oracle attack — Compress-then-encrypt attack

3. Highlight open problems and research directions.

Page 56: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Goals of this talk

1. Explain ideas behind link encryption (TLS).

2. Show why it’s hard to get right. — Warm-up: ECB mode — Padding-oracle attack — Compress-then-encrypt attack

3. Highlight open problems and research directions.

Page 57: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up

Page 58: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up

• Say we have a 7 MB message and a 128-bit cipher• How do we encrypt a long message with a short cipher?

Page 59: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up

• Say we have a 7 MB message and a 128-bit cipher• How do we encrypt a long message with a short cipher?Electronic Codebook Mode (ECB)1. Break up message into 128-bit blocks2. Encrypt message block by block

Page 60: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB encryption

msg =

Page 61: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB encryption

msg =

Page 62: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB encryption

msg =

block 1

Page 63: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB encryption

msg =

block 1

Ek

Page 64: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB encryption

msg =

block 1

Ek

c1

Page 65: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB encryption

msg =

block 1

Ek

c1

block 2

Page 66: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB encryption

msg =

block 1

Ek

c1

block 2

Ek

Page 67: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB encryption

msg =

block 1

Ek

c1

block 2

Ek

c2

Page 68: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB encryption

msg =

block 1

Ek

c1

block 2

Ek

c2

block 3

Page 69: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB encryption

msg =

block 1

Ek

c1

block 2

Ek

c2

block 3

Ek

Page 70: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB encryption

msg =

block 1

Ek

c1

block 2

Ek

c2

block 3

Ek

c3

Page 71: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB encryption

msg =

block 1

Ek

c1

block 2

Ek

c2

block 3

Ek

c3

Page 72: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB encryption

msg =

block 1

E

c1

block 2

E

c2

block 3

E

c3

Page 73: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB decryption

c1 c2 c3

Page 74: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB decryption

D

c1 c2 c3

Page 75: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB decryption

block 1

D

c1 c2 c3

Page 76: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB decryption

block 1

D

c1

D

c2 c3

Page 77: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB decryption

block 1

D

c1

block 2

D

c2 c3

Page 78: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB decryption

block 1

D

c1

block 2

D

c2

D

c3

Page 79: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB decryption

block 1

D

c1

block 2

D

c2

block 3

D

c3

Page 80: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB decryption

msg = block 1

D

c1

block 2

D

c2

block 3

D

c3

Page 81: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB mode

Page 82: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB mode

Problem?

Page 83: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB mode

Problem?

– Repeated patterns in message show up as repeated patterns in ciphertext!

Page 84: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB mode

Problem?

– Repeated patterns in message show up as repeated patterns in ciphertext!

– “cow” | “cow” | “cow” → 5d4f 5d4f 5d4f

Page 85: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB mode

Problem?

– Repeated patterns in message show up as repeated patterns in ciphertext!

– “cow” | “cow” | “cow” → 5d4f 5d4f 5d4f

– “cow” | “dog” | “cat” → 5d4f 1c91 f93e

Page 86: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Warm up: ECB mode

Problem?

– Repeated patterns in message show up as repeated patterns in ciphertext!

– “cow” | “cow” | “cow” → 5d4f 5d4f 5d4f

– “cow” | “dog” | “cat” → 5d4f 1c91 f93e

Does this little bit of leakage matter?

Page 87: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

The famous penguin: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation

Page 88: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

256-bit AES encryptionin ECB mode

The famous penguin: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation

Page 89: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

256-bit AES encryptionin ECB mode

The famous penguin: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation

Page 90: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Mail client

k k

Page 91: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Mail client

k k

Page 92: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Mail client

k k

Page 93: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Mail client

k k

Moral: A little bit of leakage goes a long way.

Page 94: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Goals of this talk

1. Explain ideas behind link encryption (TLS).

2. Show why it’s hard to get right. — Warm-up: ECB mode — Padding-oracle attack — Compress-then-encrypt attack

3. Highlight open problems and research directions.

Page 95: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Goals of this talk

1. Explain ideas behind link encryption (TLS).

2. Show why it’s hard to get right. — Warm-up: ECB mode — Padding-oracle attack — Compress-then-encrypt attack

3. Highlight open problems and research directions.

Page 96: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Second attempt: CBC mode

• Naive ECB mode (encrypt chunk-by-chunk)leaks repeated message blocks

• If we “mix the message blocks together” properly, these attacks will no longer apply

• Cipher block chaining mode (CBC) does just this — One of two major options in TLS until ~2008

Page 97: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC encryption

block 1 block 2 block 3

Page 98: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC encryption

block 1 block 2 block 3

random bits

Page 99: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC encryption

block 1 block 2 block 3

⊕random bits

Page 100: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC encryption

block 1

E

block 2 block 3

⊕random bits

Page 101: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC encryption

block 1

E

c1

block 2 block 3

⊕random bits

Page 102: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC encryption

block 1

E

c1

block 2 block 3

⊕random bits

Page 103: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC encryption

block 1

E

c1

block 2 block 3

⊕⊕random bits

Page 104: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC encryption

block 1

E

c1

block 2

E

block 3

⊕⊕random bits

Page 105: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC encryption

block 1

E

c1

block 2

E

c2

block 3

⊕⊕random bits

Page 106: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC encryption

block 1

E

c1

block 2

E

c2

block 3

⊕⊕random bits

Page 107: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC encryption

block 1

E

c1

block 2

E

c2

block 3

⊕ ⊕⊕random bits

Page 108: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC encryption

block 1

E

c1

block 2

E

c2

block 3

E

⊕ ⊕⊕random bits

Page 109: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC encryption

block 1

E

c1

block 2

E

c2

block 3

E

c3

⊕ ⊕⊕random bits

Page 110: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC encryption

block 1

E

c1

block 2

E

c2

block 3

E

c3

⊕ ⊕⊕

random bits

random bits

Page 111: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC encryption

block 1

E

c1

block 2

E

c2

block 3

E

c3

⊕ ⊕⊕

random bits

random bits

Page 112: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC decryption

c1 c2 c3random bits

Page 113: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC decryption

D

c1

D

c2

D

c3random bits

Page 114: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC decryption

D

c1

D

c2

D

c3

⊕ ⊕⊕

random bits

Page 115: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC decryption

block 1

D

c1

block 2

D

c2

block 3

D

c3

⊕ ⊕⊕

random bits

Page 116: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Why is CBC mode inconvenient?

Page 117: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Why is CBC mode inconvenient?

1. Computers now have many cores – CBC encryption is a sequential operation– Can’t make effective use of multicore hardware -> Modern ciphers focus on parallelism

Page 118: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Why is CBC mode inconvenient?

1. Computers now have many cores – CBC encryption is a sequential operation– Can’t make effective use of multicore hardware -> Modern ciphers focus on parallelism

2. CBC can only encrypt messages whose bitlength is a multiple of 128

Page 119: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Message must be multiple of block size

block 1

E

c1

block 2

E

c2

block 3

E

c3

⊕ ⊕⊕

random bits

random bits

Page 120: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

block 3

Message must be multiple of block size

block 1

D

c1

block 2

D

c2

D

c3

⊕ ⊕⊕

random bits

Page 121: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

block 3

Message must be multiple of block size

block 1

D

c1

block 2

D

c2

???

D

c3

⊕ ⊕⊕

random bits

How many bitsare empty?

Page 122: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC Padding

the_quick_brown_ fox_jumps_over_t he_lazy_dog44444

Page 123: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC Padding

Obvious fix: add some padding to the message

the_quick_brown_ fox_jumps_over_t he_lazy_dog44444

Page 124: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC Padding

Obvious fix: add some padding to the message

the_quick_brown_ fox_jumps_over_t he_lazy_dog44444

If there are 5 padding bytes,

write 44444

Page 125: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC Padding

Obvious fix: add some padding to the message

the_quick_brown_ fox_jumps_over_t he_lazy_dog44444

Page 126: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC Padding

Obvious fix: add some padding to the message

Modified CBC decryption1. Decrypt padded message as in normal CBC2. Read last byte of message – say it has value N3. Chop off the last N bytes of the message

– Make sure the last N bytes are valid padding: NN…NN – If not, output “invalid padding”

4. Output message

the_quick_brown_ fox_jumps_over_t he_lazy_dog44444

Page 127: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Padding-oracle attack

This padding scheme creates big security problems -> A “man-in-the-middle” attacker can learn pieces of the encrypted message [Vaudenay’02]

This has led to real-world vulnerabilities in TLS – Lucky13 [AlFardan&Patterson ’13] – POODLE [Möller&others’14] – also in loads of other software (Ruby on Rails, etc.)

Page 128: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack set-up

• Your mail client (Outlook) sends your email username and password to the mail server over TLS.

— This happens every ~2 minutes.

— The mail client retries upon failure.

• The mail client sends the same secret message many times

Page 129: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack set-up

• Your mail client (Outlook) sends your email username and password to the mail server over TLS.

— This happens every ~2 minutes.

— The mail client retries upon failure.

• The mail client sends the same secret message many times

user:johnc;passw ord:HNS4Life;222

Page 130: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack set-up

• Your mail client (Outlook) sends your email username and password to the mail server over TLS.

— This happens every ~2 minutes.

— The mail client retries upon failure.

• The mail client sends the same secret message many times

user:johnc;passw ord:HNS4Life;222

Padding!

Page 131: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack set-up

• Your mail client (Outlook) sends your email username and password to the mail server over TLS.

— This happens every ~2 minutes.

— The mail client retries upon failure.

• The mail client sends the same secret message many times

user:johnc;passw ord:HNS4Life;222

Page 132: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since
Page 133: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

user:johnc;passw ord:HNS4Life;222

Page 134: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

user:johnc;passw ord:HNS4Life;222

Login OK; Three new msgs

Page 135: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

user:johnc;passw ord:HNS4Life;222

Login OK; Three new msgs

n\<)O;q<SPav_oTo ord:HNS4Life;222

Page 136: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

user:johnc;passw ord:HNS4Life;222

Login OK; Three new msgs

n\<)O;q<SPav_oTo ord:HNS4Life;222

Invalid request; Please try again.

Page 137: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

user:johnc;passw ord:HNS4Life;222

Login OK; Three new msgs

n\<)O;q<SPav_oTo ord:HNS4Life;222

Invalid request;

n\<)O;q<SPav_oTo ord:HNS4Life;9X2

Please try again.

Page 138: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

user:johnc;passw ord:HNS4Life;222

Login OK; Three new msgs

n\<)O;q<SPav_oTo ord:HNS4Life;222

Invalid request;

n\<)O;q<SPav_oTo ord:HNS4Life;9X2

Padding error.

Please try again.

Page 139: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

user:johnc;passw ord:HNS4Life;222

Login OK; Three new msgs

n\<)O;q<SPav_oTo ord:HNS4Life;222

Invalid request;

n\<)O;q<SPav_oTo ord:HNS4Life;9X2

Padding error.

Please try again.

Page 140: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

Page 141: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

• The server behaves differently when (a) request is invalid, versus (b) padding is incorrect.

• This leaks a bit of information about the plaintext!

Page 142: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

• The server behaves differently when (a) request is invalid, versus (b) padding is incorrect.

• This leaks a bit of information about the plaintext!

Attack idea

1. Tweak a few bits of the client’s message.

2. Observe the server’s response to learn 1 bit of information about the encrypted password.

3. Repeat until learn entire password.

Page 143: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

Page 144: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

c1 c2

Page 145: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

c1 c2 c1’ c2

Page 146: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

c1 c2 c1’ c2

Invalid request;

Page 147: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

c1 c2 c1’ c2

Invalid request;

c1 c2

Page 148: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

c1 c2 c1’ c2

Invalid request;

c1 c2 c’’1 c2

Page 149: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

c1 c2 c1’ c2

Invalid request;

c1 c2 c’’1 c2

Padding error

Page 150: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Recall CBC decryption

user:johnc;pass

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

Page 151: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Recall CBC decryption

user:johnc;pass

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response Login OK; Three new msgs

random bits

Page 152: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

user:johnc;pass

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits E

Recall CBC decryption

Page 153: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

user:johnc;passf8l(#jf<1.bicqc

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits E

Recall CBC decryption

Page 154: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

user:johnc;passf8l(#jf<1.bicqc

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits E

3

Recall CBC decryption

Page 155: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

user:johnc;passf8l(#jf<1.bicqc

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits E

3

Padding error.

Recall CBC decryption

Page 156: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

1) Guess the last byte

f8l(#jf<1.bicqc

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits F

4

Page 157: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

1) Guess the last byte

f8l(#jf<1.bicqc

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits F

4

Padding error.

Page 158: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

1) Guess the last byte

f8l(#jf<1.bicqc

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits G

5

Page 159: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

1) Guess the last byte

f8l(#jf<1.bicqc

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits G

5

Padding error.

Page 160: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

1) Guess the last byte

f8l(#jf<1.bicqc

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits H

6

Page 161: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

1) Guess the last byte

f8l(#jf<1.bicqc

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits H

6

Padding error.

Page 162: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

1) Guess the last byte

f8l(#jf<1.bicqc

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits B

0

Page 163: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

1) Guess the last byte

f8l(#jf<1.bicqc

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits B

0

Invalid request; Please try again.

Page 164: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

1) Guess the last byte

f8l(#jf<1.bicqc

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits B

0

Invalid request; Please try again.

Attacker knows that the last byte of the message

is a 2!

Page 165: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

1) Guess the last byte

f8l(#jf<1.bicqc

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits B

0

Invalid request; Please try again.

Page 166: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

2) Learn the last byte

The attacker learns that the last byte of the plaintext, when decremented by two, equals ‘0’

x - 2 = 0

implies

x = 2

Page 167: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

2) Learn the last byte

f8l(#jf<1.bicqc

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits B

0

Page 168: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

2) Learn the last byte

f8l(#jf<1.bicqc

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits B

0

Invalid request; Please try again.

Page 169: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

2) Learn the last byte

f8l(#jf<1.bicqc

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits B

0

Invalid request; Please try again.

Attacker knows that the last three

bytes are all 2s

Page 170: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

2) Learn the last byte

f8l(#jf<1.bicqc

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits B

0

Invalid request; Please try again.

Page 171: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

3) Guess the last non-padding byte

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

333x}J4|-.(q<G/=qA

Z6D

Page 172: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

3) Guess the last non-padding byte

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

333

Padding error.

x}J4|-.(q<G/=qA

Z6D

Page 173: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

3) Guess the last non-padding byte

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

<3331?6r,VVR[wv_ohf

mZ6D

Page 174: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

3) Guess the last non-padding byte

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

Padding error.

<3331?6r,VVR[wv_ohf

mZ6D

Page 175: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

3) Guess the last non-padding byte

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

=333-RiUH%N&&'-^Z++

nZ6D

Page 176: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

3) Guess the last non-padding byte

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

Padding error.

=333-RiUH%N&&'-^Z++

nZ6D

Page 177: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

3) Guess the last non-padding byte

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

>333f(Xto%j0r:z-%L7

oZ6D

Page 178: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

3) Guess the last non-padding byte

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

Padding error.

>333f(Xto%j0r:z-%L7

oZ6D

Page 179: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

4) Learn the last non-padding byte

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

3333cV59zE’x9U1vz-1

4Z6D

Page 180: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

4) Learn the last non-padding byte

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

3333cV59zE’x9U1vz-1

4Z6D

Invalid request; Please try again.

Page 181: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

4) Learn the last non-padding byte

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

3333cV59zE’x9U1vz-1

4Z6D

Invalid request; Please try again.

Attacker knows that the last byte of the message is

a semicolon!

Page 182: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

4) Learn the last non-padding byte

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

3333cV59zE’x9U1vz-1

4Z6D

Invalid request; Please try again.

Page 183: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

5) Continue attack to learn remaining bytes

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

4444>=)$8ie5m#IwT_=

5[7E

Page 184: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

5) Continue attack to learn remaining bytes

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

4444>=)$8ie5m#IwT_=

5[7E

Padding error.

Page 185: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

5) Continue attack to learn remaining bytes

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

f4444:-2cEqUqCUa!7r'

~5[7E

Page 186: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

5) Continue attack to learn remaining bytes

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

f4444:-2cEqUqCUa!7r'

Padding error.

~5[7E

Page 187: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

5) Continue attack to learn remaining bytes

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

g4444ViVq4!L6[Mp80+_

_5[7E

Page 188: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

5) Continue attack to learn remaining bytes

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

g4444ViVq4!L6[Mp80+_

_5[7E

Padding error.

Page 189: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

5) Continue attack to learn remaining bytes

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

44444ViVq4!L6[Mp80+_

L5[7E

Page 190: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

5) Continue attack to learn remaining bytes

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

44444ViVq4!L6[Mp80+_

L5[7E

Invalid request; Please try again.

Page 191: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

5) Continue attack to learn remaining bytes

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

44444ViVq4!L6[Mp80+_

L5[7E

Invalid request; Please try again.

Attacker knows that the last two

bytes are “e;”

Page 192: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

5) Continue attack to learn remaining bytes

D

4/Q"dB*FOsN}lY5D

ord:HNS4Life;222

uwy1ri!0:0{vWfQ'

⊕⊕

Message

Ciphertext

D

Server response

random bits

44444ViVq4!L6[Mp80+_

L5[7E

Invalid request; Please try again.

Page 193: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

CBC “Padding-oracle” attack

• The attacker learns the rest of the plaintext in a byte-by-byte fashion

• Needs 16*256 = 4,096 guesses to recover the last16 bytes of the encrypted message -> This is completely practical in the right setting

• After watching your mail client for a few hours, the attacker recovers your mail password!

• Modern encryption modes avoid padding – GCM: “Galois counter mode”

Page 194: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Goals of this talk

1. Explain ideas behind link encryption (TLS).

2. Show why it’s hard to get right. — Warm-up: ECB mode — Padding-oracle attack — Compress-then-encrypt attack

3. Highlight open problems and research directions.

Page 195: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Goals of this talk

1. Explain ideas behind link encryption (TLS).

2. Show why it’s hard to get right. — Warm-up: ECB mode — Padding-oracle attack — Compress-then-encrypt attack

3. Highlight open problems and research directions.

Page 196: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Compression and encryption

• We often send compressible data (e.g., ASCII text)

• Compressed data -> better apparent network throughput

bank.comBrowser

k k

1 MB of ASCII Text[213 KB compressed]

Page 197: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Encrypt then compress? Or, compress then encrypt?

Compression and TLS

Page 198: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Encrypt then compress? Or, compress then encrypt?

Compression and TLS

The quick brown fox jumped over the lazy…

Page 199: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Encrypt then compress? Or, compress then encrypt?

Compression and TLS

The quick brown fox jumped over the lazy…

CBC-Encrypt

@5-$0,$$Be,|/!1Z+R)v_N-!ZKMPp-\FON14=BI(a^2vB1#&

Page 200: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Encrypt then compress? Or, compress then encrypt?

Compression and TLS

The quick brown fox jumped over the lazy…

CBC-Encrypt

@5-$0,$$Be,|/!1Z+R)v_N-!ZKMPp-\FON14=BI(a^2vB1#&

Compress

JhqOV91n1I%/HOl9!e|HYBV$ Z81*bw;Hv4YC?HLaWlAZ3Zw%

Page 201: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Encrypt then compress? Or, compress then encrypt?

Compression and TLS

The quick brown fox jumped over the lazy…

CBC-Encrypt

@5-$0,$$Be,|/!1Z+R)v_N-!ZKMPp-\FON14=BI(a^2vB1#&

Compress

JhqOV91n1I%/HOl9!e|HYBV$ Z81*bw;Hv4YC?HLaWlAZ3Zw%

Encrypted data is incompressible (unless your cipher is broken)

Page 202: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Encrypt then compress? Or, compress then encrypt?

Compression and TLS

The quick brown fox jumped over the lazy…

CBC-Encrypt

@5-$0,$$Be,|/!1Z+R)v_N-!ZKMPp-\FON14=BI(a^2vB1#&

Compress

JhqOV91n1I%/HOl9!e|HYBV$ Z81*bw;Hv4YC?HLaWlAZ3Zw%

Page 203: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Encrypt then compress? Or, compress then encrypt?

Compression and TLS

The quick brown fox jumped over the lazy…

CBC-Encrypt

@5-$0,$$Be,|/!1Z+R)v_N-!ZKMPp-\FON14=BI(a^2vB1#&

Compress

JhqOV91n1I%/HOl9!e|HYBV$ Z81*bw;Hv4YC?HLaWlAZ3Zw%

The quick brown fox jumped over the lazy…

Page 204: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Encrypt then compress? Or, compress then encrypt?

Compression and TLS

The quick brown fox jumped over the lazy…

CBC-Encrypt

@5-$0,$$Be,|/!1Z+R)v_N-!ZKMPp-\FON14=BI(a^2vB1#&

Compress

JhqOV91n1I%/HOl9!e|HYBV$ Z81*bw;Hv4YC?HLaWlAZ3Zw%

The quick brown fox jumped over the lazy…

lA@`'n'vLS+dwmdarb$+vn

Compress

Page 205: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Encrypt then compress? Or, compress then encrypt?

Compression and TLS

The quick brown fox jumped over the lazy…

CBC-Encrypt

@5-$0,$$Be,|/!1Z+R)v_N-!ZKMPp-\FON14=BI(a^2vB1#&

Compress

JhqOV91n1I%/HOl9!e|HYBV$ Z81*bw;Hv4YC?HLaWlAZ3Zw%

The quick brown fox jumped over the lazy…

CBC-Encrypt

lA@`'n'vLS+dwmdarb$+vn

Compress

"fKX;nC5gt1'd/l>Ae%xj>?

Page 206: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Compress-then-encrypt

PROBLEMCiphertext length leaks information to attacker.

Message is compressible. Message not compressible.

Page 207: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Compress-then-encrypt

Page 208: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Compress-then-encrypt

PROBLEMCiphertext length leaks information to attacker.

Page 209: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Compress-then-encrypt

PROBLEMCiphertext length leaks information to attacker.

• Simple example: attacker can tell if you’re sending the string 000000…00000 versus a random string

Page 210: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Compress-then-encrypt

PROBLEMCiphertext length leaks information to attacker.

• Simple example: attacker can tell if you’re sending the string 000000…00000 versus a random string

• More interesting: attacker can tell if you’re streaming “Mad Men” or “Sopranos” from Netflix

Page 211: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Compress-then-encrypt

PROBLEMCiphertext length leaks information to attacker.

• Simple example: attacker can tell if you’re sending the string 000000…00000 versus a random string

• More interesting: attacker can tell if you’re streaming “Mad Men” or “Sopranos” from Netflix

• Does this really matter?

Page 212: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attacking compress-then-encrypt

Page 213: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

• When you log into bank.com, your bank stores a “cookie” in your browser – Cookie could be a 128-bit random string – Anyone with your bank cookie can access your account

Attacking compress-then-encrypt

Page 214: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

• When you log into bank.com, your bank stores a “cookie” in your browser – Cookie could be a 128-bit random string – Anyone with your bank cookie can access your account

• If you visit evil.com, an attacker can trick your browser into sending many encryptions of:

“attacker-chosen-string || Cookie:secret-bank—token”

Attacking compress-then-encrypt

Page 215: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

• When you log into bank.com, your bank stores a “cookie” in your browser – Cookie could be a 128-bit random string – Anyone with your bank cookie can access your account

• If you visit evil.com, an attacker can trick your browser into sending many encryptions of:

“attacker-chosen-string || Cookie:secret-bank—token”

<html><title>Evil.com</title> <img src="https://bank.com/?attacker-chosen-string1"> <img src="https://bank.com/?attacker-chosen-string2"> <img src="https://bank.com/?attacker-chosen-string3"> ...

Attacking compress-then-encrypt

Page 216: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

• When you log into bank.com, your bank stores a “cookie” in your browser – Cookie could be a 128-bit random string – Anyone with your bank cookie can access your account

• If you visit evil.com, an attacker can trick your browser into sending many encryptions of:

“attacker-chosen-string || Cookie:secret-bank—token”

<html><title>Evil.com</title> <img src="https://bank.com/?attacker-chosen-string1"> <img src="https://bank.com/?attacker-chosen-string2"> <img src="https://bank.com/?attacker-chosen-string3"> ...

Attacking compress-then-encrypt

Cookie sent with these requests

Page 217: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

• When you log into bank.com, your bank stores a “cookie” in your browser – Cookie could be a 128-bit random string – Anyone with your bank cookie can access your account

• If you visit evil.com, an attacker can trick your browser into sending many encryptions of:

“attacker-chosen-string || Cookie:secret-bank—token”

<html><title>Evil.com</title> <img src="https://bank.com/?attacker-chosen-string1"> <img src="https://bank.com/?attacker-chosen-string2"> <img src="https://bank.com/?attacker-chosen-string3"> ...

Attacking compress-then-encrypt

Page 218: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attacking compress-then-encrypt

https://www.ietf.org/proceedings/85/slides/slides-85-saag-1.pdf

Page 219: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attacking compress-then-encrypt

Attack idea (CRIME and BREACH TLS attacks) [Rizzo&Duong’12] [Prado&others’13]

1. For many choices of s, trick user into sending encryptions of <s || Cookie:secret-bank-token>

https://www.ietf.org/proceedings/85/slides/slides-85-saag-1.pdf

Page 220: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attacking compress-then-encrypt

Attack idea (CRIME and BREACH TLS attacks) [Rizzo&Duong’12] [Prado&others’13]

1. For many choices of s, trick user into sending encryptions of <s || Cookie:secret-bank-token>

2. Observe how the length of the encrypted string varies.

3. Recover the password.

https://www.ietf.org/proceedings/85/slides/slides-85-saag-1.pdf

Page 221: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

evil.com

Page 222: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

evil.com

Page 223: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

c1 c2

evil.com

Page 224: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

c1 c2 c1 c2

evil.com

Page 225: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

c1

c1

c2 c1 c2

evil.com

Page 226: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

c1

c1

c2 c1 c2

c1

evil.com

Page 227: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

Page 228: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

Say that the cookie is HX8f$Q. Then

Page 229: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

Say that the cookie is HX8f$Q. Then

Cookie:ACookie:HX8f$Q compresses to 24 bytes

Page 230: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

Say that the cookie is HX8f$Q. Then

Cookie:ACookie:HX8f$Q compresses to 24 bytesCookie:BCookie:HX8f$Q 24 bytes

Page 231: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

Say that the cookie is HX8f$Q. Then

Cookie:ACookie:HX8f$Q compresses to 24 bytesCookie:BCookie:HX8f$Q 24 bytesCookie:CCookie:HX8f$Q 24 bytes

Page 232: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

Say that the cookie is HX8f$Q. Then

Cookie:ACookie:HX8f$Q compresses to 24 bytesCookie:BCookie:HX8f$Q 24 bytesCookie:CCookie:HX8f$Q 24 bytes…

Page 233: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

Say that the cookie is HX8f$Q. Then

Cookie:ACookie:HX8f$Q compresses to 24 bytesCookie:BCookie:HX8f$Q 24 bytesCookie:CCookie:HX8f$Q 24 bytes…Cookie:HCookie:HX8f$Q 23 bytes

Page 234: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

Say that the cookie is HX8f$Q. Then

Cookie:ACookie:HX8f$Q compresses to 24 bytesCookie:BCookie:HX8f$Q 24 bytesCookie:CCookie:HX8f$Q 24 bytes…Cookie:HCookie:HX8f$Q 23 bytes

Attacker knows thatcookie starts with “H”

Page 235: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

Say that the cookie is HX8f$Q. Then

Cookie:ACookie:HX8f$Q compresses to 24 bytesCookie:BCookie:HX8f$Q 24 bytesCookie:CCookie:HX8f$Q 24 bytes…Cookie:HCookie:HX8f$Q 23 bytes

Page 236: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

Say that the cookie is HX8f$Q. Then

Cookie:ACookie:HX8f$Q compresses to 24 bytesCookie:BCookie:HX8f$Q 24 bytesCookie:CCookie:HX8f$Q 24 bytes…Cookie:HCookie:HX8f$Q 23 bytes Cookie:HACookie:HX8f$Q 24 bytes

Page 237: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

Say that the cookie is HX8f$Q. Then

Cookie:ACookie:HX8f$Q compresses to 24 bytesCookie:BCookie:HX8f$Q 24 bytesCookie:CCookie:HX8f$Q 24 bytes…Cookie:HCookie:HX8f$Q 23 bytes Cookie:HACookie:HX8f$Q 24 bytesCookie:HBCookie:HX8f$Q 24 bytes

Page 238: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

Say that the cookie is HX8f$Q. Then

Cookie:ACookie:HX8f$Q compresses to 24 bytesCookie:BCookie:HX8f$Q 24 bytesCookie:CCookie:HX8f$Q 24 bytes…Cookie:HCookie:HX8f$Q 23 bytes Cookie:HACookie:HX8f$Q 24 bytesCookie:HBCookie:HX8f$Q 24 bytesCookie:HCCookie:HX8f$Q 24 bytes

Page 239: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

Say that the cookie is HX8f$Q. Then

Cookie:ACookie:HX8f$Q compresses to 24 bytesCookie:BCookie:HX8f$Q 24 bytesCookie:CCookie:HX8f$Q 24 bytes…Cookie:HCookie:HX8f$Q 23 bytes Cookie:HACookie:HX8f$Q 24 bytesCookie:HBCookie:HX8f$Q 24 bytesCookie:HCCookie:HX8f$Q 24 bytes …

Page 240: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

Say that the cookie is HX8f$Q. Then

Cookie:ACookie:HX8f$Q compresses to 24 bytesCookie:BCookie:HX8f$Q 24 bytesCookie:CCookie:HX8f$Q 24 bytes…Cookie:HCookie:HX8f$Q 23 bytes Cookie:HACookie:HX8f$Q 24 bytesCookie:HBCookie:HX8f$Q 24 bytesCookie:HCCookie:HX8f$Q 24 bytes …Cookie:HXCookie:HX8f$Q 23 bytes

Page 241: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

Say that the cookie is HX8f$Q. Then

Cookie:ACookie:HX8f$Q compresses to 24 bytesCookie:BCookie:HX8f$Q 24 bytesCookie:CCookie:HX8f$Q 24 bytes…Cookie:HCookie:HX8f$Q 23 bytes Cookie:HACookie:HX8f$Q 24 bytesCookie:HBCookie:HX8f$Q 24 bytesCookie:HCCookie:HX8f$Q 24 bytes …Cookie:HXCookie:HX8f$Q 23 bytes

Attacker knows that cookie starts with “HX”

Page 242: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Attack idea

Say that the cookie is HX8f$Q. Then

Cookie:ACookie:HX8f$Q compresses to 24 bytesCookie:BCookie:HX8f$Q 24 bytesCookie:CCookie:HX8f$Q 24 bytes…Cookie:HCookie:HX8f$Q 23 bytes Cookie:HACookie:HX8f$Q 24 bytesCookie:HBCookie:HX8f$Q 24 bytesCookie:HCCookie:HX8f$Q 24 bytes …Cookie:HXCookie:HX8f$Q 23 bytes

Page 243: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Compress-then-encrypt

• For cookie of length L: – Cost of this attack: 256L work – Brute-force guessing: 256L work

• These attacks are practical!

• Mitigation? Turn off compression. :( – Can still use application-layer compression

Page 244: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Compress-then-encrypt

• For cookie of length L: – Cost of this attack: 256L work – Brute-force guessing: 256L work

• These attacks are practical!

• Mitigation? Turn off compression. :( – Can still use application-layer compression

Exponentialspeed-up!

Page 245: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Compress-then-encrypt

• For cookie of length L: – Cost of this attack: 256L work – Brute-force guessing: 256L work

• These attacks are practical!

• Mitigation? Turn off compression. :( – Can still use application-layer compression

Page 246: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Moral of the story

Page 247: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Moral of the story

For end users:• Demand encryption

– Even weak encryption is better than none• Use a modern browser and keep it up to date

– Once found, these bugs get patched quickly

Page 248: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Moral of the story

For end users:• Demand encryption

– Even weak encryption is better than none• Use a modern browser and keep it up to date

– Once found, these bugs get patched quicklyFor engineers:• Encrypt everywhere

– It costs almost nothing; you’ll need it later anyways• Never design a new crypto protocol

– Off-the-shelf schemes suffice almost always• Pay attention to small information leaks

– Almost always: Small leak -> Large leak

Page 249: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Goals of this talk

1. Explain ideas behind link encryption (TLS).

2. Show why it’s hard to get right. — Warm-up: ECB mode — Padding-oracle attack — Compress-then-encrypt attack

3. Highlight open problems and research directions.

Page 250: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Goals of this talk

1. Explain ideas behind link encryption (TLS).

2. Show why it’s hard to get right. — Warm-up: ECB mode — Padding-oracle attack — Compress-then-encrypt attack

3. Highlight open problems and research directions.

Page 251: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Challenge 1: Secure-by-design protocols

https://tls13tamarin.github.io/TLS13Tamarin/https://eprint.iacr.org/2015/978.pdf

https://eprint.iacr.org/2015/914.pdf

http://prosecco.gforge.inria.fr/personal/bblanche/publications/BhargavanBlanchetKobeissiSP2017.pdf

Page 252: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Challenge 1: Secure-by-design protocols

• TLS with “provable” protection against certain attacks?

• TLS v1.3 incorporates research along these lines – Specify the protocol in machine-readable language – Define formal security properties (e.g., confidentiality) – Prove that specification satisfies security properties

• Challenges: – Complexity of specification & of security goals – Implementation =? Specification – Effort required

https://tls13tamarin.github.io/TLS13Tamarin/https://eprint.iacr.org/2015/978.pdf

https://eprint.iacr.org/2015/914.pdf

http://prosecco.gforge.inria.fr/personal/bblanche/publications/BhargavanBlanchetKobeissiSP2017.pdf

Page 253: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Challenge 2: Hiding the metadata

• TLS leaks website names and traffic patterns • Repeated visits to cookie-enthusiasts.com

reveal something about me • This problem is a focus of my research

Page 254: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Challenge 2: Hiding the metadata

• TLS leaks website names and traffic patterns • Repeated visits to cookie-enthusiasts.com

reveal something about me • This problem is a focus of my research

Page 255: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Challenge 2: Hiding the metadata

• TLS leaks website names and traffic patterns • Repeated visits to cookie-enthusiasts.com

reveal something about me • This problem is a focus of my research

Eavesdropper learns which website I am visiting

Page 256: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Challenge 2: Hiding the metadata

• TLS leaks website names and traffic patterns • Repeated visits to cookie-enthusiasts.com

reveal something about me • This problem is a focus of my research

Page 257: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Challenge 2: Hiding the metadata

• TLS leaks website names and traffic patterns • Repeated visits to cookie-enthusiasts.com

reveal something about me • This problem is a focus of my research Could be yours!

Page 258: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Challenge 2: Hiding the metadata

• TLS leaks website names and traffic patterns • Repeated visits to cookie-enthusiasts.com

reveal something about me • This problem is a focus of my research

Page 259: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Challenge 3: “Post-quantum” cryptography

Page 260: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Challenge 3: “Post-quantum” cryptography

• Most crypto systems in use today rely on the hardness of one of these computational problems:— Integer factorization problem— Discrete logarithm problem

Page 261: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Challenge 3: “Post-quantum” cryptography

• Most crypto systems in use today rely on the hardness of one of these computational problems:— Integer factorization problem— Discrete logarithm problem

• “Quantum algorithms” solve these problems efficiently

Page 262: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Challenge 3: “Post-quantum” cryptography

• Most crypto systems in use today rely on the hardness of one of these computational problems:— Integer factorization problem— Discrete logarithm problem

• “Quantum algorithms” solve these problems efficiently— Large-scale quantum computers could break [Shor’94]

much of today’s crypto

• The search for new cryptosystems is on!— NIST’s non-competition competition

http://csrc.nist.gov/groups/ST/post-quantum-crypto/

Page 263: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since
Page 264: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Concluding thoughts

• Cryptographic protocols are everywhere – Computers, phones, cars, satellites, toasters, etc.

• These protocols are devilishly hard to get right – Especially in systems with many moving parts (e.g.,

browser)

• And yet, the security of our computers, cars, planes, and satellites rely on us getting it right. – Lot’s of room for research, experimentation, improvement.

Henry [email protected]

henrycg.com

Page 265: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

Want to learn more?

Books – “The Codebreakers” by David Kahn – “The Puzzle Palace” by James Bamford

Courses – Free crypto course – www.crypto-class.org – Stanford Center for Prof. Dev. – scpd.stanford.edu

Questions?

Page 266: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since

References

• BEAST: http://commandlinefanatic.com/cgi-bin/showarticle.cgi?article=art027

• Vaudenay: https://www.iacr.org/cryptodb/archive/2002/EUROCRYPT/2850/2850.pdf

Page 267: Breaking the Internet: How Cryptography Fails in Practice€¦ · Breaking the Internet: How Cryptography Fails in Practice Henry Corrigan-Gibbs ... • TLS/SSL has been around since