Cyber Security For Beginners: Part 3

Arjun Suresh
CyberSec 101
Published in
5 min readSep 8, 2020

Hello everyone, in this blog, we are going to talk about the basic concepts of encryption and its various aspects. In the last blog, when we talked about confidentiality, we said that encryption is the primary method or technique used to implement the concept of confidentiality. If you haven’t read the previous blogs, I would recommend doing that before you start with this one as it builds up on the concepts we learnt earlier.

Without any further ado, let’s jump right in. So, what is encryption?

Encryption?

Before we dive into encryption, there is one small term that you need to be familiarized with ; cryptography. Cryptography is the practice and study of securing communications in the digital world using various techniques. Encryption is a form of cryptography.

Encryption is the process of converting a plain text data to a cipher text by passing it through some algorithms. This cipher text, or encrypted data, can only be reverted back to its plain text form with the help of a special key. The reverse process of converting the cipher text into plain text using a key is called as decryption. The algorithms through which the plain text data is passed to produce the cipher text are called ciphers. This is why the output of passing the plain text input data through a cipher is called a cipher text.
Encrypted data cannot be read by an eavesdropper even if they are able to see/capture it. Encryption protects the confidentiality of data.

Cryptography

There are two main components of encryption:
1. The encryption algorithm or cipher
2. The key

A cipher is an algorithm, which means it is a set of well-defined steps through which the data is passed to obtain the cipher text. These steps can be considered as a kind of procedure for converting a plain text data to its equivalent cipher text. A key is a parameter, or a piece of data, that determines the output of the cipher algorithm. This means that the output obtained may differ depending upon the key used.

Now, let’s explore the different type of encryption:
1.Symmetric
2.Asymmetric

In this particular blog, we are only going to discuss about symmetric encryption. We can say that symmetric encryption is a little bit easier to understand and implement than asymmetric encryption. But this doesn’t mean that it is less secure. In the real world, we use both these types together for better performance.

Let’s dig a little deeper into symmetric encryption.
Symmetric encryption is a type of encryption in which the same key is used to encrypt and decrypt the data. This is why I mentioned earlier that this is easier to understand when compared to asymmetric encryption. So, what are the different processes involved in symmetric encryption?

Starting with the plain text data, it is fed into an symmetric cipher. A key is used to encrypt it. The output cipher text would be sent over to the receiver. At the receiver’s end, the same key is used to decrypt the message so that the original data can be retrieved. This is the overall processes involved in this type of encryption in a nutshell.

Symmetric Encryption

So, it seems pretty easy, right? But can you guess any challenges involved in this type of encryption?

The main challenge in symmetric encryption would be the sharing of the keys. Since the same keys are used for encrypting and decrypting the data, the receiver should have the key with them. The key is an integral part of any encryption algorithm. The strength of an encryption algorithm depends on the length of the key it uses. A 128 bit key would ensure much more protection than a 64 bit key. So, how can we share these vital keys with the receiver?

There are several options to do this. We could share the key via an out-of-band channel. For example, if we are encrypting some vital data and sending it over to someone, we could share the key via a phone call or an e-mail. Another most commonly used method is to use asymmetric encryption. This is why I have mentioned earlier that these 2 methods work together. In this process, the symmetric key is encrypted using asymmetric encryption and sent along with the data to the receiver. We will learn more about this particular process in the next blog after we have discussed about symmetric encryption.

Now, let’s look at some symmetric encryption algorithms.

DES: Data Encryption Standard
This algorithm uses 64 bit keys for encrypting data. It is a block cipher(don’t worry, I will be explaining what are block and stream ciphers at the end of this blog) of which uses blocks of size 64 bits. 8 bits out of these 64 bits are used for parity check. hence, the remaining size of the key would be 56 bits. So, in effect, DES uses 56 bit keys. This is not so strong as we will see later. Even though the 56 bit key length did not provide much security, it laid the path for future encryption algorithms.

RC4: Rivest Cipher 4
This is stream cipher which uses keys of sizes between 40–2048 bits. This has also been considered to be insecure over the years.

AES: Advanced Encryption Standard
This is the most secure algorithm till date. It uses keys of 128, 192, 256 bits. As you can see, this is much more secure when compared to the other symmetric ciphers. This is also the standard cipher used by the U.S. Government to protect their classified information. It was developed by NIST (National Institute of Standards and Technology).

There are also lots more symmetric ciphers out there, but for keeping this blog at a beginner level, we are not going to look into those. If you want to learn more symmetric encryption, do check out other resources provided at the end of this blog. Before we wrap up this blog, as promised, let’s try to understand the terms stream and block related to ciphers.

Stream And Block Ciphers

A stream cipher takes a stream of input data and encrypts it one at a time. It outputs one encrypted character at a time.

A block cipher, on the other hand, takes a bucket/block of data of a particular fixed size, then encodes the whole block at once.

In the upcoming blog, we are going to explore asymmetric encryption and how these two types of ciphers work together to protect data. Thank you all for reading this blog and see you soon!

--

--

Arjun Suresh
CyberSec 101

Cyber Security Researcher And Blogger | Bug Bounty Hunter | CTF Player