1

I'm trying to understand the relationship between LUKS detached headers and their respective block device. From what I understand "formatting" with a detached header doesn't actually change the content of it's respective block device, that only occurs when you begin to write to the opened (cryptsetup luksOpen) partition.

So I would like to know:

  • Can a single encrypted partition have two independent headers. For example if I had a removable drive intermittently plugged into two different computers, could each computer have it's own independent copy of the header without any need to re-sync the two copies of the header.
  • Can a single detached header be used for two separate drives. For example if I had two encrypted backup drives, could a single header be used for both, or is the header in some way bound to the partition?

1 Answer 1

1

It's possible. If you read the cryptsetup manual and FAQ, you'll find that such things are discouraged. But there is nothing anywhere preventing you from doing so anyway.

You can use as many copies of the header as you like and even modify those copies, e.g. so one copy uses passphrase A, the other uses passphrase B - or one could be in LUKS1 format while the other is in LUKS2. Anything goes as long as the encryption itself remains unchanged. The downside is that you cannot revoke a passphrase if you do not have control of all the LUKS header copies.

You can use the same header for as many drives as you like, and it would work, but the downside is, they would all be encrypted using the very same master key. It's more common to use different headers (different master keys) perhaps with identical passphrase to them, e.g. systemd supports re-using the same passphrase to open many independent LUKS containers on bootup.

The LUKS header is just a fancy way of storing the actual encryption key (what LUKS calls the "master key") and related metadata (like which cipher to use and the data offset). It does not record partition names or sizes so there are not many restrictions. LVM or mdadm metadata is a lot more picky about these things.

1
  • Thanks that's helpful. Yes "advisable" and "possible" are notably different. Though I like the security of detaching a header and never physically moving it because the real encryption key is so much stronger than my own password. Beyond that the weakest point of security remains the same Oct 5, 2019 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.