Hey, guys, Welcome to another episode of the S S C P Exam Prep.
I'm your host, Peter. Simple. Um, this is domain five. Lesson one, cryptography.
So in this lesson, we're gonna just take a quick look at some of the fundamental concepts associated with cryptography. We're gonna look at the different kinds off ciphers there are, and mostly just basic terminology that has to do with cryptography. And
this is drill just to get our feet wet
and to build upon in the later lessons, Let's get started.
The first fundamental concept of cryptography is the high work factor. So this is the average amount of time or effort, work or work required, really to break an encryption system.
So this is usually measured in hours or dollar, some sort of figure that that can easily be calculated. This determines whether or not encryption system is considered to be unbreakable or not.
So there's there's no such thing as an unbreakable encryption system.
What their women, when they say that what they really mean is the work factor is too high for anyone to break it. So whatever system or encryption system that maybe yeah, it could be broken. If you had 200,000 years but nobody, nobody has 200,000 years. Obviously
it would take it would take too long and require too much time
and resource is to break. This is what this is, what will be considered economically infeasible.
They're really to, Ah, two ways to imprint dated. The first is stream based ciphers, so this happens on a bit by bit base. So all of the text you want to encrypt is compiled into, you know, zeros and ones, and each bit is taken and mixed with the key
in order to encrypt the data
bit by bit, one bit at a time, all the way until the end. So the way encryption works is you take that clean text that you have and you mix it with the key stream to produce the cipher text.
Now the key stream is the key, also made up of just random bits, zeros and ones. And this key stream is mixed with the plain text stream to get the cipher text. So the operation that is normally used is the excellent exclusive for and it's used because of its
be The extra war is a very, very
quick method off encrypting data. So to show you how this works, if we have just the simple
playing plain text zeros and ones there and we want to excellent with the key street. Well, the way explore works. If you were adding zero and zero, you get zero. If you're adding one and one, you get zero. And if you are adding zero and one
you get one. So if the numbers you're adding are the same, then the final number will be zero.
If you were adding numbers that are different than the final number will be one.
So in this example, as you can see, we simply explore the input, plain text and the key stream.
And the result is the cipher tax using X door.
The other type of or the other way of encrypting data is through the block cipher method. This operates on chunks of text instead off simply one bite at a time. For these tax blocks are often, you know, 64 1 28 1 92 bit sizes. Now
off ways that you can do this right. You can use a combination of substitution and transposition
substitution is the process of exchanging one letter or point for another. And then transposition is the process of re ordering the plain text to hide the message. So in substitution, if you wanted to scramble all the letters around before encrypting them, you could do that or in transposition
transposition. If you wanted to
move the paragraphs of tax around, you could do that. So if you had on three blocks,
there are three paragraphs of text
and you're plain text message. You could rotate those paragraphs around. The third block, becomes the first, and the second becomes 1/3 and someone
now would be considered transposition.
Now the block cipher definitely has some advantage over the stream cipher. It's very is a lot stronger torture to break it. It's also computational Lee intensive, which isn't
necessarily a bad thing if it's used in the right setting. So as a result that its computational e intensive, it's usually used in software where the encryption decryption process doesn't have to be as fast
stream cipher. On the other hand, it's weaker, yes, but also it's less intensive. It's quicker, so that's why it's used war in the hardware.
There are a couple of ways a TTE the block cipher. Mood works. Now we'll be looking at these in greater detail further on in this domain, but I just want to give you Ah, quick peek into the different moods off the block cipher. So the 1st 1 is the electric code book. Each block of text is scripted
independently of every other one
cipher block chaining. This is where you encrypt one block of data and whatever that cipher text this. It's fed back into the encryption process to encrypt the next book, so the blocks are kind of chained together.
Site for feedback. Each block of the key stream that is the key made up of zeros ones comes from encrypting the previous block of cipher text. So depending on how the cipher tax comes out, then that's what that's how the key stream is formulated for the next block
output feedback. The key stream is generated completely independently of the message and finally, the counter method, which uses ah Formula based plus end as a key stream generator. And the base is a 64 bit number, and the end is just accounting function.
It's a more fundamental concepts which you should be aware of in order to understand cryptography. One is the key length, right? This is the size of the key measured and Vincent blanks. Key size is very important because an algorithm cannot exceed its key length. So
the longer the key, like the better. If you have a short key Lang
security will be weak in that outgrew. The longer it is, the better it is
block size. This is the size of the blocks used in block Cyprus. Remember, I said, they're made up of 64 bit 1 28 1 56
1 92 Those made about those sizes now,
Every once in a while, one of the blocks won't be a full size. So algorithms work with a set block size that cannot change. But the cipher text are the plain text that you were using. Rather may not be your equal the size of a block. So if you're using 100 and 28 bit block,
but the size of your plain text
is on Lee ah, 100 bits,
then patting is necessary in order to work the encryption process so the way padding works, you just add a bunch of like zeros at the end, off the tax in order to the block and until the block size is reached.
Initialization factors Ivy's is just an initial value to start some process. It's really just a random generated value.
Hashing. This is a cryptographic function that is considered practically impossible to invert. So what it does is it takes the input, runs it through a hash function or an hour of them. And it comes out with a digest, which is just a random string of characters, and that digest
whenever the import Wallace, As you can see from the example now, there is only one digest pull per input. So even if you add some text
and delete the text again
and you re do the plane tax through the hash function, that digest will be different.
So each digest is strictly unique to its tax. Now it's considered impossible to invert, so hashing works in one way the input through the hashing algorithm, and then you get the output. You can't take the output and figure out the input.
Specific hashes include Message digest,
secure hashing out over Evan, Listen in a shop of all and ripened the 1 60
birthday paradox. Now fifth Birthday Paradox states that there's a greater than 50% chance that two people share a birthday within a group off 23 people. Now, I'm not going to get too much into the probability or anything like that in this. But this is
the formula. It's used to calculate the
probability of two people sharing a birthday. It's end times and minus one, divided by two. Now why am I even talking about to the birthday paradox?
Well, it's because hashes must not be susceptible to this. If the hash applies the same way with birthday paradox, and that means they're eventually there will be two. Hash is with that come from different outputs. So it if you have the same hash, full hash output
for two different inputs, and it's a huge problem that's called a collision. That's not supposed to happen.
Salting salting is just random data that's used as an additional input to a password or a string of text
that's going to be hatched now. This prevents dictionary and rainbow table attacks. Now get into them later, rolling in this course, but for now, the way Dictionary of Rainbow Table Attacks work. It's where Attackers hash commonly used passwords and regular words,
and so they try to break your password
by comparing hash algorithms, the hash of your password and the hash off the value that's in their table.
To avoid this, you want to solve your passwords so you take your password and add salt. And then that's the new password that's going to be ash. So even if you have an insecure passwords such as password 123 you add the salt, which is really just a random string of characters.
And now you have this new password, which is much
longer and much more difficult to break. This is a password that won't be found in a hashing algorithm table.
In today's lecture, we discussed fundamental cryptography concepts
when using stream based ciphers. Why's the X, or method normally used to produce the cipher text isn't a easy to remember.
Be easy to calculate.
or D provides strong security.
If you said C, it is quick than you are correct. Remember if the two numbers are the same than The final number is the around. If the two numbers are different than the final number is one.
Thanks for watching guys. I hope you learned a lot in this video and I'll see you next time.