Historical Cryptography
The roots of cryptography extend far back into human history, driven by the universal need to protect information from prying eyes. Long before the invention of computers, civilizations developed manual techniques for concealing the meaning of messages, often in response to the demands of diplomacy, espionage, and military command. Many of these methods laid the conceptual groundwork for the algorithms and key management systems we use today.
Substitution Ciphers
One of the earliest and simplest forms of cryptography is the substitution cipher, where each element of the plaintext—most often a letter—is systematically replaced by another letter or symbol according to a predefined rule.
The Caesar cipher, used by Julius Caesar to communicate with his generals, is perhaps the most famous historical example. In its simplest form, the cipher shifts each letter of the alphabet by a fixed number of positions. For instance, with a shift of three, “A” becomes “D,” “B” becomes “E,” and so on, wrapping around at the end of the alphabet.
A more modern example of a substitution cipher is ROT13 (Rotate by 13), which shifts each letter of the English alphabet by 13 places. ROT13 has the interesting property of being its own inverse: applying it twice returns the original text. While substitution ciphers like these are trivially broken by frequency analysis—studying which letters appear most often—they were once sufficient for concealing information in low-threat environments.
Polyalphabetic Substitution
To counter the weaknesses of simple substitution, cryptographers developed polyalphabetic ciphers, which use multiple substitution alphabets rather than a single, fixed one.
The most famous is the Vigenère cipher, which employs a repeating keyword to determine which substitution alphabet to use for each letter of the plaintext. For example, if the keyword is “KEY,” the first letter of plaintext is shifted according to “K” (shift 10), the second by “E” (shift 4), the third by “Y” (shift 24), and then the cycle repeats.
Imagine we wanted to cypher the message “secret message” with the key “apple”. According to this, we would shift the letters that matched with or key by the following numbers:
- A remains the same letter
- P is shifted 15 positions
- P is also shifted 15 positions
- L is shifted 11 positions
- E is shifted 4 positions
As such, we want to match our message letter by letter with our key “apple”, repeating until we reach the end of our communication. Then, each letter is replaced by the one displaced X positions in the alphabet, where X is the position in the alphabet minus 1 of the key-matching letter. Our resulting cyphertext would then be:
| Plain Text | S | E | C | R | E | T | M | E | S | S | A | G | E |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Key loop | A | P | P | L | E | A | P | P | L | E | A | P | P |
| Positions | +0 | +15 | +15 | +11 | +4 | +0 | +15 | +15 | +11 | +4 | +0 | +15 | +15 |
| Cyphertext | S | T | R | C | I | T | B | T | D | W | A | V | T |
To decipher, we would have to apply the opposite conversion:
| Cyphertext | S | T | R | C | I | T | B | T | D | W | A | V | T |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Key loop | A | P | P | L | E | A | P | P | L | E | A | P | P |
| Positions | -0 | -15 | -15 | -11 | -4 | -0 | -15 | -15 | -11 | -4 | -0 | -15 | -15 |
| Plain Text | S | E | C | R | E | T | M | E | S | S | A | G | E |
This method thwarts simple frequency analysis because the same letter in the plaintext may be encoded differently depending on its position. However, with modern statistical techniques and computing power, Vigenère is still easily broken today.
Transposition Ciphers
While substitution ciphers change the identity of each letter, transposition ciphers preserve the original characters but change their order according to a defined scheme. For instance, a simple columnar transposition arranges the plaintext into a grid of fixed width and then reads the letters column by column instead of row by row. Transposition ciphers offer more resistance to frequency analysis since the original characters are intact, but without modern complexity or added layers, they too are vulnerable to systematic attack.
An example would be the cyphering of the message “meet me in the store” with a columnar transposition of key 4, where we would write the message in rows of 4 and then writing in columns order:
| M | E | E | T |
|---|---|---|---|
| M | E | I | N |
| T | H | E | S |
| T | O | R | E |
And so the cyphertext would be:
M M T T E E H O E I E R T N S E
To decrypt the message, you need to know the number of colums that were used, and repeat the process with the cyphertext.
The Enigma Machine
During World War II, Germany deployed the Enigma machine, a sophisticated electro-mechanical cipher device that combined substitution with rotor-based permutations. The operator was responsible for configuring the machine to use the code of the day by setting the rotatory duaks at the top of the machine and configuring the wires on the front of the machine. Once the machine was configured for the day, the use was straightforward. Each keystroke would cause the rotors to advance, changing the substitution pattern and producing an effectively different cipher for every letter typed. The receiving operator followed the same process to convert back to plain text.
Enigma’s complexity created an astronomical number of possible settings—far beyond the capacity of manual decryption. However, Allied cryptanalysts, most famously those at Bletchley Park under Alan Turing’s direction, developed techniques and early computational devices to break Enigma. The work is credited with shortening the war by years, highlighting both the power and the vulnerabilities of cryptographic systems when operational mistakes are made.
Steganography
Parallel to the development of ciphers was steganography, the art of hiding the very existence of a message. Ancient examples include writing on wooden tablets and covering them with wax, or using invisible ink to conceal writing between the lines of an innocuous letter. In the digital era, steganography hides messages inside other data—such as embedding text within the pixel values of an image or the least significant bits of an audio file. While cryptography focuses on making a message unintelligible without a key, steganography aims to make it invisible altogether, and the two techniques can be combined for layered security. As of today, steganographers often hide their secret messages within images, video files or audio files as they are often so large that the secret message would probably be overlooked. They normally do this by getting rid of the least significant bytes, substituting those by the content of the message to hide. These metioned bytes are not perceibable by the human eye.
Steganography is normally used for illegal purposes, althought it could have legitimate purposes, like adding digital watermark to documents to protect intellectual property, as the hidden information is only know to the file’s creator. It is a really simple technology to use, with free tools openly available, like OpenStego, for instance.