CMSC 414 Computer and Network Security Lecture 5 Jonathan Katz.

Slides:



Advertisements
Similar presentations
Hash Function. What are hash functions? Just a method of compressing strings – E.g., H : {0,1}*  {0,1} 160 – Input is called “message”, output is “digest”
Advertisements

CMSC 414 Computer and Network Security Lecture 4 Jonathan Katz.
CMSC 414 Computer (and Network) Security Lecture 4 Jonathan Katz.
Digital Signatures Good properties of hand-written signatures: 1. Signature is authentic. 2. Signature is unforgeable. 3. Signature is not reusable (it.
Digital Signatures and Hash Functions. Digital Signatures.
1 Introduction CSE 5351: Introduction to cryptography Reading assignment: Chapter 1 of Katz & Lindell.
Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
CMSC 414 Computer (and Network) Security Lecture 5 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 4 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 3 Jonathan Katz.
CNS2010handout 10 :: digital signatures1 computer and network security matt barrie.
CMSC 414 Computer (and Network) Security Lecture 2 Jonathan Katz.
CMSC 456 Introduction to Cryptography
CMSC 414 Computer and Network Security Lecture 7 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 4 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 9 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 2 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 17 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 4 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 7 Jonathan Katz.
Fall 2010/Lecture 311 CS 426 (Fall 2010) Public Key Encryption and Digital Signatures.
CS526Topic 5: Hash Functions and Message Authentication 1 Computer Security CS 526 Topic 5 Cryptography: Cryptographic Hash Functions And Message Authentication.
Cryptography1 CPSC 3730 Cryptography Chapter 11, 12 Message Authentication and Hash Functions.
CMSC 414 Computer and Network Security Lecture 3 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 3 Jonathan Katz.
Lecture 15 Lecture’s outline Public algorithms (usually) that are each other’s inverse.
Lecture slides prepared for “Computer Security: Principles and Practice”, 2/e, by William Stallings and Lawrie Brown, Chapter 21 “Public-Key Cryptography.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Network Security (A Very Brief Introduction)
Digital Signatures Good properties of hand-written signatures: 1. Signature is authentic. 2. Signature is unforgeable. 3. Signature is not reusable (it.
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
Message Authentication  message authentication is concerned with: protecting the integrity of a message protecting the integrity of a message validating.
Information Security Principles Assistant Professor Dr. Sana’a Wafa Al-Sayegh 1 st Semester ITGD 2202 University of Palestine.
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
EE515/IS523 Think Like an Adversary Lecture 4 Crypto in a Nutshell Yongdae Kim.
Message Authentication Code July Message Authentication Problem  Message Authentication is concerned with:  protecting the integrity of a message.
Lecture 4.1: Hash Functions, and Message Authentication Codes CS 436/636/736 Spring 2015 Nitesh Saxena.
Chapter 21 Public-Key Cryptography and Message Authentication.
CMSC 414 Computer and Network Security Lecture 5 Jonathan Katz.
11.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 11 Message Integrity and Message Authentication.
CS426Fall 2010/Lecture 61 Computer Security CS 426 Lecture 6 Cryptography: Message Authentication Code.
A Quick Tour of Cryptographic Primitives Anupam Datta CMU Fall A: Foundations of Security and Privacy.
Cryptographic Hash Functions and Protocol Analysis
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Modern Cryptography.
Cryptography 1 Crypto Cryptography 2 Crypto  Cryptology  The art and science of making and breaking “secret codes”  Cryptography  making “secret.
Lecture 5.1: Message Authentication Codes, and Key Distribution
Lecture 4.1: Hash Functions, and Message Authentication Codes CS 436/636/736 Spring 2014 Nitesh Saxena.
CS426Fall 2010/Lecture 51 Computer Security CS 426 Lecture 5 Cryptography: Cryptographic Hash Function.
IT 221: Introduction to Information Security Principles Lecture 5: Message Authentications, Hash Functions and Hash/Mac Algorithms For Educational Purposes.
CS555Spring 2012/Topic 151 Cryptography CS 555 Topic 15: HMAC, Combining Encryption & Authentication.
CMSC 414 Computer and Network Security Lecture 2 Jonathan Katz.
Data Integrity / Data Authentication. Definition Authentication (Signature) algorithm - A Verification algorithm - V Authentication key – k Verification.
CS555Spring 2012/Topic 141 Cryptography CS 555 Topic 14: CBC-MAC & Hash Functions.
Cryptographic Hash Function. A hash function H accepts a variable-length block of data as input and produces a fixed-size hash value h = H(M). The principal.
Cryptography Lecture 13.
Cryptography Lecture 12.
CMSC 414 Computer and Network Security Lecture 3
Cryptography Lecture 10.
Cryptography Lecture 24.
Cryptography Lecture 12.
Lecture 4.1: Hash Functions, and Message Authentication Codes
Cryptography Lecture 14.
Cryptography Lecture 13.
Cryptography Lecture 9.
Cryptography Lecture 11.
Cryptography Lecture 13.
Cryptography Lecture 23.
Presentation transcript:

CMSC 414 Computer and Network Security Lecture 5 Jonathan Katz

Administrative announcements  Midterm I –March 6  GRACE accounts set up –Need to have a glue account –HW submission done using GRACE submit script  Finding a partner – TA with “partner-414” in subject line

Message integrity

Encryption does not provide integrity  “Since encryption garbles the message, decryption of a ciphertext generated by an adversary must be unpredictable” –WRONG  E.g., one-time pad, CBC-/CTR-mode encryption  Why is this a concern? –Lack of integrity can lead to lack of secrecy –Almost always, integrity is needed in addition to secrecy

Message authentication codes (MACs)  In the private-key setting, the correct tool for achieving message integrity is a MAC  Functionality: –MAC K (m) = t (“tag”) –Vrfy K (m, t) = 0/1 (“1” = “accept” / ”0”=“reject”) –Correctness…  Security?

Defining security  Attack model: –A random key K is chosen –Attacker is allowed to obtain t 1 = MAC K (m 1 ), …, t n = MAC K (m n ) for any messages m 1, …, m n of its choice  “Break” of security Attacker “breaks” the scheme if it outputs a forgery; i.e., (m, t) with: m ≠ m i for all i Vrfy K (m, t) = 1

Defining security  A MAC is secure if for all attackers running for some time T (e.g., T=100 years), the probability that the attacker “breaks” the scheme is at most  (e.g.,  = ) –Note that length of the tag lower bounds   Is the definition too strong? –When would an attacker be able to obtain tags on any messages of its choice?! –Why do we count it as a break if the adversary outputs a forgery on a meaningless message?!

Replay attacks  A MAC inherently cannot prevent replay attacks –These must be prevented at a higher level of the protocol! (Note that whether a replay is ok is application-dependent.) –Can be prevented using nonces, timestamps, etc.

Hash functions  A (cryptographic) hash function H maps arbitrary length inputs to a fixed-length output  Main goal is collision resistance: –Hard to find distinct x, x’ such that H(x) = H(x’) –Birthday attacks show that output length of H is critical  Other goals –Second pre-image resistance: given x, hard to find x’ ≠ x with H(x) = H(x’) Weaker than collision resistance –“Random-looking output”: I.e., “acts like a random oracle” Controversial

Hash functions in practice  MD5 –128-bit output –No longer collision resistant (as of 2004) Still second pre-image resistant (for now…) –Still widely deployed…  SHA-1 –160-bit output –No collisions known (yet), but theoretical attacks exist  SHA-2 –256-/512-bit outputs  Competition to design new hash standard has just begun…

Hash-and-MAC  Say we have a secure MAC for “short” messages –How to extend it for longer messages?  Hash and MAC –Hash message to short “digest” –MAC the digest  Not used in practice for MACs –But used extensively for signatures (see later) –Similar ideas used in practical MAC constructions HMAC M H(M) K t

MACs in practice  CBC-MAC –Can be constructed from any block cipher –Directly handles long messages (without hashing) –“Standard” variant is insecure if used on messages of different lengths Known fixes for variable-length messages – make sure to use!  HMAC –Constructed from a hash function –Directly handles long messages (hashing done as part of construction)

Encryption + integrity  In most settings, confidentiality and integrity are both needed –How to obtain both?  Three “natural” possibilities: –Encrypt-and-authenticate –Authenticate-then-encrypt –Encrypt-then-authenticate  Only the latter is problem-free…  Can also use dedicated mode of encryption

Toward public-key crypto…

Sharing keys?  Secure sharing of a key is necessary for private- key crypto –How do parties share a key in the first place?  One possibility is a secure physical channel –E.g., in-person meeting –Dedicated (un-tappable) phone line –USB stick via courier service  Another possibility: key exchange protocols –Parties can agree on a key over a public channel –This is amazing! (And marked a revolution in crypto…)

Diffie-Hellman key exchange  Modular arithmetic, Z N, Z N *  Diffie-Hellman protocol  Security? –Secure against passive eavesdropping only  We will cover stronger notions of security for key exchange in much more detail later in the semester

The Diffie-Hellman protocol prime p, element g  Z p * h A = g x mod p h B = g y mod p K AB = (h B ) x K BA = (h A ) y

Security?  Consider security against a passive eavesdropper  Under the computational Diffie-Hellman (CDH) assumption, hard for an eavesdropper to compute K AB = K BA –Not enough for security! –Can hash the key before using  Under the decisional Diffie-Hellman (DDH) assumption, the key K AB looks random to an eavesdropper

Technical notes  p and g must be chosen so that the CDH/DDH assumptions hold –Need to be chosen with care –Details in CMSC456  Can also use other groups –Elliptic curves are also popular  Modular exponentiation can be done quickly (in particular, in polynomial time) –But the naïve algorithm does not work!

Security against active attacks?  The basic Diffie-Hellman protocol we have shown is not secure against a ‘man-in-the-middle’ attack  In fact, impossible to achieve security against such an attacker unless some information is shared in advance –E.g., private-key setting –Or public-key setting (next)