File.Encrypt( ) not encrypting...  
Author Message
Tryston02





PostPosted: Visual C# General, File.Encrypt( ) not encrypting... Top

Hey guys, I am using the File.Encrypt( ) function to try and encrypt an XML file I have. The filename turns green when viewed in windows explorer (which I assume indicates an encrypted file). However, when I open with Notepad it is not encrypted. I then sent it to a co-worker to see if he can view the contents. It was not encrypted for him either.

Am I missing something

Thanks,

Chris


Visual C#10  
 
 
boban.s





PostPosted: Visual C# General, File.Encrypt( ) not encrypting... Top

That is normal. File.Encrypt protects the file from other windows or domain users. So if any one can log on your computer or have network access to folder containing that file, will not be able to see the content. But when you open the file, you can see it, it is not protected from your account (the one that encrypted the file). When you (i mean the account that created the encryption) copies the file to other computer, then after ignoring the warning, the file will be decrypted and copied. But if other account try that, or from network using different account, then copy will not be allowed, or viewing either.

 
 
Tryston02





PostPosted: Visual C# General, File.Encrypt( ) not encrypting... Top

Hello and thanks for replying.

I'm still a little confused...
I emailed it to him. Why was he able to open it There weren't any warnings that popped up.

Thanks for your help.

Chris

 
 
boban.s





PostPosted: Visual C# General, File.Encrypt( ) not encrypting... Top

Yes, but you are the one who sends the mail. If you open the file, it will not be encrypted. It is usual file for you (current account). That's why you can send it with mail.
If you want to protect the file while you are sending it with mail, find other solutions. There are many other way of hiding content. You can use the simplest and easyest, using some arhive program like winzip or winrar to protect the arhive with password. Of course there are many tools for that purpose only. Some free, some no. The good one i know is PGP, which can use public key encryption to securelly protect files.

 
 
Tryston02





PostPosted: Visual C# General, File.Encrypt( ) not encrypting... Top

Ok, I understand now. Thank you for time and help.

V/R

chris