TESTING CRYPTOGRAPHIC PROTOCOL IMPLEMENTATIONS. Verifying crypto protocols  Lots of formal methods  Good representative: Blanchet’s ProVerif Mainly.

Slides:



Advertisements
Similar presentations
SSL/TLS Protocol Network Security Gene Itkis. Basic paradigmatic application: on-line purchase Client contacts Server (possibly for the first time) Spontaneity.
Advertisements

Web security: SSL and TLS
1 Lecture 17: SSL/TLS history, architecture basic handshake session initiation/resumption key computation negotiating cipher suites application: SET.
1 Lecture 12 SSL/TLS (Secure Sockets Layer / Transport Layer Security) CIS CIS 5357 Network Security.
Lecture 6: Web security: SSL
TLS Introduction 14.2 TLS Record Protocol 14.3 TLS Handshake Protocol 14.4 Summary.
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.
Lecture 7: Transport Level Security – SSL/TLS CS 336/536: Computer Network Security Fall 2013 Nitesh Saxena Adopted from previous lecture by Tony Barnard.
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)
Web Security (SSL / TLS)
Working Connection Computer and Network Security - SSL, IPsec, Firewalls – (Chapter 17, 18, 19, and 23)
An Introduction to Secure Sockets Layer (SSL). Overview Types of encryption SSL History Design Goals Protocol Problems Competing Technologies.
Slide 1 Vitaly Shmatikov CS 378 SSL/TLS. slide 2 What is SSL / TLS? uTransport Layer Security protocol, version 1.0 De facto standard for Internet security.
1 SSL/TLS 2 Web security Security requirements Secrecy to prevent eavesdroppers to learn sensitive information Entity authentication Message authentication.
Transport Layer Security (TLS) Protocol Introduction to networks and communications(CS555) Prof : Dr Kurt maly Student:Abhinav y.
CSE 461 Section. “Transport Layer Security” protocol Standard protocol for encrypting Internet traffic Previously known as SSL (Secure Sockets Layer),
December 2006Prof. Reuven Aviv, SSL1 Web Security with SSL Prof. Reuven Aviv Dept. of Computer Science Tel Hai Academic College.
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.
EEC 693/793 Special Topics in Electrical Engineering Secure and Dependable Computing Lecture 9 Wenbing Zhao Department of Electrical and Computer Engineering.
0 SSL3.0 / TLS1.0 Secure Communication over Insecure Line.
Chapter 8 Web Security.
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.
11 Secure Sockets Layer (SSL) Protocol (SSL) Protocol Saturday, University of Palestine Applied and Urban Engineering College Information Security.
Secure Socket Layer (SSL)
Behzad Akbari Spring 2012 (These slides are based on lecture slides by Lawrie Brown)
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),
Introduction to Secure Sockets Layer (SSL) Protocol Based on:
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
Cryptography and Network Security (CS435) Part Fourteen (Web Security)
Web Security : Secure Socket Layer Secure Electronic Transaction.
Cryptography and Network Security (SSL)
December 2008Prof. Reuven Aviv, SSL1 Web Security with SSL Network Security Prof. Reuven Aviv King Mongkut’s University of Technology Faculty of information.
Web Security Network Systems Security
8-1 Chapter 8 Security Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 part 3: Securing TCP.
SSL (TLS) Part 2 Generating the Premaster and Master Secrets + Encryption.
SMUCSE 5349/7349 SSL/TLS. SMUCSE 5349/7349 Layers of Security.
Secure Sockets Layer (SSL) Protocol by Steven Giovenco.
Web Security Web now widely used by business, government, individuals but Internet & Web are vulnerable have a variety of threats – integrity – confidentiality.
1 SSL/TLS. 2 Web security Security requirements Secrecy to prevent eavesdroppers to learn sensitive information Entity authentication Message authentication.
Encryption protocols Monil Adhikari. What is SSL / TLS? Transport Layer Security protocol, ver 1.0 De facto standard for Internet security “The primary.
Mar 28, 2003Mårten Trolin1 This lecture Certificates and key management Non-interactive protocols –PGP SSL/TLS –Introduction –Phases –Commands.
1 Secure Socket Layer Originally by Yu Yang and Lilly Wang Originally by Yu Yang and Lilly Wang Modified by T. A. Yang Modified by T. A. Yang.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
8-1 CSE 4707/5850 Network Security (2) SSL/TLS. 8-2 Think about Google or YouTube  Desired properties  Indeed the other side is Google or YouTube server.
Secure Socket Layer Protocol Dr. John P. Abraham Professor, UTRGV.
@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.
Apr 1, 2003Mårten Trolin1 Previous lecture Certificates and key management Non-interactive protocols –PGP SSL/TLS –Introduction –Phases –Commands.
TLS/SSL Protocol Presented by: Vivek Nelamangala Includes slides presented by Miao Zhang on April Course: CISC856 - TCP/IP and Upper Layer Protocols.
Network security Presentation AFZAAL AHMAD ABDUL RAZAQ AHMAD SHAKIR MUHAMMD ADNAN WEB SECURITY, THREADS & SSL.
Secure Sockets Layer (SSL)
CSCE 715: Network Systems Security
Originally by Yu Yang and Lilly Wang Modified by T. A. Yang
CSE 4095 Transport Layer Security TLS, Part II
CSE 4095 Transport Layer Security TLS
SSL (Secure Socket Layer)
Chapter 7 WEB Security.
Security at the Transport Layer: SSL and TLS
SSL Protocol Figures used in the presentation
The Secure Sockets Layer (SSL) Protocol
Chapter 7 WEB Security.
Transport Layer Security (TLS)
Presentation transcript:

TESTING CRYPTOGRAPHIC PROTOCOL IMPLEMENTATIONS

Verifying crypto protocols  Lots of formal methods  Good representative: Blanchet’s ProVerif Mainly for its good spec language Almost always gives an answer  Not much on verifying implementations  fs2pv, Csur  Running example today: TLS (the thing that runs when you browse

A long history  – 1994 – Netscape’s Secure Sockets Layer (SSL)  – 1994 – SSL2 (known attacks)  – 1995 – SSL3 (fixed them)  – 1999 – IETF’s TLS1.0 (RFC2246, ≈SSL3)  – 2006 – TLS1.1 (RFC4346)  – 2008 – TLS1.2 (RFC5246)  Provides a layer between TCP and Application (in the TCP/IP model)  – Itself a layered protocol: Handshake over Record  Record (sub)protocol  – provides a private and reliable connection  Handshake (sub)protocol  – authenticates one or both parties, negotiates security parameters  – establishes secret connection keys for the Record protocol  Resumption (sub)protocol  – abbreviated version of Handshake: generates connection keys from previous handshake

Transport layer security (TLS)  Uses several cryptographic primitives  Asymmetric encryption (eg, RSA)  Symmetric encryption (eg, AES)  Hash functions (eg, SHA1, MD5)  MAC function (HMAC)  Gathered in “ciphersuites”, eg TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_DES_CBC_SHA

TLS (generic) Client Server ClientHello > ServerHello [Certificate] [ServerKeyExchange] < [CertificateRequest] ServerHelloDone [Certificate] ClientKeyExchange [CertificateVerify] [ChangeCipherSpec] Finished > [ChangeCipherSpec] < Finished Application Data

Handshake (RSA, client anonymous) Client Server ClientHello > (version, ciphers, nonce)ServerHello (chosen version & cipher=RSA + nonce) Certificate ServerHelloDone < ClientKeyExchange (encrypts pre-master-secret w/servers pk) ChangeCipherSpec Client Finished > (master secret computed from nonces (all the previous msgs hashed) and pms), split in 6 keys: cek,sek,cmk,smk,civ,siv)  Server Finished

TLS bugs / attacks  Bugs and attacks keep being found!  This year a couple  Errors:  “Bugs” -> crash the client or server, execute code,…  “Attacks” -> everything looks fine but the goals are violated  3 kinds:  Message-flow  Implementation  Cryptographic

TLS message-flow attacks  Ciphersuite rollback (ssl 2):  Change the negotiated ciphersuite to the weakest  Hello messages were not included in the finished messages! Hence unauthenticated  Same issue in resumption, it didn’t include finished messages

TLS implementation bugs 1/2  From Advisory 2002:  1. The client master key in SSL2 could be oversized and overrun a buffer.  2. The session ID supplied to a client in SSL3 could be oversized and overrun a buffer.  3. The master key supplied to an SSL3 server could be oversized and overrun a stack-based buffer.

TLS implementation bugs 2/2  From Advisory 2009:  “Several functions inside OpenSSL incorrectly checked the result after calling the EVP_VerifyFinal function, allowing a malformed signature to be treated as a good signature rather than as an error.” ret=RSA_verify(NID_md5_sha1, buf,36, buf2, rsa_num, rsa_key[j]); - if (ret == 0) <- ERROR + if (ret <= 0)  - PATCH { BIO_printf(bio_err, "RSA verify failure\n");

TLS cryptographic attacks  Attacks more on the primitives  Predicting randomness  Timing attacks  Using alert messages as oracles in RSA mode  ….

How to verify TLS?  Translates to 3 separate problems  “How to verify an implementation of TLS {symbolically,cryptographically,implementation- wise}  Mostly manual attempts  Some work in verification for “symbolically”  Rest of this talk: Will show earlier work for “symbolically” This work’s idea: put symbolic and impl. together

Verifying protocol implementations, Cambridge-Paris ‘s style

Demo

Results from that work: All properties are automatically proved  – But after a lot of hand-tuning on the source code  (otherwise ProVerif runs out of memory or does not finish)  – Final ProVerif script of Handshake+Resumption+Record still large (2100LOC)  – Proving Record/Handshake separately is much easier (but less precise)  Experimental details:

+ and -  +:  Model faithfully follows implementation  Automatic  -:  Derived model unmanageable, too complex (resource hog)  so, no spec, one believes in it because it interoperates Also true for Csur: “a running 229 line implementation (excluding included les) of A's role in the Needham-Schroeder protocol results in a set of 459 clauses”  Works only for (a subset of) F# No legacy code

Verifying protocol implementations, Cordoba‘s style  Instead of going from implementations to spec, go from spec to implementations  Derive test cases from spec, try them on (any!) implementation  -:  Spec writing is manual (but for some this is a +)  Can’t prove absence of impl. bugs (testing karma)  +:  Spec readable and short, quick verification  Works on any implementation  The role of testing is to gain confidence that we’re verifying the correct spec

How it works?  Ioco’s style testing  Find all execution interleavings i  For each i, traverse it maintaining the knowledge of “known” and “unknown” terms  “known” terms come from eavesdropping  “unknown” terms are used by the procs but not immediately known  Accept each output made by the processes, “learn” as much as possible may be delayed from previous “lets”  For each input made by the processes, branch new tests for each received subterm Change size, change msg, …  Detect expected results and check conformance

Demo

The future  If bugs_found -> JACM  Elsif old_bugs_found -> JA IIO  Else FAMAF_TR

Other things to try  Complement with some white-box testing  Csur? Why tool?  Q: given that impl bugs (like buffer overflows) are sort of independent, why not check them with another tool? Eg, Astree? Best answer so far: this technique is more to check conformance with the spec; should be complementary with those  Exhaustive coverage of protocols  TLS: Apache, openssl, gnutls, all browsers  Other prots: DNSSEC, openssh, ipsec,…