cgsecurity / testdisk

TestDisk & PhotoRec
https://www.cgsecurity.org/
GNU General Public License v2.0
1.52k stars 189 forks source link

Erasing recoverable files #116

Closed nav9 closed 2 years ago

nav9 commented 2 years ago

This is not an issue, but a feature request. Forgive me for submitting it as an issue. I didn't see an option to request a feature. The request is initiated from this question.

The problem:
From a security standpoint, when one uses TestDisk or PhotoRec and figures out that their photos or other sensitive files are recoverable, one would want to erase those files. Currently, the only software available are those that wipe empty disk space. Even such a wipe is not guaranteed to remove the files since modern storage devices may squirrel-away data into certain areas.

The request:
Since TestDisk or PhotoRec is capable of detecting the chunks of data that constitute a deleted file, I believe it would be a very simple tweak to your functions to add a feature where a user can choose to erase recoverable files. To save time, when scanning for recoverable files, the software could keep a record of the addresses of recoverable files, so if the user chooses to make them unrecoverable, the erasure could be done without having to scan the disk again. Hopefully, this would work with SSD's too. Erasure could just be about overwriting random bits onto areas of the file that would make it unrecoverable. Such a technique of selective erasure would perhaps be a lot faster than conventional methods that need to write random bits to the entire partition.

cgsecurity commented 2 years ago

Use

nav9 commented 2 years ago

As I've mentioned in my initial explanation, I don't want to use methods that wipe the entire partition or disk. I'm looking for a way to wipe targeted locations where recoverable files are found. Using full wipes reduces SSD life and takes too long on an HDD. Even if it is to wipe only the empty space on a disk or flash drive. I believe it's pretty easy to implement a targeted erasure using TestDisk's existing functions. It just isn't practical to do a full disk wipe each time one wants to get rid of a few hundred MB of photos that one deleted instead of shredding. Anyway, if this is not something you'd like to spend time on, I respect your decision. Thanks for considering it and thanks for the pointers.