Public key cryptography is basically built around key pairs. You generate a pair of keys and you share one (the public key) and you keep one secret (private key).
Anything encrypted with one key can only be decrypted by the other. So anyone can encrypt data (using public key) and only you can decrypt it (using private key). The public key is not and does not need to be secret.
The opposite can be done too (although you should use a different key pair). You could encrypt something with your private key, and then ANYONE could decrypt it with the public key. The information isn’t secret, but a recipient will know it came from you (anyone else would not have been able to encrypt it – if it was encrypted with a different private key, then using my public key to decrypt would just yield gibberish)
The reason that the key pairs work and that you can’t use the same key both encrypt and decrypt is really mathy, but you don’t really need understand that if you just remember that one key reverses what the other key does. One key alone does not allow you to reverse.
Latest Answers