RSA with a uniform unit preimage #
[BS23], §10.6.2, p. 416, modifies the RSA attack game (Attack Game 10.3) so that the
challenger draws the preimage x uniformly from the units ℤₙ* and keeps everything else the
same; uRSAadv[A, ℓ, e] is the adversary's advantage there. Theorem 10.5 says that an elementary
wrapper B around A has uRSAadv[A, ℓ, e] ≤ RSAadv[B, ℓ, e], so the RSA assumption implies
this variant. The wrapper hands a unit challenge to A and computes an e-th root of any other
challenge itself: 0 for 0, and otherwise y ^ d after factoring n with gcd(y, n).
Main definitions #
Cslib.Crypto.RSADesc.unitResidue: a unit moduloNas a residue inFin N.Cslib.Crypto.rsaUnitInversionGame,Cslib.Crypto.RSAUnitOneWay: the inversion experiment with a uniform unit preimage and its assumption.Cslib.Crypto.rsaNonUnitRoot: thee-th root of a challenge that is not a unit, computed fromNande.Cslib.Crypto.unitRSAToRSA: the wrapperBof Theorem 10.5.
Main results #
Cslib.Crypto.coprime_rsaEval_iff: RSA evaluation maps units to units and non-units to non-units.Cslib.Crypto.rsaNonUnitRoot_rsaEval:rsaNonUnitRootinverts RSA evaluation on every residue that is not a unit.Cslib.Crypto.computableInPolyTime_rsaNonUnitRoot,Cslib.Crypto.isPPT_unitRSAToRSA: the root and the wrapper are computable in polynomial time.Cslib.Crypto.succProbability_rsaUnitInversionGame_le: Theorem 10.5, at every security parameter and for every key generator.Cslib.Crypto.RSAOneWay.rsaUnitOneWay:RSAOneWay genimpliesRSAUnitOneWay gen.
Implementation notes #
The book states Theorem 10.5 for ℓ > 2 and odd e > 2, the parameters of its key generator
RSAGen(ℓ, e). Here keys come from any law on RSADesc, and the theorem has no hypothesis on it:
the proof uses only that N = p * q for distinct primes p and q and that e * d ≡ 1 modulo
(p - 1) * (q - 1), so p = 2 and e = 1 are allowed. The challenge x ^ e % N is given to
the inverter as a residue in Fin N, as in rsaInversionGame, and the inverter wins when it
returns x; the two games differ only in the law of x. The bound compares success
probabilities at each security parameter. Exercises 10.25–10.26 (§10.11, p. 431), the converse
with statistical distance strictly less than 4 / 2 ^ ℓ and additive security loss 4 / 2 ^ ℓ
(2 ^ -(ℓ - 2) for ℓ ≥ 2), are formalized in
CslibFrontier.Crypto.Computational.RSAUnitInversion.Converse.
The wrapper finds the exponent as the book's proof describes. For a challenge y ≠ 0 that is not
a unit, g = gcd(y, N) is p or q, so (g - 1) * (N / g - 1) is (p - 1) * (q - 1) and its
modular inverse d' of e is a decryption exponent (rsaNonUnitRoot_rsaEval).
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, §10.6.2, Theorem 10.5, p. 416.
The RSA inversion experiment with a uniform unit preimage ([BS23], §10.6.2,
p. 416): sample desc ← gen n, draw x uniformly from (ZMod N)ˣ, and run
Cslib.Crypto.inversionExperiment on its residue. The inverter receives (pk, x ^ e % N) and
wins when it returns a preimage.
RSA evaluation is a bijection on Fin N, so an inverter wins rsaUnitInversionGame exactly
when it recovers the residue of the challenge unit.
The RSA assumption with a uniform unit preimage for gen ([BS23], §10.6.2, p. 416,
the variant of Attack Game 10.3 that draws x from ℤₙ*, read with Definition 10.5, p. 405):
every PPT inverter recovers a uniform unit from its RSA image with negligible probability. Keys
come from any law on RSADesc (RSAGen), which need not be efficiently samplable, in place of
Boneh–Shoup's RSAGen(ℓ, e). It follows from RSAOneWay (RSAOneWay.rsaUnitOneWay, Theorem
10.5).
An e-th root modulo N of a challenge y that is not a unit, computed from N and e
alone as in the proof of Theorem 10.5 ([BS23], p. 416): 0 for y = 0, and otherwise
y ^ d' % N, where g = gcd(y, N) and d' is the inverse of e modulo
(g - 1) * (N / g - 1).
On a residue y < N that is not coprime to N, rsaNonUnitRoot is trapdoor inversion: the
e-th root that rsaInvert N d computes with the private exponent is computed from N and e
alone.
rsaNonUnitRoot is computable in polynomial time whenever N, e and y are, and
0 < N a.
The wrapper B of Theorem 10.5 ([BS23], p. 416): on a challenge y coprime to
N, run A; on any other challenge, return rsaNonUnitRoot N e y.
unitRSAToRSA A is a PPT RSAInverter whenever A is.
Theorem 10.5 ([BS23], §10.6.2, p. 416): the success probability of A with a
uniform unit preimage is at most the success probability of unitRSAToRSA A in
rsaInversionGame, at every security parameter and for every key generator. On a unit challenge
the wrapper runs A, and on any other challenge it always wins. The book assumes ℓ > 2 and odd
e > 2; here there is no condition on the key law, so p = 2 and e = 1 are allowed.
The RSA assumption implies its unit-preimage variant ([BS23], §10.6.2, p. 416, after Theorem 10.5), for every key generator.