Source: https://moais.imag.fr/membres/jean-louis.roch/perso_html/COURS/Codes/documents/td2-RSA-enonce.pdf