When I encrypt a message with the public key, can I read it with the same public key

encryptionpublic-key-encryptionssh

On a process that is using asymmetric encryption(such as ssh), when I want to send a message to someone using my public key, can I decrypt and read this message with my public key (the same that I used to encrypt) or only who has the private key would be able to decrypt this message?

Best Answer

Asymmetric encryption means that you use one key to encrypt, and ONLY the matching other key can decrypt. You don't use YOUR public key to encrypt a message you want to send to somebody. You use THEIR public key. The message will ONLY be able to be decrypted by THEIR private key.

If they wanted to send a response to you, they use YOUR public key, creating a message that can only be decrypted by YOUR private key.