0:32

And also, you should be able to identify two different types of

Â cryptography that arise as a result.

Â It might be helpful throughout our discussion to imagine the physical

Â security analogy of encryption.

Â Which could be, we're actually taking some written information on a piece of paper,

Â placing it in a box, and locking that box with a key.

Â And that's actually quite a helpful analogy for what we're about to describe.

Â So let's consider some basic terminology now.

Â So plaintext is going to represent the information we're trying to protect.

Â 1:01

We're going to convert that, to make it confidential,

Â into something called ciphertext,

Â which is going to be unreadable and it's not going to make any sense.

Â We're going to allow an attacker to observe ciphertext as it's sent across

Â a communication channel, and hopefully,

Â they will learn nothing about the plaintext as a result.

Â The person we're sending the data to, hopefully,

Â will be able to somehow get the plaintext back from the ciphertext.

Â So that's the challenge.

Â Now the means by which plaintext is converted into ciphertext will be by means

Â of an encryption algorithm.

Â And an algorithm is really just a recipe.

Â So it's a bunch of instructions that say scramble up the plaintext

Â in the following way.

Â And it's converted into ciphertext.

Â And then the decryption algorithm, something known to the recipient, allows

Â them to deconstruct that ciphertext, and recover the plaintext from it.

Â So this is best seen by means of an example, a very, very simple example.

Â And this is something called the Atbash cipher.

Â So the Atbash cipher is represented by a table, there are blue letters on top,

Â red letters underneath.

Â And we just look up this table to convert our plaintext message consisting of blue

Â letters, into a ciphertext message consisting of red letters.

Â And the encryption algorithm, in this case, is very straightforward.

Â It just says look up the table, and replace the blue letter by the red letter,

Â and the decryption algorithm is the reverse.

Â Let's look at an example.

Â So the plaintext, top secret, would just be converted

Â into a ciphertext, G L K H V X I V G, by looking at that table.

Â And hopefully, an attacker who observes G L K H V X I V G sent across

Â a communication channel will be able to make no sense of it at all.

Â However, the recipient, knowing we're using the Atbash cipher, can deconstruct

Â the message from the same table and recover the plaintext, top secret.

Â So the question is,

Â do we really get confidentiality from use of this Atbash cipher?

Â 2:58

Well, in fact, there are many reasons why the answer is no,

Â the Atbash cipher is not a very good way of scrambling data.

Â Perhaps the most fundamental one, though, is that if you think about the way we want

Â to use cryptography in modern technologies,

Â it's important that everybody understands how security is provided.

Â If we're going to go and tell somebody we're using the Atbash cipher,

Â then actually, we're revealing completely how our data is scrambled.

Â Because there's only one way in the Atbash cipher of replacing letters by letters.

Â Letter A is always replaced by Z, the letter B is always replaced by Y, etc.

Â Anyone knowing or using the Atbash cipher can immediately recover a message.

Â The decryption algorithm is immediate.

Â So we need to basically do something a bit cleverer.

Â Now if we go back to the model of encryption, what we need to do is

Â introduce something into this model that changes and can change over time.

Â And that's the role of a key.

Â So once again, to convert plaintext into ciphertext,

Â we're going to feed the plaintext into an encryption algorithm,

Â which is a recipe, but that's also going to take an encryption key as input.

Â And the ciphertext that's produced will depend not just on the encryption

Â algorithm, but also on the encryption key.

Â Likewise, the recipient will need a decryption algorithm to unscramble.

Â But they'll also need a decryption key, and

Â that's the thing that changes over time.

Â And once again, this is probably best seen by an example.

Â 4:20

So again, we're going to use an encryption algorithm that's a lookup table,

Â we're going to place letters in the top by letters underneath.

Â But instead of having only one way of doing this,

Â we're going to make it the case that the letters underneath can be

Â represented in any number of different ways.

Â What's going to have to happen is the sender and

Â receiver are going to have to agree how the encoding is done.

Â The algorithm will still be a table,

Â take the letter on top, replace it by the letter underneath.

Â But the particular letter that's chosen will be the key, and

Â that will be unknown by an attacker who observes this ciphertext.

Â So, for example, if we take the following table,

Â where a is replaced by D, b by I, c by Q, etc.

Â In that case, the message, top secret,

Â is now replaced by the ciphertext P R J W T Q U T P.

Â 5:05

But on the other hand, if we have a completely different key and

Â replace a by N, b by R, c by A, then on this occasion,

Â the plaintext top secret is converted into ciphertext X V J B K A D K X.

Â And you can see that now there are many,

Â many different ways in which we can replace the plaintext by ciphertext.

Â And they all depend on different keys.

Â Keys the receiver has agreed with the sender before the encryption was used.

Â Now, in general, we're going to need lots and lots of keys.

Â And in fact, that way of encrypting we've just discussed is sometimes called

Â the simple substitution cipher.

Â And the question is, how many different ways could we have scrambled that message

Â top secret?

Â And the answer is 40,000 times more than the number of stars in our universe,

Â which is a lot.

Â So there is no way someone is going to chance on the correct key under this kind

Â of system, if they just try them at random.

Â Now that simple substitution cipher is fundamentally flawed in lots of different

Â ways, which we'll not talk about.

Â 6:07

What is important to realize is that modern encryption algorithms,

Â like the Advanced Encryption Standard, which is in many of the technologies we

Â use every day, doesn't have these kinds of flaws.

Â It, in itself, is a recipe, a way of scrambling data.

Â Rather like just replace the plaintext letter by the ciphertext underneath.

Â It's much more complicated, but

Â it scrambles data in a particular way, according to a particular recipe.

Â And it too takes in a key, and there are many,

Â many more keys than even that simple substitution cipher.

Â But it's fundamental to realize the difference between the recipe and the key.

Â And these are two critical features of any encryption process.

Â Now there are two very different types of encryption system, and

Â this is something that's worth flagging right now.

Â And if you go back and remember the analogy for

Â encryption is locking information away in a box,

Â it's actually helpful then to think about locks and keys for a moment.

Â Because there are two types of locking mechanisms we use

Â in the every day physical world.

Â There are locks where we need the same key to lock a box, and

Â we need that key to unlock the box, and we need the key on both parts of the process.

Â But there are also keys, like padlocks, for example,

Â where anyone can lock the box just by snapping the padlock shut, and

Â only the person who holds the key can unlock the box.

Â And if we think about unlocking as being decryption, what this tells us is in any

Â encryption mechanism, the decryption key will have to be a secret.

Â It has to be something held only by the intended recipient of some information.

Â But the locking key, the encryption key doesn't necessary have to be a secret.

Â And this defines two types of cryptography.

Â So in symmetric encryption, the encryption key and

Â the decryption key are the same thing.

Â And therefore, have to be secret.

Â But in public-key cryptography, rather like the padlock analogy,

Â the encryption key can be a piece of public information.

Â So anyone can encrypt something, and only the decryption key needs to be a secret.

Â We'll come back to the importance of that in a later lesson, but it's important at

Â this stage to realize these two very different types of cryptography exist.

Â So, in summary, encryption algorithms are recipes, they're ways of scrambling data.

Â And keys play a critical role,

Â because keys allow the data to be scrambled in different ways,

Â many different ways, more ways than there are stars in the universe, hopefully.

Â And there are two very different types of cryptography.

Â In symmetric cryptography, the encryption key and

Â decryption key are the same, and need to be held secret.

Â Whereas in public-key cryptography, the encryption key could be

Â something everybody knows, and only the decryption key needs to be held secret.

Â [MUSIC]

Â