I have used cryptsetup to encrypt an external hard drive.
I have no problem at using the encrypted hard drive in this way:
/sbin/cryptsetup luksOpen /dev/sdc1 backup
// typing password
// mounting the partition
// doing something
// unmounting the partition
/sbin/cryptsetup luksClose /dev/mapper/backup
But my next requirement was to be able to do it without the need of typing a password.
Then I created a binary file with the hash of my password via this command:
hashalot -n 32 ripemd160 > volume_key
and then:
/sbin/cryptsetup luksOpen -d volume_key /dev/sdc1 backup
but I get this error:
Command failed: No key available with this passphrase.
Any ideas guys?