Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The rule: A message encrypted with a private key can only be decrypted using the corresponding public key. A message encrypted with a public key can only be decrypted using the corresponding private key.

If the poster wanted all of us to be able to read it, they would have encrypted it with their private key. Then we'd just need their public key, which is published on keyservers, to decrypt it.

Why would anyone do this? Because it is a way to verify that the message came from a specific person or group. If you can decrypt a message with a given public key, you know "Only the people who have access to the corresponding private key could have published this message." You don't necessarily know who, in specific published it, but you can do things like determining that a batch of messages all came from the same group.

Now, if the person had encrypted it with a specific person's public key, then only that specific person would be able to decrypt it, because messages encrypted with a public key can only be decrypted with the corresponding private key. Being able to post private messages in public fora without needing to meet the recipient beforehand is one of the main features of public-key cryptography.



> If the poster wanted all of us to be able to read it, they would have encrypted it with their private key. Then we'd just need their public key, which is published on keyservers, to decrypt it.

That's really interesting, I had no idea that public key encryption could be used this way.


I am not sure whether this is literally possible or not, but it doesn't make a lot of sense. Sending an encrypted message with the decryption key right along side or otherwise in public view?

The common use case is to _sign_ with a private key and _verify_ with the public key. If you need the contents of the message to be secret, you can use other methods. The signature proves something about the authorship of the original message.

For example, if someone wished to make a prediction about the future, they might write down the prediction, sign it with a private key, but then only publish the signature. Later, when the prediction turns out to be true (or false), they publish the original text. The public key can then verify that the precise text of the original prediction created the previously published signature.

edit: in this case, zobzu might have created a one-use private key, encrypted a prediction about DNSNMC with the corresponding public key, and will later publish that private key. Or it might be the output of /dev/urandom


That's how signing works. The signer generates a hash of the content being signed, and then encrypts that hash with their own private key. Then anyone with the public key can decrypt the hash, and then compare the decrypted hash against the hash of the content that they generate themselves.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: