Secure delete with python

Matthew K Jensen matt.torment at gmail.com
Tue Sep 7 02:45:21 EDT 2004


Paul Rubin <http://phr.cx@NOSPAM.invalid> wrote in message news:<7xd60zf339.fsf at ruckus.brouhaha.com>...
> Ville Vainio <ville at spammers.com> writes:
> >     Benjamin> and there is no guarantee that this actually overwrites
> >     Benjamin> the old file. The filesystem may choose to write the new
> >     Benjamin> content at another location of the disk, leaving the
> >     Benjamin> original data untouched.
> > 
> > Seriously? What OSen are known for doing this? I'd had thought that if
> > the file size is unchanged, the data is always written over the old
> > data...
> 
> That's what log structured file systems do, for example.
> 
> > Also, when overwriting a file, it's better to do it several times,
> > with alternating bit patterns and "syncing" the disk after each
> > pass. Of course even that is not going to guarantee anything because
> > it may just go to the hardware cache in the disk unit, but it's
> > reasonable if you are overwriting lots of data at once.
> 
> It may never get written to the same sector of the disk as the
> original file, even if the OS has tried to overwrite those sectors.
> Disk drives themselves will sometimes remap sectors from one place to
> another.

I had this idea once, when I assumed that the OS wrote to the first
blocks nearest to the beginning of the disk, to where I just simply
write a whole bunch of crap files to fill in blocks that could be the
place where recently deleted files used to be. Then defrag the
filesystem. Then delete the crap files.

I'm just thinking aloud if any of this helps.



More information about the Python-list mailing list