🌑

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,epk = \langle N, e\rangle, and mZNm \in \mathbb{Z}^*_N,

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

  3. DecDec: Given inputs sk=N,dsk = \langle N, d\rangle, and ciphertext cZNc \in \mathbb{Z}^*_N,

    Output the message as m^:=[cdmodN]\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)=0modNp(m) = 0 \bmod N and mN1/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,epk = \langle N, e\rangle, and m{0,1}Nl(n)2m \in \{0,1\}^{\| N\| -l(n)-2}, where l(n)2n4l(n) \le 2n - 4, choose uniform string r{0,1}l(n)r \in \{0,1\}^{l(n)}, and interpret m^:=rm\hat{m} := r\|m as an element of ZN\mathbb{Z}^*_N.

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

  3. DecDec: On inputs sk=N,dsk = \langle N, d\rangle, and ciphertext cZNc \in \mathbb{Z}^*_N, compute m^:=[cdmodN]\hat{m} := [c^d \bmod N] ,

    Output the Nl(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.