ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

45
Crypto, Certificaten, SSL, PKI What can possibly go wrong? ISC2 cryptonight 10 juni 2014

description

Public key cryptography, SSL, certificates, implementations. What can possibly go wrong with all of this? This is a presentation for the Dutch chapter of ISC2 to make people aware of the fact that proper use and implementation of cryptography can be a silver bullet, but if you do it wrong, the gun may be pointing at you.

Transcript of ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Page 1: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Crypto, Certificaten, SSL, PKI What can possibly go wrong?

ISC2 cryptonight

10 juni 2014

Page 2: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Introductie

Arthur Donkers & Ralph Moonen

Partners bij ITSX

[email protected]

[email protected]

IANAC

10 juni 2014 ISC2 cryptonight 2

Page 3: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Agenda

Symmetrische en asymmetrische crypto

Certificaten

SSL en TLS

Oeps…

10 juni 2014 ISC2 cryptonight 3

Page 4: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Vragen?

Ja graag !!!

ISC2 cryptonight 10 juni 2014 4

Page 5: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Cryptografie en cryptanalyse

Cryptografie is geheimschrijverij

Cryptanalyse is systematische analyse van versleutelde

berichten

10 juni 2014 ISC2 cryptonight 5

Page 6: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Symmetrische crypto

One key to rule them all… Zelfde sleutel voor encryptie en decryptie Combinatie van bitshuffling en XOR (short version)

10 juni 2014 ISC2 cryptonight 6

Page 7: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Voorbeelden

DES, 3DES, AES (block ciphers): opereert op blokken van (meestal) 64 bits, 128 bits etc)

10 juni 2014 ISC2 cryptonight 7

Page 8: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

DES (single run, 56 bit)

10 juni 2014 ISC2 cryptonight 8

Page 9: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

AES, replaces DES

10 juni 2014 ISC2 cryptonight 9

Substitute, permutate network

inpu

t

S1

S2

S3

S8

outp

ut

subs. layer

perm. layer inversion

k1

S1

S2

S3

S8

k2 S1

S2

S3

S8

kn

Page 10: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Stream ciphers

PRNG levert pseudo random getallen stroom: XOR met bericht.

10 juni 2014 ISC2 cryptonight 10

Page 11: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Stream ciphers, native

10 juni 2014 ISC2 cryptonight 11

Voorbeeld: RC4 HTTPS en WEP

Page 12: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Stream ciphers, block based

10 juni 2014 ISC2 cryptonight 12

Je kan een block cipher omzetten in een stream cipher

Padding

Feedback loop

Page 13: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Electronic codebook (ECB)

10 juni 2014 ISC2 cryptonight 13

Page 14: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

ECB, same input, same output

10 juni 2014 ISC2 cryptonight 14

Page 15: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Cipher block chaining

10 juni 2014 ISC2 cryptonight 15

Page 16: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

CBC decryption

10 juni 2014 ISC2 cryptonight 16

Watch out: manipulating IV leads to control of plaintext!

Page 17: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

CBC, padding oracle

10 juni 2014 ISC2 cryptonight 17

D(k,⋅) D(k,⋅)

m[0] m[1]

⊕ ⊕

c[0] c[1] IV

Since messages must be a multiple of the block size, padding necessary. Every byte of the padding is the length of the padding. i.e.: 0x0505050505 or 0x030303.

let g be a guess for the last byte of m[1]

⨁ g ⨁ 0x01

= last-byte ⨁ g ⨁ 0x01

if last-byte = g: valid pad otherwise: invalid pad

Page 18: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Asymmetrische crypto

Twee sleutels, één privé en één publiek

10 juni 2014 ISC2 cryptonight 18

Page 19: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Asymmetrische crypto

Bijna altijd gebaseerd op moeilijk omkeerbare wiskundige problemen:

Factoring (priem getallen)

Discrete logarithmen

10 juni 2014 ISC2 cryptonight 19

Page 20: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

RSA (factoring)

10 juni 2014 ISC2 cryptonight 20

Page 21: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Elliptic Curve

10 juni 2014 ISC2 cryptonight 21

Page 22: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Asymmetrische crypto

10 juni 2014 ISC2 cryptonight 22

Page 23: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Asymmetrische crypto

10 juni 2014 ISC2 cryptonight 23

Authenticatie

Digitale handtekeningen

Page 24: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Certificaten

10 juni 2014 ISC2 cryptonight 24

Trust model (wij van wc eend…)

Afspraak is dat we een aantal CA’s vertrouwen

Hoeveel is genoeg?

Page 25: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Certificaten

10 juni 2014 ISC2 cryptonight 25

Page 26: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Certificaten

10 juni 2014 ISC2 cryptonight 26

X509.v3 standaard

Page 27: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Certificaten

10 juni 2014 ISC2 cryptonight 27

X509.v3 certificaat bevat Object ID’s in ASN.1 codering.

Geheel is ondertekend door een CA die iedereen vertrouwd.

Page 28: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Certificaten

10 juni 2014 ISC2 cryptonight 28

Version: 3 (0x2) Serial Number: c3:e0:e7:bf:11:37:a3:00:20:64:53:a1:21:53:4e Signature Algorithm: sha1WithRSAEncryption Issuer: C=GB, ST=Greater Manchester, L=Salford, O=COMODO CA Limited, CN=COMODO SSL CA Validity Not Before: Dec 11 00:00:00 2013 GMT Not After : Dec 10 23:59:59 2018 GMT Subject: OU=Domain Control Validated, OU=COMODO SSL, CN=office.itsx.com Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (2048 bit) Modulus (2048 bit): <hex data> Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Authority Key Identifier: keyid:1B:6B:BD:1F:8A:49:18:94:54:37:55:B4:20:17:ED:37:B9:77:18:7D X509v3 Subject Key Identifier: 0C:95:31:B1:2B:04:EE:45:1C:B7:EA:AE:28:E4:C2:20:E4:B0:1E:09 X509v3 Key Usage: critical Digital Signature, Key Encipherment X509v3 Basic Constraints: critical CA:FALSE X509v3 Extended Key Usage: TLS Web Server Authentication, TLS Web Client Authentication X509v3 Certificate Policies: Policy: 1.3.6.1.4.1.6449.1.2.2.7 CPS: https://secure.comodo.com/CPS Policy: 2.23.140.1.2.1 X509v3 CRL Distribution Points: URI:http://crl.comodoca.com/COMODOSSLCA.crl Authority Information Access: CA Issuers - URI:http://crt.comodoca.com/COMODOSSLCA.crt OCSP - URI:http://ocsp.comodoca.com X509v3 Subject Alternative Name: DNS:office.itsx.com, DNS:www.office.itsx.com

Page 29: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Software

10 juni 2014 ISC2 cryptonight 29

Secure Socket Layer (SSL)

SSLv2

SSLv3

Transport Layer Security (TLS)

TLS 1.0, 1.1, 1.2 (en 1.3)

Page 30: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Software

10 juni 2014 ISC2 cryptonight 30

TLS is opvolger van SSL

TLS kent sterkere algorithmen

TLS 1.0 en SSLv3 zijn niet compatibel

Page 31: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Attacks, wiskunde

10 juni 2014 ISC2 cryptonight 31

Public key systemen zijn niet mathematisch bewezen veilig…

Page 32: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Attacks, algoritmen

10 juni 2014 ISC2 cryptonight 32

RC4, geen homogene uitvoer (lichte voorkeur voor waarden) in 1e 256 bytes

Page 33: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Attacks, algoritmen

10 juni 2014 ISC2 cryptonight 33

Dual EC DRBG random number generator is backdoored (NSA)?

Page 34: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Attacks, protocol

10 juni 2014 ISC2 cryptonight 34

Renegotiation aanvallen Injecteren van plain tekst

Man in the Middle

Page 35: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Attacks, renegotiation

10 juni 2014 ISC2 cryptonight 35

Page 36: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Attacks, protocol

10 juni 2014 ISC2 cryptonight 36

BEAST attack misbruik van CBC, door voorspelbare IV wordt CBC EBC

is gericht tegen de browser

Page 37: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Attacks, BEAST

10 juni 2014 ISC2 cryptonight 37

Page 38: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Attacks, protocol

10 juni 2014 ISC2 cryptonight 38

CRIME/TIME/BREACH attack Compression side channel

Verschillende data geeft verschillende compressie resultaten

Page 39: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Attacks, protocol

10 juni 2014 ISC2 cryptonight 39

Padding Oracle attack Misbruik de padding om bytes te ontsleutelen

Hangt af van timing en foutmeldingen

Page 40: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Attacks, implementatie

10 juni 2014 ISC2 cryptonight 40

Te veel om op te noemen…

Page 41: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Attacks, implementatie

10 juni 2014 ISC2 cryptonight 41

Slechte random number generators:

Genereert identieke sleutels…

Page 42: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

GCD

Indien twee RSA keys een deler gemeen hebben (omdat slechte random generator werd gebruikt) dan is dat met Euclidius’ algoritme (2300 jaar oud) zeer snel te vinden.

10 juni 2014 ISC2 cryptonight 42

Page 43: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Advies

10 juni 2014 ISC2 cryptonight 43

•  Cryptografie is moeilijk

•  Goede cryptografie is bijna onmogelijk!

•  Gebruik beschikbare implementaties, zelf implementeren is moeilijk!

•  Laat alle crypto protocollen reviewen

Page 44: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Advies

10 juni 2014 ISC2 cryptonight 44

Don’t even think of ‘inventing’ your own algorithm or protocol!

Page 45: ISC2 Dutch Chapter Cryptonight, what can possibly go wrong?

Tenslotte…

10 juni 2014 ISC2 cryptonight 45