Secure Industrial Device Connectivity with Low-Overhead TLS
Total Page:16
File Type:pdf, Size:1020Kb
Secure Industrial Device Connectivity with Low-Overhead TLS Tuesday, October 3, 2017 1:10PM-2:10PM Chris Conlon - Engineering Manager, wolfSSL - B.S. from Montana State University (Bozeman, MT) - Software engineer at wolfSSL (7 years) Contact Info: - Email: [email protected] - Twitter: @c_conlon A. – B. – C. – D. – E. F. ● ● ● ○ ● ○ ● ○ ● Original Image Encrypted using ECB mode Modes other than ECB ● ○ ● ○ ● ● ● ● ○ ● ● ● ● ○ ● ○ ○ ○ ○ ● ○ ● ● ● ● ○ ● ● ○ By Original schema: A.J. Han Vinck, University of Duisburg-EssenSVG version: Flugaal - A.J. Han Vinck, Introduction to public key cryptography, p. 16, Public Domain, https://commons.wikimedia.org/w/index.php?curid=17063048 ● ○ ● ○ ■ ■ ■ ● ○ ■ ● ● ● ● ● ○ ● ● ● ● ● ● ● ○ ○ ○ ○ ● “Progressive” is a subjective term ● These slides talk about crypto algorithms that are: ○ New, modern ○ Becoming widely accepted ○ Have been integrated into SSL/TLS with cipher suites ● ChaCha20 ● Poly1305 ● Curve25519 ● Ed25519 Created by Daniel Bernstein a research professor at the University of Illinois, Chicago Chacha20-Poly1305 AEAD used in Google over HTTPS Ed25519 and ChaCha20-Poly1305 AEAD used in Apple’s HomeKit (iOS Security) ● Fast stream cipher ● Based from Salsa20 stream cipher using a different quarter-round process giving it more diffusion ● Can be used for AEAD encryption with Poly1305 ● Was published by Bernstein in 2008 Used by ● Google Chrome ● TinySSH ● Apple HomeKit ● wolfSSL ● To provide authenticity of messages (MAC) ● Extremely fast in comparison to others ● Introduced by a presentation given from Bernstein in 2002 ● Naming scheme from using polynomial-evaluation MAC (Message Authentication Code) over a prime field Z/(2^130 - 5) Used by ● Tor ● Google Chrome ● Apple iOS ● wolfSSL Generic Montgomery curve. Reference 5 Used by ● Tera Term ● GnuPG ● wolfSSL Generic Twisted Edwards Curve. Reference 6 1. Privacy + Prevent eavesdropping 2. Authentication + Prevent impersonation 3. Integrity + Prevent modification ● Current SSL / TLS / DTLS versions ● RFC 6101 ● RFC 2246 RFC 4346 RFC 5246 ● ● ● ● ● ● Most TLS implementations run on top of a BSD socket API ● Since TLS sits ON TOP of the transport layer, you can theoretically run it on top of ANY transport medium: ○ Serial connection (RS-232) ○ Proprietary transport layer ○ Memory buffers ○ etc. ● Uses variety of crypto algorithms Hash Functions SHA, SHA-256, ... Block and Stream Ciphers 3DES, AES, Camellia, ... Public Key Algorithms RSA, ECC, NTRU, ... ● A common CIPHER SUITE is negotiated during TLS Handshake Protocol_keyexchange_WITH_bulkencryption_mode_messageauth TLS_RSA_WITH_AES_128_CBC_SHA TLS_DHE_DSS_WITH_AES_128_CBC_SHA TLS_DHE_RSA_WITH_AES_256_CBC_SHA ● Four sub-protocols: ● Responsible for negotiating a session, 1. Handshake Protocol includes: 2. Change Cipher Spec Protocol ○ Session identifier 3. Alert Protocol ○ Authentication (one-way or mutual) 4. Record Protocol ○ Using compression ○ Agreeing on set of algorithms ○ Calculation of master secret ● Four sub-protocols: ● Signals transitions in ciphering 1. Handshake Protocol strategies 2. Change Cipher Spec Protocol ● Sent by client and server 3. Alert Protocol 4. Record Protocol ● Notifies receiving party that subsequent records will be protected under newly negotiated CipherSpec and keys ● Four sub-protocols: ● Convey severity and description of 1. Handshake Protocol alert 2. Change Cipher Spec Protocol ● Either “warning” or “fatal” 3. Alert Protocol 4. Record Protocol ● Fatal results in immediate termination of connection ● Encrypted and compressed as per CipherSpec ● Four sub-protocols: 1. Handshake Protocol 2. Change Cipher Spec Protocol 3. Alert Protocol 4. Record Protocol ● TLS Record Header Format ● Handshake Protocol Format Client Hello Hello Verify Request ● Client Hello Server Hello Certificate ○ Server Key Exchange ○ Certificate Request ■ Server Hello Done ■ ■ Certificate ■ Client Key Exchange ■ Certificate Verify ■ Change Cipher Spec Finished Change Cipher Spec Finished Client Hello Hello Verify Request ● Client Hello Server Hello Certificate Server Key Exchange Certificate Request Server Hello Done Certificate Client Key Exchange Certificate Verify Change Cipher Spec Finished Change Cipher Spec Finished Client Hello Hello Verify Request ● Hello Verify Request Server Hello Certificate ○ Server Key Exchange Certificate Request ○ Server Hello Done Certificate ○ Client Key Exchange Certificate Verify Change Cipher Spec Finished Change Cipher Spec Finished Client Hello Hello Verify Request ● Server Hello Server Hello Certificate ○ Server Key Exchange Certificate Request ○ Server Hello Done Certificate ○ Client Key Exchange ■ Certificate Verify ■ ■ Change Cipher Spec ■ Finished ■ Change Cipher Spec ■ Finished Client Hello Hello Verify Request ● Server Hello Server Hello Certificate Server Key Exchange Certificate Request Server Hello Done Certificate Client Key Exchange Certificate Verify Change Cipher Spec Finished Change Cipher Spec Finished ● Hello Extensions ○ ■ ○ ■ ○ Client Hello Hello Verify Request ● Server Certificate Server Hello Certificate ○ Server Key Exchange Certificate Request ○ Server Hello Done ○ Certificate Client Key Exchange Certificate Verify ○ Change Cipher Spec ○ Finished Change Cipher Spec Finished Client Hello Hello Verify Request ● Server Certificate Server Hello Certificate Server Key Exchange Certificate Request Server Hello Done Certificate Client Key Exchange Certificate Verify Change Cipher Spec Finished Change Cipher Spec Finished Client Hello Hello Verify Request ● Server Key Exchange Server Hello Certificate ○ Server Key Exchange Certificate Request Server Hello Done ○ Certificate ■ Client Key Exchange Certificate Verify ■ Change Cipher Spec ○ Finished Change Cipher Spec Finished Client Hello Hello Verify Request Server Hello ● Server Key Exchange Certificate Server Key Exchange Certificate Request Server Hello Done Certificate Client Key Exchange Certificate Verify Change Cipher Spec Finished Change Cipher Spec Finished Client Hello Hello Verify Request ● (Certificate Request) Server Hello Certificate ○ Server Key Exchange Certificate Request ○ Server Hello Done ○ Certificate Client Key Exchange Certificate Verify Change Cipher Spec Finished Change Cipher Spec Finished Client Hello Hello Verify Request ● (Certificate Request) Server Hello Certificate Server Key Exchange Certificate Request Server Hello Done Certificate Client Key Exchange Certificate Verify Change Cipher Spec Finished Change Cipher Spec Finished Client Hello Hello Verify Request ● Server Hello Done Server Hello Certificate ○ Server Key Exchange Certificate Request ○ Server Hello Done Certificate Client Key Exchange Certificate Verify Change Cipher Spec Finished Change Cipher Spec Finished Client Hello Hello Verify Request ● Server Hello Done Server Hello Certificate Server Key Exchange Certificate Request Server Hello Done Certificate Client Key Exchange Certificate Verify Change Cipher Spec Finished Change Cipher Spec Finished Client Hello Hello Verify Request ● (Client Certificate) Server Hello Certificate ○ Server Key Exchange Certificate Request ○ Server Hello Done ○ Certificate Client Key Exchange Certificate Verify ○ Change Cipher Spec Finished ○ Change Cipher Spec Finished Client Hello Hello Verify Request ● (Client Certificate) Server Hello Certificate Server Key Exchange Certificate Request Server Hello Done Certificate Client Key Exchange Certificate Verify Change Cipher Spec Finished Change Cipher Spec Finished Client Hello Hello Verify Request ● Client Key Exchange Server Hello Certificate ○ Server Key Exchange Certificate Request Server Hello Done ○ Certificate Client Key Exchange Certificate Verify ○ Change Cipher Spec Finished Change Cipher Spec Finished Client Hello Hello Verify Request ● Client Key Exchange Server Hello Certificate Server Key Exchange Certificate Request Server Hello Done Certificate Client Key Exchange Certificate Verify Change Cipher Spec Finished Change Cipher Spec Finished Client Hello Hello Verify Request ● Certificate Verify Server Hello Certificate ○ Server Key Exchange Certificate Request Server Hello Done ○ Certificate ○ Client Key Exchange Certificate Verify ○ Change Cipher Spec Finished Change Cipher Spec Finished Client Hello Hello Verify Request ● Certificate Verify Server Hello Certificate Server Key Exchange Certificate Request Server Hello Done Certificate Client Key Exchange Certificate Verify Change Cipher Spec Finished Change Cipher Spec Finished Client Hello Hello Verify Request ● Change Cipher Spec Server Hello Certificate ○ Server Key Exchange Certificate Request ○ Server Hello Done Certificate ○ Client Key Exchange Certificate Verify Change Cipher Spec Finished Change Cipher Spec Finished Client Hello Hello Verify Request ● Change Cipher Spec Server Hello Certificate Server Key Exchange Certificate Request Server Hello Done Certificate Client Key Exchange Certificate Verify Change Cipher Spec Finished Change Cipher Spec Finished Client Hello Hello Verify Request ● Finished Server Hello Certificate ○ Server Key Exchange Certificate Request Server Hello Done ○ Certificate Client Key Exchange ○ Certificate Verify Change Cipher Spec Finished Change Cipher Spec Finished ● X.509 is a standard for PKI (public key infrastructure) ● Some things specified by it include: ○ Public key certificates ○ Certificate revocation lists ○ Certificate path validation algorithm (CA / cert chain structure) ● Structure is expressed in ASN.1 syntax ● Filename Extensions: ○ .pem ■ “Privacy-enhanced Electronic Mail” ■ Base64-encoded