cryptography and network security chapter 11 fourth edition by william stallings

22
Cryptography and Cryptography and Network Security Network Security Chapter 11 Chapter 11 Fourth Edition Fourth Edition by William Stallings by William Stallings

Post on 21-Dec-2015

244 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

Cryptography and Cryptography and Network SecurityNetwork Security

Chapter 11Chapter 11

Fourth EditionFourth Edition

by William Stallingsby William Stallings

Page 2: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

Chapter 11 – Chapter 11 – Message Message Authentication and Hash Authentication and Hash

FunctionsFunctions At cats' green on the Sunday he took the message from At cats' green on the Sunday he took the message from

the inside of the pillar and added Peter Moran's name to the inside of the pillar and added Peter Moran's name to the two names already printed there in the "Brontosaur" the two names already printed there in the "Brontosaur" code. The message now read: “Leviathan to Dragon: code. The message now read: “Leviathan to Dragon: Martin Hillman, Trevor Allan, Peter Moran: observe and Martin Hillman, Trevor Allan, Peter Moran: observe and tail.” What was the good of it John hardly knew. He felt tail.” What was the good of it John hardly knew. He felt better, he felt that at last he had made an attack on Peter better, he felt that at last he had made an attack on Peter Moran instead of waiting passively and effecting no Moran instead of waiting passively and effecting no retaliation. Besides, what was the use of being in retaliation. Besides, what was the use of being in possession of the key to the codes if he never took possession of the key to the codes if he never took advantage of it?advantage of it?

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

Page 3: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

Message AuthenticationMessage Authentication

message authentication is concerned with: message authentication is concerned with: protecting the integrity of a message protecting the integrity of a message validating identity of originator validating identity of originator non-repudiation of origin (dispute resolution)non-repudiation of origin (dispute resolution)

will consider the security requirementswill consider the security requirements then three alternative functions used:then three alternative functions used:

message encryptionmessage encryption message authentication code (MAC)message authentication code (MAC) hash functionhash function

Page 4: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

Security RequirementsSecurity Requirements

disclosuredisclosure traffic analysistraffic analysis masquerademasquerade content modificationcontent modification sequence modificationsequence modification timing modificationtiming modification source repudiationsource repudiation destination repudiationdestination repudiation

Page 5: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

Message EncryptionMessage Encryption

message encryption by itself also provides message encryption by itself also provides a measure of authenticationa measure of authentication

if symmetric encryption is used then:if symmetric encryption is used then: receiver know sender must have created itreceiver know sender must have created it since only sender and receiver now key usedsince only sender and receiver now key used know content cannot of been alteredknow content cannot of been altered if message has if message has suitable structure, redundancy suitable structure, redundancy

or a checksum to detect any changesor a checksum to detect any changes

Page 6: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

Message EncryptionMessage Encryption

if public-key encryption is used:if public-key encryption is used: encryption provides no confidence of senderencryption provides no confidence of sender since anyone potentially knows public-keysince anyone potentially knows public-key however if however if

• sender sender signssigns message using their private-key message using their private-key• then encrypts with recipients public keythen encrypts with recipients public key• have both secrecy and authenticationhave both secrecy and authentication

again need to recognize corrupted messagesagain need to recognize corrupted messages but at cost of two public-key uses on messagebut at cost of two public-key uses on message

Page 7: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

Message Authentication Code Message Authentication Code (MAC)(MAC)

generated by an algorithm that creates a generated by an algorithm that creates a small fixed-sized blocksmall fixed-sized block depending on both message and some keydepending on both message and some key like encryption though need not be reversiblelike encryption though need not be reversible

appended to message as a appended to message as a signaturesignature receiver performs same computation on receiver performs same computation on

message and checks it matches the MACmessage and checks it matches the MAC provides assurance that message is provides assurance that message is

unaltered and comes from senderunaltered and comes from sender

Page 8: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

Message Authentication CodeMessage Authentication Code

Page 9: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

Message Authentication Message Authentication CodesCodes

as shown the MAC provides authenticationas shown the MAC provides authentication can also use encryption for secrecycan also use encryption for secrecy

generally use separate keys for eachgenerally use separate keys for each can compute MAC either before or after encryptioncan compute MAC either before or after encryption is generally regarded as better done beforeis generally regarded as better done before

why use a MAC?why use a MAC? sometimes only authentication is neededsometimes only authentication is needed sometimes need authentication to persist longer than sometimes need authentication to persist longer than

the encryption (eg. archival use)the encryption (eg. archival use) note that a MAC is not a digital signaturenote that a MAC is not a digital signature

Page 10: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

MAC PropertiesMAC Properties

a MAC is a cryptographic checksuma MAC is a cryptographic checksumMAC = CMAC = CKK(M)(M)

condenses a variable-length message Mcondenses a variable-length message M using a secret key Kusing a secret key K to a fixed-sized authenticatorto a fixed-sized authenticator

is a many-to-one functionis a many-to-one function potentially many messages have same MACpotentially many messages have same MAC but finding these needs to be very difficultbut finding these needs to be very difficult

Page 11: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

Requirements for MACsRequirements for MACs

taking into account the types of attackstaking into account the types of attacks need the MAC to satisfy the following:need the MAC to satisfy the following:

1.1. knowing a message and MAC, is infeasible knowing a message and MAC, is infeasible to find another message with same MACto find another message with same MAC

2.2. MACs should be uniformly distributedMACs should be uniformly distributed

3.3. MAC should depend equally on all bits of the MAC should depend equally on all bits of the messagemessage

Page 12: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

Using Symmetric Ciphers for Using Symmetric Ciphers for MACsMACs

can use any block cipher chaining mode can use any block cipher chaining mode and use final block as a MACand use final block as a MAC

Data Authentication Algorithm (DAA)Data Authentication Algorithm (DAA) is is a widely used MAC based on DES-CBCa widely used MAC based on DES-CBC using IV=0 and zero-pad of final blockusing IV=0 and zero-pad of final block encrypt message using DES in CBC modeencrypt message using DES in CBC mode and send just the final block as the MACand send just the final block as the MAC

• or the leftmost M bits (16or the leftmost M bits (16≤M≤64) of final block≤M≤64) of final block

but final MAC is now too small for securitybut final MAC is now too small for security

Page 13: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

Data Authentication AlgorithmData Authentication Algorithm

Page 14: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

Hash FunctionsHash Functions

condenses arbitrary message to fixed sizecondenses arbitrary message to fixed sizeh = H(M)h = H(M)

usually assume that the hash function is usually assume that the hash function is public and not keyedpublic and not keyed cf. MAC which is keyedcf. MAC which is keyed

hash used to detect changes to messagehash used to detect changes to message can use in various ways with messagecan use in various ways with message most often to create a digital signaturemost often to create a digital signature

Page 15: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

Hash Functions & Digital Hash Functions & Digital SignaturesSignatures

Page 16: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

Requirements for Hash Requirements for Hash FunctionsFunctions

1.1. can be applied to any sized message can be applied to any sized message MM2.2. produces fixed-length output produces fixed-length output hh3.3. is easy to compute is easy to compute h=H(M)h=H(M) for any message for any message MM4.4. given given hh is infeasible to find is infeasible to find xx s.t. s.t. H(x)=hH(x)=h

• one-way propertyone-way property

5.5. given given xx is infeasible to find is infeasible to find yy s.t s.t. H(y)=H(x). H(y)=H(x)• weak collision resistanceweak collision resistance

6.6. is infeasible to find any is infeasible to find any x,yx,y s.t s.t. H(y)=H(x). H(y)=H(x)• strong collision resistancestrong collision resistance

Page 17: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

Simple Hash FunctionsSimple Hash Functions

are several proposals for simple functionsare several proposals for simple functions based on XOR of message blocksbased on XOR of message blocks not secure since can manipulate any not secure since can manipulate any

message and either not change hash or message and either not change hash or change hash alsochange hash also

need a stronger cryptographic function need a stronger cryptographic function (next chapter)(next chapter)

Page 18: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

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:

opponent generates 2opponent generates 2mm//22 variations of a valid message variations of a valid message

all with essentially the same meaningall with essentially the same meaning opponent also generates 2opponent also generates 2

mm//22 variations of a desired variations of a desired fraudulent messagefraudulent message

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 the have user sign the valid message, then substitute the forgery which will have a valid signatureforgery which will have a valid signature

conclusion is that need to use larger MAC/hashconclusion is that need to use larger MAC/hash

Page 19: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

Block Ciphers as Hash Block Ciphers as Hash FunctionsFunctions

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 = EMMii [H [Hi-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

Page 20: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

Hash Functions & MAC Hash Functions & MAC SecuritySecurity

like block ciphers have:like block ciphers have: brute-forcebrute-force attacks exploiting attacks exploiting

strong collision resistance hash have cost 2strong collision resistance hash have cost 2mm//22

• have proposal for h/w MD5 crackerhave proposal for h/w MD5 cracker• 128-bit hash looks vulnerable, 160-bits better128-bit hash looks vulnerable, 160-bits better

MACs with known message-MAC pairsMACs with known message-MAC pairs• can either attack keyspace (cf key search) or MACcan either attack keyspace (cf key search) or MAC• at least 128-bit MAC is needed for securityat least 128-bit MAC is needed for security

Page 21: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

Hash Functions & MAC Hash Functions & MAC Security Security

cryptanalytic attackscryptanalytic attacks exploit structure exploit structure like block ciphers want brute-force attacks to be the like block ciphers want brute-force attacks to be the

best alternativebest alternative have a number of analytic attacks on iterated have a number of analytic attacks on iterated

hash functionshash functions CVCVii = f[CV = f[CVi-1i-1, M, Mii]; H(M)=CV]; H(M)=CVNN

typically focus on collisions in function ftypically focus on collisions in function f like block ciphers is often composed of roundslike block ciphers is often composed of rounds attacks exploit properties of round functionsattacks exploit properties of round functions

Page 22: Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings

SummarySummary

have considered:have considered: message authentication usingmessage authentication using message encryptionmessage encryption MACsMACs hash functionshash functions general approach & securitygeneral approach & security