Hey everybody welcome to the next video.
So in this video we're really talking about the opposite of symmetric encryption and this is gonna be
asymmetric encryption.
Now what is asymmetric encryption.
It's also known as public key cryptography.
It's used as a process or a concept of public and private keys.
Now again this is the opposite of symmetric encryption that uses the same key which is why I said it
was important to understand that symmetric encryption uses the same key while asymmetric uses two different
keys one for encryption and one for decryption.
Now public and private keys are generated as a pair at once and that's important.
You don't want the they won't be generated separately they're generated at at the same time using the
same random number or the same hash that's being used.
Whatever the case might be in most cases it's a random number.
So it needs to be generated at once because there's a lot of math that goes involved with each one and
then public keys are sent out to third parties while private keys are stored locally.
Now publicly public key is again public.
The client will use this to encrypt their message for the private key owner.
So for example if you are if I if I generate a private and public key pair I hold the private key and
I send you the public key you take your data you encrypt it with the public key and send it over to
me.
So no one but me can decrypt that message because I have the private key I can decrypt it with the private
key.
You cannot decrypt it with a public key.
You can only encrypted with the public.
Now the private key again is private.
It's used to decrypt that message from the public key holder.
This should not be shared with anyone.
And this is why when I talked about some of the drawbacks of symmetric encryption being that one person
gains access to the to the key That's it.
Now in this case if you gain access to the private key That's it.
But if you can give the public key to anybody that's not a problem.
The problem is is when somebody compromises the public key.
Now how does this work.
We're going to take a quick example here.
So user a generates a public and private keeper and sends it to user a earns or sends the sends user
a public key to user B.
So in this case we got user a he's got a public and private key that you just generated.
He sends it to the person he wants to talk to in this case user b he sends them the only the public
he keeps the private key user B does the same thing they generate.
He generates his own public and private keeper and sends user a the user B's public key.
So now that they both have their own private keys and they have each other's public key.
Now user wants to send a message to user B so user a encrypts whatever their message is the plain text
message with user B's public key and then sends it off to user B at this point if it's intercepted nobody
can decrypt it other than user B with his private key.
Now user B receives the message and decrypt it with user B's private key their own private key then
they generate their response whatever that might be whether it's a web request whether it's just a private
email whatever the case might be and then encrypts it with user A's public key not user not its own
public key but user a.
Because remember like I said if he generated it with it's own his own public keys or user be generated
it with user B's public key User A would never be able to read the message.
So it has to be done using user A's public key it sends it off to user a.
And now user a Will decrypt it with user A's private key.
So that's kind of how it works in a nutshell.
So some of these common uses RTL s like I spoke about t s is used in almost every web browser when you
hit almost every Web site.
Now there are some Web sites that don't have HDD P.S. which uses Telus but most of them do like you
go to Google right now you'll be using tail s which means you'll be using asymmetric encryption.
So when you talk back and forth you are you are using that same concept.
You have the public key of that.
So tell us a little bit different because they add there's there's a whole process in place where they
generate the key pair as it goes.
However just understand that that same process occurs back and forth between you and Google when you
connect to Google dot com.
Again this is using RSA and then also used for Duffy Hellman which is tends to be a type of cryptographic
algorithm inside of a less known as a cipher.
But we'll get over to that when we hit the when we go over tell us a little bit later in the networking
module.
So just understand the two differences if you take anything from these two videos.
The last two videos it is symmetric encryption uses the same key to encrypt and decrypt and asymmetric
uses of public key and private key one encrypts while the other decrypt.