Full name: Chosen-message unforgeability and a message authentication code (MAC) security game.
Definition
A MAC security game is a precisely stated contest that defines when a message authentication code §5.7 (MAC), an algorithm §14.1 that computes a short tag from a secret key and a message, is secure. A challenger holds a random key. The attacker obtains the tags of messages it chooses, then wins by presenting a valid tag for a message it never asked about. Chosen-message unforgeability is the property that every attacker with a feasible amount of computation wins only with negligible probability, meaning a probability too small to matter.
Where it fits
Main entry: Message authentication code (MAC) (§5.7).
The MAC entry states the game in full. In short:
The challenger picks a key uniformly at random and keeps it secret.
The attacker sends messages of its choice, each possibly depending on earlier answers, and receives the genuine tag of each. These requests are called tagging queries.
The attacker outputs a pair and wins if is a valid tag for and differs from every .
The full name of the property is existential unforgeability under chosen-message attack (EUF-CMA). Existential means that any new message counts, even a meaningless one, because the designer of a MAC cannot know which messages will matter to an application.
A definition without tagging queries would accept broken designs. Take 16-bit keys and messages and the tag , where is bitwise XOR (exclusive or): each output bit is 1 exactly where the two input bits differ. To an attacker who has seen no tag, the tag of any message is uniformly random, so a guess is right with probability . Now let . The attacker asks for the tag of and receives . Then is the key, and the new message gets the valid tag . The attacker wins the chosen-message game with a single query, so the game rejects this design.
Re-sending a received pair is not a win, because it proves nothing about the MAC. It is a replay attack §1.26, which the protocol must stop with a freshness check such as a counter. The MAC entry also gives the stricter strong unforgeability, which counts a new valid tag on an already queried message as a win.
Limits and common mistakes
Chosen-message unforgeability is a property of the MAC alone. It does not stop replay, does not tell which holder of a shared key made a tag, and does not stop a valid message from being accepted by the wrong receiver or for the wrong operation unless that context is inside the tagged bytes (authentication coverage §5.41).
The game assumes a uniformly random key that stays secret. A key leaked through a side channel §1.29, or produced by a weak random number generator, is outside the game.
Questions answered
Why allow the attacker to see valid tags?
The attacker is allowed to see valid tags because real attackers do, and a definition that ignored this would certify MACs that break after the first message. Every message protected by a MAC (message authentication code) travels with its valid tag over a channel the attacker can read, so an eavesdropper collects message–tag pairs for free. The attacker can often also steer what gets tagged: a sensor tags readings of a room the attacker can heat. The chosen-message game therefore gives the attacker tags on messages of its own choice and still requires that it cannot produce a valid tag for any other message. Letting the attacker choose covers the attacker who only watches too, since waiting for whatever is sent is one way of choosing.
A toy tag shows the danger: the bitwise exclusive or of a key and a message . With no tag seen, forging is a blind guess, but one observed pair gives and with it a valid tag for every message. Re-sending an observed pair does not count as a forgery; it is a replay, which the protocol must stop separately.
Related entries: Authentication coverage (§5.41), Replay attack (§1.26), Forgery probability (§5.13).