Say I have an email and I want to send it to someone else. I encrypt it with his public key. This ensures that only he can read my message. Does this also means that I won't be able to read it? If so, how will I know what I have sent?
It's perfectly true. Encrypting an e-mail with someone public key, you get as output a ciphered text that you cannot decrypt yourself, this is the point of asymetric cryptography after all.
There are many methods to keep the original text.
- keep it as clear-text
- encrypt it with your own public key (to keep confidentiality)
You should play with GPG, your question will answer itself real quick. I recommend a GPG tool called Mailvelope which works with most web-based emails (gmail, hotmail, yahoo, etc).
You can encrypt a message for multiple recipients, and as @Xaqq said, most clients will include the sender in the recipients list for exactly the reason you state. But if you don't, then no, you will not be able to read your own send messages. I've certainly made that mistake before.
Yes, basically you're right: if you (or your mail client) do not specify yourself as somebody that should be able to decrypt the message, only the recipient will be able to read the message.
Multiple encryption keys are possible
But: who can read your data depends on whom it is encrypted for. For example, most mail clients will encrypt for everybody in the "To:" and "CC:" fields (while "BCC:" recipients are treated special to not reveal them), and additionally the sender (so he can read it on his own again).
Be aware encrypting to multiple users does not increase the message size linearly with the number of recipients: OpenPGP uses a hybrid encryption schema, where only the "session key" used for symmetric encryption must be encrypted (this time with public-key-cryptography) for everybody who shall be able to decrypt the message.
If your mail client does not encrypt to yourself
When your mail client (or GnuPG plugin) does not allow to configure this, chances are good that GnuPG's default configuration stays in place. There is an option
--encrypt-to, which allows providing an additional recipient. From
--recipientbut this one is intended for use in the options file and may be used with your own user-id as an "encrypt-to-self". These keys are only used when there are other recipients given either by use of
--recipientor by the asked user id. No trust checking is performed for these user ids and even disabled keys can be used.
This option can be also set in GnuPG's configuration file
~/.gnupg/gpg.conf, where the
-- must be omitted.
name can be a key ID or user ID; I'd recommend going for the full fingerprint or at least long key ID to precisely describe your key.
An example configuration directive, which would also add myself as recipient, would be
--encrypt-to could be also used if your mail client allows adding parameters which are passed to