The RSA trapdoor permutation #
The RSA trapdoor permutation family over products N = p * q of distinct primes:
key parameters (RSADesc and RSAPublicKey), modular exponentiation evaluation rsaEval and
trapdoor inversion rsaInvert, correctness of inversion on all x < N, bijectivity on
Fin N and (ZMod N)ˣ, polynomial-time computability of both evaluation and trapdoor inversion,
and the computational RSA inversion game and assumption.
Main definitions #
Cslib.Crypto.RSAPublicKey,Cslib.Crypto.RSADesc: public(N, e)and full trapdoor(p, q, e, d)RSA parameters.Cslib.Crypto.rsaEval,Cslib.Crypto.rsaInvert: RSA evaluationx ^ e % Nand trapdoor inversiony ^ d % N;Cslib.Crypto.RSAPublicKey.evalis evaluation on residuesFin N.Cslib.Crypto.RSAInput,Cslib.Crypto.encRSAInput: the input of an RSA inverter and its encoding.Cslib.Crypto.RSAInverter,Cslib.Crypto.RSAInverter.IsPPT,Cslib.Crypto.rsaInversionGame,Cslib.Crypto.RSAOneWay: the RSA inversion experiment and one-wayness assumption.
Main results #
Cslib.Crypto.rsaInvert_rsaEval,Cslib.Crypto.rsaEval_rsaInvert:rsaInvert N dandrsaEval N eare mutual inverses on{x // x < N}.Cslib.Crypto.rsaEval_bijective_fin,Cslib.Crypto.rsaEval_bijective_units: RSA evaluation is bijective onFin Nand(ZMod N)ˣ.Cslib.Crypto.computableInPolyTime_rsaEval,Cslib.Crypto.computableInPolyTime_rsaInvert: both evaluation and trapdoor inversion are computable in polynomial time.Cslib.Crypto.rsaOneWay_iff_encoded:RSAOneWayis the word-level RSA assumption.
Implementation notes #
The evaluation and trapdoor-inversion functions rsaEval and rsaInvert are defined on
arbitrary natural numbers and proved mutually inverse on all residues x < N
(rsaInvert_rsaEval, rsaEval_rsaInvert), inducing bijections both on Fin N
(rsaEval_bijective_fin, including nonunits) and on the multiplicative unit group (ZMod N)ˣ
(rsaEval_bijective_units). The inversion experiment rsaInversionGame runs
Cslib.Crypto.inversionExperiment on x drawn uniformly from Fin N (differing from
Katz–Lindell Definition 9.46, which samples uniformly from (ZMod N)ˣ; for valid RSA moduli
N = p * q, the nonunit fraction in Fin N is at most (p + q) / N) under an arbitrary
generator family RSAGen := ℕ → PMF RSADesc (efficient key generation and bit-length bounds in
n are not bundled).
An RSAInverter receives the public key and a challenge residue y : Fin N and returns a
residue. RSAInverter.IsPPT asks for one uniform strict PPT machine that reads encRSAInput, the
unary security parameter followed by N, e and y in binary, and writes the returned residue
in binary. Since RSA evaluation is a bijection on Fin N, accepting any preimage is the same as
recovering the challenge (rsaInversionGame_eq). rsaOneWay_iff_encoded shows that RSAOneWay
is the assumption over word-level inverters that read the same layout on keys with 0 < N and may
output any natural number: a word-level answer is reduced modulo N, and a typed inverter extends
to all words (IsPPTOn.exists_extension).
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Section 10.3, Attack Game 10.3 and Definition 10.5 (pp. 404–405).
- J. Katz, Y. Lindell, Introduction to Modern Cryptography, Section 9.2.4, Definition 9.46 (The RSA Assumption) and Section 15.1.1, Definition 15.1 (Trapdoor Permutations; RSA example on p. 526).
The encoding of an RSA public key: N and e in binary, N framed
(encRSAPublicKey_apply).
The tuple of the fields of encRSAPublicKey.
The encoding of a residue modulo N by its value in binary.
Euler's totient φ(N) = (p - 1) * (q - 1).
The RSA modulus is positive.
The RSA modulus is strictly greater than 1.
The totient (p - 1) * (q - 1) is strictly greater than 1.
The public exponent is positive, since 0 is not coprime to φ(N) > 1.
The public key (N, e).
RSA evaluation x ↦ x ^ e is a bijection on (ZMod N)ˣ.
RSA evaluation x ↦ x ^ e % N is computable in polynomial time whenever N, e, and x are
computable in polynomial time and 0 < N a.
RSA trapdoor inversion y ↦ y ^ d % N is computable in polynomial time whenever N, d, and
y are computable in polynomial time and 0 < N a.
The RSA assumption #
An RSA parameter generator indexed by the security parameter n.
The tuple of the fields of encRSAInput.
The encoding of an RSA inverter's input: the unary security parameter, the public key and the
challenge in binary, each framed except the last (encRSAInput_apply).
The challenge of a computed RSA input, as a binary natural number.
An RSA inverter: given the security parameter, a public key (N, e) and a residue modulo N,
it outputs a residue modulo N. RSAInverter.IsPPT states its efficiency on encodings.
An RSA inverter is PPT when one uniform strict PPT machine reads encRSAInput and writes the
returned residue in binary.
The RSA inversion experiment: sample desc ← gen n and run
Cslib.Crypto.inversionExperiment for RSA evaluation on a uniform residue x modulo N. 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 rsaInversionGame exactly when
it recovers the challenge.
RSAOneWay is the word-level RSA assumption. Quantifying over inverters that read
(1ⁿ, (N, e), y) with binary numbers on keys with 0 < N, each with one uniform strict PPT
machine, and may answer with any natural number gives the same assumption as quantifying over typed
inverters. A word-level answer is reduced modulo N, which can only help; conversely, a typed
inverter extends to all words by rerunning its machine and decoding its output
(IsPPTOn.exists_extension).