Attacks on RSA signatures without a full-domain hash #
Without a full-domain hash, RSA signatures are forgeable ([BS23], Sections 13.3 and
13.6). Three forgers win Attack Game 13.1 (Signature.Scheme.eufCmaExperiment), each with an
exact success law and a bound on its signing queries:
- p. 536: against unhashed RSA signatures,
unhashedRSAExistentialForgerpicksσand outputs the messageσ ^ e % Nwith the signatureσ. It makes no query and wins with probability1. - p. 537, equation (13.4):
unhashedRSAUniversalForgersigns any chosen messagemwith one query, by blinding: it asks for the signature onm * r ^ e % Nand divides it byr. With the factorN - 1it wins with probability1on every message, for every key. For a unitmand any sampler of units it wins exactly whenr ≢ 1moduloN; with the book's uniform unit it loses with probability exactly1 / φ(N). - p. 547, equation (13.9):
rsaMultiplicativeForgerasks for the signatures onm₁andm₂and outputs their product as a signature onm₃, whenH m₃ ≡ H m₁ * H m₂moduloN.
The forgers carry query bounds, and the blinding and unblinding maps are certified polynomial
time (computableInPolyTime_rsaBlind, for a positive modulus, and
computableInPolyTime_rsaUnblind). No forger is certified as a polynomial-time program: the game
here is typed, the library has no polynomial-time predicate for typed oracle adversaries yet
(#4894), and the word-coded form of the forgers is not in this module.
Where the book is silent:
- Equation (13.4) holds for every unit
r. Forr ≡ 1the signing query ismitself, so the output is a valid signature that Attack Game 13.1 does not count; the book does not mention this case. With the book's uniform unit the forger loses on a message that is a unit with probability exactly1 / φ(N). - The book assumes that
mis a unit and leaves the other case to the reader. Here the forger signs a non-unit itself withrsaNonUnitRoot, with no query; blinding does not work there. - The book says "three messages" for (13.9) and does not state
m₃ ≠ m₁andm₃ ≠ m₂. The game needs both; they follow from (13.9) when both digests are at least2. The product in (13.9) is over the integers; only the congruence moduloNis used.
The attack of p. 536 is stated there for any trapdoor permutation scheme; here it is stated for RSA, as p. 537 restates it.
Main definitions #
Cslib.Crypto.rsaBlind,Cslib.Crypto.rsaUnblind: blinding a message and unblinding its signature.Cslib.Crypto.unhashedRSAExistentialForger,Cslib.Crypto.unhashedRSAUniversalForger,Cslib.Crypto.rsaMultiplicativeForger: the forgers of pp. 536, 537 and 547.
Main results #
Cslib.Crypto.rsaEval_rsaUnblind: equation (13.4).Cslib.Crypto.eval_eufCmaExperiment_unhashedRSAExistentialForger: forgery without a query.Cslib.Crypto.eval_eufCmaExperiment_unhashedRSAUniversalForger_sub_one: unhashed RSA signatures are universally forgeable with one query.Cslib.Crypto.eval_eufCmaExperiment_unhashedRSAUniversalForger,Cslib.Crypto.eval_eufCmaExperiment_unhashedRSAUniversalForger_uniform,Cslib.Crypto.eval_eufCmaExperiment_unhashedRSAUniversalForger_of_not_coprime: the law of the universal forger for a sampler of units, for the uniform unit, and on a non-unit.Cslib.Crypto.eval_eufCmaExperiment_rsaMultiplicativeForger: forgery from (13.9).
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Section 13.3, pp. 536–537, and Section 13.6, p. 547.
Blinding #
The blinded message m * r ^ e % N of the attack on unhashed RSA signatures.
Unblinding: σ * r⁻¹ % N, with the inverse of r modulo N computed by BinaryGcd.modInv.
Existential forgery without a query (p. 536) #
The forger of [BS23], p. 536, against unhashed RSA signatures: pick σ and output
the message σ ^ e % N with the signature σ. It makes no signing query.
The forger of p. 536 wins Attack Game 13.1 against unhashed RSA signatures with
probability 1, for every key and every way of picking σ.
Universal forgery with one query (p. 537, equation (13.4)) #
The forger of [BS23], p. 537, against unhashed RSA signatures. To sign a unit m,
it picks r, asks for the signature σ' on the blinded message m * r ^ e % N and outputs
σ' / r: one signing query. A message that is not a unit it signs itself, with
rsaNonUnitRoot; this is the case the book leaves to the reader.
Universal forgery of unhashed RSA signatures ([BS23], p. 537, equation (13.4)):
on a unit m, when every r that pick returns is a unit modulo N, the forger's output always
verifies, and the blinded message differs from m unless r = 1 modulo N: the forger wins
Attack Game 13.1 exactly when pick returns some r ≠ 1 modulo N.
On a message that is not a unit modulo N, the forger of p. 537 makes no query and wins
Attack Game 13.1 with probability 1.
Universal forgery with a uniform blinding factor ([BS23], p. 537): on a message
that is a unit modulo N, the forger that draws r uniformly from the units loses Attack
Game 13.1 exactly when r = 1, so with probability 1 / φ(N).
Unhashed RSA signatures are universally forgeable ([BS23], p. 537): with the
blinding factor N - 1, the forger wins Attack Game 13.1 with probability 1, for every key and
every message. It makes at most one signing query (isQueryBounded_unhashedRSAUniversalForger),
and it is not certified as a polynomial-time program.
Multiplicative forgery with two queries (p. 547, equation (13.9)) #
The forger of [BS23], p. 547: ask for the signatures on m₁ and m₂ and output
their product modulo N as a signature on m₃. It makes two signing queries.
Multiplicative forgery ([BS23], equation (13.9)): if the digest of m₃ is the
product of the digests of m₁ and m₂ modulo N and m₃ is neither of them, the forger wins
Attack Game 13.1 against rsaSignature desc H with probability 1.
Efficiency of the forgers' arithmetic #
Blinding is computable in polynomial time whenever N, e, m and r are, and
0 < N a. This certifies the map, not a forger.
Unblinding is computable in polynomial time whenever N, r and σ are. This certifies
the map, not a forger.