Errata: 8 Oct 2002 - not "e and d are congruent mod phi(n)", but "ed is congruent mod phi(n)". Errata: 4 Oct 2002 - ed was incorrectly listed in one instance as congruent to 1 mod n. ed is congruent to 1 mod phi(n). ------------------------------------- Lecture notes on RSA and the totient function Jason Holt 3 October 2002 BYU Internet Security Research Lab This document is in the public domain ------------------------------------- RSA takes advantage of Euler's generalization of Fermat's Little Theorem, namely: phi(n) a is congruent to 1 (mod n) Euler's totient function, phi(n) is defined as follows, where p0..pk are the prime factors of n: e0 e1 en Given n = p0 * p1 ... * pn e0-1 e1-1 en-1 phi(n) = (p0-1)*p0 * (p1-1)*p1 ... * (pn-1)*pn For example: 5 4 90720 = 2 * 3 * 5 * 7 4 3 phi(90720) = (2-1)*2 * (3-1)*3 * (5-1) * (7-1) = 20736 The totient function describes the number of values