Provable Security 10: Signatures, MACs, and Unforgeability
Provable security notes / X
Signatures, MACs, and unforgeability
Unforgeability bounds the success probability of producing authenticated outputs that satisfy the game's freshness rule.
Signature and MAC security is expressed as a forgery game. In the ordinary forgery game, winning requires a valid output on a message never submitted for authentication. The strong game also counts a new valid output on a previously authenticated message.
EUF-CMA
For a signature scheme
\[\Sigma=(\mathsf{KeyGen},\mathsf{Sign},\mathsf{Verify}),\]existential unforgeability under chosen-message attack gives the adversary signing-oracle access. After queries \(m_1,\ldots,m_q\), it outputs \((m^*,\sigma^*)\) and wins if
\[\mathsf{Verify}_{pk}(m^*,\sigma^*)=1 \quad\text{and}\quad m^*\notin\{m_1,\ldots,m_q\}.\]Strong unforgeability also treats a new signature on an old message as a forgery.
EUF-CMA game between \(\mathcal C\) and \(\mathcal A\)
- \(\mathcal C\) runs \((pk,sk)\leftarrow\mathsf{KeyGen}(1^\lambda)\) and sends \(pk\) to \(\mathcal A\).
- \(\mathcal A\) adaptively queries a signing oracle. On query \(m_i\), \(\mathcal C\) returns \(\sigma_i\leftarrow\mathsf{Sign}_{sk}(m_i)\) and records \(m_i\).
- After any number of allowed signing queries, \(\mathcal A\) outputs \((m^*,\sigma^*)\).
- \(\mathcal A\) wins if \(\mathsf{Verify}_{pk}(m^*,\sigma^*)=1\) and \(m^*\) was never submitted to the signing oracle.
For SUF-CMA, the final pair \((m^*,\sigma^*)\) must be new; a new valid signature on an old message also counts as a win.
Textbook RSA signatures
On the RSA message domain \(\mathbb Z_N^*\), textbook RSA signs by
\[\sigma=m^d\bmod N.\]If \(\sigma_1\) signs \(m_1\) and \(\sigma_2\) signs \(m_2\), then
\[(\sigma_1\sigma_2)^e\equiv m_1m_2\pmod N.\]If \(m_1m_2\bmod N\) was not queried, \(\sigma_1\sigma_2\bmod N\) is a forgery on that new message. There is also an attack requiring no signing queries: choose any \(\sigma\in\mathbb Z_N^*\) and set \(m=\sigma^e\bmod N\). The pair \((m,\sigma)\) verifies, and the message is new because the query list is empty. EUF-CMA permits the attacker to choose its forgery message, so this already breaks the definition.
How hash-and-sign supports a reduction
In RSA full-domain hash, \(H\) maps messages into \(\mathbb Z_N^*\) and signatures satisfy \(\sigma^e=H(m)\bmod N\). The direct multiplicative attack would now require a message \(m^*\) whose hash equals the product of selected hash values; multiplying signatures alone does not supply such a message.
On its first encounter with a non-target message, through either a hash query or a signing query, a random-oracle reduction samples \(\sigma\in\mathbb Z_N^*\) uniformly and sets \(H(m)=\sigma^e\bmod N\). Since RSA is a permutation, this hash value is uniform. The simulator stores the pair and returns the same hash value or signature on subsequent queries. At a selected target message it instead programs the RSA inversion challenge. A forgery on that message inverts the challenge; a signing query on it forces this simple simulator to abort.
The probability of selecting the forgery target and avoiding such an abort determines the query-dependent loss. If the forgery message has never been hashed or signed, its hash is still an independent uniform element of \(\mathbb Z_N^*\), so a proposed signature verifies with probability at most \(1/\vert \mathbb Z_N^*\vert\). This guessing case contributes a separate additive term.
MACs
A MAC has a secret key shared by sender and receiver:
\[\tau\leftarrow\mathsf{Tag}_K(m), \qquad \mathsf{Verify}_K(m,\tau)\in\{0,1\}.\]A MAC forgery game gives the adversary a tagging oracle under a hidden symmetric key. Unlike signature verification, MAC verification is not a public operation, so a game with verification-oracle access must grant it explicitly.
MAC unforgeability game
- \(\mathcal C\) samples \(K\leftarrow\mathsf{KeyGen}(1^\lambda)\).
- \(\mathcal A\) receives oracle access to \(O_{\mathsf{Tag}}(m)=\mathsf{Tag}_K(m)\). In the version shown here it also receives \(O_{\mathsf{Verify}}(m,\tau)=\mathsf{Verify}_K(m,\tau)\).
- \(\mathcal C\) records every message submitted to the tag oracle.
- \(\mathcal A\) outputs \((m^*,\tau^*)\).
- \(\mathcal A\) wins if \(\mathsf{Verify}_K(m^*,\tau^*)=1\) and \(m^*\) was not previously tagged.
In this game the verification oracle answers all submitted pairs, and the final output determines whether the adversary wins. An online-forgery variant instead declares success as soon as a verification query accepts a message not yet submitted to the tagging oracle. Its bound counts every such verification attempt.
Tag length and verification queries
For an ideal deterministic MAC whose tags on distinct messages are independent uniform \(t\)-bit strings, \(q_v\) online guesses on untagged messages satisfy
\[\Pr[\mathsf{forge}]\le q_v2^{-t}.\]To see the bound, follow the adversary’s execution along the path where all guesses on untagged messages fail. If it makes \(r_m\) guesses for message \(m\) before obtaining its tag, a uniform hidden tag matches one of those guesses with probability at most \(r_m2^{-t}\). Summing over messages and using \(\sum_m r_m\le q_v\) gives the bound. A PRF-based MAC adds the corresponding PRF distinguishing term. The final-output game above counts a final verification as one additional attempt.
What to check
An authentication claim fixes what counts as new and which signing, tagging, or verification queries are allowed. A protocol also specifies an unambiguous encoding of the authenticated message and its context. Implementations protect secret-dependent operations, including signing and comparison against a computed MAC tag; ordinary signature verification operates on public inputs and has a different leakage profile.
