Chapter 18: One-Way Hash Functions Based on Schneier.

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

Introduction to Practical Cryptography
SECURE HASHING ALGORITHM By: Ruth Betcher. Purpose: Authentication Not Encryption Authentication Requirements:  Masquerade – Insertion of message from.
By: Matthew Ng. AND, XOR, OR, Complement, Circular Left shift, and Addition Modulo Circular Left Shift is done with s positions (0 ≤ s ≤ 31) – Denoted.
ECE454/CS594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2011.
Outline Project 1 Hash functions and its application on security Modern cryptographic hash functions and message digest –MD5 –SHA.
MD Collision Sought Marian Ščerbák University of Pavol Jozef Šafárik Košice.
MD5 Generation Auto-Generated Slides To Visualize MD5 Hash Generation by Chris Fremgen.
MD5 Generation Auto-Generated Slides To Visualize MD5 Hash Generation by Chris Fremgen.
MD5 Generation Auto-Generated Slides To Visualize MD5 Hash Generation by Chris Fremgen.
MD5 Generation Auto-Generated Slides To Visualize MD5 Hash Generation by Chris Fremgen.
Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
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 and MAC Algorithms
Announcements: 1. HW7 due next Tuesday. 2. Inauguration today! Questions? This week: Discrete Logs, Diffie-Hellman, ElGamal Discrete Logs, Diffie-Hellman,
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.
Announcements:Questions? This week: Discrete Logs, Diffie-Hellman, ElGamal Discrete Logs, Diffie-Hellman, ElGamal Hash Functions and SHA-1 Hash Functions.
MD5 Message Digest Algorithm CS265 Spring 2003 Jerry Li Computer Science Department San Jose State University.
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 Hash 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
Company LOGO Midterm Presentation Hash Function using MD5 algorithm Students: Eyal Mendel & Aleks Dyskin Instructor: Evgeny Fiksman High Speed Digital.
Chapter 5 Internet Security Applications. 5.0 Internet Access §In a secure remote access system, it must ensure the privacy and integrity of data as it.
1 Pertemuan 09 Hash and Message Digest Matakuliah: H0242 / Keamanan Jaringan Tahun: 2006 Versi: 1.
MD4 1 MD4. MD4 2 MD4  Message Digest 4  Invented by Rivest, ca 1990  Weaknesses found by 1992 o Rivest proposed improved version (MD5), 1992  Dobbertin.
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.
HASH Functions.
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)
Data & Network Security
Hash and MAC Functions CS427 – Computer Security
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
1 Network Security Lecture 5 Hashes and Message Digests Waleed Ejaz
Hash and Mac Algorithms. Contents Hash Functions Secure Hash Algorithm HMAC.
Cryptographic Hash Functions
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.
Lecture 8 Overview. Secure Hash Algorithm (SHA) SHA SHA SHA – SHA-224, SHA-256, SHA-384, SHA-512 SHA-1 A message composed of b bits.
SUNY Oneonta Data Structures and Algorithms Visualization Group MD5 Generation Auto-Generated Slides To Visualize MD5 Hash Generation by Chris Fremgen.
Team TDB Members: Anthony Knopp Zach Langley
Hash Algorithms see similarities in the evolution of hash functions & block ciphers –increasing power of brute-force attacks –leading to evolution in algorithms.
Understanding Cryptography – A Textbook for Students and Practitioners by Christof Paar and Jan Pelzl Chapter 11 – Hash Functions.
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.
Computer Science CSC 474Dr. Peng Ning1 CSC 474 Information Systems Security Topic 2.3 Hash Functions.
Computer Science and Engineering Computer System Security CSE 5339/7339 Lecture 11 September 23, 2004.
Computer Science and Engineering Computer System Security CSE 5339/7339 Lecture 10 September 21, 2004.
Information Security and Management 11. Cryptographic Hash Functions Chih-Hung Wang Fall
Lecture 9 Overview. RSA Invented by Cocks (GCHQ), independently, by Rivest, Shamir and Adleman (MIT) Two keys e and d used for Encryption and Decryption.
1 Message Authentication using Message Digests and the MD5 Algorithm Message authentication is important where undetected manipulation of messages can.
@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….
“The quick brown fox jumps over the lazy dog”
ASymmetric Key Algorithms
MD5 A Hash Algorithm….
Network Security Unit-III
Secured Hash Algorithm(SHA)
Introduction to Security
The Advanced Encryption Standard: Rijndael
MD5 A Hash Algorithm….
کدهاي احراز تماميت پيام و توابع درهم ساز
The Secure Hash Function (SHA)
Presentation transcript:

Chapter 18: One-Way Hash Functions Based on Schneier

Background M, message of arbitrary size Hash function H(M) returns a value h of m bits: h = H(M) Characteristics of H(M) –Easy to compute h –Hard to compute M given h –Hard to find another message, M’ such that H(M) = H(M’) Birthday attack –Find any two messages M and M’ such that H(M) = H(M’) To survive a birthday attack, most one-way hash functions produce 128-bit or larger hashes

Overview of One-way Hash Functions Built-on idea of compression function Divide a message into blocks Hash of block M i is h i = f(M i, h i-1 ) Hash of the last block is the hash of the entire message

MD5 Message digest version 5, an extension of MD4 Produces 128-bit hash Conjectured that it is computationally infeasible to produce two messages having the same message digest Intended for digital signature applications

Terminology and Notation "word“ –A 32-bit quantity, a group of four bytes with the low- order (least significant) byte given first “+” –Denotes addition of words, mod 2 32 X << s –Circular shifting (rotating) bits of X by s positions

MD5 Algorithm Description Message of b bits as m 0, m 1,... m b-1 Step 1. Append Padding Bits –A single “1” bit appended and then “0” bits are appended so that the length in bits of the padded message becomes congruent to 448 mod 512 –Padding is always performed, even if the length is already congruent to 448 mod 512 –In all at least one bit and at most 512 bits are appended

MD5 Algorithm Description (cont’d) Step 2. Append Length –Append a 64-bit representation of b to the padded message of the previous step –Resulting message has length, exactly multiple of 512 bits (16 words) –Let M[0... N-1] denote the words, where N is a multiple of 16 Step 3. Initialize MD Buffer –Initialize a four-word buffer (A, B, C, D) with low-order bytes first in each word A: B: 89 ab cd ef C: fe dc ba 98 D:

MD5 Algorithm Description (cont’d) Step 4. Process Message in 16-Word Blocks –Define four auxiliary functions as: F(X,Y,Z) = (X and Y) or (not(X) and Z) G(X,Y,Z) = (X and Z) or (Y and (not (Z)) H(X,Y,Z) = X xor Y xor Z I(X, Y, Z) = Y xor (X or (Not (Z)) where X, Y, and Z are 32-bit words –Use a 64-bit element table T[ ] constructed from the sine function. Let T[i] = integer part of * abs(sin(i)) where i is in radians

MD5 Algorithm Description (cont’d) –Do the following /* Process each 16-word block. */ For i = 0 to N/16-1 do /* Copy block i into X. */ For j = 0 to 15 do Set X[ j] to M[i*16+j]. end /* of loop on j */ /* Save A as AA, B as BB, C as CC, and D as DD. */ AA = A BB = B CC = C DD = D

MD5 Algorithm Description (cont’d) /* Round 1. */ /* Let [abcd k s i] denote the operation a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */ /* Do the following 16 operations. */ [ABCD 0 7 1] [DABC ] [CDAB ] [BCDA ] [ABCD 4 7 5] [DABC ] [CDAB ] [BCDA ] [ABCD 8 7 9] [DABC ] [CDAB ] [BCDA ] [ABCD ] [DABC ] [CDAB ] [BCDA ] /* Round 2. */ /* Let [abcd k s i] denote the operation a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */ /* Do the following 16 operations. */ [ABCD ] [DABC ] [CDAB ] [BCDA ] [ABCD ] [DABC ] [CDAB ] [BCDA ] [ABCD ] [DABC ] [CDAB ] [BCDA ] [ABCD ] [DABC ] [CDAB ] [BCDA ]

MD5 Algorithm Description (cont’d) /* Round 3. */ /* Let [abcd k s t] denote the operation a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */ /* Do the following 16 operations. */ [ABCD ] [DABC ] [CDAB ] [BCDA ] [ABCD ] [DABC ] [CDAB ] [BCDA ] [ABCD ] [DABC ] [CDAB ] [BCDA ] [ABCD ] [DABC ] [CDAB ] [BCDA ] /* Round 4. */ /* Let [abcd k s t] denote the operation a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */ /* Do the following 16 operations. */ [ABCD ] [DABC ] [CDAB ] [BCDA ] [ABCD ] [DABC ] [CDAB ] [BCDA ] [ABCD ] [DABC ] [CDAB ] [BCDA ] [ABCD ] [DABC ] [CDAB ] [BCDA ]

MD5 Algorithm Description (cont’d) /* Then perform the following additions. (That is increment each of the four registers by the value it had before this block was started.) */ A = A + AA B = B + BB C = C + CC D = D + DD end /* of loop on i */ Step 5. Output –Output is (A, B, C, D) beginning with the lower-byte of A and end with the high-order byte of D

Security of MD5 Check these sites: 05/06/more_md5_collis.htmlhttp:// 05/06/more_md5_collis.html 05/06/more_md5_collis.htmlhttp:// 05/06/more_md5_collis.html md5/md5.htmlhttp://userpages.umbc.edu/~mabzug1/cs/ md5/md5.html

Secure Hash Algorithm (SHA-1) Message length < 2 64 bits Produces a 160-bit message digest NIST and NSA involved in designing the algorithm Computationally infeasible –to find a message which corresponds to a given message digest, or –to find two different messages which produce the same message digest

SHA-1 RFC Convention OPERATIONS ON WORDS Bitwise logical word operations X ^ Y = bitwise logical "and" of X and Y X \/ Y = bitwise logical "inclusive-or" of X and Y X XOR Y = bitwise logical "exclusive-or" of X and Y ~ X = bitwise logical "complement" of X. The operation X + Y is defined as follows: –words X and Y represent integers x and y, where 0 <= x < 2 32 and 0 <= y < 2 32 –For positive integers n and m, let n mod m be the remainder upon dividing n by m –Compute z = (x + y) mod Then 0 <= z < Convert z to a word, Z, and define Z = X + Y.

SHA-1 RFC Convention (cont’d) OPERATIONS ON WORDS Circular left shift operation S n (X), where X is a word and n is an integer with 0 <= n <= 32, is defined by S n (X) = (X > 32-n). In the above, X > n is obtained by discarding the right-most n bits of X and then padding the result with n zeroes on the left. Thus S n (X) is equivalent to a circular shift of X by n positions to the left.

SHA-1 Description Message Padding –make the total length of a padded message a multiple of 512 –Padding process is exactly same as in MD5 –The padded message will contain 16 * n words for some n > 0 –The padded message is regarded as a sequence of n blocks M1, M2,..., Mn, where each Mi contains 16 words and M1 contains the first characters (or bits) of the message

SHA-1 Description (cont’d) Functions Used –A sequence of logical functions f 0, f 1,..., f 79 is used –With B, C, D 32-bit inputs, f t (B,C,D) is defined as: f t (B,C,D) = (B AND C) OR ((NOT B) AND D) ( 0 <= t <= 19) f t (B,C,D) = B XOR C XOR D (20 <= t <= 39) f t (B,C,D) = (B AND C) OR (B AND D) OR (C AND D) (40 <= t <= 59) f t (B,C,D) = B XOR C XOR D (60 <= t <= 79).

SHA-1 Description (cont’d) Constants Used –A sequence of constant words K(0), K(1),..., K(79) –In hex these are given by K(t) = 5A ( 0 <= t <= 19) K(t) = 6ED9EBA1 (20 <= t <= 39) K(t) = 8F1BBCDC (40 <= t <= 59) K(t) = CA62C1D6 (60 <= t <= 79)

SHA-1 Description (cont’d) Computing –Computed using the final padded message –Uses two buffers, each consisting of five 32-bit words, and a sequence of eighty 32-bit words –The words of the first 5-word buffer are labeled A,B,C,D,E –The words of the second 5-word buffer are labeled H0, H1, H2, H3, H4. –The words of the 80-word sequence are labeled W0, W1,..., W79 –A single word buffer TEMP is also employed. –To generate the message digest, the 16-word blocks M1, M2,..., Mn are processed in order –The processing of each Mi involves 80 steps

SHA-1 Description (cont’d) Before processing any blocks, the {Hi} are initialized as follows: in hex, H0 = H1 = EFCDAB89 H2 = 98BADCFE H3 = H4 = C3D2E1F0

SHA-1 Description (cont’d) Now M1, M2,..., Mn are processed. To process Mi, we proceed as follows: –Divide Mi into 16 words W 0, W 1,..., W 15, where W 0 is the left- most word. –For t = 16 to 79 let W t = S 1 (W t-3 XOR W t-8 XOR W t- 14 XOR W t-16 ). –Let A = H 0, B = H 1, C = H 2, D = H 3, E = H 4. –For t = 0 to 79 do TEMP = S 5 (A) + f t (B,C,D) + E + W t + K t ; E = D; D = C; C = S 30 (B); B = A; A = TEMP; –Let H 0 = H 0 + A, H 1 = H 1 + B, H 2 = H 2 + C, H 3 = H 3 + D, H 4 = H 4 + E.

SHA-1 Description (cont’d) After processing Mn, the message digest is the 160-bit string represented by the 5 words –H0 H1 H2 H3 H4.

Security of SHA-1 Check these sites – 2/sha1_broken.htmlhttp:// 2/sha1_broken.html – 6/ever_better_cry.htmlhttp:// 6/ever_better_cry.html –New hash algorithm: SHA2 published by NIST