Message Authentication and Digital Signatures · Cryptography and Network Security

Message Authentication Codes

Watch lectures

Message Authentication Codes

1. What Is a MAC? (beginner — keyed fingerprint!)

MAC = fingerprint mixed with SECRET key: tag=MAC(K,m)tag = MAC(K, m). Receiver recomputes with same KK — match? (1) unchanged! (2) from key-holder! Eve lacks KK → can't forge! Unlike hash (anyone recomputes!).

2. Flow (exam diagram!)

Alice: tag = MAC(K, "Pay ₹1000") → sends (message, tag)
Bob: recomputes MAC(K, received message) — equals tag? accept : reject!
Eve flips ₹1000→₹9000 → Bob's recompute differs → REJECTED!

3. Constructions (exam list!)

Type Idea Example
Hash-based nested hash with key HMAC (standard!)
Cipher-based last block of encrypted chain CBC-MAC, CMAC (AES!)
Universal-hash polynomial math (fast!) UMAC, Poly1305 (ChaCha!)

4. Rules (traps!)

  • Needs SHARED key first (key-distribution problem — DH/RSA exchange it!).
  • NO non-repudiation (both sides hold KK — either could forge! need signatures for court!).
  • Verify in CONSTANT time (compare digests without early-exit — else timing leak!).
  • Never plain Hash(K+m)Hash(K + m) with Merkle-Damgård (length-extension! use HMAC!).

5. Exam Points

  • Define + flow + forge-proof — 5-7 marks, very frequent.
  • Constructions + no-non-repudiation — 3-5 marks, frequent.
Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.

← All Cryptography and Network Security modules

Message Authentication Codes — Cryptography and Network Security — PYQDeck