Forgery experiments #
A forgery experiment draws a key pair, runs a forger with access to a signing oracle and accepts
when the forger's candidate (m, σ) verifies and is fresh. Signatures and MACs differ only in
the parameters: a MAC has no public key (PK = Unit) and verifies with the secret key.
The signing oracle is a policy over the history of answered queries (Signer). Each policy either
signs the next query or refuses it; a refused query is answered with default and is not recorded,
as in ProbOracleComp.runLogWith. Full, one-time, indexed and counter signing oracles are policies,
so the experiment is written once (forgeExperiment). Signer.restrict refuses the queries outside
a message space, which is how a word-level game keeps signing queries in the source's message
space. Freshness is a parameter too: freshMessage
asks for a message that was never signed (existential unforgeability) and freshPair for a pair
that was never answered (strong unforgeability). The evaluation law eval_forgeExperiment_eq
writes the experiment's law as an event of the logged run.
Main definitions #
Cslib.Crypto.Signer: a signing policy over the log of answered queries, withSigner.ofSign,Signer.restrict,Signer.oneTime,Signer.indexedandSigner.counter.Cslib.Crypto.forgeExperiment: the forgery experiment for a key generator, signing policy, verifier and freshness test.Cslib.Crypto.oneTimeForgeExperiment: the fresh-pair game with one signing response.Cslib.Crypto.freshMessage,Cslib.Crypto.freshPair: the existential and strong freshness tests.
Main results #
Cslib.Crypto.succProbability_forgeExperiment_mono: a weaker freshness test does not decrease the success probability. In particular a forger succeeds at least as often in the strong experiment as in the existential one (succProbability_forgeExperiment_freshMessage_le), so strong unforgeability implies existential unforgeability.Cslib.Crypto.forgeExperiment_freshPair_eq_freshMessage_of_unique,Cslib.Crypto.forgeExperiment_freshPair_eq_freshMessage: when every valid pair(m, σ)agrees with every answer the policy can produce onm(in particular, when every policy signature verifies and valid signatures are unique), strong and existential forgery are the same experiment.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Attack Games 6.1 and 13.1, and Section 13.1.1 (strong unforgeability).
A signing policy: given the secret key, the log of answered queries (in the order answered)
and the next query, either the program that signs it or none to refuse it.
The policy that signs every query with sign.
The restriction of s to the queries accepted by adm: answer an admissible query as s
does and refuse every other one. A refused query is answered with default and is not logged, so
under oneTime or counter it uses up no answer and no counter value.
The one-time restriction of s: answer the first query as s does, refuse every later
one.
The forgery experiment ([BS23], Attack Games 6.1 and 13.1): draw (pk, sk) from
keyGen, run the forger on pk against the signing oracle of the policy signer at sk, and
accept its candidate (m, σ) when verify pk sk m σ holds and fresh m σ log holds for the log
of answered queries.
Existential freshness: the message m was never signed.
Strong freshness: the pair (m, σ) was never an answer of the signing oracle.
The fresh-pair MAC experiment with one signing response ([BS23], Attack Game 6.1 restricted as in Section 7.6). The forger chooses its query and saves private state, then receives the tag before producing its candidate. This works for probabilistic programs and their distribution semantics.
A message that was never signed is not part of any answered pair.
The law of the forgery experiment, as an event of the logged run.
Freshness is monotone: replacing the freshness test by a weaker one does not decrease the success probability of any forger.
Strong unforgeability implies existential unforgeability: a forger succeeds at least as often in the strong experiment as in the existential one.
Unique oracle answers on valid messages: when every valid pair (m, σ) under a supported
key pair agrees with every answer σ' that signer can produce on m, strong and existential
forgery are the same experiment (even when signer also answers queries outside the domain of
verify).
Unique signatures: when every signature that the policy produces verifies and each message has at most one valid signature, a strong forgery is an existential one, so the two experiments coincide.