Real-world cryptography – SSL/TLS Joshua Davies Director of Architecture – 2Xoffice Author of “Implementing SSL/TLS Using Cryptography and PKI”

Slides:



Advertisements
Similar presentations
Web security: SSL and TLS
Advertisements

Spring 2000CS 4611 Security Outline Encryption Algorithms Authentication Protocols Message Integrity Protocols Key Distribution Firewalls.
Internet and Intranet Protocols and Applications Lecture 9a: Secure Sockets Layer (SSL) March, 2004 Arthur Goldberg Computer Science Department New York.
1 Lecture 17: SSL/TLS history, architecture basic handshake session initiation/resumption key computation negotiating cipher suites application: SET.
CS470, A.SelcukSSL/TLS & SET1 CS 470 Introduction to Applied Cryptography Instructor: Ali Aydin Selcuk.
Lecture 6: Web security: SSL
Cryptography and Network Security
SSL CS772 Fall Secure Socket layer Design Goals: SSLv2) SSL should work well with the main web protocols such as HTTP. Confidentiality is the top.
17.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 17 Security at the Transport Layer: SSL and TLS.
Socket Layer Security. In this Presentation: need for web security SSL/TLS transport layer security protocols HTTPS secure shell (SSH)
7-1 Chapter 7 – Web Security Use your mentality Wake up to reality —From the song, "I've Got You under My Skin“ by Cole Porter.
An Introduction to Secure Sockets Layer (SSL). Overview Types of encryption SSL History Design Goals Protocol Problems Competing Technologies.
COMP043-Cryptology Week 4 – Certs and Sigs. Digital Signatures Digital signatures provide –Integrity –Authenticity and –Non-repudiation How do they work?
Chapter 7 Web Security MSc. NGUYEN CAO DAT Dr. TRAN VAN HOAI.
Mar 19, 2002Mårten Trolin1 This lecture On the assignment Certificates and key management SSL/TLS –Introduction –Phases –Commands.
Apr 2, 2002Mårten Trolin1 Previous lecture On the assignment Certificates and key management –Obtaining a certificate –Verifying a certificate –Certificate.
Mar 12, 2002Mårten Trolin1 This lecture Diffie-Hellman key agreement Authentication Certificates Certificate Authorities SSL/TLS.
Web Security for Network and System Administrators1 Chapter 4 Encryption.
An Introduction to Security Concepts and Public Key Infrastructure (PKI) Mary Thompson.
Cryptography and Network Security Chapter 17
BY MUKTADIUR RAHMAN MAY 06, 2010 INTERODUCTION TO CRYPTOGRAPHY.
0 SSL3.0 / TLS1.0 Secure Communication over Insecure Line.
How cryptography is used to secure web services Josh Benaloh Cryptographer Microsoft Research.
Chapter 8 Web Security.
CN8816: Network Security1 Confidentiality, Integrity & Authentication Confidentiality - Symmetric Key Encryption Data Integrity – MD-5, SHA and HMAC Public/Private.
1 Chapter 4 Encryption. 2 Objectives In this chapter, you will: Learn the basics of encryption technology Recognize popular symmetric encryption algorithms.
Announcement Final exam: Wed, June 9, 9:30-11:18 Scope: materials after RSA (but you need to know RSA) Open books, open notes. Calculators allowed. 1.
CSCI 6962: Server-side Design and Programming
SSL and https for Secure Web Communication CSCI 5857: Encoding and Encryption.
Secure Socket Layer (SSL)
SSL / TLS in ITDS Arun Vishwanathan 23 rd Dec 2003.
Behzad Akbari Spring 2012 (These slides are based on lecture slides by Lawrie Brown)
Private Key Algorithms RSA SSL
Cosc 4765 SSL/TLS and VPN. SSL and TLS We can apply this generally, but also from a prospective of web services. Multi-layered: –S-http (secure http),
Key Management Workshop November 1-2, Cryptographic Algorithms, Keys, and other Keying Material  Approved cryptographic algorithms  Security.
Introduction to Secure Sockets Layer (SSL) Protocol Based on:
How cryptography is used to secure web services Josh Benaloh Cryptographer Microsoft Research.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
Network Security Essentials Chapter 5
Cryptography and Network Security (CS435) Part Fourteen (Web Security)
Web Security : Secure Socket Layer Secure Electronic Transaction.
Cryptography and Network Security (SSL)
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
Module 3 – Cryptography Cryptography basics Ciphers Symmetric Key Algorithms Public Key Algorithms Message Digests Digital Signatures.
SSL (TLS) Part 2 Generating the Premaster and Master Secrets + Encryption.
Washington System Center © 2005 IBM Corporation August 25, 2005 RDS Training Secure Socket Layer (SSL) Overview z/Series Security (Mary Sweat, Greg Boyd)
SMUCSE 5349/7349 SSL/TLS. SMUCSE 5349/7349 Layers of Security.
1 SSL/TLS. 2 Web security Security requirements Secrecy to prevent eavesdroppers to learn sensitive information Entity authentication Message authentication.
Secure Socket Layer SSL and TLS. SSL Protocol Peer negotiation for algorithm support Public key encryptionPublic key encryption -based key exchange and.
Mar 28, 2003Mårten Trolin1 This lecture Certificates and key management Non-interactive protocols –PGP SSL/TLS –Introduction –Phases –Commands.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
@Yuan Xue CS 285 Network Security Secure Socket Layer Yuan Xue Fall 2013.
Cryptography CSS 329 Lecture 13:SSL.
Page 1 of 17 M. Ufuk Caglayan, CmpE 476 Spring 2000, SSL and SET Notes, March 29, 2000 CmpE 476 Spring 2000 Notes on SSL and SET Dr. M. Ufuk Caglayan Department.
PRESENTATION ON SECURE SOCKET LAYER (SSL) BY: ARZOO THAKUR M.E. C.S.E (REGULAR) BATCH
Cryptography and Network Security
Secure Sockets Layer (SSL)
CSCE 715: Network Systems Security
Originally by Yu Yang and Lilly Wang Modified by T. A. Yang
Cryptography and Network Security
CS 465 TLS Last Updated: Oct 31, 2017.
Cryptography and Network Security
SSL (Secure Socket Layer)
The Secure Sockets Layer (SSL) Protocol
Cryptography and Network Security
Presentation transcript:

Real-world cryptography – SSL/TLS Joshua Davies Director of Architecture – 2Xoffice Author of “Implementing SSL/TLS Using Cryptography and PKI”

Outline Cryptographic concepts – Symmetric Cryptography – Public-key cryptography – Digital Signatures – Certificates SSL/TLS – Handshake – Advanced/optional components

Digital Security Privacy Integrity Authentication Authorization Non-repudiation (I can prove you did it)

Privacy - Encryption C = E k (P), P = D k (C); K is a secret parameter Ciphers: standard algorithms such as DES, 3DES, AES, RC4, Blowfish, IDEA – hundreds more SSL/TLS provisionally supports any cipher Most implementations support DES, 3DES, AES and RC4 Called symmetric because the same key is used for encryption and decryption

DES Oldest digital cipher still in use Developed by IBM for the NSA in 1974 Fixed 56-bit key size

DES – High level

DES – One round

3DES Triples DES key size by running the DES algorithm three times Encrypt Decrypt Encrypt K1K1 K2K2 K3K3

Rijndael/AES NIST started looking for a replacement for DES in 2001 Rijndael supports 128, 192 and 256-bit keys

AES Encryption

Block Ciphers and Padding Block ciphers require exactly n bytes of input – if the plaintext is shorter, it must be padded Padding must be done securely to avoid giving away keying material

Block Ciphers and CBC mode If the plaintext block P is encrypted twice with the same key, C will be identical Gives attacker some information on the structure of P CBC mode XORs each block with the output of the previous block (first block is XORed with a special value called the initialization vector)

RC4 Stream, rather than a block, cipher Generates a single keystream as long as the plaintext No need for CBC or padding

RC4 Encryption

The problem with encryption – key exchange Keys must be managed securely, but a secure channel can’t be established without a key Public-key cryptography creates two separate keys – one for encryption, one for decryption

Public-key cryptography - RSA Three numbers e, d, n such that (m e ) d %n=m e and n are the public key, d is the private key c = m e %n m = c d %n (distributivity of modulus operator) e, d, and n are long – at least 512 bits Slow runtime - generally used to exchange symmetric keys

Diffie-Hellman Key Exchange Virtually unused, but TLS 1.0 mandates it be supported Can only be used for secret exchange, not for general encryption

Diffie-Hellman Client generate random a Yc = (g a %p) Z = Ys a %p Server generate random b Ys=(g b %p) Z = Yc b %p

Elliptic-Curve Cryptography Relatively new, not much commercial support Based on operations on the curve y 2 =x 3 +ax+b Similar to Diffie-Hellman, but replaces exponentiation with elliptic curve operations Provides similar security to Diffie-Hellman and RSA with far smaller numbers

Adding Points on an elliptic curve

Computing P 3 from P 1 and P 2 x 3 =λ 2 -x 1 -x 2 y 3 =λ(x 1 -x 3 )-y 1 λ=(y 2 -y 1 )/(x 2 -x 1 ) Unless P 1 =P 2 λ=3x 1 2 +a/2y 1

Large Number Arithmetic Public key cryptography requires arbitrary precision math Floating point decimals aren’t good enough, because they lose precision Large number arithmetic takes a long time and uses a lot of memory

Large Number Multiplication 123 x [(4x10 3 )+(5x10 2 )+6(10 1 )]123 (4x10 3 )123+(5x10 2 )123+6(10 1 )123

Binary Multiplication – double and add 1101 x

Binary Exponentiation – square and multiply x 10 xxxxxxxxxx (xxxxx)(xxxxx) (xxxxx) 2 ((xx)(xx)x) 2 ((xx) 2 x) 2 (((x 2 ) 2 x) 2

Efficient, but leads to timing attacks Each operation takes long enough that it can be measured Missing multiplication operations allow an attacker to measure how many 1’s are in the exponent Solution is to perform the multiplication at each step and throw the results away

Key exchange over an insecure channel ServerClient send public key pub E pub (K) C = E k (M)

Man-in-the middle attack ServerClient send public key pub E pub’ (K) C = E k (M) Attacker send public key pub’ C = E k (M) E pub (D priv’ (K))

Prove Identity through digital signatures Upside-down public key cryptography s = m d %n m = s e %n

Document surrogates with secure hashes Public-key cryptography is slow Sign secure hashes of original documents MD5 (128-bit) SHA (-1=160-bit, -256, -384, -512)

DSA Signature generation NIST standard for document signatures; doesn’t actually encrypt anything k = (c%(q-1)) + 1 r = (g k % p) % q z = secure message hash s = ((k -1 %q)(z+xr))%q r and s are the signature, g, p & q are shared and public

DSA Signature Verification w = s -1 %q z = hash(message) u1 = (zw) % q u2 = (rw) % q v = (( g u1 y u2 )%p)%q if v ≠ r, signature is rejected Can replace exponentiation with Elliptic Curve operations to create ECDSA

Providing Message Integrity with HMAC Can secure hashes be used symmetrically?

X.509 Certificates – distribution of public keys Public keys are distributed in x.509 certificate files X.509 certificates are signed by a certificate authority (CA) CA public keys are in turn distributed as x.509 certificate files Root CA 2 nd Level CA Certificate 2 nd Level CA Certificate

Certificate-Related Browser errors: Certificate Expired

Certificate-Related Browser errors: Domain-name mismatch

Certificate-Related Browser errors: Untrusted Signer

What do all of these actually mean? A certificate serves two primary purposes: 1) Provide a public key by which the browser and the server may exchange data securely over a public medium 2) Prove correct ownership of a website

Certificate Format - Issuer

Certificate Trust Chains

Trusted Certificate Authorities Keep a mapping of public keys of trusted CA’s Look up public key and validate signature on each certificate

Certificate Format – Validity Period

Certificate Format - Subject Must match domain name

Roles and Responsibilities CASenderReceiver Generate Key Pair, self sign Generate Key Pair Wrap in CSR Distribute certificate Store CA key Verify Info, Sign Certificate Distribute Signed Cert Validate CA Signature Sign with private key Verify Signature Must be done out of band

Putting it all together – SSL handshake Server Client Server Hello (select a cipher suite) Client Hello (supported suites) Server Certificate Done E pub (Key Exchange) Change Cipher Spec

Vulnerable to replay attacks This works, but an attacker can record an exchange and replay it again and again In order to guard against replay attacks, work a variable state into the handshake and authenticate the entire handshake

The finished messages contain a hash of all messages Server Client Server Hello (select a cipher suite) Client Hello (supported suites) Server Certificate Done E pub (Key Exchange) Change Cipher Spec E k (Finished) Change Cipher Spec E k (Finished) hash

Client Hello

Server Hello

Keys aren’t exchange directly Client Key Exchange includes a premaster secret This is passed to the Pseudo-Random function, which is based on secure hashes, to generate the master secret The master secret is split into cryptography and HMAC keys

Bleichenbacher Attack Try to deduce the private key by returning an invalid key exchange message If the server responds with a handshake completion error rather than an invalid message error, one bit of private key information is leaked Solution: ignore malformed key exchange and complete the handshake

Computing master secret

Server Name Extension TLS has no notion of host names Problematic with shared sites – which certificate to respond with? SNI client hello extension allows the client to specify which host it’s trying to connect to

Session Resumption Key exchange is time-consuming HTTP is based around a lot of short transactions Session resumption allows both sides to remember keying material to be reused

Ephemeral Key Exchange Certificate-less key exchange Must be based on Diffie-Hellman No authentication of server, vulnerable to man-in-the middle attacks

Mutual Authentication The server can insist that the client verify itself as well Client and server may have a different list of trusted certificate authorities Client doesn’t have an identity to validate

Session Renegotiation Discard keying material, negotiate new keys Either side can initiate – client initiates by sending new client hello, server initiates by sending explicit renegotiation request (called a “hello request”) Renegotiation handshake is encrypted using previously negotiated key material

Prefix attacks ServerClient connect Attacker handshake complete connect renegotiate prepend some data send data

Extension 0xFF01 Simple solution – reject renegotiation attempts RFC 5746 describes a client and server extension that allows one session to be securely tied back to another

History of SSL/TLS 1995: Netscape releases a browser with SSLv2 1996: SSLv2 is found to be flawed, SSLv3 is specified 1999: IETF takes over SSL, renames it TLS, blesses version : TLS 1.1 is released, minor revisions 2008: TLS 1.2 is released, major revisions

More Information