CSCI 172/283 Fall 2010 Hash Functions, HMACs, and Digital Signatures.

Slides:



Advertisements
Similar presentations
Hash Functions A hash function takes data of arbitrary size and returns a value in a fixed range. If you compute the hash of the same data at different.
Advertisements

MAC Raushan. DES simple fiestel network 3131 PlainText Blocks 2*4=8bits 31 f f =0011 xor 0011=0000 = 0 f(r,k)=(2*r+k^2)%8 f(1,5)=(2*1+5^2)%8=3 xor 3 3.
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”
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.
Computer Science 654 Lecture 1 : Hash Functions Professor Wayne Patterson Howard University Spring 2010 (Stamp Chapter 5)
Authentication and Digital Signatures CSCI 5857: Encoding and Encryption.
Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
CNS2010handout 10 :: digital signatures1 computer and network security matt barrie.
CSE331: Introduction to Networks and Security Lecture 21 Fall 2002.
Secure Hashing and DSS Sultan Almuhammadi ICS 454 Principles of Cryptography.
ITIS 3200: Introduction to Information Security and Privacy Dr. Weichao Wang.
Csci5233 Computer Security & Integrity 1 Cryptography: Basics (2)
Hash Functions Nathanael Paul Oct. 9, Hash Functions: Introduction Cryptographic hash functions –Input – any length –Output – fixed length –H(x)
Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings Lecture slides by Lawrie Brown/Mod. & S. Kondakci.
CS526Topic 5: Hash Functions and Message Authentication 1 Computer Security CS 526 Topic 5 Cryptography: Cryptographic Hash Functions And Message Authentication.
Hash Functions 1 Hash Functions Hash Functions 2 Cryptographic Hash Function  Crypto hash function h(x) must provide o Compression  output length is.
Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
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.
Acknowledgements: William Stallings.William Stallings All rights Reserved Session 4 Public Key Cryptography (Part 2) Network Security Essentials Application.
Digital Signatures Good properties of hand-written signatures: 1. Signature is authentic. 2. Signature is unforgeable. 3. Signature is not reusable (it.
8-1Network Security Chapter 8 roadmap 8.1 What is network security? 8.2 Principles of cryptography 8.3 Message integrity, authentication.
IS 302: Information Security and Trust Week 5: Integrity 2012.
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.
Introduction1-1 Data Communications and Computer Networks Chapter 6 CS 3830 Lecture 31 Omar Meqdadi Department of Computer Science and Software Engineering.
Module 3 – Cryptography Cryptography basics Ciphers Symmetric Key Algorithms Public Key Algorithms Message Digests Digital Signatures.
23-1 Last time □ P2P □ Security ♦ Intro ♦ Principles of cryptography.
1 Hash Functions. 2 A hash function h takes as input a message of arbitrary length and produces as output a message digest of fixed length
Confidentiality Confidentiality is maintained so long as private keys are secure. Authenticity is possible via public-key encryption by encrypting messages.
11.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 11 Message Integrity and Message Authentication.
8-1 Chapter 8 Security Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 part 2: Message integrity.
Cryptographic Hash Functions and Protocol Analysis
Lecture 2: Introduction to Cryptography
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.
Authentication. Goal: Bob wants Alice to “prove” her identity to him Protocol ap1.0: Alice says “I am Alice” Failure scenario?? “I am Alice”
14-1 Last time Internet Application Security and Privacy Basics of cryptography Symmetric-key encryption.
Cryptographic Hash Functions Prepared by Dr. Lamiaa Elshenawy
Hash Functions Ramki Thurimella. 2 What is a hash function? Also known as message digest or fingerprint Compression: A function that maps arbitrarily.
CS426Fall 2010/Lecture 51 Computer Security CS 426 Lecture 5 Cryptography: Cryptographic Hash Function.
Hashes Lesson Introduction ●The birthday paradox and length of hash ●Secure hash function ●HMAC.
11.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 11 Message Integrity and Message Authentication.
IT 221: Introduction to Information Security Principles Lecture 5: Message Authentications, Hash Functions and Hash/Mac Algorithms For Educational Purposes.
Lecture 22 Network Security (cont) CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger slides are modified from Jim Kurose,
Message Authentication Codes CSCI 5857: Encoding and Encryption.
CS480 Cryptography and Information Security Huiping Guo Department of Computer Science California State University, Los Angeles 13.Message Authentication.
Cryptography Hyunsung Kim, PhD University of Malawi, Chancellor College Kyungil University February, 2016.
Data Integrity / Data Authentication. Definition Authentication (Signature) algorithm - A Verification algorithm - V Authentication key – k Verification.
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.
@Yuan Xue 285: Network Security CS 285 Network Security Hash Algorithm Yuan Xue Fall 2012.
Chapter 12 – Hash Algorithms
Message Integrity and Message Authentication
Cryptographic Hash Functions
Cryptographic Hash Function
CSCE 715: Network Systems Security
Cryptographic Hash Functions
ICS 454 Principles of Cryptography
Public Key Cryptography Diffie-Hellman, Discrete Log, RSA
Cryptography: Basics (2)
ICS 454 Principles of Cryptography
Chapter -7 CRYPTOGRAPHIC HASH FUNCTIONS
Chapter 3 - Public-Key Cryptography & Authentication
Hashing Hash are the auxiliary values that are used in cryptography.
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
Chapter 8 roadmap 8.1 What is network security?
Presentation transcript:

CSCI 172/283 Fall 2010 Hash Functions, HMACs, and Digital Signatures

What ciphers do Encryption ciphers Provide confidentiality Eve can’t see what Alice and Bob are saying Can Eve do anything? Alice Bob Eve ? C= Encrypt(M)

What ciphers don’t do Suppose Eve can get between Alice and Bob What if Eve can manipulate the data? Alice Bob Eve M M’ I’ll send Bob M Alice sent me M’ Now for a few changes Eve replaces M with M’ How can Bob tell if Alice’s message was modified?

Hash functions Map a variable length message to a fixed length message y = h(x) If h is a 64-bit hash function, then y always fits in 64 bits 0 ≤ y < 2 64 Actual hash value may be represented with fewer bits, since 0, 1, etc. are in the output range Should include leading zeros Pigeonhole principle If n+1 pigeons nest in n holes, at least one hole has more than one pigeon Maybe each hole has one pigeon, except for one that has two Maybe all the pigeons are in the same hole

Was the message modified? Alice sends Bob {C = Encrypt(M), h(M)} When Bob gets {C, h(M)}, he checks M’=Decrypt(C) Bob computes h(M’) h(M) = h(M’)? If Eve modifies the message, it probably won’t match If it does match, assume that it is the message Alice sent

What could go wrong? Suppose h(x) maps to 1 or 0 with equal probability? Eve has a 50/50 chance of fooling Bob Suppose h(x) does not map to the entire range with equal probability Forget about the encryption for a moment What could Eve do? Suppose: Eve can calculate f(h(M)) = M Eve knows some M’, h(M’) = h(M) Eve repeatedly just tries random modifications Nice try! We need some properties that provide security!

Cryptographic hash functions When security people talk about hash functions, they mean cryptographic (or secure) hash functions These should provide Collision resistance Difficult to find any M, M’≠ M s.t. h(M) = h(M’) Preimage resistance Given h(M), difficult to find M’ s.t. h(M’)=h(M) Second preimage resistance Given M, difficult to find M’ s.t. h(M’)=h(M), M’≠M If a hash function h does not meet these requirements… FAIL!

But what does it all mean? If h is secure Easy to compute in one direction Very difficult to compute in the other direction Computationally infeasible i.e. your grandchildren’s grandchildren’s grandchildren will be long gone before that computation finishes Very difficult to find two messages that hash to the same value Can anyone name any?

Secure Hash Algorithm (SHA) NIST standards Mandatory in US Government Adopted globally SHA (SHA-0) is no good anymore SHA-1 has attacks and is not recommended SHA-2 looks good for now What happens when there’s an attack? It takes years to create and analyze functions

SHA-3 About halfway through the process of choosing the next SHA family of hash functions International competition 64 submissions Round 1: 54 Round 2: 14 Round 3: ~5 And the winner is… ? Winner gets massive bragging rights A lot of new design techniques A lot of new attack techniques

Who can compute a hash? A hash is a keyless algorithm Anyone can compute h(x) if they know x Eve could replace M with M’ and h(M) with h(M’) The hash matches what Bob computes, so he assumes that Alice sent him M’ How could we stop Eve from doing this?

HMAC Hash-based Message Authentication Code Keyed hash y = HMAC(M, k) Provides some level of authentication If only and Alice and Bob know the key and the HMAC is correct, it must have come from one of them Can make an HMAC algorithm from an unkeyed hash algorithm Why not just make a keyed hash algorithm? Import/export restrictions Keyless algorithms are not restricted

How to key an unkeyed hash We have hash function h, which processes a message in b-byte blocks Let k be a key, |k| ≤ b Pad k with zeros to form k’, |k’| = b Let ipad be , repeated b times Let opad be , repeated b times HMAC-h is formed by HMAC-h(k,m) = h(k’  opad || h(k’  ipad || m))

Who sent it? For HMACs, the key is shared Fine for some applications What if instead of knowing if someone who knows the key sent it, we want to know that Alice sent it?

Digital signatures Use public key cryptography Recall that only Alice knows Alice’s private key Alice digitally signs her message, M Alice computes h(M) Alice encrypts h(M) using her private key (signing) Alice sends Bob {M, Enc(h(M), A priv )} Bob verifies the message was sent by Alice Computes y’ = h(M) Decrypts Enc(h(M), A priv ) with Alice’s public key y = Dec(Enc(h(M), A priv ), A pub ) Does y’ = y? If yes, Alice must have sent it

Digital Signatures Digital signatures provide checks for integrity and origin Because only Alice knows her private key, it must have been her that sent it Non-repudiation Suppose Alice wants to encrypt M so that Eve can’t see it Should she: Encrypt, then sign Sign, then encrypt Does it matter? Why?

Conclusion by xkcd