Hi Nicko,
In the comments over the the method "SetQWForFiles(Stream fileStream)" it is written : "This
method can be overridden by sub classes that want to wrap the stream in
some way, for example to encrypt the output data using a
System.Security.Cryptography.CryptoStream."
However,
as I wanted to keep the advantages of the RollingFileAppender, I had to
derive it in an EncryptedRollingFile. That class uses the other version of that method, which is
SetQWForFiles(TextWriter writer). So, the stream cannot be wrapped in a CryptoStream. I even wonder if only wrapping the FileStream in a CryptoStream would be enough.
So,
I had to write a bit more complicated code for having encrypted logs. Logs are encrypted before being written in the file. And it works well. I also developped the decryptor of the encrypted log
files.
The cryptography algorithm is Rijndael.
Your remarks about the compression are interesting. But would the compression of individual lines be interesting compared to the compression of the whole file ?
Sorry for my approximative english
Edouard
2006/7/29, Nicko Cadell <neoworks.com">nicko neoworks.com>:
What sort of encryption are you using? Are you writing to an encrypted windows file or are you using some sort of encrypted stream. Have you made your changes pluggable so that instead of creating an encrypted file we could create a compressed file?
Nicko
> -----Original Message----- > From: Edouard Fattal [mailto:gmail.com">efattal gmail.com] > Sent: 28 July 2006 21:56 > To: Log4NET Dev > Subject: Encrypted file appender
> > Has anyone developped an encrypted (rolling) file appender ? > I did and I would like to know if the community would > consider it as an interesting contribution. > > Thanks >
>
|