Securely deleting a file in C#.NET

前端 未结 5 2115
无人及你
无人及你 2021-02-10 01:29

In a project I am doing I want to give users the option of \'securely\' deleting a file - as in, overwriting it with random bits or 0\'s. Is there an easy-ish way of doing this

5条回答
  •  没有蜡笔的小新
    2021-02-10 01:48

    You can't securely delete a file on a journaling filesystem. The only non-journaling system still in heavy use is fat32. On any other system, the only way to securely delete is to shred the entire hard drive.

    EDIT

    The reason secure delete doesn't work, is that that data used to overwrite a file might not be stored in the same location as the data it is overwriting.

    It seems Microsoft does provide a secure delete tool, but it does not appear to be something that you can use as a drop in replacement.

    The only good way to prevent deleted file recover, short of shredding the disk, would be to encrypt the file before it is written to disk.

提交回复
热议问题