Hi,
You cannot simply say password protect a file whenever you open it in
notepad. That isn't possible. If you want to password protect a file, you
would need to embed a password within the file. For instance...
MyFile RunSecureFileManager -EnterPassword or
GeneratePublicPrivateKey -GenerateSecureFile - SecuredMyFile
You would have to figure out a proper encryption algorithm to use (there are
many outthere). What you could do is private, public keys and include the
public key within the file while encrypting the data, and decrypt it with
the private key within your program.
That is the only way I could think of doing this.
Good Luck!
--
Regards,
Mohamed Mansour
Microsoft Student Partner
"rossum" <rossum48@coldmail.comwrote in message
news:af8ul31een48bhb2rec04fame6kakntkta@4ax.com...
Quote:
On Tue, 11 Dec 2007 06:50:32 -0800 (PST),
aagarwal8@gmail.com wrote:
>
Quote:
>>Hi,
>>
>>I want to create a log file from my C# code. Currently I am encrypting
>>the contents of this log file, but now the requirement is that no one
>>should not be able to open this file from Windows Explorer. (Currently
>>if we open the file using some editor, the encrypted contents are
>>displayed)
>>
>>The file should only be read/modified from within the program.
>>
>>Is it possible to achieve this functionality in C#? Can i apply some
>>password to this file from within my program?
>>
>>Any help in this regard is greatly appreciated.
>>
>>
>>Regards,
>>Ankit!!
As an alternative you could consider steganography. Disguise the
encrypted file inside another file, say a .jpg file. When the .jpg
file is opened in Explorer the user just gets the JPG image. When
your application opens a JPG file it knows to look for the hidden
file, extract it and decrypt it.
>
That might meet your needs. The other users see a file, but not the
file that you want to conceal.
>
rossum
>