This code was just made as a coding exercise, nothing more. I am offering it as-is and I do not claim it can securely delete files, so using it is your own responsibility. No warranties, express or implied, are given.
Code: Select all
Code: Select all
That's something that has been bothering me as well.srod wrote:Looks nice info.
'scuse the daft question though and excuse my lack of knowledge of the Windows file system etc.but, when you overwrite a file like this and bearing in mind all the buffering going on (the PB file commands are certainly buffered) are we absolutely guaranteed to be overwriting the exact same bytes on the hard disc as occupied by the file being overwritten?
I think it helps eliminate "ghost" signals, where the residual signal can be read or at least inferred.dell_jockey wrote:Why would one want to overwrite a file that many times? I mean, if you would overwrite each and every byte twice, once with $AA and once with $55 (or any other pair with similar properties), you'd be sure that all bits got flipped at least once. What's the purpose of multiple passes beyond that?
Yup, I used FlushFileBuffers() after each written MB, so it should be safe.when you overwrite a file like this and bearing in mind all the buffering going on (the PB file commands are certainly buffered) are we absolutely guaranteed to be overwriting the exact same bytes on the hard disc as occupied by the file being overwritten?
Assuming you talk about gutmann, each pass was at first made for a type of disk: hdd, floppy, etc.. What I did, in a way is overkilling... I implemented the whole method (35 passes), but 7 passes are more than necessary on newer storage media. Depending on the writing scheme of the hdd, those signals will overwrite the old ones, decreasing their magnetic field so much that it can't be recovered. Since that magnetic field (in order to be reliable is strong), a few passes are needed to kill the data.Why would one want to overwrite a file that many times? I mean, if you would overwrite each and every byte twice, once with $AA and once with $55 (or any other pair with similar properties), you'd be sure that all bits got flipped at least once. What's the purpose of multiple passes beyond that?
Code: Select all
For Fill = 0 To #BlockSize
PokeB(*Pattern+Fill,%00100100)
Next
I use that because we need to poke a byte and increment the value so we can poke the new byte and so on. The variable "Fill" gets bigger and bigger until it fills up that buffer. If you just use "PokeB (*Pattern,%00100100)" the you'll just put all the values at the first position in the buffer and the rest will remain unfilled.I'd like to know why you add +Fill at the *Pattern