So when it comes to encrypting and decrypting our data, we have two major types of encryption types. We have something called symmetric encryption, and we have something called asymmetric Encryption.
Symmetric encryption is when we use the same shared key to in crypt in decrypt data. So our algorithm that we talked about earlier in our previous example we had our key of 10 We when we use that shared key, we use that same shared key to encrypt the data plus 10
as we did when we decrypted the data
minus 10. So it's the same shared Kiefer encrypting the data and decrypting the data.
some problems that symmetric encryption presents is that we must trust the other party that we're sending the data to and that we're sending the pre shared key to because anyone who has that key of 10 could impersonate anyone else. If we send, Appreciate if everyone is encrypting their data with
or everyone is encrypting their data with 10 and they all know that. Okay, I'm gonna decrypt this data with 10 then they know. Okay, this is a pre shared key. That means that I can encrypt this data with plus 10 to, so they could encrypt their data with 10 and then say, Oh, yes, I'm Anthony. I know the encryption algorithm to encrypt his password.
If everyone knows if everyone knows the pre shared key for a symmetric encryption, then there's no non repudiation.
That means anyone with the pre shared key can be Impersonating anyone else. There's no there's no there's no non repudiation. There's no proving that one person that there's no way you can send encrypted data using symmetric encryption without giving them the same key that you used to encrypt. That data
you are giving them the same is you're giving them the master key,
the same key that you used to encrypt the data there, decrypting the data with. So if you trust them enough to give them the decryption key, then you're trusting them to pretend that they argue
so, so symmetric. Encryption is is not useful for situations where we need to have non repudiation situations where we need to make sure that we meet that we may not 100% trust the other person yet, so we need another way that we can encrypt and decrypt data,
is asymmetric encryption. Now, asymmetric encryption algorithms are typically we have, ah, a bit more complex. Mathematically, then our standards symmetric. Encryption algorithms,
asymmetric encryption algorithms are different encryption and decryption keys.
what that means is we use a different key to encrypt that we use a different key to lock up the data and encrypt it.
Then we do to unlock the data and decrypted.
Now what does the pope? What's the purpose of this? Why does this help us? Well, it's the basis of P k I. R P K. I set up. That's the basis of our public key infrastructure. Our public key infrastructure is what allows us to offense is allows us to authenticate users and
against us particular server. It allows us to encrypt data and send it to a user, and only they can be cryptic. It allows us to connect to an https Web server and make sure that they are who they say they are so public. He Our public key infrastructure is a very important aspect
of modern encryption in modern authentication.
So with asymmetric it with asymmetric encryption, we have two keys
we have a public key and we have a private key.
Our public key is the key that is widely distributed and given out to whoever needs it.
This is the key that is, eight that is going to be used to publicly encrypt our data when it's say, actually sent to us.
let's say we have Alison, Bob
are sending messages back and forth.
Alice has Bob's public key,
and by using Bob's Public Key, she's able to encrypt an email to him.
So Alice takes Alice, takes an email. And remember all data. All computer data is just numbers. So this email is just a bunch of numbers in data.
She takes all those numbers,
puts it into the algorithm, and then remember, our key is a component of that algorithm.
So then he puts in that key,
puts it into the algorithm, and then this data becomes encrypted in transit.
So when it's being sent over the Internet, it's encrypted,
and it's encrypted with Bob's public key.
and Bob, when we encrypt data with a public key, the only thing that can un encrypt that data
The private KIIS secret. You don't tell anybody else your private key other than yourself,
but you don't need to tell yourself because you would know it.
And your private key is secret.
So Bob receives this email that was scrambled up and encrypted,
and he knows that it was encrypted with his public key.
Remember, the encryption has a public. He in a private key.
The public he is given to everyone.
Private Key is just for you.
Using his private key, he is able to decrypt this data
so he gets this email. It's encrypted with his public key, and he's able to decrypt it with his private key. He's able to you. It's the same algorithm, but it's or it is out of the same algorithm. But it's a different key. So different Key is used to decrypt the data than encrypted,
so he receives it, and he's able to decrypt it with his private key.
So no matter who sends Bob e mails, if they as long as they're encrypting them with Bob's public key, he is the only one who can decrypt them.
The public. When we generate a public and a private key in an asymmetric encryption. They're linked. They're mathematically linked together.
Are we generate that we generate the public key and private key. And they're just really, really big long prime numbers. And there's really, really big, long prime numbers we use put in our encryption. And they're mathematically linked together so that our public so that our private key can decrypt our public key whatever, whatever our public key and Chris
a little bit of a complex, little bit of a complex idea. So let's talk. Let's talk through this a little bit more.
we've taken this public key. We've given it to everybody. Anyone is able to encrypt e mails to Bob, but only he can decrypt them with his private key.
Now Bob wants to send an email to Alice.
that he wants to send Alice,
but he can't, and he isn't gonna encrypt it with his public key.
Well, why not? Why can't you just encrypt with his public E?
Well, he's the only one with his private key,
and anything encrypted with a public key can only be open with his private key.
So it's sort of like, Whoa, it would only really work if he was sending it to himself.
The awesome thing and the very mathematically amazing thing about asymmetric encryptions
is Bob can actually encrypt this packet or encrypt this email with his private key,
and it can be opened
and the pure and simple fact that that Alice is able to decrypt this data with Bob's public. He means that it was created with his private key,
so because they're mathematically linked and because the public key is given to everybody and the private key is only given to one person, Asymmetric encryption provides for non repudiation.
If you receive an encrypted packet and you're able to decrypt it with your private key, that means it was encrypted with your public key.
If you send a packet of somebody and it's able to be decrypted with the public key, that means it was encrypted with the private key there mathematically linked, and they work together to encrypt and decrypt data so that you don't have to give everybody the same shared key.
That way we can provide for non repudiation. That way we know that the person sending something is who they say they are.
So in this situation, Bob wouldn't at actually would not be. Wood
would hopefully not be sending it with his private key, but would actually be sending it with his own. He would be sending with Alice's public key. He could encrypt it with Alice's public key, and that way she can open the data with her with her with her private key. Or it could send it with Alice consented with her private key, and Bob could open it with
his public key for her, whichever the case may be.
But essentially the things to remember right now on the thing to get out of this right now is that an asymmetric encryption? We use different keys for encrypting and decrypting the data.
Whatever key you encrypt the data with the other key has to decrypt it.
The public key. If you decrypt a message with a public key, the public, he can't decrypt it,
it'll just encrypted all. It'll just you'll just get a whole bunch of mess of message. You won't get the actual message by decrypting the data with the same key that you encrypted with.
If you encrypt the data with your private key. You can't decrypt it again with your private key, but because your public he is common knowledge. It's no big deal if if you don't, if you lost your public key as long as it's common knowledge, you just get it again and you decrypt that data. Your private key is that the one you don't want to lose because it's the other side of that key pair.
They're the two pairs of keys into this relationship, the public in the private key.
that is the are asymmetric encryption is the basis of our p k I. R. Public infrastructure, and we have our public key in our private key. If you don't get it, if you aren't quite getting it just yet, it's okay. Next we're gonna talk about hashing and hashing is gonna give us a little bit more information
and will give us a little bit more insight into our public. E r P k are public key infrastructure