Explore / Study / Computer Science / Cryptography 407 words | 2 minutes

§16 RSA Encryption

  1. Plain/Textbook RSA Encryption Scheme
  2. Attacks on Plain RSA for Longer Messages (Coppersmith)
  3. Padded RSA Encryption Scheme

Plain/Textbook RSA Encryption Scheme

  1. GenGen: On input 1n1^n, Run GenRSA(1n)GenRSA(1^n) to obtain (N,e,d)(N, e, d).

    The public key is ⟨N,e⟩\langle N, e\rangle, and the private key is ⟨N,d⟩\langle N, d\rangle.

  2. EncEnc: Given inputs pk=⟨N,e⟩pk = \langle N, e\rangle, and m∈ZN∗m \in \mathbb{Z}^*_N,

    Output the ciphertext c:=[me mod N]c := [m^e \bmod N].

  3. DecDec: Given inputs sk=⟨N,d⟩sk = \langle N, d\rangle, and ciphertext c∈ZN∗c \in \mathbb{Z}^*_N,

    Output the message as m^:=[cd mod N]\hat{m} := [c^d \bmod N].

Attacks on Plain RSA for Longer Messages (Coppersmith)

  • Theorem (Coppersmith). Let p(x)p(x) be a polynomial of degree ee. Then in time poly(∥N∥,e)poly(\|N\|, e), one can find all mm such that p(m)=0 mod Np(m) = 0 \bmod N and ∣m∣≤N1/e|m| \le N^{1/e}.

Padded RSA Encryption Scheme

  1. GenGen: On input 1n1^n, Run GenRSA(1n)GenRSA(1^n) to obtain (N,e,d)(N, e, d).

    The public key is ⟨N,e⟩\langle N, e\rangle, and the private key is ⟨N,d⟩\langle N, d\rangle.

  2. EncEnc: On inputs pk=⟨N,e⟩pk = \langle N, e\rangle, and m∈{0,1}∥N∥−l(n)−2m \in \{0,1\}^{\| N\| -l(n)-2}, where l(n)≤2n−4l(n) \le 2n - 4, choose uniform string r∈{0,1}l(n)r \in \{0,1\}^{l(n)}, and interpret m^:=r∥m\hat{m} := r\|m as an element of ZN∗\mathbb{Z}^*_N.

    Output the ciphertext c:=[m^e mod N]c := [\hat{m}^e \bmod N].

  3. DecDec: On inputs sk=⟨N,d⟩sk = \langle N, d\rangle, and ciphertext c∈ZN∗c \in \mathbb{Z}^*_N, compute m^:=[cd mod N]\hat{m} := [c^d \bmod N] ,

    Output the ∥N∥−l(n)−2\| N\| -l(n)-2 least significant bits of m^\hat{m}.

— Mar 31, 2023

Creative Commons License
§16 RSA Encryption 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.