Unauthenticated encryption in the wild Carl Svensson, 26 MSc in - - PowerPoint PPT Presentation

unauthenticated encryption in the wild
SMART_READER_LITE
LIVE PREVIEW

Unauthenticated encryption in the wild Carl Svensson, 26 MSc in - - PowerPoint PPT Presentation

September 12, 2017 Carl Svensson SEC-T 2017 Unauthenticated encryption in the wild Carl Svensson, 26 MSc in Computer Science, KTH Head of Security, Kry CTF-player, HackingForSoju 1 About me


slide-1
SLIDE 1

Unauthenticated encryption in the wild

Carl Svensson September 12, 2017

SEC-T 2017

slide-2
SLIDE 2

About me

  • Carl Svensson, 26
  • MSc in Computer Science, KTH
  • Head of Security, Kry
  • CTF-player, HackingForSoju
  •  calle.svensson@zeta-two.com
  •  @zetatwo
  •  https://zeta-two.com

1

slide-3
SLIDE 3

Cryptography in 30 seconds

  • Transform data
  • Maths, a lot of it
  • Many possible goals
  • Confidentiality (Hide)
  • Integrity (Verify)
  • Authentication (Identify)
  • Non-Repudiation (No take-backsies)
  • Modularity

2

slide-4
SLIDE 4

AES - Very good, at one specific thing

  • Block cipher
  • Key
  • Basic building block
  • No known attacks*

3

slide-5
SLIDE 5

Block cipher modes, when you have more data

4

slide-6
SLIDE 6

Encryption is not authentication

  • A priori, no way to

differentiate

  • Has to accept all ciphertexts
  • Might be able to tell later
  • The Cryptographic Doom

Principle

5

slide-7
SLIDE 7

Bit flipping attack

6

slide-8
SLIDE 8

Example: Open redirect as a service

  • https://link.a.com/AAAA/BBBBBBBBBBBBBBBBBBBBBB
  • Known plaintext, just visit
  • x ⊕ m1 = m2 ⇔ x = m1 ⊕ m2
  • Edit link contents

7

slide-9
SLIDE 9

Padding Oracle attack

  • PKCS7 padding
  • bool oracle(input) { ... }
  • Differing error messages
  • x ⊕ g = t ⇔ x = g ⊕ t
  • 16 · 256 ≪ 25616

8

slide-10
SLIDE 10

Example: Extracting secrets -> RCE

  • Backup data
  • File format:

EncKm(key1)||EncKs(zipfile)

  • Padding Oracle -> Key -> Craft zip
  • Zip relative paths -> RCE

9

slide-11
SLIDE 11

What to do? Authenticate!

  • Encryption AND authentication
  • Message Authentication Code
  • HMACk(message) = tag
  • Verifyk(tag, message) ∈ True, False

10

slide-12
SLIDE 12

Thanks for listening!

10