12

Cryptography and Network Security Chapter 11 · Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown 09/08/10 2 Chapter 11

  • Upload
    others

  • View
    28

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Cryptography and Network Security Chapter 11 · Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown 09/08/10 2 Chapter 11

09/08/10 1

Cryptography and Cryptography and

Network SecurityNetwork Security

Chapter 11Chapter 11

Fifth EditionFifth Edition

by William Stallingsby William Stallings

Lecture slides by Lawrie BrownLecture slides by Lawrie Brown

09/08/10 2

Chapter 11 � Cryptographic Chapter 11 � Cryptographic

Hash FunctionsHash Functions

Each of the messages, like each one he had ever Each of the messages, like each one he had ever read of Stern's commands, began with a number read of Stern's commands, began with a number and ended with a number or row of numbers. No and ended with a number or row of numbers. No efforts on the part of Mungo or any of his experts efforts on the part of Mungo or any of his experts had been able to break Stern's code, nor was had been able to break Stern's code, nor was there any clue as to what the preliminary number there any clue as to what the preliminary number and those ultimate numbers signified.and those ultimate numbers signified.

��Talking to Strange Men, Talking to Strange Men, Ruth RendellRuth Rendell

Page 2: Cryptography and Network Security Chapter 11 · Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown 09/08/10 2 Chapter 11

09/08/10 3

Hash FunctionsHash Functions

� condenses arbitrary message to fixed sizecondenses arbitrary message to fixed size

h = H(M)h = H(M)

� usually assume hash function is publicusually assume hash function is public

� hash used to detect changes to messagehash used to detect changes to message

� want a cryptographic hash functionwant a cryptographic hash function� computationally infeasible to find data mapping computationally infeasible to find data mapping

to specific hash (one-way property)to specific hash (one-way property)

� computationally infeasible to find two data to computationally infeasible to find two data to

same hash (collision-free property)same hash (collision-free property)

Page 3: Cryptography and Network Security Chapter 11 · Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown 09/08/10 2 Chapter 11
Page 4: Cryptography and Network Security Chapter 11 · Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown 09/08/10 2 Chapter 11

09/08/10 7

Other Hash Function UsesOther Hash Function Uses

� to create a one-way password fileto create a one-way password file� store hash of password not actual store hash of password not actual passwordpassword

� for intrusion detection and virus detectionfor intrusion detection and virus detection� keep & check hash of files on systemkeep & check hash of files on system

� pseudorandom function (PRF) or pseudorandom function (PRF) or

pseudorandom number generator pseudorandom number generator

(PRNG)(PRNG)

09/08/10 8

Two Simple Insecure Hash Two Simple Insecure Hash

FunctionsFunctions

� consider two simple insecure hash functionsconsider two simple insecure hash functions

� bit-by-bit exclusive-OR (XOR) of every blockbit-by-bit exclusive-OR (XOR) of every block

� CCii = b = bi1i1 xor b xor b

i2i2 xor . . . xor b xor . . . xor bimim

� a longitudinal redundancy checka longitudinal redundancy check

� reasonably effective as data integrity checkreasonably effective as data integrity check

� one-bit circular shift on hash valueone-bit circular shift on hash value� for each successive for each successive n-bit n-bit blockblock

� rotate current hash value to left by1bit and XOR rotate current hash value to left by1bit and XOR

blockblock

� good for data integrity but useless for securitygood for data integrity but useless for security

Page 5: Cryptography and Network Security Chapter 11 · Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown 09/08/10 2 Chapter 11

09/08/10 9

Hash Function RequirementsHash Function Requirements

09/08/10 10

Attacks on Hash FunctionsAttacks on Hash Functions

� have brute-force attacks and have brute-force attacks and

cryptanalysiscryptanalysis

� a preimage or second preimage attacka preimage or second preimage attack� find find yy s.t. s.t. H(y) H(y) equals a given hash value equals a given hash value

� collision resistancecollision resistance� find two messages find two messages xx & & yy with same hash so with same hash so

H(x) = H(y)H(x) = H(y)

� hence value 2hence value 2m/2 m/2 determines strength of determines strength of

hash code against brute-force attackshash code against brute-force attacks� 128-bits inadequate, 160-bits suspect128-bits inadequate, 160-bits suspect

Page 6: Cryptography and Network Security Chapter 11 · Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown 09/08/10 2 Chapter 11

09/08/10 11

Birthday AttacksBirthday Attacks

� might think a 64-bit hash is securemight think a 64-bit hash is secure� but by but by Birthday ParadoxBirthday Paradox is not is not� birthday attack birthday attack works thus:works thus:

� given user prepared to sign a valid message xgiven user prepared to sign a valid message x� opponent generates 2opponent generates 2

mm//22 variations x� of x, all with variations x� of x, all with essentially the same meaning, and saves themessentially the same meaning, and saves them

� opponent generates 2opponent generates 2mm//22 variations y� of a desired variations y� of a desired

fraudulent message yfraudulent message y� two sets of messages are compared to find pair with two sets of messages are compared to find pair with

same hash (probability > 0.5 by birthday paradox)same hash (probability > 0.5 by birthday paradox)� have user sign the valid message, then substitute have user sign the valid message, then substitute

the forgery which will have a valid signaturethe forgery which will have a valid signature� conclusion is that need to use larger MAC/hashconclusion is that need to use larger MAC/hash

Page 7: Cryptography and Network Security Chapter 11 · Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown 09/08/10 2 Chapter 11

09/08/10 13

Block Ciphers as Hash FunctionsBlock Ciphers as Hash Functions

� can use block ciphers as hash functionscan use block ciphers as hash functions

� using Husing H00=0 and zero-pad of final block=0 and zero-pad of final block

� compute: Hcompute: Hii = E = E

MMii [H [H

i-1i-1]]

� and use final block as the hash valueand use final block as the hash value

� similar to CBC but without a keysimilar to CBC but without a key

� resulting hash is too small (64-bit)resulting hash is too small (64-bit)� both due to direct birthday attackboth due to direct birthday attack

� and to �meet-in-the-middle� attackand to �meet-in-the-middle� attack

� other variants also susceptible to attackother variants also susceptible to attack

09/08/10 14

Secure Hash AlgorithmSecure Hash Algorithm

� SHA originally designed by NIST & NSA in 1993SHA originally designed by NIST & NSA in 1993

� was revised in 1995 as SHA-1was revised in 1995 as SHA-1

� US standard for use with DSA signature US standard for use with DSA signature

scheme scheme � standard is FIPS 180-1 1995, also Internet RFC3174standard is FIPS 180-1 1995, also Internet RFC3174

� nb. the algorithm is SHA, the standard is SHS nb. the algorithm is SHA, the standard is SHS

� based on design of MD4 with key differences based on design of MD4 with key differences

� produces 160-bit hash values produces 160-bit hash values

� recent 2005 results on security of SHA-1 have recent 2005 results on security of SHA-1 have

raised concerns on its use in future applicationsraised concerns on its use in future applications

Page 8: Cryptography and Network Security Chapter 11 · Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown 09/08/10 2 Chapter 11

09/08/10 15

Revised Secure Hash StandardRevised Secure Hash Standard

� NIST issued revision FIPS 180-2 in 2002NIST issued revision FIPS 180-2 in 2002� adds 3 additional versions of SHA adds 3 additional versions of SHA

� SHA-256, SHA-384, SHA-512SHA-256, SHA-384, SHA-512

� designed for compatibility with increased designed for compatibility with increased security provided by the AES ciphersecurity provided by the AES cipher

� structure & detail is similar to SHA-1structure & detail is similar to SHA-1� hence analysis should be similarhence analysis should be similar� but security levels are rather higherbut security levels are rather higher

Page 9: Cryptography and Network Security Chapter 11 · Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown 09/08/10 2 Chapter 11

09/08/10 18

SHA-512 Compression SHA-512 Compression

FunctionFunction� heart of the algorithmheart of the algorithm

� processing message in 1024-bit blocksprocessing message in 1024-bit blocks

� consists of 80 roundsconsists of 80 rounds� updating a 512-bit buffer updating a 512-bit buffer

� using a 64-bit value Wt derived from the using a 64-bit value Wt derived from the

current message blockcurrent message block

� and a round constant based on cube root of and a round constant based on cube root of

first 80 prime numbersfirst 80 prime numbers

Page 10: Cryptography and Network Security Chapter 11 · Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown 09/08/10 2 Chapter 11

09/08/10 20

SHA-512 SHA-512 Round FunctionRound Function

Page 11: Cryptography and Network Security Chapter 11 · Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown 09/08/10 2 Chapter 11

09/08/10 21

SHA-3SHA-3

� SHA-1 not yet "broken�SHA-1 not yet "broken�� but similar to broken MD5 & SHA-0but similar to broken MD5 & SHA-0

� so considered insecureso considered insecure

� SHA-2 (esp. SHA-512) seems secureSHA-2 (esp. SHA-512) seems secure� shares same structure and mathematical shares same structure and mathematical

operations as predecessors so have concernoperations as predecessors so have concern

� NIST announced in 2007 a competition NIST announced in 2007 a competition

for the SHA-3 next gen NIST hash for the SHA-3 next gen NIST hash

functionfunction� goal to have in place by 2012 but not fixedgoal to have in place by 2012 but not fixed

09/08/10 22

SHA-3 RequirementsSHA-3 Requirements

� replace SHA-2 with SHA-3 in any usereplace SHA-2 with SHA-3 in any use� so use same hash sizesso use same hash sizes

� preserve the online nature of SHA-2preserve the online nature of SHA-2� so so must process small blocks (512 / 1024 bits)must process small blocks (512 / 1024 bits)

� evaluation criteriaevaluation criteria� security close to theoretical max for hash sizessecurity close to theoretical max for hash sizes

� cost in time & memory cost in time & memory

� characteristics: such as flexibility & characteristics: such as flexibility & simplicitysimplicity

Page 12: Cryptography and Network Security Chapter 11 · Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown 09/08/10 2 Chapter 11

09/08/10 23

SummarySummary

� have considered:have considered:� hash functionshash functions

� uses, requirements, securityuses, requirements, security

� hash functions based on block ciphershash functions based on block ciphers

� SHA-1, SHA-2, SHA-3SHA-1, SHA-2, SHA-3