In “New Directions in Cryptography,” Diffie and Hellman presented an algorithm that showed that asymmetric or public-key cryptography was possible. In Diffie and Hellman’s invention, a public key, which is not secret and can be freely distributed, is used for encryption, while a private key, that need never leave the receiving device, is used for decryption. This asymmetric cryptosystem is designed in such a way that the calculation of the private key from the public key is not feasible computationally, even though one uniquely determines the other.
RSA is one of the most famous and ubiquitous algorithmic implementations of this principle, using prime numbers. And despite claims to its elegant simplicity and such, it’s not exactly something you can work out in a minute.
The algorithm essentially involves three pieces of information: E, D_1 and D_2, and whose development can be described in three logical steps. First, Alice used to share a secret E with Bob by just communicating it and hoping nobody was snooping on them. Then, Alice went a step further and encrypted E with a passkey D, and communicated encrypted-E and D to Bob. After a point, Alice and Bob agreed that they each would generate a passkey at their respective ends (D_1 and D_2) using a common set of rules, leaving Alice needing to communicate only the encrypted-E.