Definition
Forgery probability is the probability that an attacker without the secret key gets a receiver to accept a message that no key holder authenticated. The term applies to a message authentication code §5.7 (MAC), which computes a short tag from a secret key and a message, and to a digital signature §5.14, computed with a private key and checked with a public key. The number depends on the attack assumed: how many genuine tags or signatures the attacker obtains, how many forged attempts the receiver checks, and the attacker’s computing power.
Where it fits
Main entry: Message authentication code (MAC) (§5.7).
The Message authentication code entry defines a forgery through the chosen-message attack: the attacker may obtain the genuine tag of any message it chooses, and wins if the receiver accepts a tag for a message the attacker never asked about. A genuine message sent again, a replay attack §1.26, is therefore not a forgery. That entry derives the bound for ideal tags, which look like independent random values to anyone without the key; is the number of tag bits compared and the number of forged attempts checked under one key. For a real MAC it adds a term that includes the chance of finding the key. Tag truncation §5.12, keeping only part of the tag, lowers .
A digital signature is checked with a public key, so an attacker tests candidate signatures on its own computer, unseen and uncounted. Its forgery probability is limited by the attacker’s computation and the difficulty of the scheme’s mathematical problem, not by a count of attempts.
Questions answered
When is q/2^t a useful approximation for guessing a t-bit tag?
For guessed attempts against a tag of bits, is a useful approximation of the chance that at least one attempt is accepted when guessing is the attacker’s best attack and is small compared with . A tag is the short value that a MAC (message authentication code) computes from a secret key and a message; counts the forged message-and-tag pairs that the receiver checks under one key. Four conditions must hold.
The key is out of reach. A key derived from a six-digit code has only possible values, fewer than ; with one genuine message and tag, an attacker tries them all offline and then forges at will, whatever is.
Tags look random. Without the key, the tags of different messages must behave like independent, uniformly random -bit values, as the outputs of a pseudorandom function §15.1 (a keyed function whose outputs look random without the key) do.
The receiver checks and counts every guess. must include every failed check with the key, on every device that shares it, with a count that survives a restart. All bits must be checked with a constant-time comparison §4.33, one whose running time does not depend on where the first difference is. A comparison that stops at the first wrong byte reveals through its timing how many leading bytes were right, so a 16-byte tag falls one byte at a time in at most guesses, plus timing repetitions, instead of up to .
is much smaller than . For different guesses at one message, is exact. For guesses at different messages the true chance is , which exceeds by less than 5% of its own value when . Near the expression is a poor approximation for guesses at different messages: and give 1, while guesses at 256 different messages succeed with probability .
For example, a 32-bit tag with at most failed checks per key gives , about one in a million. NIST Special Publication 800-107 uses this example for HMAC §5.8 (hash-based message authentication code) [310].
The expression does not describe an attacker who need not guess: one who holds or can compute the key, replaces the key that the receiver trusts, learns the tag through a side channel §1.29 such as timing or power use, or reaches code that acts without verifying. Nor does it apply to digital signatures, whose guesses are checked offline with the public key.
Related entries: Tag truncation (§5.12), Entropy and min-entropy (§5.26), Message authentication code (MAC) (§5.7), Digital signature (§5.14), Constant-time comparison (§4.33), Side channel (§1.29), Pseudorandom function (PRF) (§15.1), Union bound (§15.42). Further reading: [66, 310].