Take the 2-minute tour ×

Is there a SDK that can be used in managed code to shred files securely?

EDIT: This is the only link i could find in google that helps me

EDIT: Either SDK or some kind of COM based component.

share|improve this question
I don't think it's possible for a normal program(i.e. without intimate knowledge of both OS and storage medium) to reliable overwrite single files. –  CodesInChaos Jun 30 '11 at 11:25
add comment

5 Answers

up vote 13 down vote accepted

A pretty good article came out recently concerning this on proggit: Secure Deletion: A single overwrite will do it.

Leading forensic experts will able to recover a single bits original state after one rewrite with a 56% success rate. Considering you have a 50% success rate with pure random guessing, I don't think you have anything to be worried about.

The myth that to delete data really securely from a hard disk you have to overwrite it many times, using different patterns, has persisted for decades, despite the fact that even firms specialising in data recovery, openly admit that if a hard disk is overwritten with zeros just once, all of its data is irretrievably lost.



share|improve this answer
Um.. This doesn't really answer the question that was asked. –  Chris Pietschmann Jun 26 '09 at 3:11
@Chris Pietschmann, sometimes the best answer is "dont bother". –  Simucal Jun 26 '09 at 3:21
Just a simple note about the multiple-overwrite theory. While it probably doesn't apply today, in the past with significantly older and slower hardware, a magnetic residual could be left on a hard drive platter that could be detected and data recreated from. I'm not talking about back in the early 2000's and late 1990's of 1Gb hard drive...I mean decades ago, in the 70's and 80's or earlier. I think the "myth" was expounded a bit by governments somewhat extreme security measures to ensure drives and disks were indeed fully erased and irrecoverable (i.e multiple overwrites with 0's then 1's). –  jrista Jun 26 '09 at 3:35
This question doesn't tell you how to make sure the data is overwritten at least once, which makes it pretty useless IMO. –  CodesInChaos Jun 30 '11 at 11:19
add comment

This code from codeproject may be a good starting point.

Eraser has been around for years, you could call out to it by using System.Diagnostics.Process, or at least review the algorithm there.

share|improve this answer
add comment

Check out a response I posted here for an implementation.

share|improve this answer
This code doesn't guarantee that the random data is written to the same physical position on the storage device as the original code. –  CodesInChaos Jun 30 '11 at 11:22
add comment

Technology has changed in the past few years so when I happened to see this answer (why wasn't an answer accepted again?) I wanted to provide an update for others with similar questions.

Please note that shredding is very much filesystem and media dependent. Attempting to "shred" a file on a log based filesystem or a filesystem stored on smart (write leveling) flash isn't going to get you very far. You would have to, at a minimum, write enough data to complete fill the device to hope that the old data might be overwritten one time.

More likely you would have to write several smaller files and when you get FS full, delete one and then keep writing a new one, to ensure that all reserved space has been overwritten as well. Then you will probably be fairly safe. Probably.

I say probably because the storage media/FS could decide that a block was failing (or used too much relatively) and map it away substituting some other part of the disk instead. This is a per-block thing of course, so any much larger file is unlikely to be reconstructed.

share|improve this answer
add comment

Take a look at Windows.WinAny.Helper at the CodePlex. It has SecureDelete extension which allows you to shredd files with different algorithms like Gutmann, DoD-7, DoD-3, Random or Quick.

share|improve this answer
add comment

Your Answer


