Demystifying TLS

27
Demystifying TLS Adrien Thebo | Software Engineer | Puppet

Transcript of Demystifying TLS

Page 1: Demystifying TLS

Demystifying TLS

Adrien Thebo | Software Engineer | Puppet

Page 2: Demystifying TLS

Introduction

Page 3: Demystifying TLS

TLS == pain?

Page 4: Demystifying TLS

TLS Works!

Page 5: Demystifying TLS

What is TLS?

Page 6: Demystifying TLS

What does TLS do?

Page 7: Demystifying TLS

A brief crypto primer

Enthusiasm for prime numbers not required

Page 8: Demystifying TLS

A brief crypto primer

● Encryption and decryption

● Hash algorithms and message digests

● Digital signing

Page 9: Demystifying TLS

Symmetric algorithms

● Examples

○ AES (good)

○ Salsa20 (very good, not yet widely used)

○ Triple DES (old, slow, obsolete)

Page 10: Demystifying TLS

Asymmetric algorithms

● Main Examples

○ RSA (encryption + signing)

○ Diffie Hellman (encryption only)

● Signing only (we'll get to this later)

○ DSA

○ ECDSA

Page 11: Demystifying TLS

Symmetric vs asymmetric

Page 12: Demystifying TLS

Hashing algorithms

● Many examples

○ CRC32 (used in Ethernet)

● Not all hashes meant to be secure!

Page 13: Demystifying TLS

Message digests

● Examples

○ MD5 (cracked in about 1 second on your phone)

○ SHA1 (First collision demonstrated 2017/02/23!)

○ SHA-256 (Pretty secure! For now.)

Page 14: Demystifying TLS

Digital signatures

● Back to asymmetric cryptography!

○ Private key can "sign" some information

○ Public key can verify that signature

Page 15: Demystifying TLS

Constructing TLS

Page 16: Demystifying TLS

Encryption

Page 17: Demystifying TLS

Key exchange

● Examples

○ RSA (good)

○ Diffie Hellman (better)

Page 18: Demystifying TLS

Key exchange + forward secrecy

● RSA: no forward secrecy

● (Ephemeral) Diffie Hellman: forward secrecy!

○ RSA (good)

○ Diffie Hellman (better)

Page 19: Demystifying TLS

Authentication

● Asymmetric algorithms + TLS certificates

○ RSA

○ Other algorithms, but we're skipping them today

Page 20: Demystifying TLS

Certificate based authentication

● The important parts

a. An identity

■ email: [email protected]

■ dns: puppet.com

■ ip: 23.200.94.83

b. A public key

c. A signature

Page 21: Demystifying TLS

Authenticated key exchange

● Server certificate -> client

● Client verifies server certificate

● Client uses public key to authenticate key

exchange

○ RSA: client and server encrypt session key with

their RSA public keys

○ Diffie-Hellman + RSA: client and server sign their

DH public keys with their RSA private keys

Page 22: Demystifying TLS

Preventing tampering

Page 23: Demystifying TLS

Message authentication

● Hash based message authentication

○ Hash(session secret + message)

○ MACs can't be forged!

Page 24: Demystifying TLS

Everything put together

● Secrecy

○ Key exchange

○ Session encryption

● Authentication

○ Asymmetric crypto (RSA)

○ Certificates (Contains identity + public key)

● Integrity

○ Message authentication

Page 25: Demystifying TLS

Further reading

● Cryptography Engineering

● Puppet HTTPS background reference

Page 26: Demystifying TLS

Thank you!

Page 27: Demystifying TLS