All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <gmazyland@gmail.com>
To: sven@whgl.uni-frankfurt.de, dm-crypt@saout.de
Subject: Re: [dm-crypt] question regarding Sha1 and 512 bit key xts mode
Date: Mon, 24 Aug 2015 08:18:39 +0200	[thread overview]
Message-ID: <55DAB73F.2080002@gmail.com> (raw)
In-Reply-To: <f8225dce9f6df9b5e5560db0a5e96b18.squirrel@ssl.verfeiert.org>


On 08/23/2015 10:21 PM, Sven Eschenberg wrote:
> Maybe I got a misconception here.
> 
> But if I remember correctly:
> 
> In case of auth, a collision might get you authed, in LUKS a collission
> gets you past the candidate check, but a mere collision without hitting
> the correct key, results in gibberish during decryption.

Yes. Maybe this should be added to FAQ...

Just a little bit engineering background to the theory below :)

The hash algorithms specified in LUKS header is used to:

 1) underlying PBKDF2 for derivation of keyslot unlocking password
    (keyslot is encrypted with the same algorithms as data with this derived key)

 2) Decrypted key candidate digest check.

 3) Anti-forensic (AF) LUKS splitter

 (4) the hash used for ESSIV was always SHA256 as a default, this is unrelated
  to hash mentioned above and it is already "obsoleted" by using XTS mode where
  we do not need ESSIV)

Just note, for 2) there we have only 20bytes in header for MK digest.
(IOW it was designed for SHA1.)

This is really not a real problem, because even if you find the collision,
you have wrong key and result is decrypted gibberish (as Sven already said).

And why SHA1 as a default?
Well, it is history and more about user experience trade-off that anything else.

- original LUKS implementation had SHA1 hardcoded, old implementation
cannot decrypt anything else (pre 1.1.x versions)

- in >= 1.1.x the library SHA1 is used and code allows switch to other
hash algorithm (provided by underlying crypto library).

But because in that time (~2010) most of implementations in stable distro
releases had SHA1 hardcoded, it would make LUKS incompatible.
(Moreover using SHA1 is still not a problem there, otherwise security
aspects would have priority even if it means breaking compatibility.)

Today, it is probably possible to change hash default without a big hassle.
But we have more serious problem here: PBKDF2, which is no longer the best
KDF we can use here.

So the plan is to introduce slightly modified LUKS2 header that
allows specifying another KDF (probably per-slot) and some
other things and this would be the best time to switch the hash default
as well.

(Despite SHA1 is not problematic for this use case, it will be soon banned
in some environments. And there is a compile switch to change default for years,
so distros can change it.)

There will be some experimental branch in distro for prototyping this
(heading to cryptsetup 2.x & LUKS2.

Milan

  reply	other threads:[~2015-08-24  6:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11 16:31 [dm-crypt] question regarding Sha1 and 512 bit key xts mode anderson jackson
2013-12-11 18:04 ` Arno Wagner
2015-08-22  3:38   ` Heinz
2015-08-22 10:04     ` Michael Kjörling
2015-08-22 14:05       ` Arno Wagner
2015-08-26 12:29       ` Heinz
2015-08-22 13:58     ` Arno Wagner
2015-08-26 12:51       ` Heinz
2015-08-23 18:51     ` Sven Eschenberg
2015-08-23 19:38       ` Arno Wagner
2015-08-23 20:21         ` Sven Eschenberg
2015-08-24  6:18           ` Milan Broz [this message]
2015-08-24 11:54             ` Arno Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55DAB73F.2080002@gmail.com \
    --to=gmazyland@gmail.com \
    --cc=dm-crypt@saout.de \
    --cc=sven@whgl.uni-frankfurt.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.