Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programmatically really clean Delete files?

So you are about to pass your work-computer to some of your colleague. How do you make sure you really delete all your personal data?

Re-formatting, Re-installing OS will not really solve the problem.

I searched around and found some programs does "Wipe out" disks.

This caught me thinking how does those programs work? I mean, What algorithms they use and how low level those implementations go?

Any ideas?

like image 200
prakash Avatar asked Apr 28 '09 15:04

prakash


2 Answers

Most of those programs do a "secure delete" by overwriting the file bits with random noise.

The biggest problem has more to do with the actual implementation of hard drives and file systems than anything else. Fragmentation, caching, where the data actually is that you're trying to overwrite: that's the big problem . And it's a very low-level problem -- driver level, really. You're not going to be able to do it with Python, C#, or Java.

Once that problem is solved, there's the one of physical media. Because of the nature of magnetic media, it's very frequently possible to read the previous bits that were once on the hard drive -- even if you overwrote them with a different bit. "Secure delete" programs solve this problem by overwriting several times -- preferably a random but suitably large number of times.

Further Reading:

  • Data Erasure
  • Data Remanence
  • The Great Zero Challenge (provided by @Stefano Borini -- vote him up!)
like image 61
Randolpho Avatar answered Sep 28 '22 04:09

Randolpho


Safe delete programs overwrite the file multiple times with random patterns of data, so that even residual magnetization cannot be picked up and is lost in the noise. However, assuming that the great zero challenge has some truth in it, I think you can just fill the file/disk with zeros and call yourself happy, as this residual magnetization is practically impossible to pick even with professional setup.

like image 35
Stefano Borini Avatar answered Sep 28 '22 05:09

Stefano Borini