SSH, SSL, and IPsec: wtf?
Eric Rescorla RTFM, Inc. ekr@rtfm.com
Eric Rescorla SSH, SSL, and IPsec 1
SSH, SSL, and IPsec: wtf? Eric Rescorla RTFM, Inc. ekr@rtfm.com - - PowerPoint PPT Presentation
SSH, SSL, and IPsec: wtf? Eric Rescorla RTFM, Inc. ekr@rtfm.com Eric Rescorla SSH, SSL, and IPsec 1 What are we trying to accomplish? Alice, Bob want to talk to each other But theyre worried about attack How do you know
Eric Rescorla SSH, SSL, and IPsec 1
Eric Rescorla SSH, SSL, and IPsec 2
Eric Rescorla SSH, SSL, and IPsec 3
Eric Rescorla SSH, SSL, and IPsec 4
Eric Rescorla SSH, SSL, and IPsec 5
Eric Rescorla SSH, SSL, and IPsec 6
Eric Rescorla SSH, SSL, and IPsec 7
Eric Rescorla SSH, SSL, and IPsec 8
Eric Rescorla SSH, SSL, and IPsec 9
Eric Rescorla SSH, SSL, and IPsec 10
Challenge
Eric Rescorla SSH, SSL, and IPsec 11
Challenge
H(Sab+Challenge)
Attack Commands
Eric Rescorla SSH, SSL, and IPsec 12
Challenge1
H(Sab+Challenge1+Challenge2)
H(Sab+Challenge2+Challenge1)
Eric Rescorla SSH, SSL, and IPsec 13
Challenge1
H(Sab+Challenge1+Challenge1)
Challenge2 H(Sab+Challenge1+Challenge1)
H(Sab+Challenge2+Challenge1)
Eric Rescorla SSH, SSL, and IPsec 14
2 2
Eric Rescorla SSH, SSL, and IPsec 15
Eric Rescorla SSH, SSL, and IPsec 16
Eric Rescorla SSH, SSL, and IPsec 17
Challenge1
H(Sab+Challenge1+Challenge2)
H(Sab+Challenge2+Challenge1)
Message2,MAC
Eric Rescorla SSH, SSL, and IPsec 18
Eric Rescorla SSH, SSL, and IPsec 19
Challenge1
H(Sab+Challenge1+Challenge2)
H(Sab+Challenge2+Challenge1)
E(kb→a,(Message2,MAC))
Eric Rescorla SSH, SSL, and IPsec 20
Rather than encrypting the MAC, we should encrypt the message and MAC the ciphertext
Eric Rescorla SSH, SSL, and IPsec 21
pub, Kb priv) = F(Kb pub, Ka pub) = ZZ
Eric Rescorla SSH, SSL, and IPsec 22
priv
Not actually true. Diffje–Hellman is not that complicated and you do need to understand how it works!
Random1,Ka
pub
Random2,Kb
pub
E(kb→a,(Message2,MAC))
Eric Rescorla SSH, SSL, and IPsec 23
We need four difgerent keys: — Encryption keys Alice -> Bob and Bob -> Alice; — MAC keys Alice -> Bob and Bob -> Alice
Random1,Ka
pub
Random1,KA
pub
Random2,KA
pub
pub
E(kA→b,(Message1,MAC))
E(kA→a,(Message2,MAC))
Eric Rescorla SSH, SSL, and IPsec 24
Eric Rescorla SSH, SSL, and IPsec 25
Eric Rescorla SSH, SSL, and IPsec 26
Eric Rescorla SSH, SSL, and IPsec 27
LetsEncrypt — free, easy to use
Random1,Certa
Random2,Certb
E(kb→a,(Message2,MAC))
Eric Rescorla SSH, SSL, and IPsec 28
Random1,Certs
pub
E(kc→s,(Credit card #,MAC))
E(ks→c,(OK,MAC))
Eric Rescorla SSH, SSL, and IPsec 29
Well, it was. Now, we're moving toward forward secrecy (next slide)
Eric Rescorla SSH, SSL, and IPsec 30
and TLS 1.3
Eric Rescorla SSH, SSL, and IPsec 31
Random1,Algorithms
Random2,Algorithm,Certb
MAC(ZZ,HandshakeMsgs)
E(kb→a,(Message2,MAC))
SSH, SSL, and IPsec 32
Again, we should MAC the ciphertext rather than encrypting the MAC
Eric Rescorla SSH, SSL, and IPsec 33
Eric Rescorla SSH, SSL, and IPsec 34
Eric Rescorla SSH, SSL, and IPsec 35
TLS 1.3 is in progress, major changes: — No RSA key exchange (for forward secrecy); — authenticated encryption modes; — 0 RTT handshakes
T CP SY N
T CP SY NACK
HT T P Request
HT T P Response
Eric Rescorla SSH, SSL, and IPsec 36
Eric Rescorla SSH, SSL, and IPsec 37
HELO + T LS
OK do T LS
Eric Rescorla SSH, SSL, and IPsec 38
Eric Rescorla SSH, SSL, and IPsec 39
Eric Rescorla SSH, SSL, and IPsec 40
Eric Rescorla SSH, SSL, and IPsec 41
Eric Rescorla SSH, SSL, and IPsec 42
P rotocol=SSH2.0...
KeyExInit(algorithms...)
DH(group size)
p,g
pub
DHs
pub,Sign(Ks priv,DHs pub)
SSH, SSL, and IPsec 43
Eric Rescorla SSH, SSL, and IPsec 44
Auth: None
Auth: publickey,password,...
No
No
OK
SSH, SSL, and IPsec 45
Yes
X Server X Client SSH Client SSH Server localhost:6000 localhost:XXXX
Eric Rescorla SSH, SSL, and IPsec 46
Eric Rescorla SSH, SSL, and IPsec 47
Eric Rescorla SSH, SSL, and IPsec 48
Eric Rescorla SSH, SSL, and IPsec 49
Kernel Space User Space Transport TCP/UDP IP IPsec HTTP SMTP ... IKE SPD SAD
Eric Rescorla SSH, SSL, and IPsec 50
IP Hdr IPsec Hdr TCP Hdr Data Transport Mode IP Hdr IPsec Hdr IP Hdr TCP Hdr Data Tunnel Mode
Eric Rescorla SSH, SSL, and IPsec 51
DHi
pub
DHr
pub
{CERT r}
Eric Rescorla SSH, SSL, and IPsec 52
DHi
pub
T icket
pub,T icket
DHr
pub
{CERT r}
Eric Rescorla SSH, SSL, and IPsec 53
Eric Rescorla SSH, SSL, and IPsec 54
Eric Rescorla SSH, SSL, and IPsec 55
Eric Rescorla SSH, SSL, and IPsec 56