Time
31 hours 29 minutes
Difficulty
Beginner
CEU/CPE
30

Video Description

The algorithms of encryption This lesson covers encryption. Encryption is the process of taking data that is in clear text and changing it to and changing it into cypher text. Cypher text is the goal, what we want to send over the network and where we want to store sensitive data. Encryption and decryption is accomplished via mathematical algorithms, many of which are based randomly generated prime numbers. Typically, the algorithm stays the same, it's the key that changes.

Video Transcription

00:04
now that we've talked a little bit about how authentication works now we need to jump into our encryption. So let's talk encryption
00:12
Now.
00:13
Encryption is
00:15
the process of how we take data that's in clear text, and we change it to something that's called Cypress text
00:23
Now. Clear text is data that anyone can read its date not necessarily weaken. Read if we looked at the raw data, but it's dated that if it's a password and we can look at it, we say, Oh, that says password. It's data that if our program, if our Microsoft Word looks at it, it says, Oh, this is a document I can read this
00:41
or a wire shark can look at it and say, Oh, this is http traffic.
00:45
Clear text is data that we that is able to be read by anyone. It's not sent from one person to another, necessarily. Or if it is, it's data that hasn't been changed any anyway. Anyone who can capture that packet.
01:03
Anyone who convened that file can just open it right up and see it just like anyone else.
01:08
So that's clear. Text cipher text is what happens to that data when we put it through an encryption and it comes out all scrambled up.
01:19
It's like if we are cipher, text is the end result of taking our clear text, putting it through some sort of encryption algorithm. And then out of the other end, we get a scrambled up bunch of data that unless you know how to decrypt the data, you're not going to be able to read it
01:37
if you try to open it up. If you take a Microsoft Word document
01:40
and encrypt it and then try to read it with Microsoft Word, then it'll come up as if it doesn't recognize it as being encrypted. It will say that the doctor won't even recognize the document is being a dot D O. C. It'll tell you it's encrypted or will say that the file is corrupted because it doesn't think see it as being in any format that it can recognize.
01:59
It's just a whole bunch of jumble of code
02:01
because we essentially took that code and we jumbled it up and encrypted it somehow.
02:06
So our goal is cipher text
02:09
cipher text is what we want to send over our network.
02:14
It is what how We want to store our sensitive data when it's in places that people can read it
02:20
if we're sending data across the network. If we're sending our user name and password across the network, we want our user name and password to be encrypted. A cipher text. We don't want to send user names and passwords across an open network
02:35
as clear text, because anyone who's connected to that network could just see art in user name and password.
02:39
We want to take our user name and password. We want to take our documents. We want to take any of the files or any of the folders that we're sending across the public network and equip them so that the only person who can read them is the sender and the person who's receiving it on the other end. That's the goal of encryption, and that's what we're about to talk about.
03:00
Now. Encryption decryption is accomplished with mathematical algorithms. If you if encryption is something that you find really exciting and you really get into encryption, encryption is a lot of very high level math. We're gonna We're gonna dip into the math just a little bit, but I know that
03:15
all of our files and all of our code on computers
03:20
are all at the very base, just numbers
03:23
at the very base, all of our code and all of our all of our code is just sequences of numbers. So all of our files just a bunch of numbers that are displayed as that we see displayed as our characters, even our letters are really just numbers.
03:39
So
03:42
we need to understand that we can use these mathematical out algorithms for for passwords that include uppercase letters, lower case letters, numbers and even special characters. Because all of those things are represented by different numbers, and we take those numbers and we put them through our mathematical encryption algorithm
04:00
and then out of the other side, we get
04:02
numbers.
04:04
So we base our encryption and decryption on mathematical algorithms. And many of these mathematical algorithms, going into a little bit of an advanced topic, are based off of large, random prime numbers. The keys that we use in order to do decryption and encryption are based off of large, randomly generated prime numbers.
04:25
Because prime numbers,
04:28
there's really no, there's really no formula that we have out there for predicting or for predicting exactly how many prime numbers there are. Predicting all of the prime numbers. We have to manually go through an illiterate and see and check and see if certain numbers or prime numbers. So we use these very large prime numbers in these mathematical algorithms
04:47
in order to encrypt and decrypt our data.
04:50
Now,
04:51
the algorithm that we use
04:56
are mathematical algorithms that we use when we encrypt and decrypt data are common knowledge, the algorithms themselves, the actual process that we take the data and run it through our common knowledge, the things that we don't know the things that our secret to just the cinder and the receiver is something called
05:15
the key.
05:16
So the algorithm stays this if you're using the same type of encryption for me if you're using the same encryption type if you're using the same encryption standard. For example, if you're using an A E s encryption or you're using a T kip encryption,
05:31
the encryption algorithm
05:33
stays the same
05:35
worldwide. That's what mathematicians spend years developing is the algorithm.
05:41
The thing that changes is the key,
05:44
and the key is what unlocks your data. The key is what you use to actually encrypt the data. So you take your data in numerical format and you take your key in both of those values. Go into your algorithm to get your cipher text.
06:00
So let's talk. Let's take a look at that. An example of this. Let's see if we can explain this a little bit better in a very, very simple algorithm that we have here.
06:10
So this is just a very simple This is a very, very simple algorithm. This is the type of algorithm that you would see on. This is similar to like the little decoder rings that you may have had as a kid, where you have the entering in the outer ring and you change the outer ring so that a equal see or or
06:30
a equals E, or whichever your algorithm is,
06:32
and then you change it to that and that you have your substitution algorithm and then you just swap. You swap your letters out, and that's how you encrypted your messages when you when you are using your decoder ring as a kid. So this is this is sort of our simple computer version of this. So
06:49
we talked about how all of our characters and all of our symbols
06:53
across the board are all represented by numbers.
06:59
These we've we've taken these characters and we've shown the asking representation of those characters.
07:05
Asking is a standard. It's a standard for what? A character on a screen, the numerical value for that character on the screen. There's other standards that will give us a lot more usage of different numbers of different types of characters and different symbols. But
07:23
one a very basic. And one of the first standards that we used was the asking statement standard
07:29
where every single, every single letter and every single number we have a different numerical value for. And we use those numerical values in computers because computers can't understand a capital P or an A or an S o N S r w. We can't understand that we can't save that in memory.
07:46
We can Onley save and we can only use
07:48
numbers. We can't use letters well, way can use letters and mathematical algorithms, but we aren't. We can't make actual computations with just number with just letters. We actually have to have numerical values and substitute into those mathematical algorithms. So we need.
08:05
So we use the default asking character are the asking values
08:11
we have
08:11
of our letters here?
08:16
So this is what our computers doing behind the screen
08:18
Our behind the scenes
08:20
say we're tryingto often we're using are very simple algorithm that we developed and we're trying to authenticate ourselves to a remote server.
08:28
So we're having to send our password over the We're having this in a password over a public network.
08:35
Well, we don't want to send When are when the server asks us for our password. We don't want to send capital P A S S W zero r D in the clear over our network. Someone convey very easily Pick that up, see a password and then use it later. We don't want to do that. So we want to equip this before we send it.
08:56
So let's take a look at our numerical values are asking values for our characters
09:01
in asking a Capital P is 80. A lower case P is actually a different number, so capitals and lower cases have different values.
09:09
A Capital P is 80 lower case a is 97 s lower case is won 15 w lower case is 1 19 0 is 48 r is 114 Indy is 100.
09:24
So this
09:28
these numerical values for our data,
09:31
this is the data. This is our clear text data.
09:33
So that's the first component of our encryption. We need our data.
09:39
The next component of our encryption is our algorithm.
09:43
So we spent years and years and years, and we developed our very complex mathematical algorithm of plus
09:50
Archy.
09:52
So plus a number,
09:56
which is not a very complex mathematical algorithm at all. If you haven't guessed by now.
10:01
So our algorithm
10:03
is plus que
10:05
Now, what do we substitute for Kay? Because we can't add K. We can't do a K 97 Kate. That doesn't make sense.
10:13
We need to have a key.
10:15
And Archy is what we substitute for Kay.
10:18
So our algorithm is plus K, and then R key
10:22
is 10. And remember, our algorithm stays the same. Archy is what changes.
10:28
So we already we have a shared key. So we told we already told our server when we set it up. If I send you data,
10:37
you're going to be, it's going to be using this algorithm, and it's going to be using the key of Tim
10:45
so later I could change the key to 20. Or I could change the key to five. But right now, the key is 10. So the key is secret.
10:54
The algorithm is not. Everybody knows our algorithm. This is the This is the Anthony Simple
11:00
encryption algorithm. And it is. The algorithm is plus kit plus key,
11:05
plus whatever Mikey is. And in this instance, Mikey is 10.
11:09
So we have our three components that we need.
11:11
We have our data,
11:15
our value, our decimal values of our asking characters. We have our algorithm plus que.
11:20
And we have our key 10. So 10 equals K.
11:26
So now we're gonna take each of our values. We're gonna add 10 to 80. So we're gonna get 90
11:31
10 to 97 107
11:35
1 25 1 25 1 29 58 1 15 in 110
11:43
So if we sent this data, if we sent
11:46
this data right here
11:50
over the network
11:52
than this
11:54
would be our encrypted password.
11:58
So
11:58
we send this data over the network are passwords encrypted,
12:03
and then on the other end when the several receives are encrypted. Password is going to reverse our algorithm and it's going to do minus K because it knows our encryption algorithm is plus K and R decryption algorithm is minus K, and it knows that our key is 10 because we already shared a key to it before this session.
12:22
So I was just going to subtract
12:24
10 from all of these values and get our password. And now it knows what a password this.
12:30
So that's our very simple mathematical algorithm. Um,
12:33
it's not a very good one, because it could very easily be we could very easily just spoof this packet we could just send. We could see the encrypted packet and just spoof it, but it's it'll do for our example. But just know that mean for our
12:50
that in our example here are example shows that you for an algorithm to work for our encryption toe work. We need data,
12:58
we need an algorithm and we need a key.
13:01
The data and the key are different.
13:05
The algorithm is what stays the same. So the algorithm is the same worldwide in our data, in our key change,
13:13
and then up here we have our clear text
13:16
need at the bottom.
13:18
We have our encrypted Cypher text. So
13:22
now that we have an idea of how encryption works and now we haven't now that we have a math Matt, a little bit of a mathematical idea of how encryption works, let's move on and let's talk about our symmetric versus asymmetric encryption.

Up Next

CompTIA Network+

This CompTIA Network+ certification training provides you with the knowledge to begin a career in network administration. This online course teaches the skills needed to create, configure, manage, and troubleshoot wireless and wired networks.

Instructed By

Instructor Profile Image
Anthony Harris
Systems Analyst and Administrator at SAIC
Instructor