The RSA algorithm.
The most used cryptography system is the RSA algorithm proposed by Rivest, Shamir, and Adleman in their article "On Digital Signatures and Public Key Cryptosystems," Communications of the ACM 21 (1978): 120-126.
This is a public-key system in which the key needed to encode messages is made public, but the key needed to decode messages is kept private. It works because the private key cannot be determined from the public key. (At least it can't be determined easily.)
The RSA algorithm is based on exponentiation modulo n. The encoding and decoding algorthims are actually functions from the set of integers modulo n,
This RSA system is public-key which means the algorithm for coding is made public, but the
inverse algorithm for decoding is kept private. You would think that if you knew one function, it wouldn't be hard to find the inverse function. But there are a number of these trap-door functions that don't seem to be easily inverted.
Here are the steps in creating the two keys for the encoding and decoding functions for the RSA system.
Source files:
David E. Joyce
The PublicKey Applet.
Department of Mathematics and
Computer Science,
Clark University