Public Key Encryption


This is an introduction to public key encryption, the modern method of sending and receiving messages that you don't want others to read. The idea will unfold in the following parts:

We are sending messages using computers, which are machines that understand only numbers. In fact, only binary numbers 0 and 1, called bits. Each message will be converted into bits before being handled by the computer. While there is a standard way to convert characters to bits, the ASCII, there are many ways to look at a stream of bits as a stream of numbers.

Once we have a stream of numbers, we can play tricks on the numbers so that others cannot easily undo the trick. The best number tricks are those from cyclic arithmetic, where every arithmetic result is divided by a modulo, leaving only a remainder. The remainder cuts out a lot of information of the original calculation, and you'll need some pretty good background in a branch of mathematics, known simply as number theory, to undo tricks from cyclic math.

To apply a trick to hide the information is called encoding, or encryption.

To undo the trick to reveal the information is called decoding, or decryption.

Usually, to decode, you just do the encode in reverse. This is similar to using a key to both lock and unlock a door. If you think this idea of single key encryption is the only way to hide secrets, you are wrong.

With cyclic math, there is a way to undo not by doing in reverse, by doing in the same way as encode, but using a different key. This is similar to Columbus' travelling to "India" by going west, instead of going east, because the Earth is round. This idea of key pair encryption is possible only in the world of cyclic math.

Using a pair of keys, you can encode using one key, the encode key, and decode using another key, the decode key, but applying the same method -- all happening in cyclic math:

In the last situation, you can actually make the encode key public, just keeping the decode key private. With current knowledge and technology, no one can compute the private key without factorizing the modulo. This is the essence of public key encryption, the modern basis of security on the Internet.