Source: https://www.imo.universite-paris-saclay.fr/~daniel.perrin/interdisciplines/Cours6cryptographie.pdf