# Encryption and HUGE numbers – Numberphile

That's good, isn't it? But the problem is that the bank gives to everyone these lockers and the keys to them, so that means that, well, someone can steal someone else's locker, use the key to unlock and read the information. That would be bad. We can't do it like this. So banks use a similar principle, but instead keys are preferably given locks. So they give everyone a locker. You have a secret. You put him in the locker. You lock it not with a key, but with a lock. He'll do a click. It's clicked. Once it's locked and clicked, you have no key to the lock so you don't unlock it back. You won't open it. So when someone steals your locker, he also doesn't have a key to it. He has a lock, but he doesn't have a key, to open the lock.

The only one who has the key is the bank itself. And this is how secret information can be sent without giving keys. It's easy to lock code, but hard unlock it. First of all, I have to explain it in the simplest way possible example and then I'll show you why we use it the huge numbers. Let's say you're a bank and you give two numbers.

They are public, so anyone can find them. They are not secret. I will choose number 3 and number 10. But the bank also has a secret number. Secret bank number, you don't know yet How is it. Nobody knows it. Only the bank knows the number. I had a very bad breakfast this morning, so I will send a message to BAD CHEF. The first thing you do with such a message is that convert letters to numbers.

It's quite simple. A is 1, B is 2, and Z is 26. Toy. C is 3, D is 4. Now I'm coding the message and using it your number 3. Some codes just add 3 and some again 3 multiplies. We use 3 as a power, so we increase the numbers to the third. Let's go. So I have 2 for the third, that's 8. 1 to the third, which is 1. 5 to the third, which is 125. And 6 to the third, 216. The last step is to use the second number, 10. I divide everything by 10 and look at the rest. So if I take something like 512, if I divide by 10, it will be 51 tens and the rest 2. So it's just 2. Here 5, 1 and 4. And that's your code. And you would send this. A bank or person who wants to decrypt a message has a secret number. The secret number for our example will be number 3. There is an equation for calculating a secret number. I'll skip this for a moment now, but I'll show you how to proceed when decoding a message. This is my code. I'll write it again. I'll do the same as before.

And this time I'll use my secret number. It doesn't have to be number 3, but it just came out as before 3. But it bothers me, it doesn't have to be that way. Now I'll put it back on the third. I'll put these numbers on the third. We will do what we did before. Divide by 10 and determine the rest. And the decoder then converts it to letters, which is B and receives the BAD CHEF message again. Well, this is just an outline of how it works. This is the process that your computer does every time when you buy something on Amazon or eBay. One of the important numbers in the cipher was the 10. We got the 10 by multiplying two prime numbers. 2 times 5 are prime numbers. Multiply them and you get 10. Well, the huge number I showed you that NatWest uses, works on the same principle. They are two huge primes multiplied by each other. This is how it works. If you want to find out the decryption key, ie the secret code, you need to know the original prime numbers. And the only way a spy or someone who wants to break code can find out the original prime numbers take that big number and break it down– take it apart to the original two prime numbers. This is very difficult. So difficult that it is impractical to try it with the modern technologies. The huge number I showed you was a 2048 bit number. That means it's about 2 on 2048. About ten years ago we succeeded break a 512 bit number. We were able to take the number and decompose it to the original prime numbers. A few years ago, a team of academics managed to break through 768 bit number. To this scientific team, with all their means It took 2 years to break the 768 bit key. And they claim to break today's keys, therefore around 1024, would take a thousand times more time. But with the given speed of technology development, they count on that this 1024 bit key can be cracked within a few years. That's what they said a few years ago.

So they should slowly start exchanging this now. Gmail still uses this, but it should be replaced. And as you can see, NatWest did it. All the banks did it. Now they use 2048 bits, which would take today computers– and I mean a real attack– it would still take thousands of years for large computers decompose that number into the original prime numbers. And there's math in this code fact discovered in the 17th century Pierre de Fermat.

He is known for his great Fermat theorem. Well, that was Fermat's little theorem. When I take a number, an integer, any– Let's call it x. I'll amplify him. And it will be a prime number, p as a prime number. I'll amplify him and more subtraction x. This is a multiple of p, that is, primes. I'll show you an example. What I mean is that if I take a number like 4, then I take prime number like 5 and then subtract 4, I get 4 to 5, which is 1024.

I subtract 4, which is 1020. And that's a multiple of 5, but it's guaranteed. You are guaranteed to get a multiple of 5. Now you can imagine that in the 17th century, when Fermat He came up with the idea, people said, well, that's nice mathematical fact, but it's totally useless. How do you want to use this? And then suddenly the internet comes and this is it extremely useful. In fact, our entire modern world depends on this fact. So to use this code, the public key has two numbers.

I showed you the huge one that NatWest uses. The next one we need is the power, it's not that big. It's 65,537. Quite a big number. When you compare it to the other, it is quite small. BRADY HARAN: If you're in the mood for more talk about banks and big numbers, check out my latest video from the chemistry channel of Periodic Videos, where we are in the gold warehouse of the Bank of England, where they have a few hundred billion pounds in falling gold.

You don't just see it every day. The link is here on the screen and below the video.. 