Re: Password hash as LUKS key

Martin Olsson <[email protected]> Wed, 15 Mar 2023 15:11:18 +0000 (UTC)
Newsgroups dev.linux.lists.cryptsetup
Message-ID <[email protected]>
 On Fri 10, Mar 10, 2023 at 02:19:54 CET, Arno Wagner <[email protected]> wrote: 

>You probably have an issue with line endings. In priciple,
>this works and is supported, but interactive, pipe and 
>read-from-file are all a bit different.

I see maybe it's something wrong with the way I'm going about this. The following
are the commands I'm running:

mkpasswd (asks me to enter a password, I enter test)
Password:
$y$j9T$35ITJ7yCc3kFUsasf3QDa/$n.HqacKYHPIEE6VxIHhT2vW8.7vfh.fn008SQS5ETb9

printf "%s\n%s\n%s\n" "12345" "$y$j9T$35ITJ7yCc3kFUsasf3QDa/$n.HqacKYHPIEE6VxIHhT2vW8.7vfh.fn008SQS5ETb9"| sudo /sbin/cryptsetup luksAddKey /dev/sda3

(12345 is an existing key, and the password hash is test)

printf "test" | sudo cryptsetup luksOpen --test-passphrase /dev/sda3 && echo "There is a key available with this passphrase."
No key available with this passphrase.

(this shows that test doesn't work to unlock the encrypted partition)


>The man-page has more info on this. Best try it out with a
>really simple password like "test".

Could you point me to what section I should look at? The man page does mention hash
options but they relate to the encryption of the partition rather than the password I input
to cryptsetup.

BR,
Martin