Network Security (NetSec)

Similar documents
Network Security (NetSec)

Network Security. Kerberos and other Frameworks for Client Authentication. Dr. Heiko Niedermayer Cornelius Diekmann. Technische Universität München

Chair for Network Architectures and Services Institute of Informatics TU München Prof. Carle. Network Security. Chapter 2 Cryptography

Chair for Network Architectures and Services Institute of Informatics TU München Prof. Carle. Network Security. Chapter 2 Cryptography

Protocols II. Computer Security Lecture 12. David Aspinall. 17th February School of Informatics University of Edinburgh

Session key establishment protocols

Session key establishment protocols

Cryptographic Protocols 1

Chair for Network Architectures and Services Institute of Informatics TU München Prof. Carle. Network Security. Chapter 3

Cryptography and Network Security. Prof. D. Mukhopadhyay. Department of Computer Science and Engineering. Indian Institute of Technology, Kharagpur

1.264 Lecture 27. Security protocols Symmetric cryptography. Next class: Anderson chapter 10. Exercise due after class

Spring 2010: CS419 Computer Security

Data Security and Privacy. Topic 14: Authentication and Key Establishment

L13. Reviews. Rocky K. C. Chang, April 10, 2015

L7: Key Distributions. Hui Chen, Ph.D. Dept. of Engineering & Computer Science Virginia State University Petersburg, VA 23806

0/41. Alice Who? Authentication Protocols. Andreas Zeller/Stephan Neuhaus. Lehrstuhl Softwaretechnik Universität des Saarlandes, Saarbrücken

Chair for Network Architectures and Services Department of Informatics TU München Prof. Carle. Network Security

CS 161 Computer Security

Key Agreement. Guilin Wang. School of Computer Science, University of Birmingham

CS Computer Networks 1: Authentication

Security protocols and their verification. Mark Ryan University of Birmingham

Chair for Network Architectures and Services Department of Informatics TU München Prof. Carle. Network Security

Chapter 9: Key Management

Module: Cryptographic Protocols. Professor Patrick McDaniel Spring CMPSC443 - Introduction to Computer and Network Security

Information Security CS 526

Cryptography CS 555. Topic 16: Key Management and The Need for Public Key Cryptography. CS555 Spring 2012/Topic 16 1

Authentication Handshakes

Cryptography & Key Exchange Protocols. Faculty of Computer Science & Engineering HCMC University of Technology

Real-time protocol. Chapter 16: Real-Time Communication Security

CSC 474/574 Information Systems Security

CS 494/594 Computer and Network Security

Issues. Separation of. Distributed system security. Security services. Security policies. Security mechanism

Cristina Nita-Rotaru. CS355: Cryptography. Lecture 17: X509. PGP. Authentication protocols. Key establishment.

CSCI 667: Concepts of Computer Security. Lecture 9. Prof. Adwait Nadkarni

Lecture 5: Protocols - Authentication and Key Exchange* CS 392/6813: Computer Security Fall Nitesh Saxena

Key Management. Digital signatures: classical and public key Classic and Public Key exchange. Handwritten Signature

Computer Security. 08r. Pre-exam 2 Last-minute Review Cryptography. Paul Krzyzanowski. Rutgers University. Spring 2018

Network Security (NetSec)

Kurose & Ross, Chapters (5 th ed.)

Cryptographic Checksums

Exercises with solutions, Set 3

Grenzen der Kryptographie

UNIT - IV Cryptographic Hash Function 31.1

CS Protocols. Prof. Clarkson Spring 2016

ECE596C: Handout #9. Authentication Using Shared Secrets. Electrical and Computer Engineering, University of Arizona, Loukas Lazos

Securing Internet Communication: TLS

Applied Cryptography Basic Protocols

KEY AGREEMENT PROTOCOLS. CIS 400/628 Spring 2005 Introduction to Cryptography. This is based on Chapter 13 of Trappe and Washington

Computer Networks & Security 2016/2017

Outline More Security Protocols CS 239 Computer Security February 6, 2006

Chair for Network Architectures and Services Department of Informatics TU München Prof. Carle. Network Security. Chapter 1 Introduction

Outline More Security Protocols CS 239 Computer Security February 4, 2004

ECEN 5022 Cryptography

Chapter 10 : Private-Key Management and the Public-Key Revolution

Computer Networks 1 (Mạng Máy Tính 1) Lectured by: Dr. Phạm Trần Vũ

Applied Cryptography and Computer Security CSE 664 Spring 2017

Elements of Security

ח'/סיון/תשע "א. RSA: getting ready. Public Key Cryptography. Public key cryptography. Public key encryption algorithms

CS Protocol Design. Prof. Clarkson Spring 2017

CIS 6930/4930 Computer and Network Security. Topic 6.2 Authentication Protocols

Network Security CHAPTER 31. Solutions to Review Questions and Exercises. Review Questions

Fall 2010/Lecture 32 1

Security Handshake Pitfalls

Lecture 1: Course Introduction

Security Handshake Pitfalls

T Cryptography and Data Security

Public-key Cryptography: Theory and Practice

Outline. Login w/ Shared Secret: Variant 1. Login With Shared Secret: Variant 2. Login Only Authentication (One Way) Mutual Authentication

CS 6324: Information Security More Info on Key Establishment: RSA, DH & QKD

Security and Privacy in Computer Systems. Lecture 7 The Kerberos authentication system. Security policy, security models, trust Access control models

What did we talk about last time? Public key cryptography A little number theory

Key Establishment and Authentication Protocols EECE 412

Modelling and Analysing of Security Protocol: Lecture 1. Introductions to Modelling Protocols. Tom Chothia CWI

Outline. More Security Protocols CS 239 Security for System Software April 22, Needham-Schroeder Key Exchange

Ideal Security Protocol. Identify Friend or Foe (IFF) MIG in the Middle 4/2/2012

Computer Networking. What is network security? Chapter 7: Network security. Symmetric key cryptography. The language of cryptography

CSC/ECE 774 Advanced Network Security

Lecture 7 - Applied Cryptography

CS3235 Seventh set of lecture slides

Digital Signatures. Public-Key Signatures. Arbitrated Signatures. Digital Signatures With Encryption. Terminology. Message Authentication Code (MAC)

CIS 4360 Secure Computer Systems Applied Cryptography

Outline Key Management CS 239 Computer Security February 9, 2004

Overview. Cryptographic key infrastructure Certificates. May 13, 2004 ECS 235 Slide #1. Notation

Network Security. Chapter 7 Cryptographic Protocols

Key Exchange. References: Applied Cryptography, Bruce Schneier Cryptography and Network Securiy, Willian Stallings

Public-Key Cryptography. Professor Yanmin Gong Week 3: Sep. 7

Authentication Part IV NOTE: Part IV includes all of Part III!

Digital Signatures. Secure Digest Functions

Lecture Nov. 21 st 2006 Dan Wendlandt ISP D ISP B ISP C ISP A. Bob. Alice. Denial-of-Service. Password Cracking. Traffic.

Network Security and Internet Protocols

BAN Logic. Logic of Authentication 1. BAN Logic. Source. The language of BAN. The language of BAN. Protocol 1 (Needham-Schroeder Shared-Key) [NS78]

18733: Applied Cryptography Anupam Datta (CMU) Basic key exchange. Dan Boneh

CSC 774 Network Security

Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2010

Lecture 15: Cryptographic algorithms

CSE 127: Computer Security Cryptography. Kirill Levchenko

Lecture 30. Cryptography. Symmetric Key Cryptography. Key Exchange. Advanced Encryption Standard (AES) DES. Security April 11, 2005

Lecture 4: Authentication Protocols

Lecture 6.2: Protocols - Authentication and Key Exchange II. CS 436/636/736 Spring Nitesh Saxena. Course Admin

From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design. Edition 4 Pearson Education 2005

Transcription:

Chair of Network Architectures and Services Department of Informatics Technical University of Munich Network Security (NetSec) IN2101 WS 16/17 Prof. Dr.-Ing. Georg Carle Dr. Heiko Niedermayer Cornelius Diekmann Version: December 12, 2016 Chair of Network Architectures and Services Department of Informatics Technical University of Munich

Chapter 10: Cryptographic Protocols Introduction Protocols Authentication and Key Establishment Protocols Attack Concepts against Cryptographic Protocols Desirable Properties of Cryptographic Protocols Final Protocol, Goals, and Notation Needham Schroeder Protocol Needham Schroeder Symmetric Key Protocol Needham Schroeder Public Key Protocol Chapter 10: Cryptographic Protocols 10-1

Chapter 10: Cryptographic Protocols Conclusions - What have we learned Chapter 10: Cryptographic Protocols 10-2

Chapter 10: Cryptographic Protocols Introduction Protocols Authentication and Key Establishment Protocols Attack Concepts against Cryptographic Protocols Desirable Properties of Cryptographic Protocols Final Protocol, Goals, and Notation Needham Schroeder Protocol Conclusions - What have we learned Chapter 10: Cryptographic Protocols 10-3

Acknowledgements This course is based to some extend on slides provided by Günter Schäfer, author of the book "Netzsicherheit - Algorithmische Grundlagen und Protokolle", available in German from dpunkt Verlag. The English version of the book is entitled Security in Fixed and Wireless Networks: An Introduction to Securing Data Communications and is published by Wiley is also available. We gratefully acknowledge his support. The slide set has been reworked by Heiko Niedermayer, Ali Fessi, Ralph Holz, Cornelius Diekmann, and Georg Carle. Chapter 10: Cryptographic Protocols Introduction 10-4

Explanation Pony and Exercises Slides called "- Explanation" and usually marked with are not for the lecture, but they contain further explanations for your learning at home. Parts called "Exercise" are voluntary exercises for discussion in lecture as well as for your reworking of the slides and learning at home. Chapter 10: Cryptographic Protocols Introduction 10-5

Introduction Communicate over distance using a network Do I speak with the right person? Who can read the content? How can cryptography be used for that? Which keys? From where and when? Protocols describe an exchange of messages for a certain purpose (e.g. security goals). Cryptographic Protocols Chapter 10: Cryptographic Protocols Introduction 10-6

Learning Goals Basic understanding of cryptographic protocols Know the terms and methods and apply them Get to know some elementary protocols real-world protocols discussed in later chapters use the basics you learn here Remember and explain them You will gain some first thoughts about how to break protocols and learn to think in a way of finding attacks Apply them to find weaknesses You will gain some first ideas how to improve protocols Apply them to remove a similar weakness Chapter 10: Cryptographic Protocols Introduction 10-7

Stick to the protocol layer (Exercise, Exam) When we discuss cryptographic protocols, we assume the following The cryptographic primitives are secure. Insecure primitives or implementations can make a secure protocol insecure 1. The computers, machines,... are secure. Insecure machines can make the use of a secure protocol insecure. Our reasoning uses the Dolev-Yao attacker model. Attacker = Network Our reasoning focuses on the layer of the cryptographic protocol. Security can be shown by formal methods (model checking of protocol, security proofs, etc.). 1 Defended by security proofs, code review, formal code analysis,... Chapter 10: Cryptographic Protocols Introduction 10-8

Stick to the protocol layer (Exercise, Exam) When we try to break a protocol, we do this on the layers of the protocol. The reason is that we do not learn anything about weaknesses and security of protocols if we attack them by assuming to hack a computer and steal all data. So, whenever you are asked to analyze or attack a protocol in an exercise, attack on the layer of the protocol and attack its operation. Otherwise you do not learn to understand and evaluate protocols. The same is true if we consider mitigations. Fix the protocol by changing its operation, not by adding new requirements like super-secure primitives or machines. Chapter 10: Cryptographic Protocols Introduction 10-9

Chapter 10: Cryptographic Protocols Introduction Protocols Authentication and Key Establishment Protocols Attack Concepts against Cryptographic Protocols Desirable Properties of Cryptographic Protocols Final Protocol, Goals, and Notation Needham Schroeder Protocol Conclusions - What have we learned Chapter 10: Cryptographic Protocols 10-10

What do we know as of yet? What do we know? Symmetric encryption and keys Asymmetric encryption and keys Cryptographic hash functions Secure Channel To use a secure channel, Alice and Bob need a shared key. A protocol to establish a secure channel needs to establish a shared key. Chapter 10: Cryptographic Protocols Protocols 10-11

Protocols, Notation,... Cryptographic protocols contain: General entities that are normal participants of the protocol. We call them Alice (A), Bob (B),... Special-purpose entities that have a special role. Authentication Server (AS),... Some synonyms: entity, principle, participant Alice-Bob notation: one way to describe cryptographic protocols Protocol messages in sequence (numbering optional): 1. Alice Bob : message of Alice 2. Bob Alice : message of Bob... Chapter 10: Cryptographic Protocols Protocols 10-12

Protocols, Notation,... Or sequence diagram: Alice Bob 1. message of Alice 2. message of Bob... Some Notation: Notation Meaning A, B,... Protocol principles K A,B Key, here shared key of A and B {m} K Plaintext m encrypted and integrity-protected with key K Chapter 10: Cryptographic Protocols Protocols 10-13

Protocol Try 1 (Textbook Diffie-Hellman) Alice Bob g a mod p, g, p g b mod p knows K A,B = g ab mod p knows K A,B = g ab mod p Alice and Bob have completed a Diffie-Hellman exhange and established a shared key at the end of the protocol. Are we done? Chapter 10: Cryptographic Protocols Protocols 10-14

Protocol Try 1 - What goes wrong (Man-in-the-Middle) Repetition. This should already be known. Alice Attacker Bob g a mod p, g, p g d mod p, g, p g c mod p g b mod p knows K ab as g bd mod p knows K ab as g ac mod p Attacker now has a shared key K ac with Alice and a shared key K bd with Bob. The attacker is called Man-in-the-Middle attacker as it sits in-between any communication between Alice and Bob. Chapter 10: Cryptographic Protocols Protocols 10-15

Protocol Try 1 - What goes wrong (Man-in-the-Middle) When Alice uses the secure channel to send message m: Alice Attacker Bob {m} g ac mod p {m}g bd mod p Despite using the secure channel, the attacker can read, modify, or create message between Alice and Bob. Chapter 10: Cryptographic Protocols Protocols 10-16

Protocol Try 1 - What goes wrong (No Authentication) The exchange does not contain any authentication. Thus, Alice has no way of identifying Bob. Bob has no way of identifying Alice. An attacker can impersonate whomever it likes. Chapter 10: Cryptographic Protocols Protocols 10-17

Protocol Try 2 - Adding a password Alice Bob A, Password A,B, g a mod p, g, p B, Password A,B, g b mod p knows K A,B = g ab mod p knows K A,B = g ab mod p Try 2 still fails: Man-in-the-middle still possible Eavesdropper can read password, then impersonation possible Why do they already have a password? Lets discuss authentication. Chapter 10: Cryptographic Protocols Protocols 10-18

Chapter 10: Cryptographic Protocols Introduction Protocols Authentication and Key Establishment Protocols Attack Concepts against Cryptographic Protocols Desirable Properties of Cryptographic Protocols Final Protocol, Goals, and Notation Needham Schroeder Protocol Conclusions - What have we learned Chapter 10: Cryptographic Protocols 10-19

Entity Authentication and Key Establishment Entity Authentication Authenticity of an entity is shown An authentication protocol is run and at the end, some protocol participants are ensured of the identity of other participants. Mutual authentication: Authenticity of Alice and Bob is shown to each other Key Establishment A key is established between some protocol participants Key Transport: Some entity creates the key and sends it to other entities. Key Agreement: Multiple entities contribute to the generation of the key. Chapter 10: Cryptographic Protocols Authentication and Key Establishment Protocols 10-20

Entity Authentication and Key Establishment Many authentication protocols as a side effect of the authentication - do establish a shared session key K A,B for securing the session. Some opinions about the relationship between authentication and key establishment: "It is accepted that these topics should be considered jointly rather separately" [Diff92] "... authentication is rarely useful in the absence of an associated key distribution" [Bell95] "In our view there are situations when entity authentication by itself may useful, such as when using a physically secured communication channel." [Boyd03] Chapter 10: Cryptographic Protocols Authentication and Key Establishment Protocols 10-21

Key Establishment without Entity Authentication Why our first try failed... After a protocol run, neither Alice nor Bob know with whom they actually have exchanged a key. Can Key Establishment without Authentication work? If Alice and Bob already have an authenticated channel, then a key exchange over that channel may not need to authenticate. Chapter 10: Cryptographic Protocols Authentication and Key Establishment Protocols 10-22

Entity Authentication without Key Establishment Entity Authentication without Key Establishment? In cyber-physical system: something happens in physical world upon authentication. E.g. door opens for Alice. No session key needed. Over the network? If a shared key already exists, only the binding of key and identity (authentication) may be needed. Chapter 10: Cryptographic Protocols Authentication and Key Establishment Protocols 10-23

Entity Authentication and Key Establishment in WWW Alice wants to use the online banking service provided by her bank Authentication of the web server of the bank: Web browser verifies the identity of the web server via HTTPS using asymmetric encryption A shared session key K A,B is generated as part of the server authentication A secure channel between web browser and web server is established Authentication of the client: Uses the secure channel to the web server The web server authenticates Alice based on her PIN number No additional secret key is established Chapter 10: Cryptographic Protocols Authentication and Key Establishment Protocols 10-24

Operation of Cryptographic Protocols Initiator The principle (entity) that starts the protocol by sending the first message. Responder Principles that did not start the protocol. All principles see messages send messages draw conclusions from observations Chapter 10: Cryptographic Protocols Authentication and Key Establishment Protocols 10-25

Authentication = Proof in Formal Logic Each principle has its knowledge and beliefs. In the operation of the cryptographic protocol it takes certain actions. In the operation of the cryptographic protocol it makes observations. Reasoning on actions and observation needs to establish the objectives of the protocol. Example (Authenticity of Bob): Sent fresh challenge to Bob. Protected it with public key of Bob. If anyone can read the challenge, then it has to have knowledge of Bob s private key. Value from the challenge is seen again. Thus, Bob participated in the protocol and used his private key. Chapter 10: Cryptographic Protocols Authentication and Key Establishment Protocols 10-26

Where do the keys come from? Alice and Bob can have a long-term shared key. Alice and Bob can have exchanged their public keys. Alice and Bob have exchanged keys with a Trusted Third Party (TTP). The TTP helps. More scalable. Typical names for the TTP: Authentication Server (AS), Certification Authority (CA),... If no such pre-exchanged keys exist, cryptographic protocols cannot operate securely (Boyd s Theorem). More on the issue in a separate chapter on Identity and Public Key Infrastructures. Chapter 10: Cryptographic Protocols Authentication and Key Establishment Protocols 10-27

Authentication and Key Establishment Problem Statement - Version 1 Goals: Run a key exchange protocol such that at the end of the protocol: Alice and Bob have shared a session key for a secure channel Alice (Bob) must be able to verify that Bob (Alice) participated in the protocol run (authentication) Chapter 10: Cryptographic Protocols Authentication and Key Establishment Protocols 10-28

Protocol Try 3 Shared Key with Server Using a TTP is more scalable, so lets use a server. Alice generates a fresh key and sends it to Bob via the server. Btw, when we encrypt, the receiver might need to know who sends the message, at least if it is not the server. Alice Authentication Server Bob A, {B, K A,B } KAS,A {A, B, K A,B } KAS,B B, {A, K A,B } KA,B Only Bob knows K A,B Bob A, {B, K A,B } KA,B Only Alice knows K A,B really Alice Chapter 10: Cryptographic Protocols Authentication and Key Establishment Protocols 10-29

Chapter 10: Cryptographic Protocols Introduction Protocols Authentication and Key Establishment Protocols Attack Concepts against Cryptographic Protocols Desirable Properties of Cryptographic Protocols Final Protocol, Goals, and Notation Needham Schroeder Protocol Conclusions - What have we learned Chapter 10: Cryptographic Protocols 10-30

Attacks Already known: Attacker: Eavesdropping Man-in-the-Middle Attack Cryptanalysis Can control parts or all of the network (see Dolev-Yao) Eavesdrops and memorizes all it has seen Can initiate protocol run Can interfere with protocol runs Can try to trick principles into running the protocol For protocol analysis, it is usually not able to break crypto and hack the computers. Chapter 10: Cryptographic Protocols Attack Concepts against Cryptographic Protocols 10-31

Replay Attack Replay Attack: Receives and eavesdrops messages later-on send message or part of message to some principle. Alice (A) AS Attacker m 1 m 2, m 3 Receives Eavesdrops Later: Attacker AS m 1 m 4, m 3 Bob (B) Chapter 10: Cryptographic Protocols Attack Concepts against Cryptographic Protocols 10-32

1. (IP A, )A, {A, B} KA,B Replay Attack - Example Alice Bob Attacker 1. (IP Attacker, )A, {A, B} KA,B Alice is legitimate user Bob opens firewall for IP address of Alice Alice is legitimate user Bob opens firewall for IP address of Attacker Chapter 10: Cryptographic Protocols Attack Concepts against Cryptographic Protocols 10-33

1. (IP A, )A, {A, B} KA,B Replay Attack - Example Alice Bob Attacker 1. (IP Attacker, )A, {A, B} KA,B Alice is legitimate user Bob opens firewall for IP address of Alice Alice is legitimate user Bob opens firewall for IP address of Attacker Bob cannot decide whether the message is fresh or not. Reacting to an old message can result in security compromise! Chapter 10: Cryptographic Protocols Attack Concepts against Cryptographic Protocols 10-33

Protocol Try 4 Replay Attack Defences An attacker can replay all messages of protocol try 3. None needs to be fresh. Better add a defense Nonces N A, N B,... Alice Authentication Server Bob A, {B, N A, K A,B } KAS,A {A, B, N A, K A,B } KAS,B B, {A, N A, N B, K A,B } KA,B knows K A,B, N A Bob A, {B, N B, K A,B } KA,B knows K A,B, N B Alice Chapter 10: Cryptographic Protocols Attack Concepts against Cryptographic Protocols 10-34

Authentication and Key Establishment Problem Statement - Version 2 Goals: Run a key exchange protocol such that at the end of the protocol: Alice and Bob have a shared session key for a secure channel Alice (Bob) must be able to verify that Bob (Alice) participated in the protocol run (authentication) and that he (she) is alive (freshness) Chapter 10: Cryptographic Protocols Attack Concepts against Cryptographic Protocols 10-35

2 see Dolev-Yao Attacker Model Chapter 10: Cryptographic Protocols Attack Concepts against Cryptographic Protocols 10-36 Oracle Attacks The attacker cannot break cryptography (assumption 2 ). Yet maybe there are helpful principles that can help. e.g. because they know the relevant keys Oracles are usually entities that can efficiently do something that a normal entity (here our attacker) cannot. Attacker Oracle Can you apply some crypto for me on m? Sure, m

Oracle Attacks - Example Alice AS Bob 1. A, B, {N A, K A1 } KAS,A 2. AS, {A, B, NA, K A1 } KAS,B 3. {N B } KA1, {N A } KA,B K A,B = H(N A, N B ) Attacker M replay AS 1. A, M, {N A, K A1 } KAS,A AS as oracle helps to 2. AS, {A, M, N A, K A1 } KAS,M decrypt N A and K A1 replay 2. AS, {A, B, N A, K A1 } KAS,B M can calculate 3. {N B,2 } KA1, {N A } KA,B,2 Bob thinks it is Alice K A,B,2 = H(N A, N B,2 ) K A,B,2 Chapter 10: Cryptographic Protocols Attack Concepts against Cryptographic Protocols 10-37

Typing Attack Replace (usually encrypted) message field of one type with one of another (usually encrypted) type. Alice Attacker (M) Shopping Server in Protocol 1: 1. M, A, N B Attacker selects N B = Alice buys washing machine. in Protocol 1: 2. A, N A, M, Sig KAlice-priv (N B ) Signing innocent nonce N B in one protocol can mean signing a contract in another in Protocol 2: 1. Alice buys washing machine., Sig KAlice-priv ( Alice buys washing machine. ) Chapter 10: Cryptographic Protocols Attack Concepts against Cryptographic Protocols 10-38

Other types of attacks Think about more types of attacks. How would a protocol with a related weakness look like? Chapter 10: Cryptographic Protocols Attack Concepts against Cryptographic Protocols 10-39

Other Types of Protocol Attacks Modification: Attacker alters messages sent. Preplay: The attacker takes part in a protocol run prior to a protocol run. Reflection: The attacker sends back protocol messages to principles who sent them. Related to Oracle attacks. Denial of Service: The attacker hinders legitimate principles to complete the protocol. Certificate Manipulation: Attacks using manipulated or wrongly-obtained certificates. Protocol Interaction: Make one protocol interact with another, e.g. by utilizing that principles use the same long-term keys in both protocols and utilizing that for an attack. Chapter 10: Cryptographic Protocols Attack Concepts against Cryptographic Protocols 10-40

Chapter 10: Cryptographic Protocols Introduction Protocols Authentication and Key Establishment Protocols Attack Concepts against Cryptographic Protocols Desirable Properties of Cryptographic Protocols Final Protocol, Goals, and Notation Needham Schroeder Protocol Conclusions - What have we learned Chapter 10: Cryptographic Protocols 10-41

Desirable Properties of Cryptographic Protocols Desirable Properties = what else we should want In this section: Forward Secrecy and Key Agreement Scalability Avoidance of Single-Points-of-Failures Selection of Algorithms Generic Authentication Methods Simplicity Chapter 10: Cryptographic Protocols Desirable Properties of Cryptographic Protocols 10-42

Forward Secrecy (Repetition) Forward Secrecy (Repetition) If long-term key is compromised, attacker cannot find out session key for older sessions. If session key is compromised, other sessions and long-term key not affected. Can be achieved via Diffie-Hellman exchange. DH A is Diffie-Hellman information provided by Alice (e.g. in Textbook DH: g, p, g a mod p) DH B is Diffie-Hellman information provided by Bob Chapter 10: Cryptographic Protocols Desirable Properties of Cryptographic Protocols 10-43

Protocol Try 5 Adding Forward Secrecy Session key K A,B derived from DH A and DH B Alice Authentication Server Bob A, {B, N A, DH A } KAS,A {A, B, N A, DH A } KAS,B B, DH B, {A, N A, N B } KA,B knows K A,B, N A Bob A, {B, N B } KA,B knows K A,B, N B Alice Note: DH B is integrity protected by {A, N A, N B } KA,B. Why? Chapter 10: Cryptographic Protocols Desirable Properties of Cryptographic Protocols 10-44

Scalability - revisted Scalability of keys Authentication Server But having a central server is a single point of failure... and bad for scalability of service Thus, good if server need not be contacted within a protocol run. While server may have provided keys or certificates (identity-key binding) beforehand. Chapter 10: Cryptographic Protocols Desirable Properties of Cryptographic Protocols 10-45

Protocol Try 6 Removing Authentication Server Session key K A,B derived from Diffie-Hellman Alice A, {B, N A, DH A } KA,B,longterm Bob B, {A, N A, DH B, N B } KA,B,longterm knows K A,B,longterm and N A Bob A, {B, N B } KA,B,longterm knows K A,B,longterm and N B Alice Chapter 10: Cryptographic Protocols Desirable Properties of Cryptographic Protocols 10-46

Selection of Used Algorithms Can we adapt the protocol, so that public key cryptography could be used? In practise, one might also want that all kinds of algorithms can be exchanged over time. Do not become outdated! Concept: Generic Auth X () function that can be realized with a suitable authentication function given either a public or shared key of X. Example: Alice and Bob share a symmetric key Bob: Auth B (m) = MAC KA,B (m) Alice: Vrfy KA,B (m, Auth B (m)) Alice and Bob know each other s public key Bob: Auth B (m) = Sig KB-priv (m) Alice: Vrfy KB-pub (m, Auth B (m)) Alice and Bob have to agree on this function and used algorithms, e.g. Alice proposes a set of functions and algoritms Bob selects the ones that are then used Chapter 10: Cryptographic Protocols Desirable Properties of Cryptographic Protocols 10-47

A, B, N A, DH A, proposed crypto algs Protocol Try 7 Generic AUTH payload and Selection of Algorithms Session key K A,B derived from Diffie-Hellman Alice Bob verify AUTH correct Bob B, A, N B, DH B, chosen crypto algs, AUTH B (A, B, N A, N B, DH A, DH B ) A, AUTH A (A, B, N A, N B, DH A, DH B ) verify AUTH correct Alice Chapter 10: Cryptographic Protocols Desirable Properties of Cryptographic Protocols 10-48

A, B, N A, DH A, proposed crypto algs Protocol Try 7 Generic AUTH payload and Selection of Algorithms Session key K A,B derived from Diffie-Hellman Alice Bob verify AUTH correct Bob B, A, N B, DH B, chosen crypto algs, AUTH B (A, B, N A, N B, DH A, DH B ) A, AUTH A (A, B, N A, N B, DH A, DH B ) verify AUTH correct Alice AUTH playload could be MAC KA,B,longterm. Then, Alice and Bob authenticate on identical messages replay attack possible! Chapter 10: Cryptographic Protocols Desirable Properties of Cryptographic Protocols 10-48

A, B, N A, DH A, proposed crypto algs Protocol Try 8 AUTH Payload rework Session key K A,B derived from Diffie-Hellman Alice Bob B, A, N B, DH B, chosen crypto algs, AUTH B (A, B, N A, DH A, N B, chosen crypto algs) verify AUTH correct Bob A, AUTH A (B, A, N B, DH B, N A, proposed crypto algs) verify AUTH correct Alice AUTH playloads are different and contain information provided by both principles. Chapter 10: Cryptographic Protocols Desirable Properties of Cryptographic Protocols 10-49

Simplicity Cryptographic protocols should be kept as simple as possible (but not any simpler) Complexity makes analysis harder and increases attack surface. Design Concept: Request-Response Pairs A B : Request1 B A : Response1... Chapter 10: Cryptographic Protocols Desirable Properties of Cryptographic Protocols 10-50

DoS Protection Cryptography is expensive (in particular asymmetric cryptography) Denial-of-Service attacker Defense Make victim do expensive operations The attacker does not have to generate valid ciphertext, simple random numbers can work. Avoid expensive operations unless other principle has shown willingness to participate by replying with valid messages. In final protocol try, we will avoid crypto until message 3. Cookie mechanisms like TCP SYN Cookies could be used to avoid holding of state. Chapter 10: Cryptographic Protocols Desirable Properties of Cryptographic Protocols 10-51

Chapter 10: Cryptographic Protocols Introduction Protocols Authentication and Key Establishment Protocols Attack Concepts against Cryptographic Protocols Desirable Properties of Cryptographic Protocols Final Protocol, Goals, and Notation Needham Schroeder Protocol Conclusions - What have we learned Chapter 10: Cryptographic Protocols 10-52

Authentication and Key Establishment Problem Statement - Version 3 (FINAL) Goals: Run a key exchange protocol such that at the end of the protocol: Alice and Bob have a shared session key for a secure channel Alice and Bob have agreed on the cryptographic algorithms to be used for the secure channel Alice (Bob) must be able to verify that Bob (Alice) participated in the protocol run (authentication) and that he (she) is alive (freshness) Alice and Bob must know that K A,B is newly generated Chapter 10: Cryptographic Protocols Final Protocol, Goals, and Notation 10-53

1. N A, DH A, proposed crypto algs Final Protocol Alice Bob 2. N B, DH B, chosen crypto algs knows K A,B from DH knows K A,B from DH 3. A, Auth A (DH A, proposed crypto algs, N B ) check 4. B, Auth B (DH B, chosen crypto algs, N A ) Auth A check Auth B

1. N A, DH A, proposed crypto algs Final Protocol Alice Bob 2. N B, DH B, chosen crypto algs knows K A,B from DH knows K A,B from DH 3. A, Auth A (DH A, proposed crypto algs, N B ) From Bob, fresh due to N B check From Alice, freshness if fresh g a 4. B, Auth B (DH B, chosen crypto algs, N A ) check Auth A Bob authenticates Alice on usage of a key and fresh information from both of them Auth B

1. N A, DH A, proposed crypto algs Final Protocol Alice Bob 2. N B, DH B, chosen crypto algs knows K A,B from DH knows K A,B from DH 3. A, Auth A (DH A, proposed crypto algs, N B ) check check 4. B, Auth B (DH B, chosen crypto algs, N A ) Auth A Bob authenticates Alice on usage of a key and fresh information from both of them Auth B The same is true for Alice authenticating Bob. Exercise: check this Chapter 10: Cryptographic Protocols Final Protocol, Goals, and Notation 10-54

1. N A, DH A, proposed crypto algs Final Protocol Alice Bob 2. N B, DH B, chosen crypto algs knows K A,B from DH knows K A,B from DH 3. A, Auth A (DH A, proposed crypto algs, N B ) check check 4. B, Auth B (DH B, chosen crypto algs, N A ) Auth A Bob authenticates Alice on usage of a key and fresh information from both of them Auth B The same is true for Alice authenticating Bob. Exercise: check this AUTH playload is generated with pre-shared information! Chapter 10: Cryptographic Protocols Final Protocol, Goals, and Notation 10-54

Final Protocol Explanations Explanation Messages 1 and 2 form a request-response pair where only information is exchanged. Messages 3 and 4 form the authentication request-response pair with identity information and authentication. Alice or Bob need to stop the communication when authentication fails or a wrong entity authenticates. Message 3: Alice authenticates on her first message and on the nonce N B provided by Bob. Message 4: Bob authenticates on his first message and on the nonce N A provided by Alice. Final protocol is a simplified version of the IKEv2 protocol (IKE_SA_Init plus IKE_Auth Exchange) of IPSec (see IPSec chapter) Chapter 10: Cryptographic Protocols Final Protocol, Goals, and Notation 10-55

Repetition Exercise (later once we discussed IPSec): Compare with IKEv2 Write down "Final Protocol" in the terminology / fields used in IPSec. Alice Bob Chapter 10: Cryptographic Protocols Final Protocol, Goals, and Notation 10-56

Exercise: Final Protocol with Timestamps instead of Nonces? Alice Bob Chapter 10: Cryptographic Protocols Final Protocol, Goals, and Notation 10-57

Notation Notation Meaning A CA A r A N A t A Name of principle A (Alice), analogous for B, E, TTP, CA Certification Authority of A Random value chosen by A Nonce (number used once) chosen by A Timestamp generated by A (m 1,.., m n ) Concatenation of m 1,..., m n A B : m A sends message m to B Chapter 10: Cryptographic Protocols Final Protocol, Goals, and Notation 10-58

Notation Notation K A-pub K A-priv K A,B H(m) Enc K (m) Dec K (c) Sig K (m) MAC K (m) {m} K [m] K Cert CA (A) Meaning Public Key of A Private Key of A Shared symmetric key of A and B, only known to A and B Cryptographic hash value over m Encrypt m with key K, K can be symmetric or asymmetric Decrypt c with key K, K can be symmetric or asymmetric Signature of message m with key K, K is a private asymmetric key Message Authentication Code of m with key K, K is symmetric key Message m encrypted and integrity-protected with symmetric key K m integrity-protected with key K Certificate of CA for public key K A-pub of A, signed by the private key of CA Chapter 10: Cryptographic Protocols Final Protocol, Goals, and Notation 10-59

Chapter 10: Cryptographic Protocols Introduction Protocols Authentication and Key Establishment Protocols Attack Concepts against Cryptographic Protocols Desirable Properties of Cryptographic Protocols Final Protocol, Goals, and Notation Needham Schroeder Protocol Needham Schroeder Symmetric Key Protocol Needham Schroeder Public Key Protocol Conclusions - What have we learned Chapter 10: Cryptographic Protocols 10-60

Needham Schroeder Protocol Roger Needham Michael Schroeder Invented in 1978 by Roger Needham and Michael Schroeder [Nee78] The Needham-Schroeder Protocol is a protocol for mutual authentication and key establishment It aims to establish a session key between two users (or a user and an application server, e.g. email server) over an insecure network Chapter 10: Cryptographic Protocols Needham Schroeder Protocol 10-61

Needham Schroeder Protocol The protocol has 2 versions: The Needham Schroeder Symmetric Key Protocol: based on symmetric encryption, forms the basis for the Kerberos protocol The Needham Schroeder Public Key Protocol: uses public key cryptography. A flaw in this protocol was published by Gavin Lowe [Lowe95] 17 years later! Lowe proposes also a way to fix the flaw in [Lowe95] Gavin Lowe Chapter 10: Cryptographic Protocols Needham Schroeder Protocol 10-62

Needham Schroeder Symmetric Key Protocol Authentication Server (AS) 0. know each other, have longterm shared key k AS,A 1. Give me key and ticket for Bob, Alice. 2. Key and ticket for Bob, AS. 0. know each other, have longterm shared key k AS,B Alice (A) 3. Ticket. 4. Showing knowledge of key, Bob. Bob (B) 5. Showing knowledge of key, Alice. Chapter 10: Cryptographic Protocols Needham Schroeder Protocol 10-63

Needham Schroeder Symmetric Key Protocol Authentication Server (AS) 0. know each other, have longterm shared key k AS,A 1. Give me key and ticket for Bob, Alice. 2. Key and ticket for Bob, AS. 0. know each other, have longterm shared key k AS,B Alice (A) 3. Ticket. 4. Showing knowledge of key, Bob. Bob (B) 5. Showing knowledge of key, Alice. Only Alice and Bob (and the AS) know the shared key, showing knowledge one of them Chapter 10: Cryptographic Protocols Needham Schroeder Protocol 10-63

Needham Schroeder Symmetric Key Protocol Alice Authentication Server Bob 1. A, B, r 1 2. {r 1, K A,B, {K A,B, A} KAS,B } KAS,A 3. {K A,B, A} KAS,B 4. {r 2 } KA,B 5. {r 2 1} KA,B Chapter 10: Cryptographic Protocols Needham Schroeder Protocol 10-64

3. {K A,B, A} KAS,B 5. {r 2 1} KA,B Needham Schroeder Symmetric Key Protocol Alice Authentication Server Bob 1. A, B, r 1 2. {r 1, K A,B, {K A,B, A} KAS,B } KAS,A "Ticket" 4. {r 2 } KA,B Chapter 10: Cryptographic Protocols Needham Schroeder Protocol 10-64

Needham Schroeder Symmetric Key Protocol 1. A AS : A, B, r 1 Alice informs AS that she (A) wants to contact Bob (B). Random number r 1 is used as nonce to identify the session. Notice, the AS cannot tell whether it is Alice or someone else. Still, this is ok as answer will be protected. 2. AS A : {r 1, K A,B, {K A,B, A} KAS,B } KAS,A The AS encrypts the message with key K AS,A so that only Alice can read the message. Alice notices nonce r 1 and assumes answer to be fresh. Alice gets to know session key K A,B which is also part of the ticket. Alice also gets to know the ticket {K A,B, A} KAS,B. Alice cannot read or modify ticket as it is protected with key K AS,B unknown to her. Chapter 10: Cryptographic Protocols Needham Schroeder Protocol 10-65

Needham Schroeder Symmetric Key Protocol 3. A B : {K A,B, A} KAS,B Bob can decrypt the ticket and learns that Alice (A) wants to contact him. Furthermore, he learns the session key K A,B 4. B A : {r 2 } KA,B Bob sends nonce r 2 to Alice encrypted with the session key K A,B While Alice does not know about r 2, she knows K A,B as new session key. Integrity shows knowledge of session key by B, which means that B is Bob as only Bob (and the AS) also knows the session key. 5. A B : {r 2 1} KA,B Alice sends nonce r 2 1 to Bob encrypted with the new session key K A,B. Since only Alice also knows r 2, this A must be Alice. Notice, the change from r 2 to r 2 1 is to make messages 4 and 5 different to avoid e.g. replay attacks. Modern encryption modes with Initialization Vectors (IV) also ensure this if both messages 4 and 5 would be {r 2 } KA,B. However, an attacker could replay with the same IV and then the modified protocol would fail unless it takes further measures to forbid and prevent repeated IVs. Chapter 10: Cryptographic Protocols Needham Schroeder Protocol 10-66

Needham Schroeder Symmetric Key Protocol Ticket and Ticket Reuse Needham and Schroeder do not speak of tickets in their protocol, but from a modern point of view (relating to Kerberos) {K A,B, A} KAS,B is called a ticket. If Alice still trusts the ticket she has, Needham and Schroeder propose a shortened protocol: 1. (3.) A B : {K A,B, A} KAS,B, {r 2} KA,B 2. (4.) B A : {r 3, r 2 1} KA,B 3. (5.) A B : {r 3 1} KA,B As the session key is not fresh anymore, Alice challenges Bob with r 2 and Bob Alice with r 3. Chapter 10: Cryptographic Protocols Needham Schroeder Protocol 10-67

Needham Schroeder Symmetric Key Protocol Ticket Reuse Issues and Forward Secrecy If an attacker learns about session key K A,B and observed the related ticket in a previous protocol run, then the attacker can impersonate Alice. 1. (3.) Attacker B : {K A,B, A} KAS,B, {r 2} KA,B 2. (4.) B A : {r 3, r 2 1} KA,B needs to be intercepted and decrypted by attacker. 3. (5.) Attacker B : {r 3 1} KA,B Thus, breaking session key K A,B would allow to impersonate Alice in the future. Also, the Needham Schroeder Protocols do not provide any forward secrecy. Chapter 10: Cryptographic Protocols Needham Schroeder Protocol 10-68

Needham Schroeder Public Key Protocol Authentication Server (AS) 0. Alice knows AS and K AS-pub, AS knows Alice and K A-pub 1. Give me public key of Bob, Alice. 2. Public Key of Bob, AS. 4. Give me public key of Alice, Bob. 5. Public Key of Alice, AS. 0. Bob knows AS and K AS-pub, AS knows Bob and K B-pub Alice (A) 3. Want to talk to Bob. Alice. 6. Are you Alice? Showing knowledge of key, Bob. Bob (B) 7. Showing knowledge of key, Alice. Chapter 10: Cryptographic Protocols Needham Schroeder Protocol 10-69

Needham Schroeder Public Key Protocol Authentication Server (AS) 0. Alice knows AS and K AS-pub, AS knows Alice and K A-pub 1. Give me public key of Bob, Alice. 2. Public Key of Bob, AS. 4. Give me public key of Alice, Bob. 5. Public Key of Alice, AS. 0. Bob knows AS and K AS-pub, AS knows Bob and K B-pub Alice (A) 3. Want to talk to Bob. Alice. 6. Are you Alice? Showing knowledge of key, Bob. Bob (B) 7. Showing knowledge of key, Alice. AS asserts relationship public key person (Alice or Bob), showing knowledge of the related private key related person Chapter 10: Cryptographic Protocols Needham Schroeder Protocol 10-69

Needham Schroeder Public Key Protocol Alice Authentication Server Bob 1. A, B 2. {K B-pub, B} KAS-priv Alice knows K B-pub 3. {r A, A} KB-pub 4. B, A 5. {K A-pub, A} KAS-priv 6. {r A, r B } KA-pub Bob knows K A-pub k A,B = H(r A, r B ) Alice knows k A,B = H(r A, r B ), B = Bob 7. {r B } KB-pub Bob knows A = Alice As a one-time exception, we will use { } with asymmetric keys (for historic reasons). Never mix up encryption/signing in practice!!! Chapter 10: Cryptographic Protocols Needham Schroeder Protocol 10-70

Needham Schroeder Public Key Protocol 1. A AS : A, B 2. AS A : {K B-pub, B} KAS-priv In this exchange, Alice asks for the public key of Bob. Her identity is irrelevant. Anyone can ask for Bob s public key. AS encrypts K B-pub, B with its private key. Anyone can decrypt, but only the AS can generate this "signature". 3. A B : {r A, A} KB-pub Alice sends Bob a challenge r A and the identity A that she claims to be (not yet proven!). Only Bob can decrypt the message with his private key, so only he can know r A later-on. 4. B AS : B, A 5. AS B : {K A-pub, A} KAS-priv 4. and 5. are the same as 1. and 2. Chapter 10: Cryptographic Protocols Needham Schroeder Protocol 10-71

Needham Schroeder Public Key Protocol 6. B A : {r A, r B } KA-pub Bob answers Alice s challenge r A. So, Alice knows he is Bob. Bob challenges Alice with r A. As her public key is used, only she can decrypt the message and know r B. The shared session key is K A,B = H(r A, r B ), with H being a cryptographic hash function. As r A and r B are only sent encrypted with the public key of either Alice or Bob, no other entity knows r A, r B, and thus K A,B. 7. A B : {r B } KB-pub Alice answers Bob s challenge r B. So, Bob knows she is Alice. Chapter 10: Cryptographic Protocols Needham Schroeder Protocol 10-72

Exercise: Proper usage of Encryption and Signing On the previous slides, we used { } with asymmetric keys. It should combine Enc k ( ) and Sig k ( ). Why is this a bad idea in practice? How should the protocol look with only using Enc k ( ) and Sig k ( )? Chapter 10: Cryptographic Protocols Needham Schroeder Protocol 10-73

Needham Schroeder Public Key Protocol - Attack In 1995, Lowe found a man-in-the-middle attack on the Needham Schroeder Public Key Protocol. Assumption: Attacker M can trick Alice A into a communication with him. So, Alice starts a communication session with M. Idea: make Bob believe, he talks to Alice instead of the attacker. Chapter 10: Cryptographic Protocols Needham Schroeder Protocol 10-74

Needham Schroeder Public Key Protocol - Attack We skip the exchanges with the AS to obtain the public keys. Alice Attacker M Bob 3. {r A, A} KM-pub 3. {r A, A} KB-pub 6. {r A, r B } KA-pub 6. {r A, r B } KA-pub Alice thinks she talks to M 7. {r B } KM-pub 7. {r B } KB-pub Bob thinks he talks to Alice Alice, Bob, and M know r A, r B, and K A,B = H(r A, r B ) Chapter 10: Cryptographic Protocols Needham Schroeder Protocol 10-75

Needham Schroeder Public Key Protocol - Attack Resolution The attack fails when message 6 is modified to: 6. B A : {r A, r B, B} KA-pub Exercise: Verify that the attack will now fail. Chapter 10: Cryptographic Protocols Needham Schroeder Protocol 10-76

Chapter 10: Cryptographic Protocols Introduction Protocols Authentication and Key Establishment Protocols Attack Concepts against Cryptographic Protocols Desirable Properties of Cryptographic Protocols Final Protocol, Goals, and Notation Needham Schroeder Protocol Conclusions - What have we learned Chapter 10: Cryptographic Protocols 10-77

Conclusions - What have we learned What have we learned Authentication and Key Establishment Related to Formal Reasoning Secure Authentication needs some pre-established keys, also see PKI chapter Protocol weaknesses can be tricky Learned to attack protocols on conceptual level Learned some protocols, remember the ones with actual names 3 Learned how authenticity and key establishment can be achieved Analyze protocols on the layers they operate Analyze complete systems over all layers 3 "Try N" is not a name Chapter 10: Cryptographic Protocols Conclusions - What have we learned 10-78

Literature C. Boyd, A. Mathuria. Protocols for Authentication and Key Establishment, Springer, 2003. G. Schäfer. Netzsicherheit - Algorithmische Grundlagen und Protokolle, dpunkt Verlag, 2003. N. Ferguson, B. Schneier. Practical Cryptography, John Wiley & Sons, 2003. G. Lowe. An Attack on the Needham-Schroeder Public-Key Authentication Protocol, Information Processing Letters, volume 56, number 3, pages 131-133, 1995. R. Needham, M. Schroeder. Using Encryption for Authentication in Large Networks of Computers., Communications of the ACM, Vol. 21, No. 12, 1978. Chapter 10: Cryptographic Protocols Conclusions - What have we learned 10-79