🌑

Explore / Study / Computer Science / Cryptography 933 words | 5 minutes

§12 RSA Problem

  1. The Factoring Experiment Factor⁡A,GenModulus(n)\operatorname{Factor}_{\mathscr{A}, GenModulus}(n)FactorA,GenModulus​(n)
  2. The Factoring Assumption
  3. The RSA problem
  4. GenRSAGenRSAGenRSA
  5. The RSA Experiment RSA-inv⁡A,GenRSA(n)\operatorname{RSA-inv}_{\mathscr{A}, GenRSA}(n)RSA-invA,GenRSA​(n)
  6. The RSA Assumption
  7. Algorithm GenRSAGenRSAGenRSA
  8. Recall: Extended Euclidean Algorithm eGCD

The Factoring Experiment FactorA,GenModulus(n)\operatorname{Factor}_{\mathscr{A}, GenModulus}(n)

  • Let GenModulusGenModulus be a polynomial-time algorithm that, on input 1n1^n, outputs (N,p,q)(N, p, q) where N=pqN = pq, and p,qp, q are nn-bit primes except with probability negligible in nn.
  • The Factoring Experiment FactorA,GenModulus(n)\operatorname{Factor}_{\mathscr{A}, GenModulus}(n):
    1. Run GenModulus(1n)GenModulus(1^n) to obtain (N,p,q)(N, p, q).
    2. A\mathscr A is given N, and outputs p,q>1p' , q' > 1.
    3. A\mathscr A succeeds and the output of the experiment is defined to be 11 if pq=Np' \cdot q' = N, and 00 otherwise.

The Factoring Assumption

  • Definition. Factoring is hard relative to GenModulusGenModulus if for all probabilistic polynomial-time algorithms A\mathscr A there exists a negligible function ϵ\epsilon such that

    Pr[FactorA,GenModulus(n)=1]ϵ(n)\Pr[\operatorname{Factor}_{\mathscr{A}, GenModulus}(n) = 1] \le \epsilon(n)

  • The Factoring Assumption is the assumption that there exists a GenModulusGenModulus relative to which factoring is hard.

The RSA problem

  • Corollary 2 of Fermat’s Little Theorem for ZN\mathbb{Z}^*_N: Fix N>1N > 1. For integer e>0e > 0, define the function, fe:ZNZNf_e : \mathbb{Z}^*_N \rightarrow \mathbb{Z}^*_N by fe(x)=[xemodN]f_e(x) = [x^e \bmod N].
    1. If gcd(e,ϕ(N))=1\gcd(e, \phi(N)) = 1, then fef_e is a permutation, i.e., a bijection.
    2. Moreover, if d=e1d = e^{-1} mod ϕ(N)\phi(N), then fdf_d is the inverse of fef_e.
  • The RSA Problem is: Given N,e,yN, e, y, compute [ye1modN][y^{e^{-1}} \bmod N].

GenRSAGenRSA

  • Let GenRSAGenRSA be a probabilistic polynomial-time algorithm that on input 1n1^n, outputs a modulus NN that is the product of two nn-bit primes p,qp, q, as well as integers e,d>0e, d > 0 with gcd(e,ϕ(N))=1\gcd (e, \phi(N)) = 1 and ed=1modϕ(N)ed = 1 \bmod \phi(N).
    • Such a dd exists since ee is invertible modulo ϕ(N)\phi(N).
    • The algorithm may fail with probability negligible in nn.

The RSA Experiment RSA-invA,GenRSA(n)\operatorname{RSA-inv}_{\mathscr{A}, GenRSA}(n)

  • The RSA Experiment RSA-invA,GenRSA(n)\operatorname{RSA-inv}_{\mathscr{A}, GenRSA}(n):
    1. Run GenRSA(1n)GenRSA(1^n) to obtain (N,e,d)(N, e, d).
    2. Choose a uniform yZNy \in \mathbb{Z}^*_N.
    3. A\mathscr A is given N,e,yN, e, y and outputs xZNx \in \mathbb{Z}^*_N.
    4. A\mathscr A succeeds and the output of the experiment is defined to be 11 if xe=ymodNx^e = y \bmod N, and 00 otherwise.

The RSA Assumption

  • Definition. The RSA problem is hard relative to GenRSAGenRSA if for all probabilistic polynomial-time algorithms A\mathscr A, there exists a negligible function ϵ\epsilon such that

    Pr[RSA-invA,GenRSA(n)=1]ϵ(n)\Pr[\operatorname{RSA-inv}_{\mathscr{A}, GenRSA}(n) = 1] \le \epsilon(n)

  • The RSA Assumption is the assumption that there exists a GenRSAGenRSA algorithm relative to which the RSA problem is hard.

Algorithm GenRSAGenRSA

  • Algorithm GenRSAGenRSA. Input: Security parameter 1n1^n. Output: (N,e,d)(N, e, d).
    1. Run GenModulus(1n)GenModulus(1^n) to obtain (N,p,q)(N, p, q).
    2. Compute ϕ(N)=(p1)(q1)\phi(N) = (p - 1)(q - 1).
    3. Choose e>1e > 1, such that gcd(e,ϕ(N))=1\gcd(e, \phi(N)) = 1.
    4. Compute d:=[e1modϕ(N)]d := [e^{-1} \bmod \phi(N)]. Return (N,e,d)(N, e, d).

Recall: Extended Euclidean Algorithm eGCD

  • Extended Euclidean Algorithm eGCD:

    • Input: Integers a,ba, b with ab>0a ≥ b > 0.

    • Output: (d,X,Y)(d, X, Y) with d=gcd(a,b)d = \gcd(a, b) and Xa+Yb=dXa + Yb = d.

    • If bb divides aa return (b,0,1)(b,0,1);

    • Else compute integers q,rq, r with a=qb+ra = qb + r and 0<r<b0 < r < b,

      Set (d,X,Y):=eGCD(b,r)(d, X, Y) := \operatorname{eGCD}(b, r) (note that Xb+Yr=dXb+Yr=d),

      Return (d,Y,XYq)(d, Y, X - Yq).

  • The Extended Euclidean algorithm gives [Xmodb][X \bmod b] as the multiplicative inverse of amodba \bmod b, and [Ymoda][Y \bmod a] as the multiplicative inverse of bmodab \bmod a when gcd(a,b)=1\gcd(a, b) = 1.

— Mar 17, 2023

Creative Commons License
§12 RSA Problem by Lu Meng is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Permissions beyond the scope of this license may be available at About.