Re: rescue corrupted luks header?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Nov 08, 2008 at 04:02:23PM +0100, Arno Wagner wrote:
> On Sat, Nov 08, 2008 at 06:10:27PM +1300, Roscoe wrote:
> > > 2048 bytes looks like it would be enough if he used a 128 bit key, but
> > > if he used a 256 bit key you might not get all of the last keyslot
> > > (judging by observed payload offsets of 2056 bytes).
> > 
> > Woops....Offsets are measured in sectors not bytes!
> 
> Ups. So he would have to look into what is actually in the
> keyslots. The key-material is stored on disk directly 
> after the header and before the bulk data. 
> 
> Ok, revised: Look at offset 104 in the header. It lists
> where the bulk data starts (in sectors). Backup everything 
> before.
> 
Here is an update: I just created an 1GB luks partition via
loop-device and luks-format. The keyslot seems to be 64000 bytes
long, with the offfsets in the keyslots placinf them every
65536 bytes.

The Filesystem seems to start at offset 0x81000 (lots
of zeros before that, which I take for the 7 unused keyslots).
The header at offset 104 (0x68) says 00 00 04 08, which
would be 1032 and 1032 * 512 = 528384 = 0x81000. 

Seems that a liks header + keys material with everything 
as default is 516kB in size. 

Incidentially, below is a hexdump (via "hex") on what a good LUKS
looks like.

Arno

0x00000000: 4c 55 4b 53 ba be 00 01 - 61 65 73 00 00 00 00 00 LUKS<BA><BE>..aes.
0x00000010: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................
0x00000020: 00 00 00 00 00 00 00 00 - 63 62 63 2d 65 73 73 69 ........cbc-essi
0x00000030: 76 3a 73 68 61 32 35 36 - 00 00 00 00 00 00 00 00 v:sha256........
0x00000040: 00 00 00 00 00 00 00 00 - 73 68 61 31 00 00 00 00 ........sha1....
0x00000050: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................
0x00000060: 00 00 00 00 00 00 00 00 - 00 00 04 08 00 00 00 10 ................
0x00000070: 14 dd 4f b8 1f 42 a1 02 - 9a 93 ec ae bf 26 8d 7c ..O..B....<EC><AE>
0x00000080: 40 2e 6d 5c 4c ba 21 d8 - 31 94 dc 00 2c 0d 43 39 @.m\L.!.1...,.C9
0x00000090: bb 03 24 95 4f fe 97 97 - a0 2c 75 63 ea 92 cb a5 ..$.O....,uc..<CB>
0x000000a0: 4d aa a0 1c 00 00 00 0a - 31 35 31 61 37 30 34 64 M.......151a704d
0x000000b0: 2d 34 36 33 36 2d 34 61 - 38 30 2d 39 34 61 66 2d -4636-4a80-94af-
0x000000c0: 63 32 61 34 65 61 62 66 - 36 38 31 63 00 00 00 00 c2a4eabf681c....
0x000000d0: 00 ac 71 f3 00 02 af 20 - ea d9 3c b9 b5 14 85 49 ..q.... <EA><D9><
0x000000e0: 3c 7c 57 1a c8 8c 92 9a - 61 80 de 9d 2c fd 9b 85 <|W.....a...,...
0x000000f0: ff d4 2f 72 64 81 6f 12 - 00 00 00 08 00 00 0f a0 ../rd.o.........
0x00000100: 00 00 de ad 00 00 00 00 - 00 00 00 00 00 00 00 00 ..<DE><AD>........
0x00000110: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................
0x00000120: 00 00 00 00 00 00 00 00 - 00 00 00 88 00 00 0f a0 ................
0x00000130: 00 00 de ad 00 00 00 00 - 00 00 00 00 00 00 00 00 ..<DE><AD>........
0x00000140: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................
0x00000150: 00 00 00 00 00 00 00 00 - 00 00 01 08 00 00 0f a0 ................
0x00000160: 00 00 de ad 00 00 00 00 - 00 00 00 00 00 00 00 00 ..<DE><AD>........
0x00000170: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................
0x00000180: 00 00 00 00 00 00 00 00 - 00 00 01 88 00 00 0f a0 ................
0x00000190: 00 00 de ad 00 00 00 00 - 00 00 00 00 00 00 00 00 ..<DE><AD>........
0x000001a0: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................
0x000001b0: 00 00 00 00 00 00 00 00 - 00 00 02 08 00 00 0f a0 ................
0x000001c0: 00 00 de ad 00 00 00 00 - 00 00 00 00 00 00 00 00 ..<DE><AD>........
0x000001d0: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................
0x000001e0: 00 00 00 00 00 00 00 00 - 00 00 02 88 00 00 0f a0 ................
0x000001f0: 00 00 de ad 00 00 00 00 - 00 00 00 00 00 00 00 00 ..<DE><AD>........
0x00000200: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................
0x00000210: 00 00 00 00 00 00 00 00 - 00 00 03 08 00 00 0f a0 ................
0x00000220: 00 00 de ad 00 00 00 00 - 00 00 00 00 00 00 00 00 ..<DE><AD>........
0x00000230: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................
0x00000240: 00 00 00 00 00 00 00 00 - 00 00 03 88 00 00 0f a0 ................
0x00000250: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................



-- 
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: arno@xxxxxxxxxxx 
GnuPG:  ID: 1E25338F  FP: 0C30 5782 9D93 F785 E79C  0296 797F 6B50 1E25 338F
----
Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans

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

---------------------------------------------------------------------
dm-crypt mailing list - http://www.saout.de/misc/dm-crypt/
To unsubscribe, e-mail: dm-crypt-unsubscribe@xxxxxxxx
For additional commands, e-mail: dm-crypt-help@xxxxxxxx


[Index of Archives]     [Device Mapper Devel]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux