So much information is transmitted over the Internet. And even though you might not be planning the next money heist, I bet you would rather be confident that sending sensitive information such as your credit card, your social security number, or even your home address to a third party, happens securely. But what kind of magic allows you to securely communicate over the Internet?
It is called public key encryption.
The way people used to do things before, was using a secret key that would modify the content of the message and make it unreadable for anyone not having the secret key. This method is called symmetric encryption
However, for this method to work you need both parties to exchange the key without risking having someone get a hold of it. We all have the image of spies meeting in a park to exchange a secret envelope to be able to access a piece of specific information. But, exchanging the secret key in person becomes very inconvenient if you're not in the same location. Plus, you might wanna send information over the Internet and you need a secure way to do so. But how can you send the unencrypted secret key over, without exposing it?
The solution is called asymmetric encryption.
The way asymmetric encryption works is by generating 2 keys. Let's call them key A & key B. They're linked in such a way that anything you encrypt with key A can be decrypted with key B but you cannot guess one key from the other. If Youri and Gareth want to securely communicate, both will generate a pair of keys, a private and a public one. The private key is to be kept private and the public one can be published pretty much anywhere over the internet. Because one key can decrypt the other Youri will encrypt his message with Gareth public key. And Gareth will be able to decrypt Youri's message using his own private key.
Once you understand the concept of public key cryptography. It will help you to better understand how we can securely communicate over the Internet by digital certificates and signatures. Cryptography is very powerful and is a requirement to guarantee more privacy for users!