The case for ubiquitous transport-level encryption Andrea Bittau, - - PowerPoint PPT Presentation

the case for ubiquitous transport level encryption
SMART_READER_LITE
LIVE PREVIEW

The case for ubiquitous transport-level encryption Andrea Bittau, - - PowerPoint PPT Presentation

Introduction tcpcrypt Performance Conclusion 1/25 The case for ubiquitous transport-level encryption Andrea Bittau, Michael Hamburg, Mark Handley, David Mazi` eres, and Dan Boneh Stanford and UCL August 13, 2010 Goals Introduction


slide-1
SLIDE 1

Introduction tcpcrypt Performance Conclusion 1/25

The case for ubiquitous transport-level encryption

Andrea Bittau, Michael Hamburg, Mark Handley, David Mazi` eres, and Dan Boneh Stanford and UCL August 13, 2010

slide-2
SLIDE 2

Introduction tcpcrypt Performance Conclusion 2/25

Goals

What would it take to encrypt the vast majority of TCP traffic?

1 Performance.

Fast enough to enable by default on almost all servers.

2 End-point authentication.

Leverage certificates, cookies, passwords, etc., to achieve best possible security for any given setting.

3 Compatibility.

Works in existing networks. Works with legacy apps.

slide-3
SLIDE 3

Introduction tcpcrypt Performance Conclusion 3/25

Performance today can be pretty bad

10000 20000 30000 40000 50000 60000 70000 TCP server SSL server Connections/s 60,156 737

Biggest problem: cost of public key cryptography. Worst case: SSL can be 82x slower than TCP. . .

slide-4
SLIDE 4

Introduction tcpcrypt Performance Conclusion 3/25

Performance today can be pretty bad

10000 20000 30000 40000 50000 60000 70000 TCP server tcpcrypt server SSL server Connections/s 60,156 19,153 737

Biggest problem: cost of public key cryptography. Worst case: SSL can be 82x slower than TCP. . . Worst case: tcpcrypt only 3x slower than TCP!

slide-5
SLIDE 5

Introduction tcpcrypt Performance Conclusion 4/25

Problem today: app-level auth divorced from transport

1 SSL encrypts + server auth.

SSL. Authenticate server using certificates

slide-6
SLIDE 6

Introduction tcpcrypt Performance Conclusion 4/25

Problem today: app-level auth divorced from transport

1 SSL encrypts + server auth.

SSL. Authenticate server using certificates

2 App auths client.

SSL. Authenticate server using certificates Username: Andrea Password: w00t

If step 1 fails, step 2 doesn’t help—in fact, it harms.

slide-7
SLIDE 7

Introduction tcpcrypt Performance Conclusion 5/25

What’s the best we can do?

Level of security against a network attacker depends on scenario. Preconfiguration Use case Today’s security Possible security None None No passive eavesdropping

slide-8
SLIDE 8

Introduction tcpcrypt Performance Conclusion 5/25

What’s the best we can do?

Level of security against a network attacker depends on scenario. Preconfiguration Use case Today’s security Possible security None None No passive eavesdropping Server certificate Server auth Server auth

slide-9
SLIDE 9

Introduction tcpcrypt Performance Conclusion 5/25

What’s the best we can do?

Level of security against a network attacker depends on scenario. Preconfiguration Use case Today’s security Possible security None None No passive eavesdropping Server certificate Server auth Server auth Shared secret (cookie) no SSL None Mutual auth

slide-10
SLIDE 10

Introduction tcpcrypt Performance Conclusion 5/25

What’s the best we can do?

Level of security against a network attacker depends on scenario. Preconfiguration Use case Today’s security Possible security None None No passive eavesdropping Server certificate Server auth Server auth Shared secret (cookie) no SSL None Mutual auth Shared secret and SSL Mutual auth if cert and pass OK Mutual auth if password OK

slide-11
SLIDE 11

Introduction tcpcrypt Performance Conclusion 5/25

What’s the best we can do?

Level of security against a network attacker depends on scenario. Preconfiguration Use case Today’s security Possible security None None No passive eavesdropping Server certificate Server auth Server auth Shared secret (cookie) no SSL None Mutual auth Shared secret and SSL Mutual auth if cert and pass OK Mutual auth if password OK

slide-12
SLIDE 12

Introduction tcpcrypt Performance Conclusion 5/25

What’s the best we can do?

Level of security against a network attacker depends on scenario. Preconfiguration Use case Today’s security Possible security None None No passive eavesdropping Server certificate Server auth Server auth Shared secret (cookie) no SSL None Mutual auth Shared secret and SSL Mutual auth if cert and pass OK Mutual auth if password OK goal with tcpcrypt

slide-13
SLIDE 13

Introduction tcpcrypt Performance Conclusion 6/25

Backwards compatibility issues

Two prevalent ways of encrypting network traffic:

1 At application layer (e.g., SSL).

√ Works over almost all networks. × Need to modify applications. × Application protocol may not allow incremental deployment.

2 At network layer (e.g., IPSec).

√ Works with all applications. × Breaks NAT. × Can’t leverage user authentication.

Ubiquitous encryption requires best of both worlds.

slide-14
SLIDE 14

Introduction tcpcrypt Performance Conclusion 7/25

tcpcrypt: transport-layer encryption

tcpcrypt: a TCP option for encryption.

1 High server performance: push complexity to clients. 2 Allow applications to authenticate end points. 3 Backwards compatibility: all TCP apps, all networks, all

authentication settings.

slide-15
SLIDE 15

Introduction tcpcrypt Performance Conclusion 8/25

tcpcrypt overview

Extend TCP in a compatible way using TCP options. Applications use standard BSD socket API. New getsockopt for authentication. Encryption automatically enabled if both end points support tcpcrypt.

slide-16
SLIDE 16

Introduction tcpcrypt Performance Conclusion 9/25

Push expensive operations to clients

Public key operations expensive, but not all equally expensive. RSA-exp3-2048 performance: Operation Latency (ms) Decrypt 10.42 Encrypt 0.26 Have client do decrypt

client server

Generate ephemeral key pair public key Generate random master key encpubk(master key)

Without server authentication, have client decrypt. Lets servers accept connections at 36x rate of SSL.

slide-17
SLIDE 17

Introduction tcpcrypt Performance Conclusion 10/25

Link app auth to transport auth

Session ID: hook linking tcpcrypt to app-level authentication. New getsockopt returns non-secret Session ID value. Unique for every connection (if one endpoint honest). If same on both ends, no man-in-the-middle.

tcpcrypt Password based Authentication of user & sess ID Session ID Session ID

Authenticating the Session ID authenticates the end point.

slide-18
SLIDE 18

Introduction tcpcrypt Performance Conclusion 11/25

Auth example: batch signing

Tcpcrypt: server signs multiple session IDs at once to amortize RSA cost.

SID A “A” Signed by amazon.com RSA op.

slide-19
SLIDE 19

Introduction tcpcrypt Performance Conclusion 11/25

Auth example: batch signing

Tcpcrypt: server signs multiple session IDs at once to amortize RSA cost.

SID B SID A “A” Signed by amazon.com RSA op. “B” Signed by amazon.com RSA op.

slide-20
SLIDE 20

Introduction tcpcrypt Performance Conclusion 11/25

Auth example: batch signing

Tcpcrypt: server signs multiple session IDs at once to amortize RSA cost.

SID B SID A SID C SID D “A, B, C, D” Signed by amazon.com RSA op.

slide-21
SLIDE 21

Introduction tcpcrypt Performance Conclusion 11/25

Auth example: batch signing

Tcpcrypt: server signs multiple session IDs at once to amortize RSA cost.

SID B SID A SID C SID D “A, B, C, D” Signed by amazon.com RSA op.

SSL servers must RSA decrypt each client’s secret.

enc(secret A) enc(secret B) enc(secret C) enc(secret D) RSA op. RSA op. RSA op. RSA op.

slide-22
SLIDE 22

Introduction tcpcrypt Performance Conclusion 12/25

Key exchange overview

Do you support tcpcrypt? Yes, and I support RSA RSA public key encpubk(master key)

Generate random master key

client server

Clients periodically generate ephemeral public keys.

slide-23
SLIDE 23

Introduction tcpcrypt Performance Conclusion 13/25

tcpcrypt key exchange

SYN SYN ACK ACK

slide-24
SLIDE 24

Introduction tcpcrypt Performance Conclusion 13/25

tcpcrypt key exchange

SYN - CRYPT(HELLO) SYN ACK ACK probe tcpcrypt

tcpcrypt negotiation encoded in TCP options.

slide-25
SLIDE 25

Introduction tcpcrypt Performance Conclusion 13/25

tcpcrypt key exchange

SYN - CRYPT(HELLO) SYN ACK - CRYPT(PKCONF) ACK - CRYPT(INIT1) ACK - CRYPT(INIT2) crypto on probe tcpcrypt public key ciphers and key sizes list symmetric ciphers and MACs list, nonce, public key encrypted client and server nonce (master key)

tcpcrypt negotiation encoded in TCP options. INIT1 and INIT2 too long: sent as data invisible to apps.

slide-26
SLIDE 26

Introduction tcpcrypt Performance Conclusion 14/25

Key scheduling

Master key is hash of: Server and client nonces. Public key used and negotiated parameters.

Master key RX MAC key TX MAC key RX enc. key TX enc. key Session ID

h a s h ( H M A C )

slide-27
SLIDE 27

Introduction tcpcrypt Performance Conclusion 14/25

Key scheduling

Master key is hash of: Server and client nonces. Public key used and negotiated parameters.

Master key RX MAC key TX MAC key RX enc. key TX enc. key Session ID

h a s h ( H M A C )

Next master key

MAC enc SID

Session caching, like in SSL: on reconnect, establish new keys without explicit key exchange.

slide-28
SLIDE 28

Introduction tcpcrypt Performance Conclusion 15/25

Session caching

SYN - NEXTK1 SYN ACK - NEXTK2 crypto on ack New session based on session with ID X OK!

Low latency: completes within TCP handshake.

slide-29
SLIDE 29

Introduction tcpcrypt Performance Conclusion 16/25

TCP MAC and encryption

src port dst port seq no. (64-bit seq) ack no. (64-bit ack) d.off. flags window checksum

  • urg. ptr.
  • ptions (e.g., SACK)

MAC option data TCP length

MACed Encrypted

Allow NATs: do not MAC ports. Prevent replay: MAC extended (implicit) seq. no. Prevent truncation / extension: MAC length.

slide-30
SLIDE 30

Introduction tcpcrypt Performance Conclusion 17/25

Implementation

1 Linux kernel implementation: 4,500 LoC. 2 Portable userspace divert socket implementation: 7,000 LoC.

Tested on Windows (required implementing divert sockets), Mac OS, Linux and FreeBSD.

Packet flow in divert socket implementation.

Network Kernel tcpcryptd application 1 2 3 4

3 Binary compatible OpenSSL library that attempts tcpcrypt

with batch-signing or falls back to SSL.

slide-31
SLIDE 31

Introduction tcpcrypt Performance Conclusion 18/25

Performance overview

Performance considerations when turning encryption on:

1 Does encryption sacrifice request handling throughput? E.g.,

how many web requests / second can a server handle?

2 Is request latency harmed? E.g., How long does a client need

to wait before a web page is displayed?

3 Is data throughput high? What’s the bitrate when

downloading? Hardware: 8-core, 2.66GHz Xeon (2008-era). Software: Linux kernel implementation.

slide-32
SLIDE 32

Introduction tcpcrypt Performance Conclusion 19/25

High connection rate on servers

20000 40000 60000 80000 100000 120000 TCP tcpcrypt server SSL server Connections/s 98,434 27,070 754 No sessions cached

slide-33
SLIDE 33

Introduction tcpcrypt Performance Conclusion 19/25

High connection rate on servers

20000 40000 60000 80000 100000 120000 TCP tcpcrypt server SSL server Connections/s 98,434 27,070 754 70,044 39,785 No sessions cached All sessions cached

slide-34
SLIDE 34

Introduction tcpcrypt Performance Conclusion 20/25

Low authentication cost

5000 10000 15000 20000 25000 30000 35000 no auth shared secret certificates weak password SSL Connections/s 27,070 26,395 18,790 1,418 754

25x faster than SSL when batch signing

slide-35
SLIDE 35

Introduction tcpcrypt Performance Conclusion 21/25

Web-serve up to 25x faster than SSL

10000 20000 30000 40000 50000 60000 70000 TCP tcpcrypt server SSL Connection rate (conn/s) 60,156 19,153 737 42,440 19,787 No sessions cached All sessions cached

Apache serving a 44 byte static file. No server authentication with tcpcrypt: fair comparison would make tcpcrypt slower.

slide-36
SLIDE 36

Introduction tcpcrypt Performance Conclusion 22/25

Lower connect latency than SSL

Protocol LAN connect time (ms) TCP 0.2 tcpcrypt cached 0.3 tcpcrypt not cached 11.3 SSL cached 0.7 SSL not cached 11.6 tcpcrypt batch sign 11.2 tcpcrypt CMAC 11.4 tcpcrypt PAKE 15.2

slide-37
SLIDE 37

Introduction tcpcrypt Performance Conclusion 22/25

Lower connect latency than SSL

Protocol LAN connect time (ms) TCP 0.2 tcpcrypt cached 0.3 tcpcrypt not cached 11.3 SSL cached 0.7 SSL not cached 11.6 tcpcrypt batch sign 11.2 tcpcrypt CMAC 11.4 tcpcrypt PAKE 15.2

slide-38
SLIDE 38

Introduction tcpcrypt Performance Conclusion 22/25

Lower connect latency than SSL

Protocol LAN connect time (ms) TCP 0.2 tcpcrypt cached 0.3 tcpcrypt not cached 11.3 SSL cached 0.7 SSL not cached 11.6 tcpcrypt batch sign 11.2 tcpcrypt CMAC 11.4 tcpcrypt PAKE 15.2 Batch signing does not add latency

SYN - HELLO SYN ACK - PKCONF ACK - INIT1 ACK - INIT2 RSA sign start RSA decrypt start Signature

connection ready

slide-39
SLIDE 39

Introduction tcpcrypt Performance Conclusion 23/25

Gigabit encryption possible

2000 4000 6000 8000 10000 12000 14000 TCP tcpcrypt AES SHA1 SSL AES SHA1 Transfer rate (Mbit/s) 12,954 3,968 3,692

slide-40
SLIDE 40

Introduction tcpcrypt Performance Conclusion 23/25

Gigabit encryption possible

2000 4000 6000 8000 10000 12000 14000 TCP tcpcrypt AESNI UMAC tcpcrypt AES SHA1 SSL AES SHA1 Transfer rate (Mbit/s) 12,954 3,968 3,692 8,835 AES-NI 3.33GHz i5

New CPUs (Westmere) with special AES instructions can saturate 9 Gbit/s networks while encrypting.

slide-41
SLIDE 41

Introduction tcpcrypt Performance Conclusion 24/25

Related work

1 Network layer solutions: IPSec, Better Than Nothing Security.

Hard to integrate with application-level authentication. Network compatibility issues: NATs.

2 Application layer solutions: SSL, Opportunistic encryption

[Langley].

Poor server-side performance. Requires changes to apps and possibly protocol.

3 SSL performance improvements:

SSL batching [Shacham & Boneh]: requires different public keys. SSL rebalancing [Castelluccia, Mykletun & Tsudik]: does not leverage app-level authentication.

slide-42
SLIDE 42

Introduction tcpcrypt Performance Conclusion 25/25

Conclusion

1 High server performance makes encryption a realistic default. 2 Let applications leverage tcpcrypt to maximize

communication security in every setting.

3 Incrementally deployable, compatible with legacy apps, TCP

and NATs. Install tcpcrypt and help encrypt the Internet! http://tcpcrypt.org