Safely erasing a file with simple methods?

Possible duplicate:
C # - Delete a file permanently

Hello,

I am using C # .NET Framework 2.0. I have a question related to shredding files.

My target operating systems are: Windows 7, Windows Vista, and Windows XP. Maybe Windows Server 2003 or 2008, but I assume that they should be the same as the first three.

My goal is to safely delete the file.

I do not believe that using File.Delete is absolutely safe. I read somewhere that the operating system simply marks the raw data of the hard drive for deletion when a file is deleted - the data is not deleted at all. This is why there are so many working methods for recovering supposedly โ€œdeletedโ€ files. I also read why it is much more useful to overwrite a file, because then the data on the disk actually needs to be changed. It's true? Is that what you need?

If so, I believe I can just write a file full of 1 and 0 several times.

I read: http://www.codeproject.com/KB/files/NShred.aspx http://blogs.computerworld.com/node/5756 http://blogs.computerworld.com/node/5687 Securely deleting a file on C # .NET

+7
source share
4 answers

I am afraid that you have a difficult problem. I would suggest not trying to solve it yourself.

Please note that in addition to providing physical rewriting of the file (which may be via LAN, flash or something else) you will have to take care of any application caches, Windows sleep mode files, Windows recovery files, Windows swap file, and all copies or old ones to be erased versions of these files (swap all the empty space or, even worse, the space in which the cache used to be, and possibly allocated to other files) - everything is in the correct order.

I think your chances may be better if you can store your files on a dedicated logical (or even physical) disk that is not used by the OS or other applications, and if you convince Windows not to replace the memory that you use to store the file while in RAM (using VirtualLock ()). However, you must delete the swap, cache, etc.

In addition, you must integrate the Eraser product into the application (Eraser is free software and its source code is released under the GNU General Public License).

+5
source

From what I read , the decision to actually make the data no longer visible seems to overwrite the file with 0 and 1.

+2
source

If the file that you delete safely was yours, first of all, you can think about encrypting it first. Then, even if it is restored after deletion, the information will not be disclosed (it is assumed that you can manage the keys).

+1
source

You can open the file and overwrite it with stream encryption several times. Overwriting it 7 times and then deleting it seems to be the norm :)

0
source

All Articles