I am having a complete mental block understanding decryption with public and private keys. In my head, I am (apparently) falsely equating decryption to using a *Little Orphan Annie* decoder ring like in the movie *A Christmas Story*.
If a block of data was encrypted with a key, I can’t understand how a another key that is completely different is able to decrypt that data. I know there’s a fair bit of complex math involved, but if you multiple X by Y to get Z, then the only way to get X back from Z is to divide by Y.
* data->public key->encrypted->private key->data
* data->private key->encrypted->public key->data
* data->public key->encrypted->public key->error
* data->private key->encrypted->private key->error
In: 2
The actual answer would require math, so here is just an ELI5 analogy. To write a hidden letter you write it using invisible ink, but to read that letter you use some chemical process to turn that ink into a different color. Completely different process. You can’t read a written letter if you only have the invisible ink, and you can’t write an invisible letter if you only have the chemical process to turn the ink to a different color. Of course, if you only have the invisible ink and you want to read a letter, if you’re sufficient persistent, you can analyze the invisible ink you have, and figure out how to detect the ink on the paper, but it’s going to be much more difficult.
That’s an ELI5 analogy of how public key encryption work.
>if you multiple X by Y to get Z, then the only way to get X back from Z is to divide by Y.
Well, that isn’t the only way.
Here is a different analogy. You have a mailbox. The box have a tiny slit to put letter in. It’s easy to put the letter in, and it’s technically possible to take it out using the slit again, but it’s really hard. But if you have the key, you can unlock the box and take out the letters easily. That key is the alternative method to get back.
Latest Answers