🎓 BookMCQ
← Back to 31. Cryptography and Network Security

📝 Message authentication MAC (13 MCQs)

📖 From Data Communication and Networks • 31. Cryptography and Network Security • 13 questions available

What is Message authentication MAC?

A Message Authentication Code (MAC) is a short piece of information generated using a shared secret key and a hash function to verify both the integrity and authenticity of a message, ensuring it comes from a trusted source and has not been altered.

4
Easy
6
Medium
3
Hard

📝 All Message authentication MAC MCQs

Q1. Which of the following best defines a Message Authentication Code (MAC) in the context of network security?

A.A method to encrypt data for confidentiality
B.A short piece of information used to verify both data integrity and authenticity ✅
C.A protocol for establishing a secure channel
D.A technique to compress messages before transmission
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: A MAC is a compact tag generated using a secret key that allows the receiver to confirm that the message originated from the holder of that key and that it has not been altered. It provides integrity and authenticity but does not provide confidentiality, distinguishing it from encryption methods.

Q2. If a sender uses a MAC generated with a secret key K, and an attacker does not know K, what can be inferred about the attacker's ability to modify the message without detection?

A.The attacker can easily modify the message and recompute the MAC
B.The attacker can modify the message but the MAC will remain valid
C.The attacker can only modify the message if the MAC length is less than 64 bits
D.The attacker cannot produce a valid MAC, so any modification will be detected ✅
💡 Difficulty: easy | ✅ Correct: D

📖 Explanation: Because the MAC depends on the secret key, an adversary lacking K cannot create a correct tag for a altered message. Any change will cause the verification to fail, alerting the receiver to tampering. This property holds regardless of message size or MAC length, assuming the key remains secret.

Q3. A MAC tag is 64 bits long. What is the probability that an attacker guesses a correct tag in a single forgery attempt?

A.2642^{-64}
B.2322^{-32}
C.21282^{-128}
D.2162^{-16}
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The chance of guessing a specific 64‑bit value is one over the total number of possible values, i.e., 1/264=2641/2^{64}=2^{-64}. This assumes the attacker makes a single random attempt and that the MAC is uniformly distributed over its output space.

Q4. Which MAC construction offers stronger protection against replay attacks: a deterministic MAC or a randomized MAC that includes a nonce?

A.Deterministic MAC is stronger
B.Randomized MAC is stronger only if the nonce is public
C.Both provide equal protection ✅
D.Randomized MAC that incorporates a fresh nonce per message
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: A randomized MAC that incorporates a unique, unpredictable nonce ensures each tag is fresh, preventing an adversary from simply re‑sending a previously captured message‑tag pair. Deterministic MACs generate the same tag for identical inputs, making them vulnerable to replay unless additional freshness mechanisms are added.

Q5. When comparing HMAC and CBC‑MAC, which statement about key reuse is correct?

A.Both require separate keys for encryption and MAC
B.HMAC can safely reuse the same key for encryption and MAC ✅
C.CBC‑MAC must use a different key from any encryption algorithm
D.HMAC never uses a key at all
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: HMAC is designed to be secure even when the same secret key is employed for both MAC generation and encryption, because it hashes the key in a specific way. CBC‑MAC, however, does not provide this guarantee and typically requires a distinct key to avoid related‑key attacks.

Q6. If a system upgrades its MAC length from 80 bits to 128 bits, what is the most likely impact?

A.Security decreases, bandwidth increases
B.Security stays the same, bandwidth decreases
C.Security improves, bandwidth slightly increases
D.Security improves, bandwidth unchanged ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: Increasing the tag size raises the difficulty of a successful forgery from 2802^{-80} to 21282^{-128}, dramatically enhancing security. The additional 48 bits add modest overhead to each transmitted message, slightly increasing bandwidth consumption but often justified by the stronger protection.

Q7. How does a MAC differ from a digital signature regarding computational cost and non‑repudiation?

A.MACs are cheaper and do not provide non‑repudiation ✅
B.MACs are more expensive and provide stronger non‑repudiation
C.Both have identical cost and non‑repudiation properties
D.Digital signatures are cheaper but lack integrity guarantees
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: A MAC is generated using symmetric keys, making it computationally lightweight compared to asymmetric digital signatures, which require expensive public‑key operations. However, because both parties share the secret, a MAC cannot prove which party generated the tag, so it does not offer non‑repudiation, unlike a digital signature.

Q8. A protocol computes a MAC over header || payload. If an attacker can reorder these fields, which attack becomes feasible?

A.Key recovery attack
B.Collision attack on the hash function
C.Message substitution attack ✅
D.Denial‑of‑service attack
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: Reordering changes the input to the MAC function while preserving the original tag, enabling the attacker to substitute one legitimate message for another that shares the same tag. This is a form of message substitution that exploits the MAC's lack of binding between field order and authenticity.

Q9. When applying the principle of key separation, what is the recommended practice for a secret used in both encryption and MAC?

A.Use the same key for both operations
B.Derive a new key by hashing the original key
C.Never use a MAC if encryption is performed
D.Share the key with the receiver only after encryption ✅
💡 Difficulty: easy | ✅ Correct: D

📖 Explanation: Key separation advises that a single secret should not be directly reused for multiple cryptographic purposes. The safest approach is to derive independent keys (e.g., via a KDF) for encryption and MAC, ensuring that compromise of one does not affect the other.

Q10. How does the collision resistance of the hash function used in HMAC affect the overall security of the MAC?

A.It has no effect on MAC security
B.Weak collision resistance reduces MAC security ✅
C.Strong collision resistance weakens MAC security
D.Collision resistance only matters for digital signatures
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: HMAC relies on the underlying hash function; if an attacker can find collisions, they may craft different messages that produce the same MAC, undermining integrity. Therefore, strong collision resistance is essential to prevent such forgery attacks and maintain MAC robustness.

Q11. In a protocol where messages may arrive out of order, which step should be included when verifying a MAC?

A.Ignore the sequence number and verify only the payload ✅
B.Verify the MAC after re‑ordering messages based on a trusted sequence number
C.Compute a new MAC using the receiver’s secret key
D.Skip MAC verification if the message is late
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Even when messages are received out of order, the MAC must be checked on the exact data that was originally authenticated, including any sequence number or timestamp. Reordering before verification would alter the input, causing a mismatch and a false failure.

Q12. A system uses a 256‑bit secret key and a 128‑bit MAC tag. Approximate the probability that two distinct messages produce the same tag (birthday bound).

A.2642^{-64}
B.21282^{-128}
C.2642^{-64} (approximately) ✅
D.2322^{-32}
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: The birthday paradox suggests a collision becomes likely after about 2n/22^{n/2} samples, where n is the tag length. For a 128‑bit tag, this threshold is roughly 2642^{64} messages, giving a collision probability on the order of 2642^{-64} for any pair of distinct messages.

Q13. If a MAC verification fails, what is the most appropriate immediate response in a secure communication protocol?

A.Resend the same message
B.Ignore the failure and continue
C.Log the event but accept the message
D.Terminate the session and alert the peer ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: A failed MAC indicates potential tampering or a key mismatch. Continuing could expose the system to further compromise, so the safest action is to abort the current session, notify the counterpart, and possibly initiate a fresh secure exchange to re‑establish trust.

🔗 Related Topics (MCQs)