From: https://code.google.com/p/cryptsetup/wiki/FrequentlyAskedQuestions6.15 Can I clone a LUKS container? You can, but it breaks security, because the cloned container has the  same header and hence the same master key. You cannot change the  master key on a LUKS container, even if you change the passphrase(s),  the master key stays the same. That means whoever has access to one of  the clones can decrypt them all, completely bypassing the passphrases.The right way to do this is to first luksFormat the target container,  then to clone the contents of the source container, with both  containers mapped, i.e. decrypted. You can clone the decrypted  contents of a LUKS container in binary mode, although you may run into  secondary issues with GUIDs in filesystems, partition tables,  RAID-components and the like. These are just the normal problems  binary cloning causes. Note that if you need to ship (e.g.) cloned LUKS containers with a  default passphrase, that is fine as long as each container was  individually created (and hence has its own master key). In this case,  changing the default passphrase will make it secure again.I have two notebooks with root access installed with LUKS. I don't know if originally they where CLONED or not. My question: How can I create a HASH (ex.: sha512) from the LUKS master keys, so that I can compare the two, that if they are the same or not?
How can I get a HASH of the LUKS master key?
luks
Thanks for the answers, I created a sed command for it: [root@notebook ~] test `whoami`=root && k=`cryptsetup luksDump -q --dump-master-key $(blkid | awk '/crypto_LUKS/ {print $1}' | cut -d: -f1 | head -1)` && echo $k | sed 's/^MK dump:/Fgkmtusjs\nMK dump:/g' | sed '1,/^Fgkmtusjs/d' | sed 's/.*\t//g' | sha512sum | sed s/\-/`hostname`/gEnter LUKS passphrase: d78abb0542736865f94704521609c230dac03a2f369d043ac212d6933b91410e06399e37f9c5cc88436a31737330c1c8eccb2c2f9f374d62f716432a32d50fac  notebook.localdomain[root@notebook ~]tested on: Scientific Linux 6.4; Ubuntu 12.04