94
HOW TO BACKDOOR DIFFIE-HELLMAN David Wong NCC Group

How to Backdoor Diffie-Hellman

Embed Size (px)

Citation preview

Page 1: How to Backdoor Diffie-Hellman

HOW TO BACKDOOR DIFFIE-HELLMAN

David Wong

NCC Group

Page 2: How to Backdoor Diffie-Hellman

TLSpre-2007: Absence of TLS

2007: TLS only for login forms (Graham sniffs gmail cookies live at Blackhat)

2009: Moxie releases SSLstrip at Blackhat

2010: HSTS introduced in Firefox

2013: Facebook is full-https

2014: preloaded-HSTS introduced in Chrome

Page 3: How to Backdoor Diffie-Hellman

TLSpre-2007: Absence of TLS

2007: TLS only for login forms (Graham sniffs gmail cookies live at Blackhat)

2009: Moxie releases SSLstrip at Blackhat

2010: HSTS introduced in Firefox

2013: Facebook is full-https

2014: preloaded-HSTS introduced in Chrome

Page 4: How to Backdoor Diffie-Hellman
Page 5: How to Backdoor Diffie-Hellman

TLSpre-2007: Absence of TLS

2007: TLS only for login forms (Graham sniffs gmail cookies live at Blackhat)

2009: Moxie releases SSLstrip at Blackhat

2010: HSTS introduced in Firefox

2013: Facebook is full-https

2014: preloaded-HSTS introduced in Chrome

Page 6: How to Backdoor Diffie-Hellman

TLSpre-2007: Absence of TLS

2007: TLS only for login forms (Graham sniffs gmail cookies live at Blackhat)

2009: Moxie releases SSLstrip at Blackhat

2010: HSTS introduced in Firefox / Firesheep

2013: Facebook is full-https

2014: preloaded-HSTS introduced in Chrome

Page 7: How to Backdoor Diffie-Hellman
Page 8: How to Backdoor Diffie-Hellman

TLSpre-2007: Absence of TLS

2007: TLS only for login forms (Graham sniffs gmail cookies live at Blackhat)

2009: Moxie releases SSLstrip at Blackhat

2010: HSTS introduced in Firefox / Firesheep

2013: Facebook is full-https / Snowden leaks

2014: preloaded-HSTS introduced in Chrome

Page 9: How to Backdoor Diffie-Hellman

TLSpre-2007: Absence of TLS

2007: TLS only for login forms (Graham sniffs gmail cookies live at Blackhat)

2009: Moxie releases SSLstrip at Blackhat

2010: HSTS introduced in Firefox / Firesheep

2013: Facebook is full-https / Snowden leaks

2010/2014: preloaded-HSTS introduced in Chrome

Page 10: How to Backdoor Diffie-Hellman
Page 11: How to Backdoor Diffie-Hellman
Page 12: How to Backdoor Diffie-Hellman

Logjam

Page 13: How to Backdoor Diffie-Hellman

• hardcoded DHE parameters in Apache

• NSA believed to be able to compute discrete logarithm in modulo 1024-bit integers

• too much work

Logjam

Page 14: How to Backdoor Diffie-Hellman

Logjam

Client Server

clientHello

serverHello

rsa(secret)

Page 15: How to Backdoor Diffie-Hellman

Logjam

Client Server

clientHello

serverHello

clientKeyExchange

serverKeyExchange

Page 16: How to Backdoor Diffie-Hellman

Logjam

Client Server

clientHello

serverHello

clientKeyExchange

serverKeyExchange

Page 17: How to Backdoor Diffie-Hellman

Logjam

Client Server

clientHello

serverHello

Page 18: How to Backdoor Diffie-Hellman

• hardcoded DHE parameters in Apache

• NSA believed to be able to compute discrete logarithm in modulo 1024-bit integers

• too much work

Logjam

Page 19: How to Backdoor Diffie-Hellman

• hardcoded DHE parameters in Apache

• NSA believed to be able to compute discrete logarithm in modulo 1024-bit integers

• too much work

Logjam

Page 20: How to Backdoor Diffie-Hellman

• hardcoded DHE parameters in Apache

• NSA believed to be able to compute discrete logarithm in modulo 1024-bit integers

• too much work

Logjam

Page 21: How to Backdoor Diffie-Hellman

U.S. export rules

• weak “Export” Cipher Suites

• 512-bit primes for Diffie-Hellman

• 40-bit keys for DES

Page 22: How to Backdoor Diffie-Hellman

U.S. export rules

• weak “Export” Cipher Suites

• 512-bit primes for Diffie-Hellman

• 40-bit keys for DES

Page 23: How to Backdoor Diffie-Hellman

U.S. export rules

• weak “Export” Cipher Suites

• 512-bit primes for Diffie-Hellman

• 40-bit keys for DES

Page 24: How to Backdoor Diffie-Hellman
Page 25: How to Backdoor Diffie-Hellman

LOTUS NOTES

• 64-bit crypto allowed…

• …if 24 bits of the key are encrypted to the NSA

• NSA’s RSA public key O=MiniTruth CN=Big Brother

Page 26: How to Backdoor Diffie-Hellman

LOTUS NOTES

• 64-bit crypto allowed…

• …if 24 bits of the key are encrypted to the NSA

• NSA’s RSA public key O=MiniTruth CN=Big Brother

Page 27: How to Backdoor Diffie-Hellman

LOTUS NOTES

• 64-bit crypto allowed…

• …if 24 bits of the key are encrypted to the NSA

• NSA’s RSA public key O=MiniTruth CN=Big Brother

Page 28: How to Backdoor Diffie-Hellman

Kleptography

• A kleptographic attack is an attack which uses asymmetric cryptography to implement a cryptographic backdoor.

• A secure kleptographic attack is undetectable as long as the cryptosystem is a black-box.

• what about white-box? Reverse Engineering?

Page 29: How to Backdoor Diffie-Hellman

Kleptography

• A kleptographic attack is an attack which uses asymmetric cryptography to implement a cryptographic backdoor.

• A secure kleptographic attack is undetectable as long as the cryptosystem is a black-box.

• what about white-box? Reverse Engineering?

Page 30: How to Backdoor Diffie-Hellman

Kleptography

• A kleptographic attack is an attack which uses asymmetric cryptography to implement a cryptographic backdoor.

• A secure kleptographic attack is undetectable as long as the cryptosystem is a black-box.

• what about white-box? Reverse Engineering?

Page 31: How to Backdoor Diffie-Hellman

• Weak crypto

• Kleptography

Page 32: How to Backdoor Diffie-Hellman

Dual EC

Page 33: How to Backdoor Diffie-Hellman

2007

Page 34: How to Backdoor Diffie-Hellman

CRYPTO 2007

Page 35: How to Backdoor Diffie-Hellman

NSA’s BULLRUN

Page 36: How to Backdoor Diffie-Hellman
Page 37: How to Backdoor Diffie-Hellman
Page 38: How to Backdoor Diffie-Hellman
Page 39: How to Backdoor Diffie-Hellman

Dual EC is obvious.

Page 40: How to Backdoor Diffie-Hellman

• Weak crypto

• Kleptography

• New Backdoored Algorithms

Page 41: How to Backdoor Diffie-Hellman
Page 42: How to Backdoor Diffie-Hellman
Page 43: How to Backdoor Diffie-Hellman

DHE backdoor?

Page 44: How to Backdoor Diffie-Hellman

DHE backdoor?

• Everyone trust DHE already

• Logjam: hardcoded DHE everywhere

• Everyone is upgrading to 2048-bit parameters

Page 45: How to Backdoor Diffie-Hellman

DHE backdoor?

• Everyone trust DHE already

• Logjam: hardcoded DHE everywhere

• Everyone is upgrading to 2048-bit parameters

Page 46: How to Backdoor Diffie-Hellman

DHE backdoor?

• Everyone trust DHE already

• Logjam: hardcoded DHE everywhere

• Everyone is upgrading to 2048-bit parameters

Page 47: How to Backdoor Diffie-Hellman

Diffie-Hellman

Alice Bob

Page 48: How to Backdoor Diffie-Hellman

Diffie-Hellman

Alice Bob

Page 49: How to Backdoor Diffie-Hellman

Diffie-Hellman

Alice Bob

Page 50: How to Backdoor Diffie-Hellman

Diffie-Hellman

Alice Bob

Page 51: How to Backdoor Diffie-Hellman

Diffie-Hellman

Alice Bob

Page 52: How to Backdoor Diffie-Hellman

Agenda

1. Group Theory

2. Attacks on DH

3. Construct a backdoor

4. Construct a NOBUS backdoor

Page 53: How to Backdoor Diffie-Hellman

Known attacks against DHGroup Theory

Page 54: How to Backdoor Diffie-Hellman

Known attacks against DHGroup Theory

Alice’s

Page 55: How to Backdoor Diffie-Hellman

Known attacks against DHPohlig-HellmanGroup Theory

Page 56: How to Backdoor Diffie-Hellman

Known attacks against DHPohlig-HellmanGroup Theory

Page 57: How to Backdoor Diffie-Hellman

Known attacks against DHPohlig-HellmanGroup Theory

Page 58: How to Backdoor Diffie-Hellman

Known attacks against DHPohlig-HellmanGroup Theory

Page 59: How to Backdoor Diffie-Hellman

Known attacks against DHPohlig-HellmanGroup Theory

Page 60: How to Backdoor Diffie-Hellman

Known attacks against DHPohlig-HellmanGroup Theory

Page 61: How to Backdoor Diffie-Hellman

Known attacks against DHPohlig-HellmanGroup Theory

Page 62: How to Backdoor Diffie-Hellman

Known attacks against DHPohlig-HellmanGroup Theory

Page 63: How to Backdoor Diffie-Hellman

wPohlig-HellmanGroup Theory

Page 64: How to Backdoor Diffie-Hellman

Known attacks against DH

Page 65: How to Backdoor Diffie-Hellman

Known attacks against DHDiffie-HellmanKnown attacks against DH

Page 66: How to Backdoor Diffie-Hellman

Known attacks against DH

• Trial Multiplication

• SNFS, GNFS

• Shank’s BSGS, Pollard Rho & Kangaroo, …

• Small subgroup attacks (active)

• Pohlig-Hellman (passive)

Page 67: How to Backdoor Diffie-Hellman

Known attacks against DH

• Trial Multiplication

• SNFS, GNFS

• Shank’s BSGS, Pollard Rho & Kangaroo, …

• Small subgroup attacks (active)

• Pohlig-Hellman (passive)

Page 68: How to Backdoor Diffie-Hellman

Known attacks against DH

• Trial Multiplication

• SNFS, GNFS

• Shank’s BSGS, Pollard Rho & Kangaroo, …

• Small subgroup attacks (active)

• Pohlig-Hellman (passive)

Page 69: How to Backdoor Diffie-Hellman

Known attacks against DH

• Trial Multiplication

• SNFS, GNFS

• Shank’s BSGS, Pollard Rho & Kangaroo, …

• Small subgroup attacks (active)

• Pohlig-Hellman (passive)

Page 70: How to Backdoor Diffie-Hellman

Known attacks against DH

• Trial Multiplication

• SNFS, GNFS

• Shank’s BSGS, Pollard Rho & Kangaroo, …

• Small subgroup attacks (active)

• Pohlig-Hellman (passive)

Page 71: How to Backdoor Diffie-Hellman

Small Subgroups Attack

alice

Page 72: How to Backdoor Diffie-Hellman

Small Subgroups Attack

alice

Page 73: How to Backdoor Diffie-Hellman

Small Subgroups Attack

alice

Page 74: How to Backdoor Diffie-Hellman

Small Subgroups Attack

alice

odd even

Page 75: How to Backdoor Diffie-Hellman

Known attacks against DHPohlig-Hellman

Page 76: How to Backdoor Diffie-Hellman

Known attacks against DHPohlig-Hellman

Page 77: How to Backdoor Diffie-Hellman

Prime groups

Page 78: How to Backdoor Diffie-Hellman

Prime groups

Page 79: How to Backdoor Diffie-Hellman

Prime groups

Page 80: How to Backdoor Diffie-Hellman

Prime groups

Page 81: How to Backdoor Diffie-Hellman

CM-HSOComposite Modulus with a Hidden Smooth Order

Page 82: How to Backdoor Diffie-Hellman

CM-HSOComposite Modulus with a Hidden Smooth Order

Page 83: How to Backdoor Diffie-Hellman

CM-HSOComposite Modulus with a Hidden Smooth Order

Page 84: How to Backdoor Diffie-Hellman

CM-HSOComposite Modulus with a Hidden Smooth Order

Page 85: How to Backdoor Diffie-Hellman
Page 86: How to Backdoor Diffie-Hellman
Page 87: How to Backdoor Diffie-Hellman

DEMO

Page 88: How to Backdoor Diffie-Hellman

https://github.com/mimoo/Diffie-Hellman_Backdoor

Page 89: How to Backdoor Diffie-Hellman

Detect and Protect

• Check for prime modulus

• Better: check for safe prime modulus

• Google Chrome -> deprecating DHE

• migrating to ECDHE

Page 90: How to Backdoor Diffie-Hellman

Detect and Protect

• Check for prime modulus

• Better: check for safe prime modulus

• Google Chrome -> deprecating DHE

• migrating to ECDHE

Page 91: How to Backdoor Diffie-Hellman

Detect and Protect

• Check for prime modulus

• Better: check for safe prime modulus

• Google Chrome deprecating DHE (-> ECDHE)

• migrating to ECDHE

Page 92: How to Backdoor Diffie-Hellman

END

how many VPN/libraries/closed-source products are backdoored?

Page 93: How to Backdoor Diffie-Hellman

END

how many VPN/libraries/closed-source products are backdoored?

what about ECDHE?

Page 94: How to Backdoor Diffie-Hellman

twitter.com/lyon01_david