People have been interested in writing secret messages almost as long as people have been able to write. During the twentieth century, it became clear that cryptography had a lot to do with mathematics, and the role of making and breaking codes has increased dramatically in the military since the First World War.2Although you may not know it, cryptography plays a role in most of our daily lives as well. When we make a purchase over the internet, our web browser uses encryption to keep our financial data secure. Automatic Teller Machines (ATMs), satellite TV, and a number of other everyday services use encryption. Secret codes are also just kind of fun to fiddle with, and fun is part of our main focus today.
First, let's introduce some terminology. The discipline of encoding and decoding secret messages is called cryptography, from the Greek words kryptos ( ), meaning hidden or secret, and graphia ( ), meaning writing. The original, readable message is referred to as the plaintext or clear text. Encoding the message is called encryption (or sometimes enciphering), and the hard-to-read result is called the ciphertext (or the encrypted message). Turning the ciphertext back into plaintext is called decrypting, deciphering, or decoding the message. Usually the conversion process depends on an additional piece of information, usually called the key or the password; the key forms the basis of the security and must be kept private. Sometimes there are different keys used to encrypt and decrypt messages. If it is infeasible to determine the key used for decryption without knowing the key used to encrypt, this method can be used for public-key cryptography (which we won't be able to discuss). Finally, decrypting a message without being told the corresponding key is called cracking or breaking the code.
Technically speaking, there is a difference between a cipher and a code: a code works at the level of meaning, replacing words or phrases with others (for example, when parents refer to a four-year-old's upcoming birthday party as ``the festivities'' to avoid exciting her prematurely), while a cipher replaces individual letters or groups of letters with others. Naturally, these are not mutually exclusive, and are often used together.3 While formally they are different things, one often informally uses the word ``code'' when speaking of ciphers. Since we will only be looking at ciphers, we will use the terms interchangeably.
One last bit of terminology we must cover is the choice of Alphabet for the plaintext (and the ciphertext). We need to agree up front which characters we will be writing our messages in. Prior to the advent of computers, messages typically consisted of only the 26 letters of the alphabet; all spaces, punctuation, numerals, and so on were removed from the message prior to encryption. No distinction was made between upper-case and lower-case letters. Today, a computer tends to do the enciphering and deciphering, and the alphabet is much larger, typically containing 128, 256, or more character codes. We'll adopt the more spy-like convention of using just 26 characters.
In this note, we'll write our plaintext in all lower case letters, as
For example, if we wanted to encrypt the sentence ``Please do not read this.'',
we would first represent it as
Apparently neutral's protest is thoroughly discounted and ignored. Isman hard hit. Blockade issue affects pretext for embargo on byproducts, ejecting suets and vegetable oils.one finds a rather different message, namely
Pershing sails from NY June I.Steganography is often used to augment cryptography, and is also related to ``digital watermarking''.