Public Key Encryption -- Part 1: Sending Messages


Table of Content

Introduction

To understand public key encryption, and how it can be used, we must have some idea of how messages are transmitted from one computer to another.

Ultimately, the work of sending or receiving data is being done by the central processing unit (CPU) of the computer (or the network part of the computer). The CPU can handle only numbers -- in fact, binary numbers consisting of digits 0 and 1. Therefore, all text information has to be reduced to a long string of 0's and 1's for data transmission.

Let's see this process in action.

Type a message:


Back to table of content

ASCII Encoding

For the English language, the standard way to convert symbols to numbers is called the American Standard Code for Information Interchange, or ASCII. The symbols consist of the alphabets, uppercase and lowercase, all digits and punctuation marks, about 26+26+10+30=92 symbols. Each symbol is assigned an 7-bit binary number.

Nowadays, CPUs are designed with size 8-bits, 16-bits, 32-bits, 64-bits, etc. Computers everywhere use 8-bits for every symbol. Now we have 28=256 numbers to play with. The rule is to use the first 128 numbers for ASCII, effectively putting a leading 0 to the original 7-bit binary to make up an 8-bit binary number. The remaining half, 128 symbols, are for graphic symbols.

Use the ASCII converter to see how this works. This is called the standard ASCII encoding. Applying this method, any English text can be sent as a series of 8-bit binaries.

To see how the above message is converted to a stream of binary, click ths: and scroll up to read the box.

Back to table of content

ASCII Decoding

Given a data stream of 0's and 1's, how can you recover the message?

If you know that the stream is produced by ASCII encoding, the reverse (or decoding) is straight forward:

This is reading the above example from bottom to top. Note that each decimal number is between 0 and 127, the 27=128 values of original 7-bit binary (or leading bit is 0 in 8-bit binary).
To see if the computer can do decoding, click ths: and scroll up to read the box.

Back to table of content

Any secret?

If you haven't met ASCII codes before, you may think that computers are already very good in keeping messages secret. Suppose someone tries to intercept the bits during transmission. Surely that someone has to be very clever to make any sense out of a long stream of 0's and 1's.

The truth is: these ASCII codes are standard among computers. The encoding and decoding methods are well-known -- they are even built into some hardware. Here is a simple ASCII decoder.

There is no way to hide secrets using standard ASCII. This is just a symbol-to-number coding scheme necessary for a numeric processor -- and all CPUs are really number crunchers.

How about inventing your own symbol-to-number coding scheme to hide your messages?

Well, you can do that, but then only your partner who knows how to convert the numbers back into symbols can talk to you. You and your partner need to develop your special softward/hardware to do your special encoding and decoding. And only you and your partner can talk. You can't use any of the standard software/hardware, and you can't talk to other computers in the world.

This may be useful for, say, the hot-line between Washington and Moscow, but certainly not for your connection to the Internet.

However, it is possible to do some tricks to the binary stream and keep your message secret, still using ASCII codes. This is the topic of Part 2.

Back to table of content


Back to home.