# The Intriguing Mathematics Behind Cryptography

Written on

## Chapter 1: The Historical Context of Cryptography

The practice of sending secret messages dates back to the advent of writing itself. Archaeological evidence reveals that as far back as 1500 B.C., Mesopotamian clay tablets contained encoded recipes for artisans. For instance, the image included here showcases a coded letter dispatched from France to the Ottoman Empire, carrying vital diplomatic secrets. A more contemporary instance is the decoding of the Zimmermann Telegram by U.S. intelligence, which was instrumental in the nation’s decision to enter World War I. This highlights the pivotal role of cryptography throughout history, but what is the relationship between cryptography and mathematics?

Historically, mathematics was largely considered irrelevant to the craft of encoding messages. This perspective shifted dramatically at the dawn of the 20th century, thanks to visionary mathematicians like Alan Turing, who laid the groundwork for modern cryptography. It became evident that mathematical principles could significantly enhance the complexity of codes, rendering them more secure against decryption.

In this article, I'll guide you through various encoding techniques, each progressively intricate. Additionally, I will elucidate the mathematical concepts underpinning these methods. If you're eager to delve deeper, numerous resources await you at the end of this piece. Let’s begin!

## Chapter 2: Understanding Basic Cryptographic Techniques

At its core, cryptography can be distilled into a straightforward scenario: we have a sender named Alice, who possesses a message denoted by the variable m. Alice is aware of a key represented by the variable k. Utilizing the message and the key, Alice encodes her message through an encoding function, expressed as E(m, k), resulting in the secret code C. After this encoding process, we have the confidential message ready for transmission.

The intended recipient, Bob (a common choice in cryptographic examples), must also be familiar with the key and decoding function, D. He retrieves the original message by calculating m = D(C, k). It's essential to note that Bob requires three pieces of information: the encoded message, the encoding method, and the key. This foundational knowledge is what makes cryptography so robust!

Let's illustrate these methods using a simple cipher. Featured above is a type of cipher known as the wheel cipher, innovated by none other than Thomas Jefferson. This cipher consists of multiple disks, each inscribed with the 26 letters of the alphabet in a random sequence. The arrangement of these disks serves as the key, necessitating that both Alice and Bob align their disks in the same order for successful communication.

To encode a message, the disks are rotated to display the text. The row of letters directly beneath the visible message then represents the encoded output, C. For example, encoding the message 'RETREATNOW' with a specific disk arrangement yields 'WVCTSOKTDN'.

This wheel cipher underwent several modifications and was used by the U.S. military in the 1920s and 1930s, known as the M-94 cipher, which featured 25 aluminum disks, allowing for an astonishing number of combinations—approximately 15 septillion possibilities!

## Chapter 3: The Emergence of Advanced Cryptographic Methods

Despite its ingenuity, the wheel cipher's vulnerability to decryption remains a significant concern. With enough intercepted messages, an expert could systematically eliminate potential keys until the correct one is identified. Thus, the need for more sophisticated encryption methods arose, particularly with the advent of computers.

Alan Turing, a pivotal figure in the realms of artificial intelligence, computational mathematics, and cryptography, played a crucial role during this transitional period. His efforts to decode enemy communications during World War II, particularly the Axis Powers' ciphers, marked a significant evolution in cryptography.

As computer technology advanced, so did the complexity of ciphers. A prime example is the Enigma machine, utilized by the Axis Powers to encrypt communications. This device employed rotating dials that altered their position with each keystroke, making the encryption process exceedingly difficult to decipher.

The first video, "The Mathematics of Cryptography," dives into the foundational principles behind cryptographic methods and their historical development.

The Enigma machine not only used dials for encoding but also incorporated a switchboard with interconnected wires, adding further layers of complexity. Each day, operators would use a secret book that outlined the rotor and wiring configurations, ensuring that messages were encoded in unique ways daily.

The potential settings for the machine were staggering: by selecting three out of five dials, setting them in the correct starting position, and considering the numerous wire arrangements, the total combinations skyrocketed to approximately 150 quintillion! How was such a formidable code ultimately broken?

## Chapter 4: The Role of Mathematics in Decoding

Mathematicians deployed various strategies to tackle the challenges posed by the Enigma cipher. One pivotal concept in this endeavor was the notion of permutations, which formally define a mapping from one letter to another. The complexity of the Enigma cipher resulted in a total of 15 distinct permutations applied sequentially to derive the final encoded message.

Some permutations contain cycles—groups of letters that map onto one another. For instance, if A maps to J, J to F, and F back to A, these letters form a cycle within the broader permutation. Below is a visual representation of a permutation.

To interpret this permutation, begin with each letter in the top row and substitute it with the letter directly below. The cycle identified earlier is evident in this mapping. Another effective way to represent permutations is through directed graphs, which highlight the cycles within the structure.

While I won’t delve into the specific mathematics behind breaking the Enigma code, it's important to note that understanding the cyclic structure of permutations was crucial. Various techniques were developed to simplify these permutations, including the concept of conjugates. A significant theorem states that if two permutations share the same cyclic structure, they can be classified as conjugates of one another. By transforming permutations into their conjugates, the 25 permutations of the Enigma code could be dramatically simplified. With Turing's early computers, the Allied forces could efficiently break the code each day.

The Axis Powers' mistakes also facilitated the decryption process. Each day commenced with an encrypted weather report, often containing the word "WEATHER," providing a useful clue. Additionally, the Enigma machine was designed so that no letter could encode to itself, further aiding the codebreakers.

## Chapter 5: The Evolution of Modern Cryptography

This concerted effort firmly established the link between mathematics and cryptography. In the ensuing decades, as computing power expanded, mathematicians employed their expertise to create increasingly secure codes. One such advancement is public-key encryption, which has become critical in today’s digital landscape.

This method involves two distinct keys: a public key, accessible to everyone for encoding messages, and a private key, which is closely guarded for decoding. The efficacy of this system rests on computational complexity. While the encoding method may be publicly known, certain mathematical problems are so complex that solving them could take an impractically long time—sometimes thousands of years.

These problems are classified as NP (nondeterministic polynomial time) problems, which lack efficient solutions. The discrete logarithm problem is a prime example currently utilized for encryption. Solving equations involving large numbers within this framework is a formidable challenge.

The second video, "Mathematics in Cryptography - Toni Bluher," provides an insightful exploration of contemporary encryption techniques and their reliance on mathematical principles.

As long as NP problems remain computationally difficult to solve, the landscape of public-key encryption will remain secure. Mathematicians continue to innovate new encryption methods using a plethora of known NP problems.

## Chapter 6: Conclusion and Further Exploration

I trust you found this exploration enlightening! Cryptography is a vast field intertwined with applied mathematics. The rise of modern technology has rendered it increasingly relevant, and mathematicians are continually applying their theories to practical applications.

If you wish to delve further into this fascinating topic, I recommend the following resources. With countless ciphers available, it can be daunting to navigate through them all. Check out cryptii.com for an interactive platform where you can experiment with various encoding methods. Another valuable site is CrypTool-Online.

My inspiration for this article stemmed from "Discover Crypt," an engaging website that introduces cryptography concepts in an interactive manner. For those interested in the intricate details of breaking the Enigma code, the Wikipedia page on the subject is informative, along with a comprehensive article from the American Mathematical Society.

For those keen on accessible yet insightful books about cryptography, "Understanding Cryptography: A Textbook for Students and Practitioners" is an excellent choice. Additionally, "Introduction to Modern Cryptography" offers a contemporary viewpoint, albeit with a technical focus.

To explore the discrete logarithm problem further, the Wikipedia page provides extensive details and links for deeper understanding. NP problems are equally intriguing, and there are numerous resources available for those wishing to learn more.

If you enjoyed this article, consider showing your support! You might also want to follow me for more insights or subscribe to my email list, where I share weekly articles about mathematics and science.