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
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
[...]
-
Why two different tools for the same task: dmsetup is a lower level tool then cryptsetup.– akhanDec 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
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
-
As far as i understand, when using
cryptsetup status <partition>
, the<partition>
s that give info can be identified by the typecrypt
when usinglsblk
(without options). Apr 8 at 10:51