I've got an eraser class in my .NET application.
It allows user to delete files and folders securely, without a chance to recover erased data by any file recovery software.
Currently it works by opening the file in binary mode and filling the size with random bytes.
I'm afraid 开发者_C百科the solution is not reliable. While the contents gets erased, file record itself (file name, size, attributes), remains recoverable.
The question is - how to erase the system data related to specific file or folder. I think managed code can't help here and Windows API should be used.
Overwrite with random data, change the file attributes, rename the file several times, change the file size, and only then delete the file?
精彩评论