The RSA algorithm was invented in 1978 by Ron Rivest , Adi Shamir, and Leonard Adleman . Here's the relatively easy to understand math behind RSA public key encryption. E does not have to be prime, but it must be odd.
E is the public exponent .
D is the secret exponent . If P and Q are each 1024 bits long, the sun will burn out before the most powerful computers presently in existence can factor your modulus into P and Q . Here is an example of RSA encryption . It is not yet rigorously proven that no easy methods of factoring exist. Also, it is not yet rigorously proven that the only way to crack RSA is to factor the modulus.