March 8, 2019
Everything Else
Written communication is found in every instance of our history — dating back to our earliest days as a species. Prior to our discovery of agriculture & permanent settlements, nomadic tribes famously left behind stories of triumphs & hardships in primitive language structures known as proto-writing(s). Once we began settling, however, the utility of written communication rightly evolved. Previously, nomadic tribes feared nature most in the form of predatory animals & cataclysmic climate events; post-settlement, however, other tribes took the mantle as the largest threats.
Interactions among early settlements forced the birth of diplomacy, which, in turn, pushed communication & language to evolve. Specifically, it led to the necessity of secrecy & encryption. How could communities guard their most trusted secrets, or trust messengers carrying their most trusted secrets, without risking said secrets falling into the wrong hands?
Enter Cryptography
Ciphers are arguably the basic building blocks of cryptography — they’re certainly the earliest recorded implementations of encryption. In fancy crypto-lingo, a cipher is simply a series of steps that scrambles (encrypts) the original message, known as a plaintext, to a resultant message known as a ciphertext.
The earliest ciphers recorded in history were quite rudimentary, usually encrypted by hand or a simple mechanical device. In order to gain a deeper understanding of goals & principles behind ciphers, we’ll walk through three of these simple, manually-encrypted ciphers of historical significance:
While these early examples provide ample learning opportunities & highlight key points, they’re light-years behind their modern counterparts. Powerful, publicly-known ciphers make up the cornerstone of communication security — for example, the famous AES (Advanced Encryption Standard) that’s commonly used all over the internet which is a stunning implementation of a Rinjdael cipher. In fact, Modern ciphers are so secure that they require near-infinite computing power to break through brute-force (in comparison to the flimsy ciphers we’ll cover that are manually breakable through minimal effort).
The first stop in our journey is intricately linked with the Jewish religion. Dating far back to ancient Israel, the Atbash Cipher is a simple monoalphabetic substitution cipher used to encrypt the Hebrew alphabet. Supposedly, the Book of Yirmeyahu (Jeremiah) has several words enciphered through the use of Atbash.
As the first cipher, it offered close to zero security as it followed a very simple substitution method. In a cipher, a substitution is exactly what it sounds like: take one letter (or character), & substitute it based on some encryption protocol (rule). In Atbash, the first letter of the alphabet is replaced with the last letter, the second letter is switched with the second to last, & so on; essentially, the alphabet is reversed. That’s it. That’s the encryption of our first cipher — let’s walk through an example with an English alphabet of 26 letters:
Hopefully, the example above is straight-forward. Reading the above diagram left-to-right & top-to-bottom, we start with a plaintext message (“This is a cipher”). We then encrypt it with the Atbash protocol (reversed alphabet), which results, finally, in a ciphertext (“Gsrh Rh Z Xrksvi”). For many reasons, this is a very insecure cipher. The largest reason is that once it’s broken, it’s broken for all messages. There is no required distinction per message, no key.
While almost surely not the first moment in history that a cryptographic system was used by a ruling body, the renowned Roman empire famously relied on secret communication. The rule of Julius Caesar, specifically, was known to use one of the earliest forms of encryption to convey secret messages to generals posted on the front-lines.
The Caesar Cipher highlights another bare-bones, dead-simple encryption protocol. This time around, the Romans simply left-shifted every character in their alphabet by three characters, then encrypted the plaintext by substituting its characters with the newly-formulated alphabet. An example follows below:
Once again, it’s clear that this particular cipher depends on the secrecy of the system itself. Once a “hacker” figures out that all the messages are encrypted with the exact same shift, 3, all previous, current & future messages are cracked. This time, the number 3, is a prime example of a key. As one can begin to sense, maintaining an encryption system with a static (single) key is guaranteed failure, so the question becomes: how can we design an encryption system with multiple, or dynamic keys?
As history tells us, around 1553, one, Giovan Attista Bellaso published the very answer to the question posed above. Published in his book La cifra del. Sig. Giovan Battista Bella, the Vigenere Cipher was the first cipher to use an encryption system with a dynamic (changing) key. Leveraging a type of division common to programmers, modulo math, the Vigenere cipher is much more involved when manually encrypting a plaintext. In the example below, we’ll again encrypt the same plaintext message (“This is a cipher”), however, we’ll also assign a key — the word “Testkey”:
Take a moment to process the image above — it’s clearly quite a bit more involved than the Atbash & Caesar example. First, note the operation required us to calculate the full, plaintext key, also known as the keyshift. Our plaintext message measures 13 characters, our selected key measures 7 characters: the Vigenere cipher requires a full-length key that covers the entire length of our plaintext message.
In order to derive this full-length key, a keyshift, we simply divide the number of characters in our plaintext key by the number of characters in our selected key — using modulo math this leaves us with 1 modulo 6 (a remainder of 6). This means that our keyshift is our key with its original 7 characters, plus the first 6 characters of our key for a total of 13 characters: “Testkeytestke.”
Next, in order to encrypt the first character of our plaintext (“T”), we first find the character of our plaintext in the top-row, then find the accompanying keyshift (“T”) character in the left-column. Finally, our encrypted character is the resultant character in the square above. An example follows below of only this first character:
The encrypted “T” character, with a “T” key, results in a cipher character “M” — which follows the full ciphertext described in the first image.
Compared to its ancestors, the Vigenere cipher was considered an evolutionary step forward, gaining a reputation for being exceptionally strong. It wasn’t until approximately ~300 years later that the first of many cryptoanalysts were able to decode, or break, the cipher. While it was harder to crack than it’s predecessors, the real crown jewel of the Vigenere cipher is the fact it introduced dynamic encryption keys. Compare this to the Atbash or Caesar cipher, which relied on the secrecy of a system, while the Vigenere cipher relied on the secrecy of a key.
The concept described in the last sentence is a critical principle of modern cryptography. Known as Kerckhoff’s principle, in restated terms it claims that:
A cryptographic system should be secure even if everything about the system, except the key, is public knowledge.
Since the 20th century, the field, methods & applications of cryptography exploded. While previous methods of classic cryptography enlisted pen, paper & really rudimentary mechanical aids, the 20th century introduced complex machines, electromechanical machines, & eventually computers as more sophisticated means of encryption.
One of these monumental inflection points in cryptography stems from the introduction of the Enigma Rotor Machine. With its game-changing significance in WWII, it’s fascinating characters (particularly one Alan Turing), & it’s accompanying encryption system, Enigma is worthy of a deep dive — which is exactly what we’ll visit next.
sources
An Introduction to the Theory of Numbers