Securely erasing a file using simple methods?

Posted by Jason on Stack Overflow See other posts from Stack Overflow or by Jason
Published on 2010-12-30T06:11:27Z Indexed on 2010/12/30 6:54 UTC
Read the original article Hit count: 413

Filed under:
|
|
|

Hello,

I am using C# .NET Framework 2.0. I have a question relating to file shredding.

My target operating systems are Windows 7, Windows Vista, and Windows XP. Possibly Windows Server 2003 or 2008 but I'm guessing they should be the same as the first three.

My goal is to securely erase a file.

I don't believe using File.Delete is secure at all. I read somewhere that the operating system simply marks the raw hard-disk data for deletion when you delete a file - the data is not erased at all. That's why there exists so many working methods to recover supposedly "deleted" files. I also read, that's why it's much more useful to overwrite the file, because then the data on disk actually has to be changed. Is this true? Is this generally what's needed?

If so, I believe I can simply write the file full of 1's and 0's a few times.

I've read: http://www.codeproject.com/KB/files/NShred.aspx http://blogs.computerworld.com/node/5756 http://blogs.computerworld.com/node/5687 http://stackoverflow.com/questions/4147775/securely-deleting-a-file-in-c-net

© Stack Overflow or respective owner

Related posts about c#

Related posts about security