I was under the impression that you can't recover "deleted files" from iPhones and their encrypted storage memory the same way you can from a computer.

But after doing some research, there seems to be a bunch of apps that can do just that.

So I'm wondering, is there a way I can securely delete specific messages (personal ones) from my phone, in a way that definitely cannot be recovered if my phone is imaged? I can't wipe the whole phone though, that's off the table.

Essentially what I'd like is the iPhone equivalent of "erase free space" that Disk Utility has, that overwrites all free space so nothing can be accessed.

  • Which apps are you referring to? When you “my phone is imaged” - do you mean by someone who already has got the passcode for decryption? – jksoegaard Apr 2 at 1:06
  • There are a lot of 3rd party apps that claim to be able to recover deletes texts, I haven't actually tried any of them though. And yes, the person imaging the phone will have the passcode. – l008com Apr 2 at 1:07
  • Name one or more of them so that we can know what we’re talking about here. – jksoegaard Apr 2 at 1:08
  • Can we assume anything about the level of sophiscation when imaging? I.e. are we talking a backup made from iTunes, or do you want to be protected against someone who has the skills and hardware to read directly from the NAND flash chips themselves? – jksoegaard Apr 2 at 1:10
  • For example: PhoneRescue, Tenorshare iPhone Data Recovery, WonderShare Dr Fone. They all sound super sketchy but it's important the people getting my phone don't have access to my personal texts. – l008com Apr 2 at 1:10

The only way to be fully protected against this is to delete the messages from the phone, create a backup of the phone and then completely wipe the phone. You can restore the backup afterwards.

Because wiping the phone means that the encryption keys previously used are thrown out and new ones put in place, it is not possible for a (reasonable) attacker to get to the messages even if they should be available in encrypted form on the NAND flash.

If you know the file structure of the app that the messages are saved in, it is possible to create a somewhat weaker defense against outsiders accessing your now-deleted texts. For example if the messages are stored in a SQLite database (such as with for example the Messages app), you could jailbreak the phone, export the database to a dump text file (which wouldn’t contain the deleted messages), remove the original database and then fill up the disk with random bytes. When the disk is filled up, delete the file with random bytes and import your database dump as a SQLite database.

The above mentioned procedure is necessary because when you delete a single message from a SQLite database, it is not a file that is removed. It is merely space within a file that is marked as non-used at the application layer. The file is not shrunk nor does the operating system know that parts of the file are non-used. The above mentioned process forces these deleted areas to be made available to the operating system for overwriting.

In addition overwriting is in itself not a good protection on a NAND flash disk with wear-leveling (i.e. the flash storage in a modern iPhone is comparable to a SSD drive with its own controller, etc.). The reason being that even when you overwrite a data block on disk, the controller inside the flash storage might decide to simply “stow away” that physical block and map other physical blocks in instead. This is a byproduct of wear-leveling.

  • So theres no known way of overwriting free space, to make deleted files nonexistent without doing the full wipe? (I wish iPhone had a Disk Utility) – l008com Apr 2 at 1:19
  • Yes there is - but that won’t protect you as it doesn’t overwrite “free” space within files. In addition overwriting doesn’t fully protect you in a NAND flash scenario because of wear-leveling. It only really works on spinning disk drives. – jksoegaard Apr 2 at 1:20
  • Ok heres a question. If we do go the backup-wipe-restore route, WOULD that even protect us from getting deletes messages recovered? If all of the Messages are stored in a single SQLlite database, then isn't that file going to be backed up and restored, deleted table rows and all? – l008com Apr 2 at 1:37
  • Combine the two methods for the best protection. – jksoegaard Apr 2 at 5:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .