Hello all,
I was wondering if it was at all possible to create an app (windows service maybe) to encrypt files. If the file was double clicked a password prompt would pop up if the user entered the correct password (given when encrypting the file) it would be unlocked and the user could go about as normal, but if they gave an incorrect password x number of times the file would be deleted and or rendered unretrievable Is this possible or have I been watching to much TV
Thanks
Tom

AutoDelete encryption
Sahil Malik
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=125283&SiteID=1
http://blogs.msdn.com/junfeng/archive/2005/11/18/494572.aspx
http://blogs.msdn.com/oldnewthing/archive/2006/12/18/1317290.aspx
jan3784
Yes shell extensions can be written in C# but since you'll end up working with PIDLs it'll be a lot more work. There are some articles on the INet about using .NET in a shell extension.
Michael Taylor - 1/25/07
http://p3net.mvps.org
William Biesty
Also the deletion/removal is just another security method. We all know all codes can be broken its just a matter of time this helps to add more security.
Thanks
Tom
Cyber Sinh
Too much TV :} A windows service won't help you here. I assume that you want to do this through explorer. In that case you're going to have to write a shell extension which is well beyond this post. You'll need to refer to MSDN on how to do it. I'm not even sure if a shell extension will work because you actually need to hook into all file types so you might need to start with the shell extension documentation and see if there is something closer to what you'll actually need. For example you create a context menu handler if you want to hook into the context menu of the shell.
Nevertheless I personally wouldn't appreciate it if a file was deleted or even removed if I failed to give the correct password. I just wouldn't encrypt it. Also note that NTFS supports encryption of files and folders out of the box. In this way a file can be encrypted to a specific user and automatically decrypted while the user is logged in. All other users are prevented from accessing the file.
Michael Taylor - 1/25/07
http://p3net.mvps.org