1

I've been thinking of purchasing a Purism machine, which uses an SSD to store data. Now, from my research, it seems SSDs make it pretty hard to securely delete data because of wear leveling, especially when it comes to deleting a specific file as opposed to wiping out the entire device. Fortunately, Purism machines have their SSDs encrypted by default to circumvent this problem. However, that does not account for cases in which the encryption key is leaked, lost, or obtained through coercion.

My question, then, is: when you partition an SSD, can you be sure the data will stay there and not be "shuffled" to other parts of the device? Also, in this set-up, could you later use Secure Erase, TRIM, or even just overwrite the partition with gibberish n times to securely delete only what is stored in that partition? If so, what would be the best course of action to do so? How many times would I be able to re-use a partition in this manner before it became too worn?

Thank you very much for your attention!

2
  • 1
    Partitioning isn't really relevant with regards to your concern, as a partition is merely a "scope" of which logical blocks will be used (for a filesystem). Yet the problem that concerns you is about the perhaps-constantly-changing mapping between the logical blocks and the actual storage, so it does not matter whether you use only some of the logical blocks or all of them, or which of them you use. (In other words, partitioning is not a new factor / variable with regards to what you've already read about)
    – Tom Yan
    Mar 19, 2022 at 18:23
  • Just as an aside, the ATA "SECURE ERASE" is deprecated, and replaced by the "SANITIZE" command.
    – Ro-ee
    Mar 19, 2022 at 22:01

2 Answers 2

0

While the gist of your understanding is correct, there are some small but critical bits that make a massive difference that need to be corrected.

LUKS (Linux encryption - which works analogously to bitlocker) does not use your encryption key to encrypt the data directly (in fact you can have up to 8 different encryption keys per LUKS system). The trick is that LUKS has a header, and the encryption keys are used to unlock the header, which in turn unlocks the device. If your encryption key is compromised you can simply change the key There is still a risk though - if someone has an old encryption key + a dump of the old header they can overwrite the header and recover the data with the old key - but this is a mmuch narrower and more preventable risk.

This also means that to wipe the entire partition, all you need to do is wipe the encryption header.

When you use LUKS on a disk with secure erase, you are effectively encrypting twice, with 2 headers. The advantage of secure erase is it is done in hardware, and thus knows the disk geometry and it can be sure the header has not been moved/abstracted. (The disadvantage is secure erase is not open to scrutiny and may not be as secure as believed - indeed there have been disks which could be recovered after secure erase due to a bug/backdoor - https://www.helpnetsecurity.com/2018/11/06/self-encrypting-ssds-vulnerable/)

Unfortunately these are all partition/disk level solutions. You cant absolutely guarantee deletion at the file level (although some software can use encrypted headers to act in a similar way at a file level - I suspect some password managers like keepass compatible ones do this)

5
  • “Military grade software” to wipe disks, are only really useful with traditional HDD, data recovery is very difficult with SSD, since your unable to scan every literal storage cell for the data (only the data the firmware wants you to use). So wiping the header, and losing the password, is enough for 99% of people. If you are in that 1% where that’s not enough, let’s be honest, your data is already compromised by that government agency that wanted the data. I would advise writing over the data, by installing some operating system, this will prevent 99% of attempts of data recovery on an SSD.
    – Ramhound
    Mar 19, 2022 at 20:06
  • 1
    So all you need to do is to wipe the header. Does that mean the header does not get moved around? I'm no expert, but I've heard that an SSD is essentially a black box. The SSD controller decides what goes where, and keeps this from the outside world.
    – SPRBRN
    Mar 19, 2022 at 20:08
  • @SPRBRN The Secure Erase header would not move around (I suspect its not even on the disk). Secure Erase is implemented by the drive itself. Unfortunately the LUKS header might move around. As LUKS is software, and the SSD is abstracted away, it can't be guaranteed.
    – davidgo
    Mar 19, 2022 at 20:12
  • davidgo, the possibility of the LUKS header moving is vastly reduced by the way it is stored, read the following: 2.4 AF-Splitter LUKS uses anti-forensic information splitting as specified in [Fru05b] source: gitlab.com/cryptsetup/cryptsetup/-/wikis/LUKS-standard/…
    – r2d3
    Mar 19, 2022 at 21:55
  • @SPRBRN - The header we are talking about isn’t being around since the data isn’t changing. Even if it is moved around, without the ability to decrypt the data, the existence of the header is useless. Hence the reason you simply overwriting the data is enough with a SSD after a Secure Erase. Data is only “moved around” to other cells on writes, the header doesn’t change, so it’s unlikely it would be moved around.
    – Ramhound
    Mar 19, 2022 at 22:21
0

My question, then, is: when you partition an SSD, can you be sure the data will stay there and not be "shuffled" to other parts of the device?

No, you can't because the firmware only manages wear in internal blocks in a way you cannot assume any fixed relationship between hard drive sectors and internal blocks.

Also, in this set-up, could you later use Secure Erase,

Yes you can, but would you trust the firmware? Hard drive manufacturers have already been caught implementing bad encryption. The ATA command "secure erase" in case of always encrypting devices can be handled in a way that the drive deletes the internal encryption/ decryption key. That would make the drive unreadable. But can you trust the firmware that it really deleted this key? Furthermore the drive could have reduced the number of possible key variations. Do not trust the black box.

just overwrite the partition with gibberish n times to securely delete

This is not sufficient because of the existence of internal spare blocks and the dynamic assignment to logical sectors.

only what is stored in that partition?

This does not work, explanation above.

If so, what would be the best course of action to do so?

Use full drive encryption provided by open source software, Truecrypt, Veracrypt, LUKS etc...

How many times would I be able to re-use a partition in this manner before it became too worn? TRIM, or even

Take the guaranteed number of terabytes of your manufacturer and divide it by the size of your drive. That gives you the number of times you can rewrite the whole drive.

Example: drive size is 120 GB, guarantee is 80 TB, gives 80 000 GB / 120 TB = ~667 full writes.

But those writes are not necessary. Partly overwriting the areas where the encrypted key(s) reside will be sufficient.

With regards to the comment of xxxxxx

Does that mean the header does not get moved around?

Sure it can move, but LUKS for instance is spreading the header over a big number of sectors so that any single reassignement does not enable the firmware to get hold of the full header simultaneously.

If that is your fear you still have the possibility to overwrite the data but if your storage is that much used up or broken (device does not write anymore or seems dead) you can simply physically destroy it.

Keep in mind that you need full header information and data sectors to decrypt content.

You must log in to answer this question.

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