Secure Protocols in a Hostile World for CHES 2015 Matthew Green - - PowerPoint PPT Presentation

secure protocols in a hostile world
SMART_READER_LITE
LIVE PREVIEW

Secure Protocols in a Hostile World for CHES 2015 Matthew Green - - PowerPoint PPT Presentation

Secure Protocols in a Hostile World for CHES 2015 Matthew Green Johns Hopkins University Why this talk? Why this presentation? These people are wrong solved problem Algorithms Protocol Design Unsolved Implementation Library


slide-1
SLIDE 1

Secure Protocols in a 
 Hostile World

Matthew Green
 Johns Hopkins University for CHES 2015

slide-2
SLIDE 2

Why this talk?

slide-3
SLIDE 3

Why this presentation?

These people are wrong

slide-4
SLIDE 4

Algorithms Protocol Design Implementation Library API design Deployment & Correct Usage Unsolved “solved problem”

slide-5
SLIDE 5

Algorithms Protocol Design Implementation Library API design Deployment & Correct Usage “solved problem” Unsolved

slide-6
SLIDE 6

Algorithms Protocol Design Implementation Library API design Deployment & Correct Usage “solved problem” Unsolved

slide-7
SLIDE 7

Why does this matter?

slide-8
SLIDE 8
slide-9
SLIDE 9
slide-10
SLIDE 10
slide-11
SLIDE 11
  • We know how to build strong cryptosystems
  • Our research focuses on building stronger crypto systems!
  • And yet we continue to deploy weak ones
  • Worse, we’re largely stuck with weak ones
  • What’s going on here?
  • Main case studies: SSL/TLS, IPSEC

This talk

slide-12
SLIDE 12

Case study 1: SSL/TLS

slide-13
SLIDE 13
  • Most important security protocol on the Internet
  • Allows secure connections between clients & servers
  • Current version: TLS 1.2
  • (But browsers still support SSL 3, TLS 1.0/1.1) 


plus 1.3 coming soon!

  • Not just web browsing!

SSL/TLS

slide-14
SLIDE 14

A brief history

  • SSLv1 born at Netscape. Never released. (~1994)
  • SSLv2 released one year later
  • SSLv3 (1996)
  • TLS 1.0 (1998)
  • Still widely deployed
  • TLS 1.1 (2006)
  • TLS 1.2 (2008)
slide-15
SLIDE 15

How secure is TLS?

  • Many active attacks and implementation vulnerabilities
  • Heartbleed, Lucky13, FREAK, CRIME, BEAST, RC4
slide-16
SLIDE 16

How secure is TLS?

  • Many active attacks and implementation vulnerabilities
  • Heartbleed, Lucky13, FREAK, CRIME, BEAST, RC4

In practice: most of these require substantial resources and 
 can’t be deployed at scale

slide-17
SLIDE 17
  • Not all attacks:

How secure is TLS?

But not all attacks…

slide-18
SLIDE 18

What’s wrong with TLS?

slide-19
SLIDE 19

Quite a bit

  • Many problems result from TLS’s use of 


“pre-historic cryptography” (- Eric Rescorla)

  • CBC with Mac-then-Encrypt, bad use of IVs
  • RSA-PKCS#1v1.5 encryption padding
  • RC4
  • DH parameter generation
  • Horrifying backwards compatibility requirements
slide-20
SLIDE 20

Quite a bit

  • Many problems result from TLS’s use of 


“pre-historic cryptography” (- Eric Rescorla)

  • CBC with Mac-then-Encrypt, bad use of IVs
  • RSA-PKCS#1v1.5 encryption padding
  • RC4
  • DH parameter generation
  • Horrifying backwards compatibility requirements

Many of these flaws were ‘known’
 at design time, but exploited by
 researchers only afterwards.

slide-21
SLIDE 21

MAC-then-pad-then-Encrypt

  • TLS MACs the record, then pads (in CBC), then enciphers
  • Obvious problem: padding oracles
  • Countermeasure(s): 


  • 1. Do not distinguish padding/MAC failure


  • 2. “Constant-time” decryption

slide-22
SLIDE 22

BEAST

  • Serious bug in TLS 1.0
  • Allows complete decryption of CBC ciphertexts
  • Use of predictable Initialization Vector (CBC residue bug)
  • Known since 2002, attack described by Bard in 2005


(Bard was advised to focus on more interesting problems.)

  • Nobody cared or noticed until someone implemented it
slide-23
SLIDE 23

Solution in practice: RC4

:-(

(When RC4 is your solution, 
 you need a better problem)

slide-24
SLIDE 24

Compression (CRIME)

  • Can’t really blame the TLS designers for including it...
  • Blame cryptographers for not noticing it’s still in use?
  • Blame cryptographers for pretending it would go away.
  • We need a model for compression+encryption
  • Clearly this can’t be semantically secure
  • But how much weaker? Can we quantify?
slide-25
SLIDE 25

Protocol Design

slide-26
SLIDE 26

Example: Negotiation

Each TLS handshake begins with a cipher suite negotiation that determines which key agreement protocol (etc.) will be used. Negotiate Key Exchange Confirm handshake messages

slide-27
SLIDE 27

Ciphersuite Negotiation

I support: 
 RSA, DHE, ECDHE, RSA_EXPORT I choose: 
 ECDHE

Negotiate

slide-28
SLIDE 28

Ciphersuite Negotiation

I support: 
 RSA, DHE, ECDHE, RSA_EXPORT I choose: 
 ECDHE

Key exchange

slide-29
SLIDE 29

Ciphersuite Negotiation

I choose: 
 ECDHE

Confirm handshake messages

I support: 
 RSA, DHE, ECDHE, RSA_EXPORT

slide-30
SLIDE 30

MITM Negotiation

slide-31
SLIDE 31

MITM Negotiation

I support: 
 RSA, DHE, ECDHE, RSA_EXPORT

slide-32
SLIDE 32

MITM Negotiation

I choose: 
 RSA_EXPORT I support: 
 RSA, DHE, ECDHE, RSA_EXPORT

slide-33
SLIDE 33

MITM Negotiation

I choose: 
 RSA_EXPORT I support: 
 RSA, DHE, ECDHE, RSA_EXPORT

slide-34
SLIDE 34

MITM Negotiation

I choose: 
 RSA_EXPORT I support: 
 RSA, DHE, ECDHE, RSA_EXPORT

Attacker can break RSA export key

slide-35
SLIDE 35

MITM Negotiation

I choose: 
 RSA_EXPORT

Confirm handshake messages

I support: 
 RSA, DHE, ECDHE, RSA_EXPORT

… and forge confirmation messages

slide-36
SLIDE 36

MITM Negotiation

I choose: 
 RSA_EXPORT

Confirm handshake messages

I support: 
 RSA, DHE, ECDHE, RSA_EXPORT

As of Mar ’15, 30+% of TLS hosts supported export suites!

slide-37
SLIDE 37

MITM Negotiation

I choose: 
 RSA_EXPORT

Confirm handshake messages

I support: 
 RSA, DHE, ECDHE, RSA_EXPORT

Solution: Modern clients won’t offer broken cipher suites like RSA_EXPORT 
 (unless they’re wget or curl!) As of Mar ’15, 30+% of TLS hosts supported export suites!

slide-38
SLIDE 38

Question

Is it sufficient for the client to support only “strong” ciphersuites, even if the server supports weak ones?

slide-39
SLIDE 39

Question

Is it sufficient for the client to support only “strong” ciphersuites, even if the server supports weak ones?

  • Let A be the set of KA protocols supported by Client


Let B be the set of KA protocols supported by Server

  • If each KA protocol in is a secure KA protocol, is the TLS

handshake secure?

A ∩ B

slide-40
SLIDE 40
  • In CRYPTO 2012 (!) we saw the first paper


to successfully analyze TLS-DHE [Jager et al.]

  • In CRYPTO 2013 a random-oracle analysis of the


TLS-RSA handshake [Krawczyk et al.]

  • In CRYPTO 2014 an automated analysis of the full


handshake, under a new security model [Bhargavan et al.]

TLS for cryptographers

slide-41
SLIDE 41
  • In CRYPTO 2012 (!) we saw the first paper


to successfully analyze TLS-DHE [Jager et al.]

  • In CRYPTO 2013 a random-oracle analysis of the


TLS-RSA handshake [Krawczyk et al.]

  • In CRYPTO 2014 an automated analysis of the full


handshake, under a new security model [Bhargavan et al.]

TLS for cryptographers

slide-42
SLIDE 42
  • In CRYPTO 2012 (!) we saw the first paper


to successfully analyze TLS-DHE [Jager et al.]

  • In CRYPTO 2013 a random-oracle analysis of the


TLS-RSA handshake [Krawczyk et al.]

  • In CRYPTO 2014 an automated analysis of the full


handshake, under a new security model [Bhargavan et al.]

TLS for cryptographers

slide-43
SLIDE 43

Theorem

  • Bhargavan et al. theorem statement:


Let A be the set of KA protocols supported by Client
 Let B be the set of KA protocols supported by Server
 
 If each KA protocol in is a secure KA protocol &
 there exist PRFs, then the TLS handshake is a secure KA protocol.

A ∪ B

slide-44
SLIDE 44

Theorem

  • Bhargavan et al. theorem statement:


Let A be the set of KA protocols supported by Client
 Let B be the set of KA protocols supported by Server
 
 If each KA protocol in is a secure KA protocol &
 there exist PRFs, then the TLS handshake is a secure KA protocol.

TLS design/deployment assumes this would be !

A ∪ B A ∩ B

slide-45
SLIDE 45

Example 2: Negotiation

Tolga Acar, Mira Belenkiy, Mihir Bellare, and David Cash, Cryptographic Agility and its Relation to Circular Encryption, in EUROCRYPT 2010

I support: 
 RSA, DHE, ECDHE I support: 
 RSA, DHE, DHE_EXPORT, RSA_EXPORT, ECDHE

slide-46
SLIDE 46

Example 2: Negotiation

Tolga Acar, Mira Belenkiy, Mihir Bellare, and David Cash, Cryptographic Agility and its Relation to Circular Encryption, in EUROCRYPT 2010

I support: 
 RSA, DHE, ECDHE I support: 
 RSA, DHE, DHE_EXPORT, RSA_EXPORT, ECDHE RSA_EXPORT

slide-47
SLIDE 47

Example 2: Negotiation

Tolga Acar, Mira Belenkiy, Mihir Bellare, and David Cash, Cryptographic Agility and its Relation to Circular Encryption, in EUROCRYPT 2010

I support: 
 RSA, DHE, ECDHE I support: 
 RSA, DHE, DHE_EXPORT, RSA_EXPORT, ECDHE RSA_EXPORT

slide-48
SLIDE 48

Example 2: Negotiation

Tolga Acar, Mira Belenkiy, Mihir Bellare, and David Cash, Cryptographic Agility and its Relation to Circular Encryption, in EUROCRYPT 2010

I support: 
 RSA, DHE, ECDHE I support: 
 RSA, DHE, DHE_EXPORT, RSA_EXPORT, ECDHE RSA_EXPORT

FREAK [Bhargavan et al.]:
 Due to a bug in SecureTransport, OpenSSL, SChannel, client accepts export-grade RSA key

slide-49
SLIDE 49

Tolga Acar, Mira Belenkiy, Mihir Bellare, and David Cash, Cryptographic Agility and its Relation to Circular Encryption, in EUROCRYPT 2010

slide-50
SLIDE 50

Example 2: Negotiation

Tolga Acar, Mira Belenkiy, Mihir Bellare, and David Cash, Cryptographic Agility and its Relation to Circular Encryption, in EUROCRYPT 2010

I support: 
 RSA, DHE, ECDHE I support: 
 RSA, DHE, DHE_EXPORT, RSA_EXPORT, ECDHE

Negotiation Solution: Fix implementations Patch OpenSSL, SecureTransport, SChannel so they will recognize an RSA export key
 exchange message, barf (patches rolled out March 2015)

slide-51
SLIDE 51

Example 3: Negotiation

Tolga Acar, Mira Belenkiy, Mihir Bellare, and David Cash, Cryptographic Agility and its Relation to Circular Encryption, in EUROCRYPT 2010

I support: 
 RSA, DHE, ECDHE I support: 
 RSA, DHE, DHE_EXPORT, RSA_EXPORT, ECDHE

slide-52
SLIDE 52

Example 3: Negotiation

Tolga Acar, Mira Belenkiy, Mihir Bellare, and David Cash, Cryptographic Agility and its Relation to Circular Encryption, in EUROCRYPT 2010

I support: 
 RSA, DHE, ECDHE I support: 
 RSA, DHE, DHE_EXPORT, RSA_EXPORT, ECDHE DHE_EXPORT

slide-53
SLIDE 53

Example 3: Negotiation

Tolga Acar, Mira Belenkiy, Mihir Bellare, and David Cash, Cryptographic Agility and its Relation to Circular Encryption, in EUROCRYPT 2010

I support: 
 RSA, DHE, ECDHE I support: 
 RSA, DHE, DHE_EXPORT, RSA_EXPORT, ECDHE DHE_EXPORT

slide-54
SLIDE 54

Example 3: Negotiation

Tolga Acar, Mira Belenkiy, Mihir Bellare, and David Cash, Cryptographic Agility and its Relation to Circular Encryption, in EUROCRYPT 2010

I support: 
 RSA, DHE, ECDHE I support: 
 RSA, DHE, DHE_EXPORT, RSA_EXPORT, ECDHE DHE_EXPORT

slide-55
SLIDE 55

Example 3: Negotiation

Tolga Acar, Mira Belenkiy, Mihir Bellare, and David Cash, Cryptographic Agility and its Relation to Circular Encryption, in EUROCRYPT 2010

I support: 
 RSA, DHE, ECDHE I support: 
 RSA, DHE, DHE_EXPORT, RSA_EXPORT, ECDHE DHE_EXPORT

LogJam [Adrian et al.]:
 Due to a bug in the TLS protocol client accepts export-grade DHE key

slide-56
SLIDE 56

TLS design/deployment assumptions were wrong, and we knew this for years —
 but failed to properly communicate to the community.

slide-57
SLIDE 57

TLS design/deployment assumptions were wrong, and we knew this for years —
 but failed to properly communicate to the community. The community made terrible assumptions and didn’t ask us what we thought of them. Then they got mired in backwards compatibility issues and only responded to attacks.

slide-58
SLIDE 58

Exploiting LogJam

(Joint work: Adrian, Bhargavan, Durumeric, Gaudry, Green, Halderman, Heninger, Springall, Thomé, Valenta, VanderSloot, Wustrow, Zanella-Beguelin, Zimmermann) to appear ‘CCS 2015


slide-59
SLIDE 59

Exploiting LogJam

  • To exploit the downgrade attack, requires 


solving a 512-bit DL in real time

  • Initially this seems challenging, but NFS algorithm


can be heavily optimized for pre-computation
 using only prime (p)

  • “Oversieving” increases cost of sieving and storage,


but reduces cost of linear algebra step & final “descent”

slide-60
SLIDE 60

Exploiting LogJam

  • To exploit the downgrade attack, requires 


solving a 512-bit DL in real time

  • 92% of DHE_EXPORT servers use one of two hard-

coded primes (p) (Mod_SSL, Apache)

slide-61
SLIDE 61

Exploiting LogJam

  • To exploit the downgrade attack, requires 


solving a 512-bit DL in real time

  • 92% of DHE_EXPORT servers use one of two hard-

coded primes (p) (Mod_SSL, Apache)

Sieving/Linear Alg: 1 week (wall clock) for each p Descent on (g, h)

slide-62
SLIDE 62

Example 3: Negotiation

Tolga Acar, Mira Belenkiy, Mihir Bellare, and David Cash, Cryptographic Agility and its Relation to Circular Encryption, in EUROCRYPT 2010

I support: 
 RSA, DHE, ECDHE I support: 
 RSA, DHE, DHE_EXPORT, RSA_EXPORT, ECDHE DHE_EXPORT

Short term (hack) solution: Fix OpenSSL, SecureTransport, SChannel so they refuse DHE keys <768 bits patched in NSS, SChannel, BoringSSL, LibreSSL, SecureTransport (Took months to accomplish this, since it breaks ~1% of the Internet to make this fix)

slide-63
SLIDE 63

How do we fix this?

slide-64
SLIDE 64

Example 3: Negotiation

Tolga Acar, Mira Belenkiy, Mihir Bellare, and David Cash, Cryptographic Agility and its Relation to Circular Encryption, in EUROCRYPT 2010

I support: 
 RSA, DHE, ECDHE I support: 
 RSA, DHE, DHE_EXPORT, RSA_EXPORT, ECDHE DHE_EXPORT

Long(er) term solutions: Eliminate 1024-bit DHE (but Java). Stop using common DHE primes. Use EU-CMA signatures to validate the protocol

  • transcript. Then you can achieve the

security the TLS designers originally set out to achieve. (TLS 1.3 adds such a message, provisionally.)

A ∩ B

slide-65
SLIDE 65
  • What’s going on here?

This picture again

slide-66
SLIDE 66
  • What’s going on here?

This picture again

This is just a fancy SSL terminator

slide-67
SLIDE 67
  • What’s going on here?

This picture again

This is where the magic happens

slide-68
SLIDE 68

What is LONGHAUL?

Hypothesis 1: LONGHAUL is a database of stolen RSA secret keys

  • This works well, but it’s boring
  • Easy to solve: switch to PFS cipher suites

(DHE/ECDHE)

slide-69
SLIDE 69

What is LONGHAUL?

  • Hypothesis 1: The NSA is stealing RSA secret keys
  • This works really well, but it’s boring
  • Solution: switch to PFS cipher suites (DHE)
slide-70
SLIDE 70

What is LONGHAUL?

  • Hypothesis 1: The NSA is stealing RSA secret keys
  • This works really well, but it’s boring
  • Solution: switch to PFS cipher suites (DHE)
slide-71
SLIDE 71

Problem

  • LONGHAUL also purports to decrypt IPSec/IKE
  • IKE does not use RSA
  • It uses Diffie-Hellman for each connection.
slide-72
SLIDE 72

What is LONGHAUL?

slide-73
SLIDE 73
slide-74
SLIDE 74

What is LONGHAUL?

Hypothesis 2: The NSA is breaking1024-bit DHE

  • This sounds completely insane
  • Maybe it’s not
slide-75
SLIDE 75

Breaking DHE at scale

  • Breaking DHE == solving the Discrete Logarithm problem
  • In theory, this is too expensive for keys >=768 bits
  • However there is a wrinkle…
slide-76
SLIDE 76

Breaking DHE at scale

  • A large percentage of Apache/Java/ISS servers use fixed, hardcoded

parameters for DHE

  • IPSec/IKE is even worse: nearly 50% of servers will choose 


Oakley groups 1 and 2 (768/1024) - generated in 1998

  • NFS is heavily optimized for pre-computation using only the primes
  • With specific pre-computation ($10s-100s of Million/1 year?)


an attacker might be able to break 30-50% of DHE connections with academic levels of computing

  • Approximately 30 core days for final descent
slide-77
SLIDE 77

How do we fix this?

  • Eliminate 1024-bit DH
  • This is challenging in TLS, since many machines (Java 7) crash on

longer parameter lengths

  • D. Gillmor, new extension to negotiate FF-DHE
  • Eliminate DHE altogether
  • Move to ECDHE, which is currently not 100% supported
  • Downgrade to RSA (!)
  • Eliminate common primes
slide-78
SLIDE 78

Why aren’t we fixing this?

slide-79
SLIDE 79

Why aren’t we fixing this?

slide-80
SLIDE 80

Conclusion

  • Cryptography is challenging! (duh)
  • We fail to push best practices down to the engineering community
  • They fail to pull best practices from the literature, even 


years after vulnerabilities are known

  • Cryptosystems continue to become more complex and vulnerable
  • This process is not really tolerable anymore