Effacer les filtres
Effacer les filtres

Drive Wiper Program

2 vues (au cours des 30 derniers jours)
Michael
Michael le 9 Jan 2012
Hello
I've been experimenting with a driver wiper program designed to remove sensitive data from a hard drive, eg. before it is sold. From a little bit of research I think three wipes will be sufficient, among the many methods I chose one scheme which writes all zeros, then all ones, then random noise onto the drive. I've tried implementing this but I'm not seeing very good performance.
The program is implemented in a script file which is placed on the drive and executed in MATLAB (installed on another drive). This script creates a logical matrix of zeros which is matched in size to the available memory (apparently one logical element in MATLAB is one byte, not one bit?!). It's then written to an indexed binary file (eg. "1.bin") which seems to shrink it down in size by a factor of 8 so that one element is one bit. I fill the drive with these files, then overwrite them with another matrix of ones and then a matrix of random numbers. (this is another problem, I'm using "randi(2,X)>1" to generate an X-by-X matrix of 1s and 0s and it takes ages for a 4GB file).
The writing process takes really long and I think the "fwrite" command I'm using is quite inefficient because it's taking a lot longer than some professional software. I thought holding the file in RAM and repeatedly copying it would be fast but it's slower than duplicating a single file in Windows Explorer with copy/paste. I think it might be something to do with the way logical elements are stored in RAM- if I'm writing a 4GB matrix into a binary file it comes out at 512MB so I need eight times as many writes to fill the drive up.
Does anyone have any ideas for improving the speed? Hoping to put this on the file exchanged once it can compete with professional software.
Regards, Mike

Réponses (2)

Walter Roberson
Walter Roberson le 10 Jan 2012
Sorry, but that algorithm cannot compete with professional software.
I used to be a security administrator and knowing about drive wiping was one of my responsibilities.
Your algorithm does not deal with runt sectors, and does not deal with sectors remapped due to bad blocks; it may also fail on journaled filesystems such as are commonly used on MS Windows and OS-X. See http://en.wikipedia.org/wiki/Data_remanence#Complications
A 3-pass wipe only meets the lowest level of US and Canadian government erase specifications -- sufficient only for disks that never contained any legally-protected data. Disks that contain any personally-identifiable financial or medical information or even just contract terms where the other party did not explicitly consent to contract disclosure, are one or more security levels up from that.
At my workplace, our rule is that our lowest security server disks must be physically rendered unusable. They cannot even be "handed-down" to a lower security level in the same organization.

Jan
Jan le 11 Jan 2012
The German journal C't has asked several service for professional data recovery for recreating the original data of a hard disk, which was overwritten by only zeros or only ones - without any success. Of course there might be a single high tech lab in the desert in Nevada, where a bit can be identified after overwriting with a 0 or a 1. But I'm convinced that they will not work for me or for other FEX users. The US government erase specification will most likely contain a security overhead considering future developments.
Therefore I would stay as a simple method like:
FID = fopen(File, 'r+');
if FID < 0
fprintf(2, '### %s\n', ['Cannot wipe out file: ', File]);
else
fseek(FID, 1, 0);
Len = ftell(FID);
fseek(FID, -1, 0);
fwrite(FID, rand(1, Len) * 255, 'uint8');
fclose(FID);
end
rand()*256 is faster than randi(). For GB files, I'd do this in chunks.
The wear-leveling algorithms of SSDs will reduce the power of "overwriting" data remarkably. The smart auto-backups of Windows 7, the write-caches of the hard disk and the page-file will be further problems.
I do not see a chance to compete with a professional disk wiper. And evey these tools cannot compete with a physical destruction.

Catégories

En savoir plus sur Low-Level File I/O dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by