0

I want to encrypt and send an email in C# using PGP key. I have only the public key and I don't want to use the private key (since I don't need to sign the message). Can you provide any example or link on how to do this?

I've seen C# How to simply encrypt a text file with a PGP Public Key? but it is about encrypting texts, not email messages. How to use it to send an email?

Community
  • 1
  • 1
bpiec
  • 1,561
  • 3
  • 23
  • 38

2 Answers2

1

This project on CodeProject will allow you to programmatically encrypt email you send using keys. It's well-documented and easy to use.

Steve Wilkes
  • 7,085
  • 3
  • 29
  • 32
0

Encrypting Email is the same thing.

You encrypt the message you want to send and then put that as the email body.

You can't encrypt the entire email body, otherwise the email servers wouldn't be able to deliver it.

  • Do I only need to encrypt the string which is passed to `MailMessage`'s `Body` property? – bpiec Mar 30 '12 at 07:16
  • Correct. As a side note - You shouldn't put anything sensitive in the email subject - as that'll obviously be in clear-text. –  Mar 30 '12 at 07:25
  • Are you sure that I do not have to include some special header in email message? – bpiec Mar 30 '12 at 07:37