
Ask HN: Asymmetric Encryption - davidcollantes
On this page (https:&#x2F;&#x2F;support.microsoft.com&#x2F;en-us&#x2F;kb&#x2F;246071) Microsoft states that:<p><pre><code>    Any message that is encrypted by using the private key can only be decrypted by using the matching public key. 
</code></pre>
Is that right? I always though, using `gpg` as a base, the messages are encrypting using public keys, and decrypted using the corresponding private key. What am I missing?
======
giucal
It works in both directions, but the purpose is different.

To put it simply:

Since you are supposed to be the _sole_ owner of your _private_ key, using it
to encrypt something allows the public to verify your identity.

~~~
davidcollantes
And that is how signatures work. But while encrypting only, does it still
remains the same?

~~~
giucal
Sorry, I'm not sure I've understood your question.

Do you mean _encrypting the same way we encrypt using public key_?

If so:

No, because as far as I can tell, when you "encrypt" a message with your
public key you are in fact encrypting a random symmetric key which has been
used in turn to encrypt the message. (Both ciphertexts must be sent to the
recipient.)

As you may infer, if we use the same mechanism but encrypt using the private
key, we just cannot ensure the authenticity of the message.

Edit: corrected typos.

