What do you know about Cryptography ? PART I

Karim Baggari
6 min readJun 23, 2023

--

When you were little, did you and your siblings ever communicate in a secret language around your parents? It didn’t really matter what you were talking about, as long as your parents didn’t know what it was. That was the fun part. It may have seemed like a delightful game when you were younger, but for as long as humans have existed, we’ve devised methods to keep messages hidden from others. The subject of cryptography or concealing messages from potential adversaries has existed for thousands of years.

Let’s simplify it a bit. Encryption involves taking a message, known as plaintext, and using a cipher operation to transform it into a scrambled and unreadable form called ciphertext. Then, decryption is the process of converting the ciphertext back into the original, readable plaintext.

For example, let’s take the famous sentence “Hello World,” which is the most famous sentence in the IT world. Now, let’s apply a basic cipher that substitutes “e” with “b” and “o” with “t.” As a result, we get “Hbllo Wtrld,” which becomes our ciphertext.

Well, it’s actually quite easy to decipher this ciphertext since it’s a very basic example. However, in the real world, encryption is much more challenging than simply substituting letters. It involves complex algorithms and techniques that go beyond simple letter substitutions. So, while our example may seem straightforward, real-world encryption methods require a deeper level of sophistication to ensure security and protect sensitive information.

Well, before we dive into more complex examples, let’s first understand how a cipher works. A cipher consists of two main components: an encrypting algorithm and a key. The encrypting algorithm is responsible for the logic and process of transforming plaintext into ciphertext. It’s important to note that modern ciphers involve intricate mathematical operations beyond simple letter substitutions. However, don’t worry, there are also simpler algorithms that don’t require a Ph.D. in mathematics to comprehend.

The key is another vital component of a cipher. It holds the crucial information required for both encryption and decryption processes. The key acts as the unique element within the cipher system, distinguishing it from others. Without the correct key, unauthorized individuals would be able to decipher your message just by knowing what algorithm are you using, the key plays a critical role in safeguarding the secrecy and security of your encrypted information.

So a little recape the encryption is the process of converting a readable plaintext into a cipherText by feeding it into a cipher, a cipher is made of two components an encryption algorithm and a key, the encrypting algorithm is the process of the convertion from a plaintext to cipherText and the key is the peace of information that makes your cipher unique and not everyone with the same algorithm can decrypt it.

Well, I can understand your line of thinking. You might wonder why you need a key at all. Why not simply keep the encryption algorithm you’re using a secret? It’s like hiding the key to your house under the doormat. As long as nobody knows where you keep the key, everything should be secure, right? Well, technically, you wouldn’t be entirely wrong. In fact, this concept is known as “security through obscurity.” It suggests that if nobody knows the specific algorithm or security practices you employ, then you’re safe from potential attackers.

But once that information is discovered, all security goes out the window along with your house. Clearly, security through obscurity isn’t something that you should rely on for securing communication or systems or for your house for that matter.

This overarching concept in cryptography is known as Kerckhoff’s principle. According to this principle, a cryptosystem, which includes algorithms for key generation, encryption, and decryption, should remain secure even if all details about the system are known except for the key. So, it’s perfectly fine if an attacker becomes aware of every aspect of the system, including the encryption algorithm. The crucial factor for maintaining security lies in keeping the unique element of the cipher unknown, and I’m referring to the key. You might also come across this principle being referred to as Shannon’s maxim or “the enemy knows the system.

So the conclusion is that The system should remain secure, even if your adversary knows exactly what kind of encryption systems you’re employing as long as your keys remain secure.

Well, it seems like you now have a good understanding of encryption from a general perspective.But you need to know there is other names on the table as an exampleThe broader field that encompasses the practice of coding and concealing messages is called cryptography, while the study of this practice is referred to as cryptology. On the other hand, the opposite side of the coin, which involves seeking hidden messages or deciphering coded information, is known as cryptanalysis.

Cryptanalysis played a pivotal role in World War II, especially when the Germans utilized the Enigma algorithm for their communication. The Allied countries recognized the importance of decrypting these messages and assembled teams of talented mathematicians and cryptanalysts to tackle the challenge. Among them, the brilliant mind of Alan Turing stood out.

Alan Turing’s remarkable work and his invention, the Bombe machine, played a crucial role in breaking the Enigma code. The Bombe machine automated the process of deciphering the complex Enigma-encrypted messages, significantly accelerating the decryption efforts. Turing’s breakthrough not only provided valuable intelligence to the Allies but also made a profound impact on the course of the war.

The story of Alan Turing and the success of cryptanalysis during World War II is truly fascinating. It highlights the importance of cryptography and the remarkable achievements that can be made through innovation and perseverance.

Another concept worth noting is frequency analysis, which involves studying the occurrence of letters in ciphertext. The underlying idea behind this type of analysis is that certain letters appear more frequently in written languages, and specific letter combinations are commonly observed. For instance, in English, the most frequently used letters are e, t, a, and o, while common pairs include th, er, on, and an. It’s interesting to note that this method was invented by an Arabian mathematician called “Al-Kindi” in the 9th century.

It’s fascinating how the field of cryptography has evolved over time, and these concepts continue to play a significant role in the development and understanding of secure communication methods.

Another practice worth mentioning is steganography. It involves the hiding of information from observers without encoding it. Think of writing a message using invisible ink. The message remains in plaintext, requiring no decoding to read it, but it stays hidden from sight. The ink used is invisible and can only be made visible by a method known to the recipient. In modern steganographic techniques, messages or files can be embedded within other files, such as images or videos, appearing as ordinary content to casual observers, like a picture of a cute cat.

But if you feed that image into steganography software, it would extract a message hidden within the image file.

That concludes Part 1 of our series of articles on encryption. We’ve covered some fascinating topics, but there’s still plenty more to explore in our upcoming articles. I hope this article has provided you with a general understanding of this fascinating field of study. Until the next article, take care, and stay tuned for more exciting content. Have a great day! :)

--

--

Karim Baggari

Greetings! I'm Karim BAGGARI, a Moroccan software engineer participating into shaping the future of tech through my Articles :))).