2

There is such utility for Linux systems called shred. It writes files with random values several times and then also can write it with zeroes (to hide overwriting) and delete them so that files couldn't be restored.

Is there something trustful like this for Android (preferably not proprietary, but libre software)?

Andrew T.
  • 15,988
  • 10
  • 74
  • 123
R S
  • 173
  • 9
  • 3
    Overwriting data in the "flash age" is next to useless as wear leveling redirects the written data to a new flash cell. – Robert Nov 15 '20 at 16:40
  • https://unix.stackexchange.com/q/602498 instead of /dev/zero you can use /dev/urandom (but as Robert said it's pointless) https://android.stackexchange.com/q/231098 – alecxs Nov 15 '20 at 17:26
  • @Robert ok, what to do to destroy data: overwrite the whole flash memory with the other files? – R S Nov 15 '20 at 20:18
  • @RS As long as the flash memory has no spare section overwriting all free space should work. But be careful Android does not like it if the user data partition is fully used. Therefore better keep some KB free. – Robert Nov 15 '20 at 20:45
  • Flash storage devices are very likely to have some over-provisioning space left for garbage collection, weal leveling and performance. And also there are scores of partitions other than /data on a common Android device. So even if you overwrite (or ERASE / TRIM / DISCARD) the whole /data partition (including its filesystem), you cannot clean the whole flash storage chip. But overwriting a file with random data is usually enough for common users. It makes the recovery of file from filesystem level impossible. Recovery from flash chip isn't very easy, it's usually done in forensic labs only. – Irfan Latif Nov 15 '20 at 23:49
  • @RS can you give us example how you deleted and successful recovered some file on your android device? – alecxs Nov 16 '20 at 09:06
  • @alexcs I deleted a photo by trash button in picture viewing application (Gallery). Then installed some application from Google Play, it scanned memory and then it showed huge amount of deleted images, including the one I was looking for. – R S Nov 16 '20 at 22:40
  • @Irfan Latif so if I edit a photo, like spoil it with a brush and then delete it, it's going to work? Edited (spoiled) image only can be recovered, right? – R S Nov 16 '20 at 22:43
  • that files actually were never deleted. you most likely just 'restored' existing files from com.android.gallery3d/files/.trashcan or com.android.gallery3d/cache - recovery of deleted files isn't that easy (especially on FBE encryption it's not possible at all) – alecxs Dec 04 '20 at 22:45
  • @alecxs there is no /files, there was cache with some strange files (not jpgs) and I deleted all files in the cache, then data recovery app still restored all photos (deep scan). This one: https://play.google.com/store/apps/details?id=com.i8dudata.imgrecover.free – R S Dec 14 '20 at 23:07
  • @Irfan Latif ok, then what's going on (see comment above)? – R S Dec 14 '20 at 23:09
  • 1
    made some test with the app - it is definitely related to gallery and not actually restoring deleted files. instead it finds thumbnails of previously viewed pictures. i made some screenshot and deleted from gallery. deep scan did find the screenshot. then i cleared gallery app data. second run deep scan did not find the screenshot anymore (my phone is not encrypted) – alecxs Dec 15 '20 at 20:38
  • @alecxs thank you very much, what to do if I have no /files ? – R S Dec 15 '20 at 21:59
  • on my samsung tablet android 10 i have noticed in stock file manager there is a trash enabled by default - i have disabled now – alecxs Dec 16 '20 at 09:28
  • 1
    i can imagine the locations of thumbnails are endless. basically you need such app with option to delete results. if your device is rooted you can try to find such locations and delete files manually. if you don't ask for single files, of course a simple factory reset is sufficient – alecxs Dec 16 '20 at 09:35

0 Answers0