WDMC-Ex2-Ultra icon indicating copy to clipboard operation
WDMC-Ex2-Ultra copied to clipboard

cryptsetup failed with code 22

Open matrob opened this issue 5 years ago • 1 comments

I have followed the instructions from the readme exactly, but stop at the following point: cryptsetup -v --type luks --cipher aes-xts-plain64 --key-size 512 --hash sha512 --iter-time 2000 --use-random --verify-passphrase luksFormat /dev/md0

I receive the following command line output: # command failed with code 22: invalid argument

EDIT: The ArchWiki helped me to better understand cryptsetup and helped to solve the problem. https://wiki.archlinux.org/index.php/Dm-crypt/Device_encryption#Cryptsetup_usage

matrob avatar Jan 31 '20 12:01 matrob

Ex2 Ultra device has hardware CESA enctyption built-in: https://wiki.kobol.io/helios4/cesa/

So I found it is better to use aes-cbc-essiv, that is about twice faster than the cipher above. So the correct command should be:

cryptsetup -v -y -c aes-cbc-essiv:sha256 luksFormat /dev/sda1

I have fixed the README.

vzhilov avatar Apr 21 '20 08:04 vzhilov