Бенчмарк cryptsetup показывает, что скорость шифрования более чем втрое больше скорости записи на диск, то есть вроде как шифрование не должно быть узким местом, но на деле скорость записи на шифрованный раздел вдвое меньше, чем на нешифроанный.
Почему так может быть?
Бнчмарк:
» cryptsetup benchmark
# Tests are approximate using memory only (no storage IO).
PBKDF2-sha1 1236528 iterations per second for 256-bit key
PBKDF2-sha256 1583951 iterations per second for 256-bit key
PBKDF2-sha512 1067796 iterations per second for 256-bit key
PBKDF2-ripemd160 862315 iterations per second for 256-bit key
PBKDF2-whirlpool 633198 iterations per second for 256-bit key
# Algorithm | Key | Encryption | Decryption
aes-cbc 128b 698,2 MiB/s 2265,7 MiB/s
serpent-cbc 128b 83,5 MiB/s 340,9 MiB/s
twofish-cbc 128b 184,6 MiB/s 376,5 MiB/s
aes-cbc 256b 519,6 MiB/s 1782,3 MiB/s
serpent-cbc 256b 89,0 MiB/s 344,2 MiB/s
twofish-cbc 256b 191,6 MiB/s 370,6 MiB/s
aes-xts 256b 1555,7 MiB/s 1569,8 MiB/s
serpent-xts 256b 355,3 MiB/s 339,8 MiB/s
twofish-xts 256b 366,2 MiB/s 364,7 MiB/s
aes-xts 512b 1288,3 MiB/s 1291,3 MiB/s
serpent-xts 512b 356,7 MiB/s 339,8 MiB/s
twofish-xts 512b 368,3 MiB/s 371,0 MiB/s
» sudo cryptsetup status /dev/mapper/luks-df63558b-b644-435e-8135-72609beb62b7
/dev/mapper/luks-df63558b-b644-435e-8135-72609beb62b7 is active and is in use.
type: LUKS1
cipher: aes-xts-plain64
keysize: 256 bits
device: /dev/mapper/intelssd-lvol0
offset: 4096 sectors
size: 10481664 sectors
mode: read/write
» dd if=/dev/zero of=/media/Crypt/null bs=1M count=4000 status=progress oflag=direct
4000+0 записей получено
4000+0 записей отправлено
4194304000 байт (4,2 GB, 3,9 GiB) скопирован, 22,9683 s, 183 MB/s
» dd if=/dev/zero of=$HOME/null bs=1M count=4000 status=progress oflag=direct
4000+0 записей получено
4000+0 записей отправлено
4194304000 байт (4,2 GB, 3,9 GiB) скопирован, 9,26037 s, 453 MB/s