How does symmetric encryption work
Think of the front door of your home. You lock it with a key on the way out and open it with the same key on the way in. One key does both the locking and the opening. Symmetric encryption works the same way: the same key locks and unlocks. It is simple and fast, but a nasty problem is hiding in it. For a friend far away to open your locked letter, your friend needs the same key. How do you hand that key over safely?
One key locks and unlocks
The last lesson described encryption as locking contents with a key so that only the right key can unlock them. The name symmetric comes from the fact that the locking key and the unlocking key are one and the same.
Lock a letter with that key and nobody can read it; apply the same key and the original contents come back. Because the locking side and the unlocking side share the same key, it is called symmetric.
Press lock and then unlock. Locking makes the text unreadable, and unlocking with the same key brings the original back.
Locking turned the letters into a jumble, and the same key made them cleanly readable again, just as one front-door key both locks and opens the door.
A structure this simple brings a big advantage: it is very fast.
Fast and simple
Symmetric encryption involves relatively simple, lightweight calculations, so it locks and unlocks anything from a short note to a large file in an instant. Bulky data such as phone photos, videos or an entire storage drive is handled quickly too. Modern computers and phones even have circuits dedicated to these calculations.
The most widely used symmetric cipher today is called AES. Most of the encryption in Wi-Fi, messaging apps and device storage locks data with symmetric ciphers like this.
Choose small or large data and lock it. Even when it is large, the same key locks and unlocks it in no time.
Even as the data grew, locking finished quickly. Thanks to this speed, symmetric encryption is used very widely in practice. But there is something to think about here.
If you are only locking and unlocking your own files, you just keep the key to yourself. But to send a locked letter to someone far away and have them open it, that person needs the same key too.
How do you hand over that key?
Send only the locked letter and your friend cannot open it. So the key has to be sent as well, and thinking about the road the key travels is unsettling. If someone is sitting on that road, they can secretly copy the key as it passes.
The moment the key leaks, the lock means nothing, because whoever copied it can unlock it just as easily. And encrypting the key before sending it only needs yet another key to unlock that, so the problem repeats without end.
Press send the key. If someone is sitting on the road, you will see that the passing key can be copied.
With someone on the road, the key was copied as it passed. A copied key unlocks our lock just as well. Yet if you do not send the key at all, your friend can never open the letter.
Sending it risks a copy; not sending it makes it useless. You could meet in person to hand it over, but you cannot do that with the countless people you meet for the first time on the internet.
Blocked if you send, blocked if you do not
Put the two paths side by side. The first is sending the key: quick and easy, but if it is copied on the way, the lock collapses. The second is not sending the key: no risk of copying, but the other person has no way to open the letter.
One path is blocked by danger, the other by uselessness. On top of that, every pair of people needs its own key, so the number of keys to share grows quickly as more people join.
Tap the two options to compare them. Sending risks a copy and not sending means it cannot be opened, so both paths are blocked.
Whichever you chose, it was a dead end. This is the famous key distribution problem. However fast and good symmetric encryption is, the moment a secret is shared between two people, a safe way to hand over the key is needed. For a long time people were stuck right here.
Then a completely different idea appeared: public-key encryption, which splits the locking key and the unlocking key into two. On the real internet the two are used together: public-key encryption safely delivers a symmetric key, and the fast symmetric key then carries the data.
Wrapping up
In short, symmetric encryption uses one and the same key to lock and to unlock. So it is simple and handles even large data very fast. But to use it with someone far away you have to hand over the same key, and sending it risks a copy while not sending it leaves them unable to unlock.
This dead end is the key distribution problem. The way to solve it while keeping the speed is public-key encryption, the topic of the next lesson.
Tap the key points in order to review. (the same key locks and unlocks → fast and simple → how do you hand over the key? → blocked whether you send it or not) The public key in the next lesson gets around this dead end.
Now you have seen both the bright side and the dark side of symmetric encryption: the clear advantage of locking and unlocking quickly with one key, and the hard homework of how to share that key. The better the tool, the more you need to know its weakness to use it well.
The next lesson looks at how public-key encryption, which splits the locking key and the unlocking key in two, solves that homework.