18

What command can be used to determine the used encryption on a LUKS partition (all the relevant information, initialization vector, generation scheme, mode of operation and block cipher primitive)?

2 Answers 2

19

If the decrypted volume is /dev/mapper/crypto then you can get the information with

dmsetup table crypto
0 104853504 crypt aes-cbc-essiv:sha256 000[...]000 0 254:2 4096

If the encrypted volume is /dev/storage2/crypto then you get the information with

cryptsetup luksDump /dev/storage2/crypto
LUKS header information for /dev/storage2/crypto

Version:        1
Cipher name:    aes
Cipher mode:    cbc-essiv:sha256
Hash spec:      sha256
[...]
2
  • Why two different tools for the same task: dmsetup is a lower level tool then cryptsetup.
    – akhan
    Dec 5, 2018 at 19:49
  • 7
    @akhan That's just what I am used to. But cryptsetup status crypto can be used, too. Dec 7, 2018 at 21:28
11

List the disks:

lsblk --fs

Then (used encryption):

cryptsetup luksDump /dev/sdb1

Or (used encryption):

cryptsetup status crypt_sdb1 

In addition (kernel supported encryption and bench):

cat /proc/crypto
ls /lib/modules/$(uname -r)/kernel/crypto/

#cryptsetup benchmark --cipher aes-xts --key-size 256 
cryptsetup benchmark
1
  • As far as i understand, when using cryptsetup status <partition>, the <partition>s that give info can be identified by the type crypt when using lsblk (without options). Apr 8 at 10:51

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.