Cryptography: Authenticating MessagesSlide 2The Problem: authenticate messagesAuthenticating messages - alternativesMessage Authentication Code (MAC)MAC useWhy use MAC, given encryption?Hash functionSimple Hash functionHash function (H) useAttacks on Hash Functions and MACsHMAC – combine MAC and HashCryptography: Authenticating MessagesAnita JonesCS551/651 Information Assurance Copyright(C) Anita Jones9/06 Requirementsdisclosure - prevent release of message contentstraffic analysis - prevent discovery of traffic pattern between partiesmasquerade - prevent insertion of messages by fraudulent sourcecontent modification - prevent itsequence modification - prevent ittiming modification -- prevent delay or replayrepudiation - prevent denial of a send or a receive9/06 The Problem: authenticate messagescontent is authentic – bits are as sentsequence of messages is properNote: Separate problems-confidentiality – i.e. encrypt the message-authenticate that the sender is genuine9/06 Authenticating messages - alternativesauthenticator - a value that authenticates a message contentmessage encryption - ciphertext of entire msgmessage authentication code, MAC (cryptographic checksum) - public function & secret key produce fixed length valuehash - public function maps message (any length) to fixed-length hash value (hash code also called a message digest) – no key9/06 Message Authentication Code (MAC)Objective: assure authentic contentMessage is not encryptedMAC is small fixed-size data block, appended to message MA and B share secret keyMACK[M] = F(M, key)9/06 MAC usemessage authentication (no confidentiality) A->B: [M, MACK [M]]authentication and confidentiality A->B: EK1[M, MACK [M]]authentication and confidentiality A->B: [EK1[M], MACK [EK1[M]]]Note: MAC function not necessarily reversible9/06 Why use MAC, given encryption?message may not need to be secret, but must be authenticbroadcast - only have one site responsible for monitoring authenticity. Broadcast plaintext plus MACoverload - send plaintext messages (ie. receiver need not decrypt. Authenticate selectively9/06 Hash functionalso called a “message digest”no keylike MAC, small amount of data; hash of message gives fixed-size valuedefine hash function so that change of any one bit of message will result in different hash valuehash function is not secretone-way; receiver recomputes hash function9/06 Simple Hash functionparity, or longitudinal redundancy checkprocess one bit at a timeuse XOR ( x )input – arbitrary length messagesize of processed block – one bitoutput – one bitC = b1 x b2 x b3 x . . . x bn9/06 Hash function (H) useA->B: M, H [M]can cryptographically protect Hhash provides redundant authentication A->B: EK[M, H [M]]only hash code encrypted, i.e. a MAC! Authentication, but no confidentiality A->B: M, EK [H[M]]9/06 Attacks on Hash Functions and MACsHash functions – strength of hash function depends solely on length of hash code producedGiven code h = H[M], try to find Y, H[Y]=hBrute-force attack on a MAC requires known some message/MAC pairsGiven MACK[M] = X, try all values for key – (key attack)Try different message values, M, trying to get value X9/06 HMAC – combine MAC and HashCryptographic hash functionWhy?Hashing is faster than encryptionNo export control on cryptographicApproachAppend key to each (hashed) block of messageThen hashRemember, a hash function is
View Full Document