Gossips on Cryptography — Part 2

Sahil Aggarwal
3 min readSep 16, 2023

In this blog, we will continue our discussion from the last blog Part 1. If you have not read it, please read it once.

Now as we discussed ceasor chiper is less secure, There is a more secure algo than it and it’s name is Vigenere cipher.

This algo is more or less the same as Caesar chiper, but instead of rotating every word with the same number, here we rotate every letter with a different number and the combination of these numbers is known as a key.

Let’s start with the same example to encrypt

Plain text to encrypt — SendHelp

Key — BULGE

Cipher text we will get from the following table

Now all these algorithms we discussed till now are Symmetric algorithms — which means that same Same key is used for the encryption and decryption of the messages.

Now as we see here we have two things in the encryption world One is Key and one is Algo.

Now Consider a local example of our house lock and key, what we should do locking and unlocking mechanisms should be kept secret or the key only be? If we have Too many algo’s then maintaining it and passing it to everyone algo with data to decrypt the messages will be cumbersome and non-maintainable.

Due to all these reasons, We have some popular Algos which are kept open for the public and only Key Management and how we can share the key remains the only problem with us.

Nowadays AES is the most popular and secure algo used for encrypting data at rest and many people are trying to break this algo for good reasons.

Now Comes Another Question :

When we encrypt the same Plain Text with the Same key Should it result in the same Chiper text?

Well, the Answer to this is Yes/No. It depends on the use case and how much security we want.

Now in the encryption, the Same Chiper text is produced every time. This is called Convergent Encryption.

Now it depends on the IV(intialization vector). If we pass the same IV while encrypting data then the Chiper text will be the same.

IV(Initialization Vector) Definition — An Initialization Vector (IV) in encryption is a random or semi-random value used to initialise a cryptographic algorithm's initial state before it begins to encrypt or decrypt data. The purpose of an IV is to ensure that the same plaintext encrypted with the same encryption key results in different ciphertexts each time it’s encrypted. This property is crucial for security, particularly when encrypting multiple pieces of data with the same key.

Now the question arises when we need Convergent Encryption :

There are many use cases like, sometimes when we want to search for a name which is encrypted in the database, then we have two ways here

  • Decrypt all the Names stored in the database, load them into memory and search
  • Encrypt the name which came as an input for search and then search that chiper text in SQL Query.

Option 2 is more optimal and fast and will consume fewer resources. But to implement it we need Convergent Encryption Algorithm

Until now we have heard about some important terms as follows(including part 1) :

  • Cryptography
  • Algorithm
  • Plain Text
  • Key
  • Cipher Text
  • Symmetric Encryption
  • Convergent Encryption
  • Initialization Vector

Please keep them in mind as these are the generic terms used everywhere in the world of encryption and decryption.

In coming Blogs, we will gossip about some other things like

  • Hashing
  • Asymmetric Algorithms
  • PKI Infrastructure
  • Envelope Encryption
  • and many more things

Stay tuned for next part …

--

--