Fascinating technology behind public and private key pairs cryptography
The internet has opened up new ways of communication. But those come with their own security challenges. When we send on email or chat with someone, we assume that only the intended recipient can read our message. But how can we be sure of that? When we send data over the internet, we first need to lock that data up so that only the people with the right key can unlock it. Assuming that we can't deliver the key in person, we need to find a secure way to share it over the internet. Securing that key with another key will create a never-ending loop. So how can we securely share a key over an insecure channel like the internet?
Luckily some people instead of looking ways to securing key, they invented new way of locking and unlocking data. This is called public key cryptography. It uses two keys, a public key and a private key. Public key is used to lock (encrypt) the data, and private key is used to unlock (decrypt) the data. So, if you want to send a secure message to someone, you need to use their public key to encrypt the message and send it to them. Public key can't be used to decrypt the message, only the private key can do that. So no one else can read the message except the recepient who has the private key. So its same if receipient wants to send a secure message to you, they will use your public key to encrypt the message and send it to you. Only you can decrypt the message using your private key.
So each person has 2 keys, a public key and a private key. You share your public key with everyone, but you keep your private key secret for yourself. Of course you don't need to do this manually. Almost all apps you use today use public key cryptography behind the scenes to secure your data. For example, when you visit a website that uses HTTPS, your browser uses public key cryptography to securely share a key with the website so that all the data you send and receive is encrypted vice versa.
I won't go into the mathematical details of how public key cryptography works, but I will give you a high level overview. Public key cryptography is based on the idea of one-way functions. A one-way function is a function that is easy to compute in one direction, but hard to compute in the other direction. For example, multiplying two large prime numbers together is easy, but factoring the resulting number back into its prime factors is hard. That's the basis of RSA, one of the most widely used public key cryptography algorithms.
Summary
Public key cryptography is a powerful tool that allows us to securely communicate over insecure channels like the internet. It uses two keys, a public key and a private key, to lock and unlock data. Public key cryptography is based on the idea of one-way functions, which are easy to compute in one direction but hard to compute in the other direction. This technology is used in almost all apps you use today to secure your data.
Top comments (0)