Re: Password hash as LUKS key
Grzegorz Szymaszek <[email protected]> Wed, 15 Mar 2023 17:24:31 +0100
| Newsgroups | dev.linux.lists.cryptsetup |
|---|---|
| Message-ID | <ZBHxP1L7FMpfW600@nx64de-df6d00> |
Hi,
On Wed, Mar 15, 2023 at 03:11:18PM +0000, Martin Olsson wrote:
> printf "%s\n%s\n%s\n" "12345" "$y$j9T$35ITJ7yCc3kFUsasf3QDa/$n.HqacKYHPIEE6VxIHhT2vW8.7vfh.fn008SQS5ETb9"| sudo /sbin/cryptsetup luksAddKey /dev/sda3
1. The format string contains three %s conversion specifications, but
you provide printf with only two operands. Please try something like
the following in your shell:
printf '1. %s 2. %s 3. %s\n' FIRST SECOND
This is probably not an issue since IIRC luksAddKey only asks for
the new passphrase once, so it should ignore the next empty line.
2. In double quotes, a dollar denotes a variable name. For example, in
"$y$j9T", the shell replaces $y and $j9T with the values of the
respective variables. Since they are probably not defined, they are
replaced with empty strings instead. I think the actual password you
set with the above command is
"5ITJ7yCc3kFUsasf3QDa/.HqacKYHPIEE6VxIHhT2vW8.7vfh.fn008SQS5ETb9".
Good luck!
--
Grzegorz Szymaszek
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEZT55kPBhnB69hD4ZeE9lGUIcpz4FAmQR8T8ACgkQeE9lGUIc pz5Yuw//fdG8JV3P8Alg+XUKf4r2Xc8gAj41cTEkpA8qZMaW1eqwtnvZlcnVhSue JGGTm3jwh7cjml7pLupS4HRcT02YGkf+C3ejBJbX0zQsT1G/5QbytQ66YxavJkYZ cDGowPqCIqaDyB3IS02xSbhOLwulBXaLUnGntES24IceqDCSiY6GqBu/42DxcFcg MdcaMbl+jGkMwf13O8yPmXFBE9qC62g1v0GnVEV6+aKtr7d+kvSIYXZCQ6kIEuqv YJ2cb2V53/6grdCy4sK5G/esq3Xtlt+rRo3DNfBk6sMa8HRgeZxqGxXnWl/c2oCI /2ylYyzMcKuPqFGZi9wCAZmr8Ng90aa/Kisp4mQ4R3yg+CMT/1YrhO8CnGKioeSj 8ZlGONIlbAQMrDwcmSmNI5JTQ9hMw6zhcba0BExZBW2HWHlfSIbI3Il5+RWH2p00 /gUBhsK/2TcIosFhKL3K7HBZAFc1W+8qQhgNJj8bAGfP+V0nF7+OaDrL0Ti8yyF+ kRCsvtpaWYW7FPVYuLYP2DIsDLnYkueMV9sw8y6E85vW6nMaqtf/RVLWz42tSOMd 8LICbiYSM/ZJEgGTBPut2jV0w9+G/DMPcSdz4D0XFgWCsetk6CyKgHTxSEYwGFOe pMUZIhbhJpSugZS9KqySEfVnAL93pdquF+p0BUF+YpTwIAPOG8Y= =PbbJ -----END PGP SIGNATURE-----