Re: sha256 in "AF hash" despite using sha512 during luksFormat

Milan Broz <[email protected]>
Newsgroups dev.linux.lists.cryptsetup
Message-ID <[email protected]>
On 10/09/2022 00:50, [email protected] wrote:
> Dear cryptsetup/LUKS Team,
> 
> I was using sha512 in the luksFormat command.
> Later I used luksAddKey while thinking that it should be using the
> sha512 hash that I defined in luksFormat.
> But, when I did luksDump, then I noticed that the field "AF hash" for
> the second key (which was added via luksAddKey ; its keyslot is #1)
> contains the value "sha256".

The digest hash remains the same. it is changed only if the digest
is recalculated later (reencryption).

(In LUKS1 there was only one hash algorithm used for everything,
in LUKS2 you can have different algorihms per keyslots, digest and AF but
for digest and AF there is no API co change it later.)

BTW SHA512, specially for AF, is overkill, it will not help anything.
Why do you want to use it there? The whole idea for AF is just to
diffuse the key on a larger area - any hash algorithm here works ok.

For digest it has no security improvement either, as the input is
randomly generated key and if you want to run bruteforce on it, it is much
faster to try to decrypt some sector where you can detect correct plaintext
than to use slow digest PBKDF2 here.

m.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.