Hash and MAC Algorithms

Slides:



Advertisements
Similar presentations
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.
Advertisements

ECE454/CS594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2011.
Cryptography and Network Security Chapter 12 Fourth Edition by William Stallings Lecture slides by Lawrie Brown.
SMUCSE 5349/49 Message Authentication MAC and Hash.
PIITMadhumita Chatterjee Security 1 Hashes and Message Digests.
1 Chapter 5 Hashes and Message Digests Instructor: 孫宏民 Room: EECS 6402, Tel: , Fax :
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.
Hashes and Message Digest Hash is also called message digest One-way function: d=h(m) but no h’(d)=m –Cannot find the message given a digest Cannot find.
Cryptography and Network Security Chapter 12
Cryptography and Network Security Hash Algorithms.
Cryptography and Network Security (CS435) Part Ten (Hash and MAC algorithms)
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.
Information Security and Management 11
SHA (secure hash algorithm) Jen-Chang Liu, 2005 Adapted from lecture slides by Lawrie Brown.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Cryptography and Network Security Chapter 12 Fourth Edition by William Stallings Lecture slides by Lawrie Brown.
1 Pertemuan 09 Hash and Message Digest Matakuliah: H0242 / Keamanan Jaringan Tahun: 2006 Versi: 1.
CSCE 790: Computer Network Security Chin-Tser Huang University of South Carolina.
Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings Lecture slides by Lawrie Brown/Mod. & S. Kondakci.
Lecture 23 Symmetric Encryption
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Cryptography1 CPSC 3730 Cryptography Chapter 11, 12 Message Authentication and Hash Functions.
1 Cryptography and Network Security (Various Hash Algorithms) Fourth Edition by William Stallings Lecture slides by Lawrie Brown (Changed by Somesh Jha)
1 Message Authentication and Hash Functions Authentication Requirements Authentication Functions Message Authentication Codes Hash Functions Security of.
Lecture slides prepared for “Computer Security: Principles and Practice”, 2/e, by William Stallings and Lawrie Brown, Chapter 21 “Public-Key Cryptography.
HASH Functions.
Hash and MAC Algorithms Dr. Monther Aldwairi New York Institute of Technology- Amman Campus 12/3/2009 INCS 741: Cryptography 12/3/20091Dr. Monther Aldwairi.
Message Authentication Code July Message Authentication Problem  Message Authentication is concerned with:  protecting the integrity of a message.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
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)
Chapter 21 Public-Key Cryptography and Message Authentication.
Data & Network Security
Hash and MAC Functions CS427 – Computer Security
Hash and Mac Algorithms. Contents Hash Functions Secure Hash Algorithm HMAC.
CSCE 815 Network Security Lecture 8 SHA Operation and Kerberos.
Cryptography & Network Security: 1 IX. Hash Algorithms Look at three important hash functions (MD5, SHA-1, RIPEND-160) then look an Internet- standard.
Chapter 4 Message Authentication MSc. NGUYEN CAO DAT Dr. TRAN VAN HOAI 1.
Chapter 18: One-Way Hash Functions Based on Schneier.
Hash Algorithms see similarities in the evolution of hash functions & block ciphers –increasing power of brute-force attacks –leading to evolution in algorithms.
Cryptographic Hash Functions and Protocol Analysis
Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Message Authentication and Hash Functions K. U. Khimani Asst. Prof. IT Dept. VVP Engineering College.
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
DATA & COMPUTER SECURITY (CSNB414) MODULE 3 MODERN SYMMETRIC ENCRYPTION.
1 Chapter 12: Hash and MAC Algorithms Fourth Edition by William Stallings Lecture slides by Lawrie Brown (modified by Prof. M. Singhal, U of Kentucky)
Computer Science CSC 474Dr. Peng Ning1 CSC 474 Information Systems Security Topic 2.3 Hash Functions.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
Hashes Lesson Introduction ●The birthday paradox and length of hash ●Secure hash function ●HMAC.
Information Security and Management 11. Cryptographic Hash Functions Chih-Hung Wang Fall
IT 221: Introduction to Information Security Principles Lecture 5: Message Authentications, Hash Functions and Hash/Mac Algorithms For Educational Purposes.
Hash Algorithms Ch 12 of Cryptography and Network Security - Third Edition by William Stallings Modified from lecture slides by Lawrie Brown CIM3681 :
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
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.
@Yuan Xue 285: Network Security CS 285 Network Security Hash Algorithm Yuan Xue Fall 2012.
Chapter 12 – Hash Algorithms
Secure Hash Algorithm A SEARIES OF SHA….
UNIT 2 Public-key Cryptography And Message Authentication
CSCE 715: Network Systems Security
Cryptography and Network Security (Various Hash Algorithms)
کدهاي احراز تماميت پيام و توابع درهم ساز
Hash and MAC Algorithms
HMAC and its Design Objectives
The Secure Hash Function (SHA)
Presentation transcript:

Hash and MAC Algorithms MD5 in detail Overview of SHA and RIPEMD-160 HMAC

Introduction There is a general structure used practically in all cryptanalytically srtong hash-function fig. 8.10 analogous to the Feistel cipher as a general structure of block-ciphers it is safe to base new improved algorithms on a known proven structure

MD5 Algorithm Developed by Ron Riverst in 1992 based on MD4 by Ron Riverst 1990 to increase the level of security Has been the most widely used and is still in wide use The algorithm takes as input a message of arbitrary length and produces a 128-bit message digest The input is processed in 512-bit blocks Some concerns about the safety of MD5 brute-force attack: with a 128-bit message digest the birthday attack needs an effort of 264, which can not be considered safe. cryptanalytic attacks exist that break MD5 partly. The succes of current attacs is too close to breaking MD5, that from a cryptanalytic point of view it must be considered vulnerable.

MD5 Algorithm Step 1: Append padding bits Step 2: Append length the message is padded so that its length in bits is 448 mod 512 Step 2: Append length A 64-bit representation of the length of the original message (before padding in step 1) is appended to the message, thus yielding a message that is an integer multiple of 512 bits in length. The message is represented as 512-bit blocks Y0, Y1, … ,YL-1 the length of the message being L blocks. The length of the message is an integer multiple of 16 32-bit words. Thus N=16*L. Step 3: Initialize MD buffer a 128-bit buffer is used to hold the intermediate and final value of the message digest. this MD buffer is represented as four 32-bit registers (A,B,C,D), wich are initialized with A=67452301, B=EFCDAB89, C=98BADCFE and D=10325476 in hexadecimal values.

MD5 Algorithm Step 4: Process message in 512-bit blocks: The core of the algorithm is a compression function consisting of four ”rounds” of processing. The module is labeled HMD5 in fig. 9.1. and its inner logic is shown in fig. 9.2. The four rounds have a similar structure, but each uses a different primitive logical function, referred as F, G, H and I. The input of each round is the 512-bit block being processed Yq and the four register values (A,B,C,D) of the MD buffer. Also each round uses one-fourth of a table T[1...64] containing a randomized set 32-bit patterns. The goal of this table is to eliminate any regularities in the input data. As a result each round updates the four register values (A,B,C,D) of the MD buffer. The register values is the output of the round. The output of the fourth round is added to the input of the first round CVq to produce CVq+1. The addition is done independently for each of the four 32-bit words in the buffer in modulo 232.

MD5 Algorithm Step 5: Output After all the L 512-bit blocks have been processed, the output from the Lth stage is the 128-bit message digest. to summarise: CV0 = IV CVq+1= SUM32(CVq, RFI[Yq, RFH[Yq, RFG[Yq, RFF[Yq, CVq]]]] ) MD = CVL. where IV = initial value of the ABCD buffer Yq = the qth 512-block of the message. L = the number of blocks CVq= chaining variable processed with the the qth block of the message RFX= round function using primitive logical function X MD = final message digest value SUM32= Addition module 232 performed separatedly on each pair of words of the two inputs.

MD5 Algorithm – compression function Each round consists of a sequence of 16 steps operating on the register buffer (A,B,C,D) Each step is has the form: a  b + (( a + g(b,c,d) + X[k] + T[i] ) <<< s ) where a,b,c,d = the four words of the buffer, in a specified order that varies from step to step g = one of the primitive functions F, G, H, I <<< s = circular left shift (rotation) of the 32-bit argument by s bits. X[k] = M[q  16  k] = the kth 32-bit word in the qth 512-bit block of the message T[i] = the ith 32-bit word in matrix T + = addition modulo 232. The step operation is illustrated in fig 9.3. the order in which the four words (a,b,c,d) are used produces a word-level circular right shift of one word for each step.

MD5 Algorithm – primitive functions Each primive function performs a set of bitwise logical operations, i.e. the nth bit of the output is a function of the three other nth bits in the input words. The primitive functions are as follows: One 512-bit block consists of 16 32-bit words. Each word of a block is used exactly once in a round, during one step. The order in which these words are used varies from round to round. Also four different circular left shift (CLS) amounts are used within each round. Round Primitive function g g(b,c,d) 1 F(b,c,d) (b  c)  (b  d) 2 G(b,c,d) (b  d)  (c  d) 3 H(b,c,d) b  c  d 4 I(b,c,d) c  (b  d)

SHA-1 Developed by NIST and published as a FIPS-standard in 1993 A revised version, SHA-1, was published as a FIPS-standard in 1995 The design closely models MD4 Produces a 160-bit message digest to resist brute-force attacks thus MD-buffer contains 5 words. The complexity of the algorithm is greater than in MD4 The algorithm has four rounds each consisting of 20 steps The basic structure is illustrated in fig. 9.5 and 9.6. Wt is a word derived from the 512-bit block in a complex manner that varies from step to step across rounds. Kt is a additive constant varying across rounds.

Comparision of SHA-1 and MD5 The comparision is according to the design goals of MD5 Security against brute force attacks 32-bits longer MD is the main advantage of SHA-1. The difficulty of producing two messages with the same MD is 264 in MD5 and 280 in SHA-1, thus SHA-1 is considerable stronger. Security against cryptanalysis MD5 is somewhat vulnerable whereas SHA-1 is generally believed to be resistant to cryptanalysis. However the design criteria of SHA-1 are not public, so the security is difficult to judge. Speed Both algorithms execute fast on a 32-bit architecture. SHA-1 has more steps and a longer buffer, so it will execute slowlier. Simplcity and compactness Both algorithms are simle to describe and implement and do not require large program-code or substitution tables

RIPEMD-160 Developed by the European project RIPE in 1996 Right after the release the developers found attacks on two round of RIPEMD, and also on MD4 and MD5. 1997 the algorithm was upgraded to RIPEMD-160 The desing follows MD5 The MD is 160-bits, th e input block is 512-bits There are two parallel lines of round, each consisting of five rounds there are two MD buffers, one for each round Each round has 16 steps The design is illustrated in Fig. 9.8 and 9.9

Comparision of RIPEMF-160, SHA-1 and MD5 The comparision is according to the design goals of MD5 Security against brute force attacks 32-bits longer MD is the main advantage of SHA-1 and RIPEMD-160. The difficulty of producing two messages with the same MD (birthday attack) is 264 in MD5 and 280 in SHA-1 and RIPE-MD160 making them considerable stronger. Security against cryptanalysis MD5 is somewhat vulnerable whereas SHA-1 is generally believed to be resistant to cryptanalysis. However the design criteria of SHA-1 are not public, so the security is difficult to judge. Resistance to cryptanalysis has been one of the main design objectives. The use of two parallel lines of round should make cryptanalysis more difficult compared to SHA-1. Speed All algorithms execute fast on a 32-bit architecture. SHA-1 and RIPEMD-160 have more steps and a longer buffer leading to slowdown in execution. Simplcity and compactness All algorithms are simle to describe and implement and do not require large program-code or substitution tables.

Comparision of RIPEMF-160, SHA-1 and MD5

HMAC HMAC is a MAC derived from a cryptographically safe hash-function hash fuctions (MD5, SHA-1) execute faster in software than symmetric block ciphers library code for cryptographic hash functions is widely available there are export restrictions from the USA for some block ciphers, bot none for hash-functions HMAC is the ”mandatory-to-implement” MAC for IP Security. HMAC is used widely, e.g. in SSL Basically HMAC is a way to incorporate a secret key into an existing hash function.

HMAC – Design objectives To use, without modification existing hash functions. To allow easy replaceability of the embedded hash function in case faster or more secure functions are found or required To preserve the original performance of the hash function in terms of security and speed To use and handle keys in a simple way To have a well understood cryptographic analysis of the strength of the authentication mechanism based on a reasonable assumptions on the embedded hash function.

HMAC – Algorithm Illustrated in Fig 9.10. Explanation: H = embedded hash function M = message input to HMAC Yi = ith block of M L = number of blocks in M. b = number of bits in a block n = length of hash code produced by H K = secret key K+ = K padded with zeroes so that the result is b bits in length ipad = 00110110 repeated b/8 times opad = 01011010 repeated b/8 times HMACK = H[(K+  opad) || H[(K+  ipad) || M ]]

HMAC – Security The exact relationship between the strength of the HMAC and the strength of the embedded hash function has been proved The security is at least as strong as the underlying hash function HMAC is more resistant to birthday attack the use of MD5 is also safe, if speed is important