Source: https://www.sismondi.ch/disciplines/applications-des-mathematiques/cours-eleves/a10_partie-02_cryptographie_th-exo-corr_21-22.pdf