1

We've developed a service, which sends e-mails... quite trivial at this step.

The next step will be: handling the bounces.
To implement this I need to add some information into the headers... Let's say it's a simple string (to keep the question really basic).

Which compression/encryption (.net-built-in prefered) should I take, when I'm looking for an algorithm which includes a checksum internally (I do not want to create a CRC or alikes and add it to the headers either) - so, changing some char of the encrypted/compressed string doesn't mean it's valid!

This need not be a "high-sofisticated" algorithm, as I just want a basic detection against changes/injections...

Just to be clear: There must be a chance to decompress/decrypt!

3 Answers3

2

If you need to decompress/decrypt the message, you probably want a two-way encryption. I am not an expert here, but I think .NET comes with built-in support for AES, which is a Rijndael algorithm. You can get more information here.

acalypso
  • 800
  • 1
  • 8
  • 26
  • genious! ... i will try this one! –  May 10 '11 at 07:24
  • http://www.obviex.com/samples/Encryption.aspx there's a better sample ... but i implemented this with `Rfc2898DeriveBytes` –  May 10 '11 at 08:23
0

Have you thought/read about OpenPGP? This SO thread might be a good starting point for you.

Community
  • 1
  • 1
Ozair Kafray
  • 13,351
  • 8
  • 59
  • 84
  • 1
    yes, i've thought about pgp ... but for my case, pgp might be too sofisticated :) ... –  May 10 '11 at 07:23
0

To answer the compression part of it, you may want to consider either the System.IO.Compression.GZipStream or System.IO.Compression.DeflateStream classes for compression. DeflateStream uses LZW compression that is (with a bit of hackery), compatible with ZLib (http://stackoverflow.com/questions/70347/zlib-compatible-compression-streams).

Kevin Hsu
  • 1,726
  • 11
  • 14
  • what's the minimum length of the string to retrieve a good compression-rate? –  May 11 '11 at 05:21