- [Narrator] As we've already discussed,
every encryption algorithm relies upon the use
of encryption and decryption keys.
And it is critical to keep some of those keys secret.
In the case of symmetric encryption,
the sender and receiver share a single secret key
that nobody else should know.
Before the sender and receiver can begin to communicate
using a symmetric algorithm, they must somehow agree upon
and exchange the shared secret key
that they will use for that communication session.
If you stop and think about it for a moment,
this can be a real challenge.
Let's say that Alice and Bob would like the ability
to communicate secretly with each other.
They hope to achieve two of the goals of cryptography:
confidentiality for their communications
and an assurance of authentication,
that they are really talking to each other.
So, how can they exchange an encryption key?
Alice might go ahead and randomly select her secret key,
which is fine, but then she has to somehow send it to Bob.
She doesn't yet have a secure channel to communicate
with Bob, so she can't encrypt the key.
If she sends it by email or some other unencrypted means,
a third party, like Mal, might intercept the key in transit
and then use that key to eavesdrop on all
of the subsequent communications between Alice and Bob.
Compounding the problem,
what would Bob do when he received this key from Alice?
He doesn't have any way to verify
that the person sending him the key is really Alice.
If Mal is clever, she could impersonate Bob
and send a fake key to Alice, and then impersonate Alice
and send the same fake key to Bob.
This would have the same effect as intercepting the key
that Alice was sending to Bob legitimately.
And Mal would be able to eavesdrop
on all of their communications.
The simple answer to this problem is
to use Out-of-Band Key Exchange.
This simply means that Alice and Bob exchange the key
in some way that they both trust
that uses a different communications channel.
For example, Alice and Bob may simply meet in person.
If they know each other by sight,
they could then create the key together
and save it on each of their devices.
Or Alice could create a key and put it on a USB drive
and mail that drive to Bob at a trusted physical address.
If Alice and Bob know each other's voices,
they could even exchange a key over the telephone.
These methods come with their own challenges, however,
as they're all time-consuming.
Alice and Bob might be separated by a great distance,
making a physical meeting impractical.
Sending a letter by physical mail takes a few days.
And attempting to read a lengthy encryption key
over the phone is very difficult.
The solution to this problem
is to use an In-Band Key Exchange algorithm
that allows Alice and Bob to exchange a secret key
over the network, even if they don't have secured way
to communicate with each other.
I'll explore one way to do that
with the Diffie-Hellman algorithm in the next video.