InterMAClib: Beyond Confidentiality and Integrity in Practice - - PowerPoint PPT Presentation

intermaclib beyond confidentiality and integrity in
SMART_READER_LITE
LIVE PREVIEW

InterMAClib: Beyond Confidentiality and Integrity in Practice - - PowerPoint PPT Presentation

InterMAClib: Beyond Confidentiality and Integrity in Practice Torben B. Hansen @n_tbh Joint work with Martin R. Albrecht @martinralbrecht Kenneth G. Paterson @kennyog Information Security Group Centre


slide-1
SLIDE 1

InterMAClib: ¡Beyond ¡Confidentiality ¡ and ¡Integrity ¡in ¡Practice

Torben ¡B. ¡Hansen ¡@n_tbh Joint ¡work ¡with ¡ Martin ¡R. ¡Albrecht ¡@martinralbrecht Kenneth ¡G. ¡Paterson ¡@kennyog

Information ¡Security ¡Group Centre ¡for ¡Doctoral ¡Training ¡in ¡Cyber ¡Security

Real ¡World ¡Crypto ¡2018 ¡January ¡12th

slide-2
SLIDE 2

Motivation

We ¡are ¡here

InterMAC(lib) OpenSSH InterMAC cipher ¡modes Performance

The ¡next ¡~25 ¡mins

slide-3
SLIDE 3

C C ¡← Enck(M) M ¡← Deck(C)

AE

[BKN02]

SSH ¡CBC-­‑mode ¡is ¡secure! Good ¡approximation?

[APW09]

SSH ¡CBC-­‑mode ¡is ¡not secure! Symmetric ¡encryption ¡ Modelling ¡security

slide-4
SLIDE 4

C C ¡← Enck(M) M1 ← Deck(C1) C1 C2 M2 ← Deck(C2) M ¡= ¡M1 || ¡M2 [BDPS12]

SSH ¡packets ¡contains ¡a ¡length ¡field

slide-5
SLIDE 5

IND-­‑sfCFA

IND-­‑CCA

IND-­‑sfCTF

IND-­‑CTXT C ¡← Enck(M) M1 ← Deck(C1) C1 C2 M2 ← Deck(C2) M ¡= ¡M1 || ¡M2

Security ¡notions

C

slide-6
SLIDE 6

IND-­‑sfCFA

IND-­‑CCA

IND-­‑sfCTF BH-­‑sfCFA

IND-­‑CTXT C ¡= DJ@)%&6h C1 C2 C’ ¡= *s&FQOm”F C3 DJ@)%&6h*s&FQOm”F C C’

Security ¡notions

  • ­‑ Length ¡field ¡encrypted
  • ­‑ Random ¡amount ¡of ¡

padding

SSH:

slide-7
SLIDE 7

IND-­‑sfCFA

IND-­‑CCA

IND-­‑sfCTF BH-­‑sfCFA n-­‑DOS-­‑sfCFA

Enc Mac

Payload Ciphertext MAC ¡tag Sequence Number

4

Packet Length

4

Pad Len 1 Padding ≥4 Packet Length

IND-­‑CTXT

Security ¡notions

[BDPS12] [BDPS12] ¡/ ¡ [ADHP16 ¡] [ADHP16] (Open)SSH ¡EtM cryptographic ¡processing

slide-8
SLIDE 8

1 Enc

c

Mac Enc

1 c

Mac Enc

2 c

Mac

InterMAC

[BDPS12]

IND$-­‑CPA PRF

Achieve ¡all ¡4 security ¡ notions

N ¡-­‑ 1 N ¡-­‑ 1 N ¡-­‑ 1

Chunk ¡counter: Message ¡counter:

slide-9
SLIDE 9

N ¡-­‑ 1 N ¡-­‑ 1 N ¡-­‑ 1 1 Enc

c

Mac Enc

1 c

Mac Enc

2 c

Mac

InterMAC in ¡practice

t

t=1 : no padding t=2 : padding

1 1 1 …

Chunk ¡counter: Message ¡counter:

slide-10
SLIDE 10

N ¡-­‑ 1 N ¡-­‑ 1 N ¡-­‑ 1 Enc Enc Enc

InterMAC in ¡practice

Chunk ¡counter: Message ¡counter:

c 1 c 2 c

Nonce-­‑based AE

t

t=1 : no padding t=2 : padding

0 1 1 …

slide-11
SLIDE 11

InterMAClib

C-­‑implementation Aims ¡to ¡be ¡”safe” ¡to ¡use Small ¡API User-­‑oblivious ¡nonce-­‑management Algorithm ¡agility AES-­‑GCM Chacha20-­‑Poly1305

slide-12
SLIDE 12

Nonce ¡management

chunk ¡counter ¡= ¡0 message ¡counter ¡= ¡0

InterMAC with ¡ChaCha20-­‑Poly1305

Kmac <-­‑ ChaCha20(0, ¡K, ¡nonce, ¡block_counter = ¡0) C <-­‑ ChaCha20(M, ¡K, ¡nonce, ¡block_counter = ¡1) Tag ¡<-­‑ Poly1305(Kmac, ¡C)

InterMAC with ¡AES-­‑GCM

nonce ¡= ¡

32 64

Initialise aes-­‑gcm with ¡nonce ¡for ¡each ¡chunk im_init(… ¡, ¡ae_cipher) ¡:

slide-13
SLIDE 13

We ¡implemented ¡InterMAC-­‑based ¡ cipher ¡modes ¡in ¡OpenSSH (v7.4) Performance ¡of ¡InterMAC-­‑based ¡ cipher ¡modes ¡compared ¡to ¡existing ¡ cipher ¡modes

Payload Packet Length

4

Pad Len 1 Padding

≥4

im-­‑aes128-­‑gcm-­‑N im-­‑chacha-­‑poly-­‑N

OpenSSH packet ¡ processing ¡code: complex ¡and ¡buggy Throughput Total ¡bytes ¡transmitted Behavior ¡relating ¡to ¡chunk ¡ length ¡N

Want ¡cipher ¡modes ¡with ¡all ¡4 ¡security ¡ properties No ¡current ¡cipher ¡mode ¡satisfy ¡that… [ADHP16]

Standalone ¡code-­‑path ¡ in ¡the ¡OpenSSH packet ¡ processing ¡code

[ADHP16] [PW10] [APW09]

slide-14
SLIDE 14

AWS US-­‑Oregon AWS London

SCP

[ADHP16]

slide-15
SLIDE 15

AWS US-­‑Oregon AWS London

SCP

slide-16
SLIDE 16

N ¡-­‑ 1 N ¡-­‑ 1 N ¡-­‑ 1

slide-17
SLIDE 17

Implementations ¡must ¡cater ¡for ¡ ciphertext fragmentation We ¡believe ¡this ¡feature ¡should ¡be ¡ reflected ¡in ¡the ¡security ¡models [BDPS12] ¡provides ¡a ¡security ¡ model ¡for ¡studying ¡symmetric ¡ encryption ¡schemes ¡supporting ¡ ciphertext fragmentation InterMAC satisfies ¡all ¡security ¡ notions ¡from ¡[BDPS12] We ¡modify ¡InterMAC to ¡make ¡it ¡ usable ¡in ¡practice ¡and ¡create ¡ InterMAClib InterMAC: ¡SSH ¡binary ¡packet ¡ protocol ¡done ¡right, ¡using ¡ modern ¡primitives OpenSSH want ¡cipher ¡modes ¡ that ¡meets ¡all ¡security ¡notions ¡ from ¡[BDPS12] We ¡implement ¡InterMAC-­‑based ¡ cipher ¡modes ¡in ¡OpenSSH using ¡ InterMAClib We ¡measured ¡performance; ¡ indicates ¡that ¡greater ¡security ¡can ¡ be ¡traded ¡for ¡only ¡a ¡minor ¡ performance ¡hit

Finish ¡line ¡is ¡in ¡sight…

slide-18
SLIDE 18

Torben ¡Hansen ¡@n_tbh Martin ¡Albrecht ¡@martinralbrecht Kenny ¡Paterson ¡@kennyog

Hi ¡Bob, ¡ I ¡believe ¡we ¡ can ¡beat ¡Eve! RealWorld Class ¡Alice!