Hello and welcome to this fundamentals of cryptography course and the previous series of videos, we
were talking about symmetric encryption algorithms in this series.
We're going to be switching gears and talking about public key cryptography, also known as asymmetric
cryptography.
And the reason for both of these names is that you have two different keys, a public key and a private
key.
And so in this video, we're going to start out talking about what is public key cryptography and discussing
three main points.
We're going to start out with fundamentals, a public key cryptography, talking about what it is and
how it works at a high level.
After that, we'll talk about encryption and digital signatures.
Two of the applications of asymmetric encryption algorithms.
And then finally, we'll talk about some of the advantages of public key cryptography.
And the previous series, we talked about how symmetric algorithms are great for bulk data encryption
because they're often faster than asymmetric algorithms, asymmetric algorithms.
On the other hand, have certain advantages and capabilities that symmetric encryption algorithms don't
share.
And so now let's get started by talking about the fundamentals of public key cryptography.
So we mentioned a few times already in this course, asymmetric or public key encryption algorithms
use different keys for encryption and decryption.
The private key is a random number that's kept secret or private by the user.
And so when we say random, we mean random within certain constraints here.
And this is very similar to the secret key.
It's used in symmetric encryption algorithms.
You randomly generate a number, but that number has to fulfill certain criteria.
For example, the A-S algorithm has set key lines.
And so you have a random number of a set size.
Similarly, with asymmetric encryption, you have set parameters for a seeker key or private key that
they have to fulfill.
But otherwise random.
On the other hand, public keys are not random at all.
They're actually derived from the private key.
And this derivation is accomplished through a process specific to each algorithm.
We'll talk about some of the mathematical functions used in public key cryptography in a later video.
And so this public key is publicly shared.
And so that might mean that someone posts their public key on the Internet so that everyone can use
it or it may be shared in a smaller, more specialized group.
When we say public here, we just mean that it's not kept private, that anyone who wants to take advantage
of the ability to encrypt data and communicate in encrypted fashion with the user has to have access
to that public key.
In addition to these private and public keys, asymmetric encryption algorithms often use shared public
values.
And so this same definition of public is the same as with the public encryption key.
It's visible to both parties and anyone who may be eavesdropping on the channel.
So remember, kickoffs, says law.
The only thing that should be secret about an encryption algorithm is the secret key in this case were
publicly sharing the public key and any public values to fulfill the constraints of that rule.
Now, let's talk about some of the high level applications of public key encryption algorithms, encryption
and digital signatures.
So unlike symmetric cryptography, public key algorithms can be used for more than just encryption.
They can also be used to generate a digital signature.
So in a public key encryption, what happens is someone uses a user's public key to encrypt the data
using the applicable encryption algorithm and sends that encrypted data to the user.
That user then can use their private key to undo the encryption or decrypt the data producing the original
message.
When we're performing digital signatures, we do the exact opposite, actually.
So if I'm creating a digital signature, my goal is to verify that I am the one sending the message.
And so how I can do this is I can take my message and create a hash of it.
We'll talk about hash functions more in later videos.
But at a high level, you can think of a hash function as a function that takes any input and produces
a fixed sized output in a way where it's really hard to find two inputs that create the same output.
So you can assume if you have an output, that there's only one known input for it.
And so what I'm going to do when I create a digital signature.
So I'm going to take my message and hash it to produce that output so that I'll send along with the
original message.
So what I'm going to be sending is the original message, whether encrypted or unencrypted and encrypted
hash of that message and my public key.
So when the recipient receives these pieces of information, what they're going to do is take the original
message and perform the same hash operation as me, which should produce the same output as I had.
They're then going to decrypt the encrypted hash of this message using the private key that I've sent
along with my message.
So undo what I did with my private key.
And so theoretically, they should end up with two identical hashes.
And if that's the case, then they're able to verify my identity and the fact that I am the one that
created this message because only someone with knowledge of the private key could generate a valid digital
signature.
And so there is one of the big assumptions of private key crypt or public key cryptography is that I'm
the only one that knows my private key.
Anyone with knowledge of my private key could generate a valid digital signature, claiming to be me.
And so it's really important for me to ensure that I properly protect my private key.
And so these are two of the most common applications of public key cryptography.
We can either use it for encryption, digital signatures and as we'll talk about in later videos, key
exchange.
But now let's talk about some of the advantages of public key cryptography and the previous sequence
of videos.
We talked about how ACE are symmetric.
Encryption is really good at bulk data transfer because it's fast.
However, public key cryptography can provide more guarantees than symmetric encryption.
One of these is confidentiality, which both of them share.
Both of them are able to create a safer text that is impossible to transform back into the plain text
without knowledge of the appropriate secret key symmetric encryption.
The same key is used as encryption and public key cryptography.
You need to know the private key to perform decryption.
So that's one of the advantages of public key cryptography.
A second is authentication.
We just talked about this with digital signatures.
If I create a message and digitally sign it, you know, for a fact that I am the one that signed it
or at least someone with knowledge of my private key signed it.
And so this is useful because it can verify the authenticity of data.
You'll often see digital signatures on authenticated emails and things like that where you want to make
sure that it hasn't been spoofed or modified in transit.
And a third guarantee that public key cryptography can provide is non repudiation.
And what this means is that if I've sent a message and digitally signed it, I can't deny having sent
it.
And this all comes down to that same assumption that I'm the only one that knows my private key.
If I've generated a digital signature with a private key, only people who know that private key could
have generated the digital signature.
And so therefore, the existence of that digital signature means that it was created by someone with
knowledge of my private key.
So as long as I've protected my private key properly, then it's impossible for me to deny generating
that digital signature because no one else could have done it.
And so that is non repudiation and that's very useful for, say, legal documents or contracts.
If I digitally sign a contract and then try to deny in court that I signed it.
If someone can prove it was signed with my private key, then is a pretty good chance that I'm the one
that signed it.
And there's a pretty good chance that I'm going to lose the court case where I'm saying it wasn't me.
And so these three advantages are guarantees are much more than what symmetric cryptography provides,
symmetric cryptography mainly provides confidentiality.
And you sort of get some level of authentication due to the fact that in only people with knowledge
of an encryption key could actually have generated a message, the error encrypted it or decrypted it.
However, with public key cryptography, we can say which of the two parties generated the message and
make it so that they can't deny having done so.
And so, as a quick recap, we.