Crypto Application: TLS / SSL4 SSL/TLS Operations •Client connects to the server –To access a...

18
1 Crypto Application: TLS / SSL Network Security Workshop 26-30 October 2020

Transcript of Crypto Application: TLS / SSL4 SSL/TLS Operations •Client connects to the server –To access a...

Page 1: Crypto Application: TLS / SSL4 SSL/TLS Operations •Client connects to the server –To access a resource •Public-key cryptography during initial handshake to authenticate and exchange

1

Crypto Application: TLS / SSL

Network Security Workshop26-30 October 2020

Page 2: Crypto Application: TLS / SSL4 SSL/TLS Operations •Client connects to the server –To access a resource •Public-key cryptography during initial handshake to authenticate and exchange

22

SSL/TLS Protocol

Encrypted SSL/TLS data [HTTP]

Transport (TCP)

Internet

Network Access

Application (HTTP)

Page 3: Crypto Application: TLS / SSL4 SSL/TLS Operations •Client connects to the server –To access a resource •Public-key cryptography during initial handshake to authenticate and exchange

33

TLS/SSL: What it does• Confidentiality

– Encryption

• Integrity– Keyed hash (HMAC): TLS (authentication!)– Hash (MAC): SSL

• Authentication– certificates

Page 4: Crypto Application: TLS / SSL4 SSL/TLS Operations •Client connects to the server –To access a resource •Public-key cryptography during initial handshake to authenticate and exchange

44

SSL/TLS Operations• Client connects to the server

– To access a resource

• Public-key cryptography during initial handshake to authenticate and exchange session keys– PKI (X.509 Certificates)

• Symmetric key cryptography to encrypt and hash data– Master secret (shared secret) generated– Separate Encryption and Hashing keys from the master secret

Page 5: Crypto Application: TLS / SSL4 SSL/TLS Operations •Client connects to the server –To access a resource •Public-key cryptography during initial handshake to authenticate and exchange

55

How SSL/TLS Works – Part 1

1Sends HelloMessage

2

Supported algorithms, random number

Algorithms, random number

3

4

Certificate

5 6Encrypted pre-master secret

Sends HelloMessage

AuthenticationServer

SendsCertificates

Generates randomvalue

(pre-master secret &encrypts it

with the server’spublic key)

Decrypts to retrievepre-master secret

7Calculates Keys 7 Calculates Keys

8 8Sends finishedmessage

Sends finishedmessage

9 9Data

SSL Data Transfer Phase

SSL Handshake Phase

CLIENT SERVER

Master Secret (shared)• Encryption key• Hashing key

Encrypted data

PKI

Page 6: Crypto Application: TLS / SSL4 SSL/TLS Operations •Client connects to the server –To access a resource •Public-key cryptography during initial handshake to authenticate and exchange

66

PKI – public key infra• Digital (X.509) certificates

– associates a public key with an individual or organizationVERSION

SERIAL NUMBER

SIGNATURE ALGORITHM

ISSUER NAME

VALIDITY PERIOD

SUBJECT NAME

SUBJECT PUBLIC KEY

EXTENSIONS (ISSUER KEY ID)

EXTENSIONS (SUBJECT KEY ID)

EXTENSIONS (CRL)

CA DIGITAL SIGNATURE

Version of X.509

Uniquely identifies the certificate

Algorithms used by the CA to sign the cert

Id of the CA (that issued the cert)

Cert validity

Entity associated with the public key

Owner’s public key

Identify the pub key of issuer of the cert

Extra info (owner of the cert)

Extensions (CRL)

Certifies the binding – sings pub key of subject

Page 7: Crypto Application: TLS / SSL4 SSL/TLS Operations •Client connects to the server –To access a resource •Public-key cryptography during initial handshake to authenticate and exchange

77

PKI – Chain of Trust• Root CA

– Self-signed– Issue and sign ICA’s certificate

• Intermediate CA– Issue and sign EE certificate

• End Entity

Root CA

ICA ICA

EE EE EE EE

Page 8: Crypto Application: TLS / SSL4 SSL/TLS Operations •Client connects to the server –To access a resource •Public-key cryptography during initial handshake to authenticate and exchange

88

PKI – Example• Client (browser) sends https request to

google.com– browsers have trusted CA certificates stored

• Web server sends back google.com’scertificate– Signed by Google ICA, plus– Google ICA’s certificate signed by root CA

(GeoTrust)

• Verify the certificates up the chain of trust– Once successfully verified, use the public key

Root CA CertSignature (self-

signed)

google.comCert

Signature (signed by ICA)

ICA Cert

Signature (signed by root)

Page 9: Crypto Application: TLS / SSL4 SSL/TLS Operations •Client connects to the server –To access a resource •Public-key cryptography during initial handshake to authenticate and exchange

99

How SSL/TLS Works – Part 2

1Sends HelloMessage

2

Supported algorithms, random number

Algorithms, random number

3

4

Certificate

5 6Encrypted pre-master secret

Sends HelloMessage

AuthenticationServer

SendsCertificates

Generates randomvalue

(pre-master secret &encrypts it

with the server’spublic key)

Decrypts to retrievepre-master secret

7Calculates Keys 7 Calculates Keys

8 8Sends finishedmessage

Sends finishedmessage

9 9Data

SSL Data Transfer Phase

SSL Handshake Phase

CLIENT SERVER

Master Secret (shared)• Encryption key• Hashing key

Encrypted data

Symmetric Encryption

Page 10: Crypto Application: TLS / SSL4 SSL/TLS Operations •Client connects to the server –To access a resource •Public-key cryptography during initial handshake to authenticate and exchange

1010

Symmetric Encryption• Once the server’s public key is verified up the chain of trust

– Client generates a pre-master secret (C-random & S-random)– Sends to the server encrypted (with server’s public key)

• Both client and server generates the Master Secret– Uses the pre-master secret, C-random, and S-random with the agreed

key exchange cipher (eg: DH)

• Separate Encryption and Hashing keys generated from the Master secret– All future communication hashed and encrypted using the symmetric

keys

Page 11: Crypto Application: TLS / SSL4 SSL/TLS Operations •Client connects to the server –To access a resource •Public-key cryptography during initial handshake to authenticate and exchange

1111

Trusted vs Non-trusted Certificate

Page 12: Crypto Application: TLS / SSL4 SSL/TLS Operations •Client connects to the server –To access a resource •Public-key cryptography during initial handshake to authenticate and exchange

1212

Certificate Authority

Page 13: Crypto Application: TLS / SSL4 SSL/TLS Operations •Client connects to the server –To access a resource •Public-key cryptography during initial handshake to authenticate and exchange

1313

WoSign

https://groups.google.com/forum/m/#!topic/mozilla.dev.security.policy/k9PBmyLCi8I/discussion

Page 14: Crypto Application: TLS / SSL4 SSL/TLS Operations •Client connects to the server –To access a resource •Public-key cryptography during initial handshake to authenticate and exchange

1414

Introducing Let’s Encrypt• An open source CA

– Proof your domain to get your digital (TLS/SSL) certificate– https://letsencrypt.org

Page 15: Crypto Application: TLS / SSL4 SSL/TLS Operations •Client connects to the server –To access a resource •Public-key cryptography during initial handshake to authenticate and exchange

1515

Let’s Encrypt chain• Let’s Encrypt ICA (X3) cross-signed by DST (IdenTrust)

– Until ISRG (Internet Security Research Group) is trusted by everyone

https://letsencrypt.org/2018/08/06/trusted-by-all-major-root-programs.html

Page 16: Crypto Application: TLS / SSL4 SSL/TLS Operations •Client connects to the server –To access a resource •Public-key cryptography during initial handshake to authenticate and exchange

1616

Introducing Let’s Encrypt• Browsers and OS

• https://community.letsencrypt.org/t/which-browsers-and-operating-systems-support-lets-encrypt/4394

• Check your browser– https://wiki.apnictraining.net

• (signed by Let’s Encrypt)

Page 17: Crypto Application: TLS / SSL4 SSL/TLS Operations •Client connects to the server –To access a resource •Public-key cryptography during initial handshake to authenticate and exchange

17

Page 18: Crypto Application: TLS / SSL4 SSL/TLS Operations •Client connects to the server –To access a resource •Public-key cryptography during initial handshake to authenticate and exchange

1818

Thank You!END OF SESSION