Skip to content

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.

9 points11 comments
Open on Reddit
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.

should i redo my installation with 'luks2' instead?

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.

10 points
unknown author1 hidden

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.

1 points
Tall-Alps8657Removed · saved before deletion

dont convert, there is a huge vulnerability in doing this, you absolutely must format and redo with luks2

1 points

'--type luks' and not 'luks2', is there any difference between them?

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...)

8 points
unknown author

Alright, that sounds good. I doubt my PC will ever get stolen, but id rather have it encrypted anyway.

2 points

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.

3 points

Do you encrypt prior installing arch or after?

1 points
unknown author3 hidden

I did a 'shred -n 1 -v' on my drive, then encrypted and installed.

2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.