martijnvanbrummelen / nwipe

nwipe secure disk eraser
GNU General Public License v2.0
693 stars 79 forks source link

Non-linear erasure #10

Open wavexx opened 8 years ago

wavexx commented 8 years ago

This is mostly a RFC than a feature request ;)

Running a wipe on a large spinning drive takes a long time. In fact, if I just want to give out the drive to somebody else, I would be fine to make recovery hard, without really overwriting all disk blocks.

It would be nice if, instead of doing a linear block-by-block overwrite, only a handful of blocks each N would be cleared instead, starting from 0 and then seeking forward until the end of the disk, then restarting at a different offset within modulo N (possibly spreading the offset as well), and repeating until all blocks are successfully cleared.

Using a deterministic seed, you could change the forward offset pseudo-randomly, so that the chances of recovery due to a fixed alignment decrease drastically.

To speed-up the process, you could even target filesystem-specific metadata blocks first, notably, starting a superblocks, then going bottom-up up to the first 1 or 2 leaf inodes (so that even block-based data recovery methods would fail immediately), and then proceed with the pseudo-random, space-filling forward scan.

It's going to be overall slower for clearing the disk completely, but recovery is going to be almost impossible within just a few minutes, as opposed to hours.

Just a thought.

martijnvanbrummelen commented 6 years ago

Sounds nice a nice feature, I will put it on my list. Perhaps I can create this feature in the future.

kelderek commented 6 years ago

Would it be just as effective to do it like the old progressive/interlaced jpgs? You just jump in a regular fashion, e.g. block 1, 11, 21, 31, etc. to the end, then 2, 12, 22, 32, etc to the end, 3, 13 and so on. that would allow you to quickly reduce recoverability across the whole disk with out risking a random approach leaving large sections untouched. You also wouldn't have to track what you have already done like you would with a random approach.

Doing the key blocks in a traditional fashion first is a great idea.