📝 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.
📝 All Message authentication MAC MCQs
Q1. Which of the following best defines a Message Authentication Code (MAC) in the context of network security?
📖 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?
📖 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?
📖 Explanation: The chance of guessing a specific 64‑bit value is one over the total number of possible values, i.e., . 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?
📖 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?
📖 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?
📖 Explanation: Increasing the tag size raises the difficulty of a successful forgery from to , 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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).
📖 Explanation: The birthday paradox suggests a collision becomes likely after about samples, where n is the tag length. For a 128‑bit tag, this threshold is roughly messages, giving a collision probability on the order of for any pair of distinct messages.
Q13. If a MAC verification fails, what is the most appropriate immediate response in a secure communication protocol?
📖 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.