Using RSA public key exchange - How it works
RSA
RSA public key exchange is an asymmetric encryption algorithm. RSA can be used with digital signatures, key exchanges and for encryption. The RSA algorithm addresses the issue which the Diffie-Hellman algorithm is known for, by providing authentication as well as encryption. Providing RSA is used with a long key, it has proven to be a very secure algorithm.
Like Diffie-Hellman, using RSA requires a public key and private key for encrypting and decrypting data over the internet. The main purpose to use such an algorithm is because we need a scalable and secure solution for secure key exchange over the internet. VPN gateway's as well as other aspects such as secure websites communicating keys across the internet to be used for encrypting and decrypting data could easily be sniffed and stolen by a hacker. For this reason, it is why the public and private key (Asymmetric) mechanism was put into place. So entities could securely agree on a symmetric key over the internet without anyone else being able to capture the secret key.
The RSA algorithm is based on the difficulty of factoring large numbers into two prime factors. It is based on a one way hash function, where it is easy to multiply two numbers to get the output or value, however using this output or value to working out the original two prime numbers is very difficult. So in a one way hash analogy, its easy to go one way from a point or value, but very difficult reversing or going backwards to getting back to the original point or value.
RSA has been implemented in hardware and software. RSA is built into software such as Microsoft products, Apple and Novell. RSA has been implemented into hardware such as network interface cards and smart cards as well.
As well as RSA, some other asymmetric encryption algorithms are Diffie-Hellman, ECC, El Gamal, DSA, LUC and Knapsack.Further Reading
Wikipedia's guide to RSA