Question about LUKS encryption
I tried encrypting my machine, but following the arch wiki got confusing because i didn't understand what LVM was or what LUKS was at first.
I managed to follow a video guide together with the arch wiki so that i may have a better grasp of the subject, and i do have some issues with swap and tmp encryption, but ill figure that out on my own.
When creating the luks partition or whatever you call it, i ran a command similar to this one.
as shown in the arch wiki.
"cryptsetup luksFormat --type luks2 /dev/sda1"
except that the video i was following was using '--type luks' and not 'luks2', is there any difference between them?, should i redo my installation with 'luks2' instead?. Thanks.
Edit: thanks everyone for your answers.
Edited 16 Jan 2019. We only hold this version.
About this post
- Posted
- Archived
- Edited
- Score
- 9 · 100% up
- Kind
- Text
- ID
- agg7b4
12 comments
LUKS is for encryption
LVM is for dynamic partitioning (or traditional partitioning on top of devices that normally don't support traditional partitioning either)
Basically LUKS is what you want if you need more security, and LVM is what you want if "one big filesystem for everything" doesn't cut it for you.
You can use either or both. They're independent layers of storage.
No need to redo, you could convert to luks2, it's possible to upgrade (but not easy to downgrade) without re-encrypting data. (cryptsetup convert --type luks2 - use at your own risk)
What you must understand is that encryption is only as good as your passphrase. If you had a really good passphrase, no one could brute force it even if there was no such thing as the brute-force protection by iterations that is LUKS1. But as long as your passphrase can be obtained with a simple keylogger, it's pointless to invest in even stronger anti-bruteforce mechanisms like iterations+huge ram usage (only while unlocking) that is LUKS2.
No one will brute force your passphrase given much easier methods available ( https://xkcd.com/538/ ).
Once the container is open, both LUKS1 + LUKS2 just do regular old encryption, nothing changes about that.
There are other compelling reasons to use LUKS2, however. It adds metadata copies and checksums and integrity support if you desire. So it's more resilient against data corruption than LUKS1, and it can at least tell you outright when you're screwed. It also sports a much better keyslot system - no longer limited to 8 and and able to prioritize/tag them more specifically. It also remembers personal preferences such as whether or not you wish to allow TRIM on encrypted SSDs.
Quite simply, it's more modern and feature-rich. LUKS1 will eventually be zoned out entirely...
Then again most users never have more than one passphrase or maybe two. And might not mind the other features or not know how to set those up. (Just using --type luks2 does not magically enable most of the new whizbangs)
I'm still using LUKS1 myself. And it will stay that way for a while, because all cool features aside, having a full grasp on how things work is just as important, and I just understand LUKS1 much better than LUKS2 - too many settings can be confusing too.
Thanks for the help.
I used the convert command and it seems to have worked without a hitch. ive also read a bit more on the wiki and i feel that i understand LVM and LUKS slightly better now.
dont convert, there is a huge vulnerability in doing this, you absolutely must format and redo with luks2
Yes. LUKS (without the 2) is an older header format than LUKS2. LUKS is still around for a variety of reasons (because LUKS2 is unsupported by GRUB2 at this time, and for general backwards compatibility, as well as the fact that it still works.) LUKS2 is better, but not necessarily in ways that matter a great deal to a basic setup (plugins, extensibility, hardening of the password protection, a bit of metadata redundancy, that sort of thing.)
If you're already running on LUKS, there's no real need to upgrade (unless you think your computer will be stolen by some very advanced adversaries with access to custom ASIC cracking hardware that probably doesn't exist yet; but then you wouldn't be asking in here, would you...)
Alright, that sounds good. I doubt my PC will ever get stolen, but id rather have it encrypted anyway.
It might be confusing, indeed, because there is just so much you can do. I've made a list of commands to launch to have a pretty generic luks + lvm setup: https://git.sitilge.id.lv/sitilge/setup . Hope it helps.
Concur on the confusing nature of the encryption sections of the wiki. I found myself going back and forth all over the place trying to get my head around it. It'd be great if somebody more skilled could give that whole section a re-write, or at least restructure it so its easier to newbies to follow.
Do you encrypt prior installing arch or after?
I did a 'shred -n 1 -v' on my drive, then encrypted and installed.
Okay I am looking for a post install encryption of my partition