Full disk encryption on an ssd
The last thing I heard about full disk encryption on an ssd was that it's very risky because the ssd couldn't use the trim command anymore. Also nobody really knew how secure it was and there seemed to be some concerns if encryption on an ssd was as secure as encryption on a hdd.
-
Does a full disk encryption slow down my system at all? Does it cause bigger cpu usage or have a negative impact on ssd i/o? Is any of this noticeable?
-
Does the problem with trim still apply? Can I use full disk encryption on an ssd without problems?
-
Is full disk encryption on ssds as secure as it is on a standard hdd?
edit: Is there any way to set this up after already having installed arch? Or do I need to reinstall everything?
Edited 31 Aug 2014. We only hold this version.
About this post
- Posted
- Archived
- Edited
- Score
- 29 · 100% up
- Kind
- Text
- ID
- 2f370s
9 comments
I can give you a quick rundown on potential issues with this as I understand them.
SSD controllers internally re-route the write location of the ATA commands for disk leveling purposes. One side effect of this is you could end up with two (or more) copies of your LUKS header on the drive. On a regular HDD, if one passphrase gets compromised, you can just use LUKS to revoke that key and create a new one (as long as the master private key wasn't compromised in the process.) On an SSD if you do this, an attacker could potentially find an old copy of your LUKS header and use the compromised passphrase to gain access to your entire drive, even data that was written after the change (because you're still using the same master private key until you reformat.)
TRIM is disabled in LUKS (and I believe even standard dm-crypt) by default. This is because TRIM'd blocks will show as all zeros. This makes it easy for an attacker to identify which blocks are free and which are in use. Over time, the pattern of TRIM'd blocks makes it possible for an attacker to identify your file system (ext4, xfs, btrfs, etc.) I suspect most people won't be bothered too much by this so you may want to enable TRIM for performance reasons.
Even if you don't use TRIM, you may still be giving away how much of your drive is in use. On regular HDDs it's recommended to write a full pass of random data to the drive before you encrypt (for example with /dev/urandom) Because encryption is indistinguishable from random data, this makes it impossible to know how much of your drive is in use. On an SSD though, doing this will hurt performance (probably pretty greatly so.) This is because on a write command, an SSD will first have to erase the block and then write to it (hence the purpose of TRIM to erase as you go.) If you dd if=/dev/urandom to an SSD you're giving it pretty much the worst environment because every single block you write to will first have to be erased. For performance, you're much better off using the drive's secure erase command but, again, this will make your free space report as all zeros.
Encrypted data can't be compressed. If your SSD controller uses compression internally to minimize writes and maximize performance (SandForce controllers do this) you may notice a performance hit.
This SO post has a nice discussion.
TRIM is supported on encrypted SSD's nowadays. You might have to enable it manually, but it works fine.
It doesn't really have a noticeable performance impact as far as I can tell. If you want the absolute maximum in performance, FDE does have some overhead, but it's not really noticeable in any normal usage. I mostly use it on my laptop that has a cheap SSD and a dinky Core i3 and it's plenty fine.
AFAIK it's the same level of security as on a standard spinning disk drive, but I'm not an expert. At the very least, it will keep a casual thief who steals your laptop from being able to access it and will probably at least cause major annoyance even to someone skilled.
You can definitely use TRIM, but dm-crypt disables it by default, because it allows an attacker to guess the file system in use (refer to the wiki on how to enable TRIM support).
There is no reason why SSD encryption shouldn't be as safe as HDD encryption. Something to keep in mind though: If you store something unencrypted, it is possible that the SSD controller remaps the block it stored the data on (making it unaccessible, because the block has an error). You can't access that block, even when overwriting the whole disk. It might be possible to reset the controller to factory defaults, undoing any remap. If you need this, also refer to the wiki (I can't remember what that method was called)
That means using TRIM on encrypted SSD is not safe and TRIM should be disabled...
Depends on what you want to hide. When enabling TRIM you can guess which block are used, but thats it. The content is still save.
You want a processor that supports AES-NI. Not noticeable from my POV.
You may have to enable it but it's quite easy to check if it's working properly, quite easy with lvm setups and/or dm-crypt.
Should be.
#####
######
#### AES instruction set:
Interesting: [ARM architecture](https://en.wikipedia.org/wiki/ARM_architecture) | [CLMUL instruction set](https://en.wikipedia.org/wiki/CLMUL_instruction_set) | Westmere \(microarchitecture) | Jaguar \(microarchitecture)
Parent commenter can [toggle NSFW](http://www.np.reddit.com/message/compose?to=autowikibot&subject=AutoWikibot NSFW toggle&message=%2Btoggle-nsfw+ck5jio9) or[](#or) [delete](http://www.np.reddit.com/message/compose?to=autowikibot&subject=AutoWikibot Deletion&message=%2Bdelete+ck5jio9). Will also delete on comment score of -1 or less. | FAQs | [Mods](http://www.np.reddit.com/r/autowikibot/comments/1x013o/for_moderators_switches_commands_and_css/) | [Magic Words](http://www.np.reddit.com/r/autowikibot/comments/1ux484/ask_wikibot/)
As for speed, you're not going to notice a slowdown. Encryption/decryption is blazing fast on modern hardware, even without a dedicated instruction set. I've installed full disk encryption on 10-year-old laptops with no noticeable performance hit.
Maybe someday linux supports OPAL 2.0 like windows does. Full, easy encription with no performance hit and no battery hit (for laptops)