Thanks for the kind feedback!
The concept of private and public keys was indeed left out of the exposition here, as it is a slightly separate topic and covering it would make the text too messy and mathematical.
Let me help you cover the gap a bit by using a dumbed-down example.
Consider the set of numbers 1...99. For certain mathematical reasons I don't want to discuss, let us limit ourselves only to numbers which are not divisible by 2 or 5. That is, our number set of interest is {1, 3, 7, 9, 11, 13, 17, 19, 21, 23, ...}.
Note that we could be using these numbers to encode our messages. For example, 1 could correspond to the letter "A", 3 to the letter "B", 7 to "C", etc.
Now, consider the function f(x) = x3 mod 100.
That is, take the last two digits of the cube of the number. For example,
f(3) = 33 mod 100 = 27
f(7) = 73 mod 100 = 343 mod 100 = 43
f(41) = 413 mod 100 = 68921 mod 100 = 21
etc.
If you play with this function (e.g. try it in Excel), you can confirm that:
- It converts each of the numbers in our set to another number in the same set.
- The overall conversion pattern does not look "obvious".
We will thus call f an "encryption function".
Now, suppose we took the message "C" (i.e. number 7) and encrypted it using f. As you can read from above, the resulting encryption would be 43 ("R", in fact). How could we now decrypt it back?
It turns out, in order to decrypt a message (i.e. number) encrypted with f, you need to apply a different function, g(x) = x7 mod 100. Observe:
g(27) = 277 mod 100 = 10460353203 mod 100 = 3
g(43) = 437 mod 100 = 271818611107 mod 100 = 7
g(21) = 217 mod 100 = 1801088541 mod 100 = 41
Think about this curious property of the pair of functions f and g. If you encrypted your data using f, you need to use g to decrypt it (and vice-versa, in fact - try it).
I can therefore publish the function f and ask everyone to use it to encrypt messages for me. Assuming that I keep g secret, only I would be able to decrypt the messages encrypted with f.
Here, f becomes my public key (technically speaking, my public key will be a pair of numbers (3, 100), which specify that you need to raise your numbers to power 3 and take a modulo 100). The function g (technically speaking, the number 7) is my private key.
When the numbers are small, like in the example above, this scheme is not very secure because it is possible to devise g from f using some maths. However, if the numbers are huge (as in, having thousands of digits), this becomes computationally intractable.
The public-private keypair such as f and g can also be used to create digital signatures. For that purpose you just need to use g to "decrypt" a given message (e.g. a message "THIS IS SIGNED BY ME"). The resulting "decryption" will of course look like some numeric garbage, however whoever now applies your public key f to this garbage will be able to confirm that it gets "encrypted" back to a meaningful signature message. As it is only you who knows g, we can be sure that this garbage could indeed only be computed by you.
The example I brought describes roughly the RSA cryptosystem. Many other public key cryptosystems (aka "asymmetric cryptosystems") exist, each with its own properties. For example, Bitcoin uses a cryptosystem based on elliptic curves. In all cases the core idea is to have a pair of functions, such that one can "undo" the actions of the other, yet it is computationally intractable to derive one from the other.
Thanks! Great!
But in just conceptual terms: public key = mailbox address. Private key = mailbox key. Would that be correct?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Yes, on an abstract level it is correct as well, although you kind-of loose all of the technical magic and some concepts do not fit this intuition (e.g. you can encrypt a message with someone's public key and post it on a public bulletin board - only the recipient will be able to decrypt it).
A similar nontechnical intuitive analogy could be of a padlock. You know, the kind which locks itself without a key, but you need a key to open it. The "public key" is such a padlock (in an open state). Anyone can use it to secure a message. Only you have the key to open it, though.
Bitcoin addresses, in fact, are public keys indeed (while the "wallet" is simply the corresponding private key).
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
You've got the X-factor!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit