[Data Encryption, Security] Can someone explain how Public key and private key encryption works in layman terms?

776 views

PKI (or Public Key Infrastructure)

Perhaps better posted in r/programming but figured i’d try here.

In: Technology

3 Answers

Anonymous 0 Comments

I have an envelope with a secret message that I want to send you. My goal is to ensure only you can open the envelope and read it.

You and I both have a unique lock and its key each. What I do, is seal the envelope with your lock and send it to you. Only you have the key to open that lock. The envelope can reach anyone in the middle but they cannot snoop into it.

Now you received a random envelope with your lock on it. How will you know who sent it and what’s the guarantee that I sent the letter and not someone else pretending to be me? To fix this, what I also do is stick my key on the envelope as well. Now if that key is able to open my lock then you know for sure that I sent you the envelope.

In the real world, the “lock” is known as a public key. Every door has a lock but only it’s corresponding key can open it. The “key” which opens a lock is known as a “private” key. The key is not supposed to be shared with anyone. If I have the key then I can open the lock and pretend to be you.

You might ask why would you stick the key to the letter and send it? In real life, you don’t do that. You use your key to do some magic to ensure that only your lock is able to recognize said magic.

Also note this is highly ELI5’d

You are viewing 1 out of 3 answers, click here to view all answers.