In encryption, how is it you can decrypt with a private key what was encrypted with a public key, or decrypt with a public key what was encrypted with a private key, but not private-to-private or public-to-public?

779 views

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

11 Answers

Anonymous 0 Comments

Encryption is all about doing one-way mathematical processes to the data. Once you’ve done them, you can’t figure out what was done using just the available data, and you can’t undo it using the original key because the process is one-way. The public key, on the other hand, *can* reverse the process, basically by doing a second irreversible process on the encrypted data which just happens to always reverse the first one. So if you run just the first process or just the second process twice, you get a jumbled mess, but if you run them in sequence you get the data.

The most common encryption algorithms in use today use multiples of extremely large prime numbers to do this. Basically, in order to decrypt the message using only the public or only the private key, you would need to factorize a number with hundreds or even thousands of digits. Barring quantum computing, there is no fast way to do this, as the only existing methods are slightly more systematized guess and check algorithms. Without having both keys, you basically only have the extremely large multiple of two extremely large prime numbers, and are forced to figure out exactly which two prime numbers were multiplied to produce it. That’s not a reversible process with available hardware.

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