Step through the RSA algorithm: choose two primes, compute n and ฯ(n), find public exponent e and private exponent d, then encrypt and decrypt a message with the resulting keypair.
RSA security relies on the difficulty of factoring large numbers. Given n = pยทq, computing ฯ(n) = (pโ1)(qโ1) is easy if p and q are known, but practically impossible if only n is given. The extended Euclidean algorithm computes d = eโปยน mod ฯ(n).
Choose two primes p and q. The system computes n, ฯ(n), public key e, and private key d. Enter a message to encrypt with the public key and decrypt with the private key. See each modular exponentiation step.
RSA was published in 1977 by Rivest, Shamir and Adleman. The same algorithm was independently discovered in 1973 by Clifford Cocks at GCHQ but remained classified until 1997. Modern RSA uses 2048+ bit keys.