SlideShare a Scribd company logo
1 of 32
Download to read offline
Understanding Cryptography – A Textbook for
Students and Practitioners
by Christof Paar and JanPelzl
www.crypto-textbook.com
Chapter 11 – Hash Functions
ver. October 29, 2009
These slides were prepared by Stefan Heyse and Christof Paar and Jan Pelzl
And modified by Sam Bowne
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl2
Some legal stuff (sorry): Terms of Use
• The slides can used free of charge. All copyrights for the slides remain with
Christof Paar and Jan Pelzl.
• The title of the accompanying book “Understanding Cryptography” by
Springer and the author’s names must remain on eachslide.
• If the slides are modified, appropriate credits to the book authorsand the
book title must remain within the slides.
• It is not permitted to reproduce parts or all of the slides in printed form
whatsoever without written consent by the authors.
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl3
Contents of this Chapter
11.1 Motivation: Signing Long Messages
11.2 Security Requirements of Hash Functions
11.3 Overview of Hash Algorithms
11.4 The Secure Hash Algorithm SHA-1
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl4
11.1 Motivation: Signing Long Messages
• Three Problems
• Computational overhead
• Message overhead
• Security limitations
• Attacker could re-order or re-use signed blocks
Solution:
Instead of signing the whole message, sign only a digest (=hash)
Also secure, but much faster
Needed:
Hash Functions
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl
Motivation
Problem:
Naive signing of long messages generates a signature of same length.
5
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl
Solution
6
• Hash, then sign
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl
Principal input–output behavior of hash functions
7
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl8
11.2 Security Requirements of Hash Functions
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl
The three security properties of hash functions
9
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl10
Hash Functions: Security Properties
• Preimage resistance: For a given output z, it is impossible to
findany input x such that h(x) = z, i.e., h(x) is one-way

(Also called one-wayness)
• Second preimage resistance: Given x1, and thus h(x1), it is
computationally infeasible to find any x2 such that h(x1) =h(x2)

(Also called weak collision resistance)
• Collision resistance: It is computationally infeasible to find
anypairs x1 ≠ x2 such that h(x1) =h(x2)

(Also called strong collision resistance)
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl11
Hash Functions: Security
• Collison resistance causes most problems
• How hard is it to find a collision with a probability of 0.5 ?
• Related Problem: How many people are needed such that two
of them have the same birthday with a probability of 0.5 ?
• No! Not 365/2=183
• 23 are enough ! This is called the birthday paradox (Search
takes ≈√2n steps)
• To deal with this paradox, hash functions need a output size of
at least 160 bits
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl12
Hash Functions: Security
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl13
11.3 Overview of Hash Algorithms
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl
• MD4 family
• SHA-1: output - 160 Bit; input - 512 bit chunks of message x;

operations - bitwise AND, OR, XOR, complement and cyclic shifts.
• RIPE-MD 160: output - 160 Bit; input - 512 bit chunks of message
x; operations – like in SHA-1, but two in parallel and combinations
of them after each round.
Hash Functions: Algorithms
Hash Algorithms
based on
block ciphers
SpecialAlgorithms,
e.g. MD4 family
14
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl
• Matyas-Meyer-Oseas hash
function
• Break original file into
blocks
• Start with known public
block H0, which may be all
zeroes
• Encrypt a block using
previous H as the key, then
XOR with next block of file
data to form the new H
• Repeat through whole file
Hash Functions from Block Ciphers
15
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl
Other Hash Functions from Block Ciphers
16
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl17
11.4 The Secure Hash Algorithm SHA-1
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl18
SHA-1
•Part of the MD-4 family.
•Based on a Merkle-Dåmgard construction
•Similar to a Feistel block cipher
•160-bit output from a message of maximum length
264 bit.
•Widely used ( even tough some weaknesses are
known)
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl19
How Big is 2**60 bits?
•2**10 = 1024 = 1Kb
•2**20 = 1Mb
•2**30 = 1Gb
•2**40 = 1 Tb
•2**60 = 1 million Tb
•2**63 = 1 million TB
•2**54 = 2 million TB
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl
SHA-1 High Level Diagram
20
Compression
Function
consists of 80
rounds which
are divided
into four
stages of 20
rounds each
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl
SHA-1: Padding
• Message x has to be padded to fit a size of a multiple of
512 bits
• Add k zero bits
• k = 512 − 64 − 1 − l = 448 − (l + 1) mod512
21
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl
SHA-1: Padding Example
• Message is abc

24 bits long

k = 512 − 64 − 1 − 24 = 423
22
64 bits long
Value = 24 in binary
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl23
SHA-1: Hash Computation
• Each message block xi is processed in four stages with 20 rounds each
SHA-1 uses:
• A message schedule which computes a 32-bit word W0, W1, ..., W79
foreach of the 80 rounds
• Five working registers of size of 32 bits A,B,C,D,E
• A hash value Hi consisting of five 32-bit words Hi
(0), Hi
(1), Hi
(2) , Hi
(3), Hi
(4)
• In the beginning, the hash value holds the initial value H0, which is
replaced by a new hash value after the processing of each single
messageblock.
• The final hash value Hn is equal to the output h(x) of SHA-1.
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl24
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl
SHA-1: All four stages
25
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl
SHA-1:
Internals of
a Round
Stage t Round j Constant Kt Function ft
1 00…19 5A827999 (B∧C)∨(¯ B∧D)
2 20…39 6ED9EBA1 B⊕C⊕D
3 40…59 8F1BBCDC (B⊕C)∨(B⊕D)∨(C⊕D)
4 60…79 CA62C1D6 B⊕C⊕D
AND
OR
NOT
XOR
SHA-1 Collision Found
• Collision found on Feb. 23, 2017
• Links Ch 12-2017-1, 2, and 3 in CNIT 123
28
29
Browsers Deprecated SHA-1
• Link Ch 12zr in CNIT 123
Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl31
■ Lessons Learned: Hash-Functions
• Hash functions are keyless. The two most important applications of hash
functions are their use in digital signatures and in message authentication
codes such as HMAC.
• The three security requirements for hash functions are one-wayness,
second preimage resistance and collisionresistance.
• Hash functions should have at least 160-bit output length in order to
withstand collision attacks; 256 bit or more is desirable for long-term
security.
• MD5, which was widely used, is insecure. Serious security weaknesses
have been found in SHA-1, and the hash function should be phased out.
The SHA-2 algorithms all appear to be secure.
• The ongoing SHA-3 competition will result in new standardized hash
functions in a few years.
CNIT 141: 11. Hash Functions

More Related Content

What's hot

2. Stream Ciphers
2. Stream Ciphers2. Stream Ciphers
2. Stream CiphersSam Bowne
 
Presentation about RSA
Presentation about RSAPresentation about RSA
Presentation about RSASrilal Buddika
 
The rsa algorithm
The rsa algorithmThe rsa algorithm
The rsa algorithmKomal Singh
 
3. The Data Encryption Standard (DES) and Alternatives
3. The Data Encryption Standard (DES) and Alternatives3. The Data Encryption Standard (DES) and Alternatives
3. The Data Encryption Standard (DES) and AlternativesSam Bowne
 
Elliptic Curves in Cryptography
Elliptic Curves in CryptographyElliptic Curves in Cryptography
Elliptic Curves in CryptographyCSNP
 
Applications of-linear-algebra-hill-cipher
Applications of-linear-algebra-hill-cipherApplications of-linear-algebra-hill-cipher
Applications of-linear-algebra-hill-cipherAashirwad Kashyap
 
Cryptography and network security Nit701
Cryptography and network security Nit701Cryptography and network security Nit701
Cryptography and network security Nit701Amit Pathak
 
RSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key CryptographyRSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key CryptographyMd. Shafiul Alam Sagor
 
Linux binary Exploitation - Basic knowledge
Linux binary Exploitation - Basic knowledgeLinux binary Exploitation - Basic knowledge
Linux binary Exploitation - Basic knowledgeAngel Boy
 
DES (Data Encryption Standard) pressentation
DES (Data Encryption Standard) pressentationDES (Data Encryption Standard) pressentation
DES (Data Encryption Standard) pressentationsarhadisoftengg
 
Different types of Symmetric key Cryptography
Different types of Symmetric key CryptographyDifferent types of Symmetric key Cryptography
Different types of Symmetric key Cryptographysubhradeep mitra
 
Caesar Cipher , Substitution Cipher, PlayFair and Vigenere Cipher
Caesar Cipher , Substitution Cipher, PlayFair and Vigenere CipherCaesar Cipher , Substitution Cipher, PlayFair and Vigenere Cipher
Caesar Cipher , Substitution Cipher, PlayFair and Vigenere CipherMona Rajput
 
History of cryptography
History of cryptographyHistory of cryptography
History of cryptographyFarah Shaikh
 

What's hot (20)

2. Stream Ciphers
2. Stream Ciphers2. Stream Ciphers
2. Stream Ciphers
 
Block Ciphers Modes of Operation
Block Ciphers Modes of OperationBlock Ciphers Modes of Operation
Block Ciphers Modes of Operation
 
Presentation about RSA
Presentation about RSAPresentation about RSA
Presentation about RSA
 
The rsa algorithm
The rsa algorithmThe rsa algorithm
The rsa algorithm
 
Rsa cryptosystem
Rsa cryptosystemRsa cryptosystem
Rsa cryptosystem
 
3. The Data Encryption Standard (DES) and Alternatives
3. The Data Encryption Standard (DES) and Alternatives3. The Data Encryption Standard (DES) and Alternatives
3. The Data Encryption Standard (DES) and Alternatives
 
Cryptography
CryptographyCryptography
Cryptography
 
Elliptic Curves in Cryptography
Elliptic Curves in CryptographyElliptic Curves in Cryptography
Elliptic Curves in Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
The rsa algorithm JooSeok Song
The rsa algorithm JooSeok SongThe rsa algorithm JooSeok Song
The rsa algorithm JooSeok Song
 
Applications of-linear-algebra-hill-cipher
Applications of-linear-algebra-hill-cipherApplications of-linear-algebra-hill-cipher
Applications of-linear-algebra-hill-cipher
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
 
Cryptography and network security Nit701
Cryptography and network security Nit701Cryptography and network security Nit701
Cryptography and network security Nit701
 
RSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key CryptographyRSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key Cryptography
 
Ecc2
Ecc2Ecc2
Ecc2
 
Linux binary Exploitation - Basic knowledge
Linux binary Exploitation - Basic knowledgeLinux binary Exploitation - Basic knowledge
Linux binary Exploitation - Basic knowledge
 
DES (Data Encryption Standard) pressentation
DES (Data Encryption Standard) pressentationDES (Data Encryption Standard) pressentation
DES (Data Encryption Standard) pressentation
 
Different types of Symmetric key Cryptography
Different types of Symmetric key CryptographyDifferent types of Symmetric key Cryptography
Different types of Symmetric key Cryptography
 
Caesar Cipher , Substitution Cipher, PlayFair and Vigenere Cipher
Caesar Cipher , Substitution Cipher, PlayFair and Vigenere CipherCaesar Cipher , Substitution Cipher, PlayFair and Vigenere Cipher
Caesar Cipher , Substitution Cipher, PlayFair and Vigenere Cipher
 
History of cryptography
History of cryptographyHistory of cryptography
History of cryptography
 

Similar to CNIT 141: 11. Hash Functions

4. The Advanced Encryption Standard (AES)
4. The Advanced Encryption Standard (AES)4. The Advanced Encryption Standard (AES)
4. The Advanced Encryption Standard (AES)Sam Bowne
 
Introduction to Cryptography Parts II and III
Introduction to Cryptography Parts II and IIIIntroduction to Cryptography Parts II and III
Introduction to Cryptography Parts II and IIIMaksim Djackov
 
Crypto-Presentation jfjfd dkfdnfdj kdfjdjfdjkfd .pptx
Crypto-Presentation jfjfd dkfdnfdj kdfjdjfdjkfd .pptxCrypto-Presentation jfjfd dkfdnfdj kdfjdjfdjkfd .pptx
Crypto-Presentation jfjfd dkfdnfdj kdfjdjfdjkfd .pptxanxiousanoja
 
Crypto theory practice
Crypto theory practiceCrypto theory practice
Crypto theory practiceFraboni Ec
 
Crypto theory to practice
Crypto theory to practiceCrypto theory to practice
Crypto theory to practiceLuis Goldster
 
Crypto theory practice
Crypto theory practiceCrypto theory practice
Crypto theory practiceJames Wong
 
Crypto theory to practice
Crypto theory to practiceCrypto theory to practice
Crypto theory to practiceTony Nguyen
 
Crypto theory to practice
Crypto theory to practiceCrypto theory to practice
Crypto theory to practiceDavid Hoen
 
Crypto theory to practice
Crypto theory to practiceCrypto theory to practice
Crypto theory to practiceHarry Potter
 
Crypto theory practice
Crypto theory practiceCrypto theory practice
Crypto theory practiceYoung Alista
 
cryptography and network security chap 3
cryptography and network security chap 3cryptography and network security chap 3
cryptography and network security chap 3Debanjan Bhattacharya
 
DES-lecture (1).ppt
DES-lecture (1).pptDES-lecture (1).ppt
DES-lecture (1).pptMrsPrabhaBV
 
block ciphers
block ciphersblock ciphers
block ciphersAsad Ali
 
SymmetricCryptography-Part3 - Tagged.pdf
SymmetricCryptography-Part3 - Tagged.pdfSymmetricCryptography-Part3 - Tagged.pdf
SymmetricCryptography-Part3 - Tagged.pdfMohammedMorhafJaely
 
Everything I always wanted to know about crypto, but never thought I'd unders...
Everything I always wanted to know about crypto, but never thought I'd unders...Everything I always wanted to know about crypto, but never thought I'd unders...
Everything I always wanted to know about crypto, but never thought I'd unders...Codemotion
 

Similar to CNIT 141: 11. Hash Functions (20)

4. The Advanced Encryption Standard (AES)
4. The Advanced Encryption Standard (AES)4. The Advanced Encryption Standard (AES)
4. The Advanced Encryption Standard (AES)
 
Introduction to Cryptography Parts II and III
Introduction to Cryptography Parts II and IIIIntroduction to Cryptography Parts II and III
Introduction to Cryptography Parts II and III
 
Crypto-Presentation jfjfd dkfdnfdj kdfjdjfdjkfd .pptx
Crypto-Presentation jfjfd dkfdnfdj kdfjdjfdjkfd .pptxCrypto-Presentation jfjfd dkfdnfdj kdfjdjfdjkfd .pptx
Crypto-Presentation jfjfd dkfdnfdj kdfjdjfdjkfd .pptx
 
Crypto theory practice
Crypto theory practiceCrypto theory practice
Crypto theory practice
 
Crypto theory to practice
Crypto theory to practiceCrypto theory to practice
Crypto theory to practice
 
Crypto theory practice
Crypto theory practiceCrypto theory practice
Crypto theory practice
 
Crypto theory to practice
Crypto theory to practiceCrypto theory to practice
Crypto theory to practice
 
Crypto theory to practice
Crypto theory to practiceCrypto theory to practice
Crypto theory to practice
 
Crypto theory to practice
Crypto theory to practiceCrypto theory to practice
Crypto theory to practice
 
Crypto theory practice
Crypto theory practiceCrypto theory practice
Crypto theory practice
 
Cryptography and Network Security William Stallings Lawrie Brown
Cryptography and Network Security William Stallings Lawrie BrownCryptography and Network Security William Stallings Lawrie Brown
Cryptography and Network Security William Stallings Lawrie Brown
 
cryptography and network security chap 3
cryptography and network security chap 3cryptography and network security chap 3
cryptography and network security chap 3
 
DES-lecture (1).ppt
DES-lecture (1).pptDES-lecture (1).ppt
DES-lecture (1).ppt
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
Ch03
Ch03Ch03
Ch03
 
block ciphers
block ciphersblock ciphers
block ciphers
 
SymmetricCryptography-Part3 - Tagged.pdf
SymmetricCryptography-Part3 - Tagged.pdfSymmetricCryptography-Part3 - Tagged.pdf
SymmetricCryptography-Part3 - Tagged.pdf
 
public-key cryptography Shamir
public-key cryptography Shamirpublic-key cryptography Shamir
public-key cryptography Shamir
 
Everything I always wanted to know about crypto, but never thought I'd unders...
Everything I always wanted to know about crypto, but never thought I'd unders...Everything I always wanted to know about crypto, but never thought I'd unders...
Everything I always wanted to know about crypto, but never thought I'd unders...
 
Cryptography-101
Cryptography-101Cryptography-101
Cryptography-101
 

More from Sam Bowne

3: DNS vulnerabilities
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities Sam Bowne
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development SecuritySam Bowne
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the ApplicationSam Bowne
 
3. Attacking iOS Applications (Part 2)
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)Sam Bowne
 
12 Elliptic Curves
12 Elliptic Curves12 Elliptic Curves
12 Elliptic CurvesSam Bowne
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-HellmanSam Bowne
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1Sam Bowne
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android ApplicationsSam Bowne
 
12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)Sam Bowne
 
12 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3Sam Bowne
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard ProblemsSam Bowne
 
8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)Sam Bowne
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis MethodologySam Bowne
 
8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated EncryptionSam Bowne
 
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)Sam Bowne
 
7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)Sam Bowne
 
5. Stream Ciphers
5. Stream Ciphers5. Stream Ciphers
5. Stream CiphersSam Bowne
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data CollectionSam Bowne
 

More from Sam Bowne (20)

Cyberwar
CyberwarCyberwar
Cyberwar
 
3: DNS vulnerabilities
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the Application
 
3. Attacking iOS Applications (Part 2)
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)
 
12 Elliptic Curves
12 Elliptic Curves12 Elliptic Curves
12 Elliptic Curves
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-Hellman
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android Applications
 
12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)
 
10 RSA
10 RSA10 RSA
10 RSA
 
12 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard Problems
 
8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis Methodology
 
8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated Encryption
 
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)
 
7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)
 
5. Stream Ciphers
5. Stream Ciphers5. Stream Ciphers
5. Stream Ciphers
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection
 

Recently uploaded

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 

Recently uploaded (20)

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 

CNIT 141: 11. Hash Functions

  • 1. Understanding Cryptography – A Textbook for Students and Practitioners by Christof Paar and JanPelzl www.crypto-textbook.com Chapter 11 – Hash Functions ver. October 29, 2009 These slides were prepared by Stefan Heyse and Christof Paar and Jan Pelzl And modified by Sam Bowne
  • 2. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl2 Some legal stuff (sorry): Terms of Use • The slides can used free of charge. All copyrights for the slides remain with Christof Paar and Jan Pelzl. • The title of the accompanying book “Understanding Cryptography” by Springer and the author’s names must remain on eachslide. • If the slides are modified, appropriate credits to the book authorsand the book title must remain within the slides. • It is not permitted to reproduce parts or all of the slides in printed form whatsoever without written consent by the authors.
  • 3. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl3 Contents of this Chapter 11.1 Motivation: Signing Long Messages 11.2 Security Requirements of Hash Functions 11.3 Overview of Hash Algorithms 11.4 The Secure Hash Algorithm SHA-1
  • 4. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl4 11.1 Motivation: Signing Long Messages
  • 5. • Three Problems • Computational overhead • Message overhead • Security limitations • Attacker could re-order or re-use signed blocks Solution: Instead of signing the whole message, sign only a digest (=hash) Also secure, but much faster Needed: Hash Functions Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl Motivation Problem: Naive signing of long messages generates a signature of same length. 5
  • 6. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl Solution 6 • Hash, then sign
  • 7. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl Principal input–output behavior of hash functions 7
  • 8. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl8 11.2 Security Requirements of Hash Functions
  • 9. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl The three security properties of hash functions 9
  • 10. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl10 Hash Functions: Security Properties • Preimage resistance: For a given output z, it is impossible to findany input x such that h(x) = z, i.e., h(x) is one-way
 (Also called one-wayness) • Second preimage resistance: Given x1, and thus h(x1), it is computationally infeasible to find any x2 such that h(x1) =h(x2)
 (Also called weak collision resistance) • Collision resistance: It is computationally infeasible to find anypairs x1 ≠ x2 such that h(x1) =h(x2)
 (Also called strong collision resistance)
  • 11. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl11 Hash Functions: Security • Collison resistance causes most problems • How hard is it to find a collision with a probability of 0.5 ? • Related Problem: How many people are needed such that two of them have the same birthday with a probability of 0.5 ? • No! Not 365/2=183 • 23 are enough ! This is called the birthday paradox (Search takes ≈√2n steps) • To deal with this paradox, hash functions need a output size of at least 160 bits
  • 12. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl12 Hash Functions: Security
  • 13. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl13 11.3 Overview of Hash Algorithms
  • 14. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl • MD4 family • SHA-1: output - 160 Bit; input - 512 bit chunks of message x;
 operations - bitwise AND, OR, XOR, complement and cyclic shifts. • RIPE-MD 160: output - 160 Bit; input - 512 bit chunks of message x; operations – like in SHA-1, but two in parallel and combinations of them after each round. Hash Functions: Algorithms Hash Algorithms based on block ciphers SpecialAlgorithms, e.g. MD4 family 14
  • 15. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl • Matyas-Meyer-Oseas hash function • Break original file into blocks • Start with known public block H0, which may be all zeroes • Encrypt a block using previous H as the key, then XOR with next block of file data to form the new H • Repeat through whole file Hash Functions from Block Ciphers 15
  • 16. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl Other Hash Functions from Block Ciphers 16
  • 17. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl17 11.4 The Secure Hash Algorithm SHA-1
  • 18. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl18 SHA-1 •Part of the MD-4 family. •Based on a Merkle-Dåmgard construction •Similar to a Feistel block cipher •160-bit output from a message of maximum length 264 bit. •Widely used ( even tough some weaknesses are known)
  • 19. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl19 How Big is 2**60 bits? •2**10 = 1024 = 1Kb •2**20 = 1Mb •2**30 = 1Gb •2**40 = 1 Tb •2**60 = 1 million Tb •2**63 = 1 million TB •2**54 = 2 million TB
  • 20. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl SHA-1 High Level Diagram 20 Compression Function consists of 80 rounds which are divided into four stages of 20 rounds each
  • 21. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl SHA-1: Padding • Message x has to be padded to fit a size of a multiple of 512 bits • Add k zero bits • k = 512 − 64 − 1 − l = 448 − (l + 1) mod512 21
  • 22. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl SHA-1: Padding Example • Message is abc
 24 bits long
 k = 512 − 64 − 1 − 24 = 423 22 64 bits long Value = 24 in binary
  • 23. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl23 SHA-1: Hash Computation • Each message block xi is processed in four stages with 20 rounds each SHA-1 uses: • A message schedule which computes a 32-bit word W0, W1, ..., W79 foreach of the 80 rounds • Five working registers of size of 32 bits A,B,C,D,E • A hash value Hi consisting of five 32-bit words Hi (0), Hi (1), Hi (2) , Hi (3), Hi (4) • In the beginning, the hash value holds the initial value H0, which is replaced by a new hash value after the processing of each single messageblock. • The final hash value Hn is equal to the output h(x) of SHA-1.
  • 24. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl24
  • 25. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl SHA-1: All four stages 25
  • 26. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl SHA-1: Internals of a Round Stage t Round j Constant Kt Function ft 1 00…19 5A827999 (B∧C)∨(¯ B∧D) 2 20…39 6ED9EBA1 B⊕C⊕D 3 40…59 8F1BBCDC (B⊕C)∨(B⊕D)∨(C⊕D) 4 60…79 CA62C1D6 B⊕C⊕D AND OR NOT XOR
  • 27. SHA-1 Collision Found • Collision found on Feb. 23, 2017 • Links Ch 12-2017-1, 2, and 3 in CNIT 123
  • 28. 28
  • 29. 29
  • 30. Browsers Deprecated SHA-1 • Link Ch 12zr in CNIT 123
  • 31. Chapter 11 of Understanding Cryptography by Christof Paar and Jan Pelzl31 ■ Lessons Learned: Hash-Functions • Hash functions are keyless. The two most important applications of hash functions are their use in digital signatures and in message authentication codes such as HMAC. • The three security requirements for hash functions are one-wayness, second preimage resistance and collisionresistance. • Hash functions should have at least 160-bit output length in order to withstand collision attacks; 256 bit or more is desirable for long-term security. • MD5, which was widely used, is insecure. Serious security weaknesses have been found in SHA-1, and the hash function should be phased out. The SHA-2 algorithms all appear to be secure. • The ongoing SHA-3 competition will result in new standardized hash functions in a few years.