Skip to contentSkip to conversation

extracting master key from luks header, cryptsetup

dm-crypt anirudh 3 participants 3 messages May 4, 2011

lore
Share & tools
lore

anirudh

author
#0 lore raw

Is there a way to extract the master key from luks header if we have the key or pass-phrase used to encrypt the volume using cryptsetup?

I wold like to save the master-key separately in a safe place and use it only in the case where i forget the pass-phrase used to encrypt the volume. Mainly to avoid saving the pass-phrase every time i change it.

#1 lore raw

Just create a backup luks header with a keyslot that is not in your actual header and write that key down.
Then to get to the volume you simply overwrite the luks header with the backup. I see no reason why this shouldn't work.

Quoted 12 lines · anirudh

Is there a way to extract the master key from luks header if we have the key or pass-phrase used to encrypt the volume using cryptsetup?

I wold like to save the master-key separately in a safe place and use it only in the case where i forget the pass-phrase used to encrypt the volume. Mainly to avoid saving the pass-phrase every time i change it.

_______________________________________________
dm-crypt mailing list
[email protected]
http://www.saout.de/mailman/listinfo/dm-crypt

#2 lore raw
In reply to anirudh
Quoted 2 lines · anirudh

Is there a way to extract the master key from luks header if we have the key or pass-phrase used to encrypt the volume using cryptsetup?

If you want to really backup master key (and not the whole header with known keyslot with luksHeaderBackup) use "luksDump --dump-master-key" command (available in cryptsetup 1.2.0, passphrase for some keyslot is required).

(Also you can activate device and save the mapping table with master key with "dmsetup table --showkeys <active device>".)

Milan