Advice needed on C# file compression/encryption

I have a fairly large data collection system, which stores its data into an XML format.

This has two limitations:

1. Each file has approx 1000 <reading> tags, and there is much repeated text, I would like to be able to compress somehow to remove some of this bloat.

2. Data is stored in plaintext. The system is not human accessable but for CFR 21 reasons I want to at least have some sort of rudimentary tamper protection.

I am using LINQ to XML quite heavily, but ideally I want to compress, then encrypt each file also.

I am a bit stuck with how to continue here. Also, I generally access 30-100 of these files in quick succession. Is there a large processing overhead associated with compression and encryption in c#?
LVL 1
kingy0489Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
kaylanreilorConnect With a Mentor Commented:
Now, if you really really need some encryption you can first have a look to the doc of the System.Security.Cryptography.RijndaelManaged class and its very simple example : http://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndaelmanaged.aspx.
If you need deeper analysis, there is a good serie of articles here : http://www.vbdotnetheaven.com/UploadFile/gsparamasivam/cryp04112005063256AM/cryp.aspx.
0
 
kaylanreilorCommented:
You can add a compression step when reading and writting your data by using the System.IO.Compression.GZipStream class (or DeflateStream).
http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx.
0
All Courses

From novice to tech pro — start learning today.