CompTIA Security+ SY0-601 – 2.9 Basics of cryptographic concepts Part 2
March 26, 2023

4. Block and stream cipher

In this video, we’re going to be talking about cipher suites. Now, the two cipher suites that we’re going to be mentioning here is what’s known as block and stream ciphers. Now what this is, is basically how the encryption is actually getting done. Is it encrypting data block by block or is it encrypted bit by bit? And what’s the pros and cons of this? So let me explain this to you because you have to get a good understanding of the data stream itself, how data is represented to a computer. So first of all, remember, data in a computer is not represented in letters.

It’s not ABC. It’s all binary ones and zeros. So here’s how a computer works in the world of encryption without getting too technical about this. Let’s say you got a picture, okay? Let’s say you got a picture and the picture is four megabytes. How many bits is that? Four megabytes is 32 million bits. How did I get that? Well, mega is a million, right? And eight bits in a byte.

So for a computer to open up a picture that is four megabytes, it’s 32 million bits. That means it has to read your computer reads 32 million ones and zeros in order to show up in order to display a picture of four megabytes. So remember this, 32 million bits. Now, how does it encrypt it? Well, basically, ciphers are going to either be blocked or streamed. Now, almost all ciphers today, the main one we use is anyhow like AES, not almost all, let’s just say the main ones we use today, I can take a few stream. The main one we used to the AES is known as a block cipher. Well, here’s how block cipher works. Block cipher works by taking all these 32 million ones and zeros and breaks it into blocks, small blocks. For example, 128 bit blocks. That means if you have 32 million bits, it’s going to take all 32 million bits. And then it’s basically going to divide it one 2812-812-8128. Then what it does is it encrypts every single block with the algorithm and the key. So it keeps doing this over and basically it’s block by block by block encryption. Now, here’s the problem with this. If you’re using a cipher that does block encryption, it generally requires more Ram on your computer. So if your computer now this is almost all general purpose computer will do this to support enough Ram in order to do block by block encryption. The other one is a stream cipher.

The stream cipher is going to encrypt data bit by bit by bit. So it’s going to do 32 million bits, but it’s going to encrypt one bit at a time. Stream ciphers are mostly used on systems where it’s going to actually be less ram doesn’t have a lot of Ram like hardware based devices. For example, Web wireless encryption or old wireless encryption that we cracked earlier in the class. That was based on a stream cipher. That was a stream cipher because it uses the RC Four algorithm, which was basically a stream cipher. So stream ciphers doesn’t require a lot of memory. Block cipher does. Now, how does it actually do it? That’s a discussion for another class. Take my CISP class and I’ll really go into cryptography. I’ll show you the math, some of the math behind it. Let’s see your exam. This is really what you need to know. All right? This is what cipher suites are. You’ve got block or you have stream.

5. Symmetric Ciphers

In this video, I’m going to be talking about symmetric encryption. Now, symmetric encryption basically means that the key using to encrypt the data is the same key that’s going to be used to decrypt the data. So one key does both the encryption and decryption process. Now, let me give you an example. Let’s say this mary over there that I want to send some data to. So I’m going to take the data, and I’m going to encrypt it with a cryptographic key. And then I’m going to send her the data. Now, for her to decrypt it, she’s going to have to have this exact same key.

 So she gets the key, she decrypts the data. If no one else has that key, then no one else can decrypt that data. That’s basically what symmetric encryption is. The word symmetric means the same. Now, symmetric encryption does have pros and cons. The pro is that the encryption process is very quick. It doesn’t require a lot of CPU power. The con is transporting that symmetric key. That’s one of the main problems with asymmetric with symmetric encryption, is transporting the symmetric key. And as you add users, the key starts to grow the number of keys that you have to manage. So let me show you guys a quick diagram on this. Okay, go back here to my trusty one note. So let me draw you guys on a quick diagram here. And I’m going to put my name Andy here. And there is Mary, and then there is Bob. So me, Mary and Bob. Now, you have to understand the scenario.

 We can all hear each other. Let’s say everything that occurs between Andy and Bob, andy and Mary, bob can hear. And everything between me and Bob and Bob, mary, we can all hear each other. We’re just sitting next to each other. But what happens if I want to pass a secret message to Mary? What if I want to pass Mary the answers to the certification exam? Or the answers to a practice test, right? Just me and her. Just me and her. Got a little secret message going on there I want to pass. But the problem is, Bob is listening. Every single thing that occurs between me and Mary, bob is listening. So in the world of symmetric encryption, I would create a symmetric key. And let’s say I have data.

 This is data set one. Let’s say data set one is the answers to the certification exam. How would I say I would encrypt this data, right? And I would give it to Mary. I say, hey, Mary, here is the cipher text. So Mary gets the cipher text. The question is, how would Mary get this key? Right? So I want you guys to think for a second, how would I transport that key? Remember, if everything that I say between me and Mary, bob is listening, there’s nothing that I could do to get her that key. Now, you guys may say, well, why don’t you text it to her? But that’s not an option. I said everything that goes between me and her has to be read by Bob. So this is where symmetric encryption becomes very difficult. That way there has to be a way to do it. Now, we could do it out of bandway or offline way. In other words, I may physically get up and walk it over to her. That’s one way I can text it to her, email it to her. But remember, at that moment, you’re not using the same media. So in the world of the Internet, this is not not going to work. It’s not like if you want to send data to Amazon, you call Amazon and get a key, right? That doesn’t work like that. So there is a way to fix this, and we’ll talk about this later.

 In this way, we’re going to be using asymmetric encryption to transport symmetric keys, which we’ll talk about later. So we could see this problem of just transporting the key. That’s a problem. The other problem here is that let’s say you do want to do this and you want to set up key pairs. You would need a key between me, between Bob and Andy. Bob and Mary. And Andy and Mary. Now you have one key, two key, three keys. Now if you want to manage pure symmetrical encryption, now you got to create keys between all your users. Let’s say Peter joins. Now, you need a key with Andy, you need a key with Mary, and he needs a key with Peter, right? That be key four, five, five, and six keys. But what if Peter leaves and Jill comes? Now you need to replace all the keys Peter had with everybody’s computer. This is the problem with symmetric encryption. Symmetric encryption, the key management is very difficult. Transporting the keys is very difficult. So why do we want to use it?

Because it’s so fast. Because it encrypts bulk data very quickly. So you’re probably saying, how do we fix that? The answer is with asymmetric encryption. We’ll take a look at another video. I think we’re going to title them on hybrid cryptography and you’ll see why we combine them. So there are solutions to these problems, which we’ll take a look at later. But let’s continue talking about asymmetric cryptography. Remember, we do use asymmetric cryptography to encrypt data around the world. That’s what it’s basically going to be about. So just to understand what it is, and also for your exam, you have to memorize some algorithms and some issues with them.

What you should know. Let me show you guys what I mean. So I’m going to scroll down here and I have a table that I want to review with you guys. What you guys should do. Pause the video, take out a notebook, make a note of these algorithms. This is a set of asymmetric algorithms that you may see pop up on your exam. And you should know them that this these are Asymmetric algorithms. And you should know which one of these you shouldn’t be using, right? Which one of these we don’t want to use? Let’s go through them.

So the first one up I have is this, the Data Encryption Standard. This is a 64 bit block size algorithm with a key size of 56 bit. Now, the problem with this algorithm is that the key size was never large. The Data Encryption Standard, or Des, was a, was an algorithm that we used for many, many years. It was a standardized algorithm the government had used from the late 1970s up until the end of the 1999, when Des was cracked with a machine called the Des Cracker. You should not be using Des, and no application in today’s world should support Des. So when Des was cracked, the government had an issue and they had a problem.

So in order to extend the life and to get more out of it, they created triple Des. Triple Des basically took this 56 bit key algorithm and basically would do three rounds of encryption with it, created 168 bit. Triple Des is still not secure today. In today’s world, we should not be using triple Des. Okay, so triple Des, we’re going to get rid of this one. All right, so you don’t want to use these two. Idea was another one at 128 bits. Now I’m going to talk to you guys a little about a competition that happened. You see, in the end of 1999, when Des, the Data Encryption Standard, was cracked. Des was based on an algorithm called a Lucifer algorithm. That was correct. So what they did was they held a competition and people entered this competition, and the competition would be won by an algorithm called the Rhindal algorithm, or the Rhindal algorithm.

The Randall algorithm would then become known as AES, the advanced encryption standard. So the advanced encryption standard basically using the Rhinell algorithm. That’s what we’re going to use today to encrypt all data. You see this when you’d use Web, right? You guys see that says Wpaes, right? You guys probably remember that WPA two, actually with AES encryption. So that’s what we use today. So this competition were all the algorithms that was out there that we use, like RC Four, RC Five, RC Six. So for your example, you guys should know, you guys should just be familiar with these other ones. So there’s blowfish this one up to 448 bit skip jack.

 This is more for voice encryption. But with the NSA, I don’t think that’s used anymore. RC Two, RC Four. This was used in Web, right? The one where we cracked Web, but Web had an IV problem. Here you have RC Five, and then you have the Advanced Encryption Stem. This is the one we’re going to use today. This is the algorithm that we all use. To encrypt our data in today’s run. There’s another one with two fish up to 256 bit. Now, I think for your exam, I don’t think you need to know rounds. I know I have it here. I don’t think you need to know rounds of encryption. That’s how many times you’re going to do these substitution and transposition and so on. Block sizes.

 I don’t think you’re going to need to know that either. But the key size, you probably should know the key size for your exam, and you need to know that these are symmetric algorithms. Your exam will not go in and talk about how these algorithms work. That’s way beyond the scope of our exam. We just need to know, hey, these are symmetric. And don’t forget, symmetric encryption is very quick, but it’s difficult to transport the keys, difficult to keep management or keep track of all the keys that we have. All right, so this is symmetric encryption. Let’s keep going.

Leave a Reply

How It Works

img
Step 1. Choose Exam
on ExamLabs
Download IT Exams Questions & Answers
img
Step 2. Open Exam with
Avanset Exam Simulator
Press here to download VCE Exam Simulator that simulates real exam environment
img
Step 3. Study
& Pass
IT Exams Anywhere, Anytime!