Source: http://exo7.emath.fr/cours/ch_crypto.pdf