RSA is an asymmetric encryption algorithm developed by Ron Rivest, Adi Shamir, and Leonard Adleman. It uses prime numbers to generate the public and private keys. To do this, Alice and Bob each choose two large prime numbers, p and q, and multiply them to get n. For example, Alice chooses p = 17 and q = 23, resulting in n = 391. Alice and Bob then calculate phi, which is the product of p-1 and q-1. In this example, Alice calculates phi = (17-1) x (23-1) = 352. Next, they each choose a number called e, smaller than phi and coprime with it. For example, Alice chooses e = 5. Lastly, they calculate d which is the inverse of e modulo phi. This means that d x e divided by phi has a remainder of 1. In this example, Alice calculates d = 141. Finally, they use n and e as their public key and n and d as their private key. For example, Alice's public key is (391, 5) and her private key is (391, 141).