[dm-crypt] Variable data offset for a LUKS volume that uses a detached header.

Arno Wagner arno at wagner.name
Thu Dec 24 07:31:35 CET 2015

On Wed, Dec 23, 2015 at 23:15:51 CET, .. ink .. wrote:
> On Wed, Dec 23, 2015 at 9:23 AM, Arno Wagner <arno at wagner.name> wrote:
> >
> > Hmm. What about actually shifting the partition contents physically?
> >
> > Or maybe have a dummy-LUKS device, open that, read the master-key
> > (see FAQ Item 6.10 ) close it again, and use that master-key
> > on a plain device? This is probably far to complex, but could
> > serve for experiments.
> >
> This actually works and i will go with it,it is actually possible to
> get the master key
> from a header without first unlocking the device.
> I have a proof of concept code on how to get a master key from a LUKS
> volume/header
> and then opening a plain dm-crypt device with the master key together
> with other options.
> I have used the code to successfully create a LUKS volume header with
> a VeraCrypt
> master key and then reading the master key from the LUKS header and
> create a "correct"
> mapper through a plain dm-crypt device.

Excellent, that was the idea. The actual dummy-mapping was 
only for the case that you use the cryptsetup binary, with
the library that is not needed. "Plain" as the actual 
maping for the data-device has the advantage that you
get a lot more flexibility.
> The code is at:
> https://github.com/mhogomchungu/random_stuff/blob/master/cryptsetup.c

Thanks for sharing!

Arno Wagner,     Dr. sc. techn., Dipl. Inform.,    Email: arno at wagner.name
GnuPG: ID: CB5D9718  FP: 12D6 C03B 1B30 33BB 13CF  B774 E35C 5FA1 CB5D 9718
A good decision is based on knowledge and not on numbers. -- Plato

If it's in the news, don't worry about it.  The very definition of 
"news" is "something that hardly ever happens." -- Bruce Schneier

More information about the dm-crypt mailing list