Lecture 5: Cryptographic Hashes

Slides:



Advertisements
Similar presentations
Hashes and Message Digests
Advertisements

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.
ECE454/CS594 Computer and Network Security
Lecture 7 Overview. Advanced Encryption Standard 10, 12, 14 rounds for 128, 192, 256 bit keys – Regular Rounds (9, 11, 13) – Final Round is different.
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”
CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (3) Information Security.
ECE454/CS594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2011.
1 Lecture 3: Secret Key Cryptography Outline concepts DES IDEA AES.
CS 6262 Spring 02 - Lecture #7 (Tuesday, 1/29/2002) Introduction to Cryptography.
Digital Signatures and Hash Functions. Digital Signatures.
Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
PIITMadhumita Chatterjee Security 1 Hashes and Message Digests.
1 Chapter 5 Hashes and Message Digests Instructor: 孫宏民 Room: EECS 6402, Tel: , Fax :
First Edition by William Stallings and Lawrie Brown Lecture slides by Lawrie Brown and edited by Archana Chidanandan Cryptographic Tools.
Hash functions a hash function produces a fingerprint of some file/message/data h = H(M)  condenses a variable-length message M  to a fixed-sized fingerprint.
Dr Alejandra Flores-Mosri Message Authentication Internet Management & Security 06 Learning outcomes At the end of this session, you should be able to:
Chapter 4  Hash Functions 1 Overview  Cryptographic hash functions are functions that: o Map an arbitrary-length (but finite) input to a fixed-size output.
Secure Hashing and DSS Sultan Almuhammadi ICS 454 Principles of Cryptography.
Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m.
CS470, A.SelcukHash Functions1 Cryptographic Hash Functions CS 470 Introduction to Applied Cryptography Instructor: Ali Aydin Selcuk.
Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings Lecture slides by Lawrie Brown/Mod. & S. Kondakci.
Cryptography1 CPSC 3730 Cryptography Chapter 11, 12 Message Authentication and Hash Functions.
Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Chapter 8.  Cryptography is the science of keeping information secure in terms of confidentiality and integrity.  Cryptography is also referred to as.
Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
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.
1 Chapter 11: Message Authentication and Hash Functions Fourth Edition by William Stallings Lecture slides by Lawrie Brown (modified by Prof. M. Singhal,
Hash Functions A hash function H accepts a variable-length block of data M as input and produces a fixed-size hash value h = H(M) Principal object is.
Dan Johnson. What is a hashing function? Fingerprint for a given piece of data Typically generated by a mathematical algorithm Produces a fixed length.
Cryptography, Authentication and Digital Signatures
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.
1 Hashes and Message Digests. 2 Hash Also known as –Message digest –One-way function Function: input message -> output One-way: d=h(m), but not h’(d)
Module 3 – Cryptography Cryptography basics Ciphers Symmetric Key Algorithms Public Key Algorithms Message Digests Digital Signatures.
Cryptography Wei Wu. Internet Threat Model Client Network Not trusted!!
Hashing Algorithms: Basic Concepts and SHA-2 CSCI 5857: Encoding and Encryption.
11.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 11 Message Integrity and Message Authentication.
Confidentiality Confidentiality is maintained so long as private keys are secure. Authenticity is possible via public-key encryption by encrypting messages.
1 Network Security Lecture 5 Hashes and Message Digests Waleed Ejaz
Hash and Mac Algorithms. Contents Hash Functions Secure Hash Algorithm HMAC.
6fb52297e004844aa81be d50cc3545bc Hashing!. Hashing  Group Activity 1:  Take the message you were given, and create your own version of hashing.  You.
Cryptographic Hash Functions and Protocol Analysis
Lecture 2: Introduction to Cryptography
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Modern Cryptography.
Chapter 11 Message Authentication and Hash Functions.
Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Authentication. Goal: Bob wants Alice to “prove” her identity to him Protocol ap1.0: Alice says “I am Alice” Failure scenario?? “I am Alice”
Lecture 23 Symmetric Encryption
Cryptographic Hash Functions Prepared by Dr. Lamiaa Elshenawy
Cryptography and Network Security (CS435) Part Nine (Message Authentication)
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.
IT 221: Introduction to Information Security Principles Lecture 5: Message Authentications, Hash Functions and Hash/Mac Algorithms For Educational Purposes.
Message Authentication Codes CSCI 5857: Encoding and Encryption.
1 Message Authentication using Message Digests and the MD5 Algorithm Message authentication is important where undetected manipulation of messages can.
CS480 Cryptography and Information Security Huiping Guo Department of Computer Science California State University, Los Angeles 13.Message Authentication.
Data Integrity / Data Authentication. Definition Authentication (Signature) algorithm - A Verification algorithm - V Authentication key – k Verification.
@Yuan Xue 285: Network Security CS 285 Network Security Hash Algorithm Yuan Xue Fall 2012.
Cryptographic Hash Functions
Cryptographic Hash Functions
ICS 454 Principles of Cryptography
ICS 454 Principles of Cryptography
Presentation transcript:

Lecture 5: Cryptographic Hashes Outline definition properties uses authentication encryption (stream cipher) integrity protections passwords hash example: MD2 other hash algorithms

Definition and Properties cryptographic hash (message digest) – a function that maps an arbitrary length input into a fixed output (called hash or digest) hash properties one-way – computationally infeasible to find the input for a particular hash value pseudorandom – intruder should not be able to deduce information about the input out of the hash collision resistant – cannot find two inputs that generate the same hash

Pseudorandomness in Detail Each hash value seen in practice should have about 1/2 the bits on Changing one bit out input should change about 1/2 the bits (unpredictable which) Two outputs should be uncorrelated, regardless of how closely related the inputs any subset of the bits should be a good hash

Collision Resistance in Detail Birthday Problem (“paradox”): When √N elements or more are chosen randomly from a domain of N, the probability of collision is above 50% how many people do you need to get so that at least one pair shares a birthday? why is collision resistance necessary? if intruder is able to pick text to match his task is simplified due to birthday paradox with probability more than 50%? more than 23, the answer is computed by inverting the problem – what’s the probability of people not sharing a birthday – total possibilities 356*356 first person picks b-day 354, second person picks 354, etc. so for n people it will be 356!/(356^N * (356-N)!) for N>23 the inverse comes up to greater than 50%

Hash Uses Sign hash (digest) instead of message Store digests of files, to look for changes (e.g., viruses). (Tripwire does this) Why wouldn’t CRC work? With secret, can do anything a secret key algorithm can do (authenticate, encrypt, integrity-protect) irreversible password hash database why must be irreversible?

Authentication with Hash how was authentication with secret key cryptography done? both know secret K Alice Bob I’m Alice R hash(R||K)

Stream Cipher with Hash Create pad. First send IV in clear b1=hash(K || IV) b2=hash(K || b1) bi=hash(K || bi-1) Note, with IV, Alice can precompute pad, but Bob can’t can mix in plaintext for pad generation – lose pre-computation capability, gain (some) integrity protection b1=hash(K || IV) c1= c1  b1 b2=hash(K || c1) c2= c2  b2 bi=hash(K || ci-1) ci= ci  bi

Integrity Protection with Hash MAC(again) – message authentication code – used to protect the integrity of a message can we just hash the message (without using key) to produce the MAC? approaches to hash-based MAC prefix: MACK(x) = H(K || x) not secure; extension attack: the hashes are usually computed by repeatedly hashing blocks and combining with previously computed value intruder can append to the message without knowing key suffix: MACK(x) = H(x || K) mostly ok; problematic if H is not collision resistant: two messages with the same hash will have the same MAC, why? envelope: MACK(x) = H(K1 || x || K2) HMAC: MACK(x) = H(K1 || H(x || K2)) provably secure; slower, popular in Internet standards. MAC – message authentication code, used to protect integrity of the message message hash will not work, because anyone can do it knowing the hash algorithm two messages with the same hash will have the same MAC, why? – because the key is just appended to the message – se the argument for the extension attack

Unix Password Hash used only one way for authentication DES-like, plain DES is not used to prevent hardware-based DES encoders from being used in password guessing password converted to a DES – key first 8 7-bit ASCII characters of the password used to create 56-bit key used to encrypt the number 0 problem: same passwords hash to the same value (dictionary attack possible) solution: use salt an arbitrary 12-bit value salt controls what bits are duplicated in R at every DES round salt is appended to hash in the clear

Unix Password Hash (cont.) how to deal with passwords longer than 8 characters could ignore all but 1st 8 chars done in old Unixes typical: store crypt(1st 8 bytes), crypt(2nd 8 bytes) what’s wrong with this? if the second half is short – can break it and try guessing the first half

MD2: outline takes an arbitrary message, operates on octets and produces a 128-bit (16-octet) digest steps input the message, break into octets, pad to a multiple of 16 octets compute a 16-octet checksum and append it to the message final pass: compute the digest these three steps can be done in one pass very limited memory requirements – can be done on resource constrained machine

MD2:Padding the padded message must be a multiple of 16 octets (128 bits) always padded (even if original message is already a multiple) the padding octets contain the number of padding octets

MD2: Checksum Calculation checksum is an intermediate 16-octet value appended to the message for before final digest calculation checksum is computed one padded message octet at a time the current octet of the message is: XORed with previous octet of the checksum the result substituted according to fixed octet substitution table (-substitution) the result is XORed with current value of checksum and stored

MD2: Final Pass padded message with checksum is processed one 16-octet block at a time each time a 48-octet value is computed as: message digest || current message block || XOR of the two 18 passes over this value -1th bit contains sum of 47th octet + pass number each pass – current octet XORed with a -substitution of the previous octet after 18 passes, the first 16 octets are used as MD for the next 16-octet block of the message

History of Hash Algorithms MD – proprietary, never published, not widely used MD2 – first public algorithm, oriented towards 8-bit processing, little memory, good for embedded devices MD3 – immediately superceded by MD4 (never published) MD4 – runs faster than MD2, uses 32-bit operations, became suspect MD5 – slightly slower, more conservative SHA-1 – NIST standard, similar to MD5 even more conservative eventually MD2 and MD4 are “broken” – two messages with the same hash are found MDs produce 128-bit digests, SHA-1 – 160-bit digest if the second half is short – can break it and try guessing the first half