A comprehensive discussion and derivation of RSA cryptography, including the generalisation to multiple primes.