Ask HN: Asymmetric Encryption
On this page (https://support.microsoft.com/en-us/kb/246071) Microsoft states that:
Any message that is encrypted by using the private key can only be decrypted by using the matching public key.
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?
4 comments
[ 2.3 ms ] story [ 18.0 ms ] threadTo 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.
To communicate with an individual, you encrypt with their public key and they decrypt with their private key.
The rule of thumb is, do you want the public to read it (decryption with public key) -- or do you want a private individual to read it (decryption with private key).
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.