public inbox for dm-crypt@saout.de
 help / color / mirror / Atom feed
From: "Michael Kjörling" <michael@kjorling.se>
To: dm-crypt@saout.de
Subject: Re: [dm-crypt] Anyone know why I can't access my volumes?
Date: Tue, 10 Dec 2019 20:00:13 +0000	[thread overview]
Message-ID: <ckdbfzbs3f3tzzngmrcmzcbw@localhost> (raw)
In-Reply-To: <CAJCQCtS-tb5wPpVRf5WdeAGvqdTjEmkeUhfc62jAidaD4gXKXQ@mail.gmail.com>

On 10 Dec 2019 10:42 -0700, from lists@colorremedies.com (Chris Murphy):
> A possible better workaround for this problem, is helping the user
> create a recovery passphrase, and maybe even some desktop environments
> or installers go with a policy where the user is taken through this by
> default. That'd be a randomly generated passphrase, limited character
> set (perhaps ASCII), so that it's unambiguous. There is a bias,
> predicating it on Latin input. But it's better than data loss! And
> then display that recovery passphrase for the user to escrow somewhere
> safe. And then almost any keymapping or keyboard still gets the
> encoding for this passphrase correct.
> 
> If an attacker sees more than one keyslot used, and assumes one is a
> recovery key, and assumes the passphrase is ASCII, haven't they
> improved their bruteforce attack capability? And that comes full
> circle back to whether the keymapping and keyboard locale information
> should be stored somewhere, and checked at passphrase entry time, and
> the user warned if there's a mismatch.

As you say, it's not _just_ an encoding problem.

There's character encoding, particularly but not exclusively for
non-US-English characters (0-9, A-Z, some punctuation). (This is the
mapping from glyphs on the screen to bits and bytes in memory.)

There's keyboard layout. (This is the mapping from physical key to
glyphs on the screen.)

Particularly on laptops, there's also the issue that some have an
integrated numeric keypad _overlaid on the alphanumeric portion of the
keyboard_, which can definitely trip you up.

If you're unlucky, there's a flaky key switch which causes a key
stroke to not register properly.

And probably one or two things I'm forgetting at the moment.

For a recovery passphrase in particular, I'd suggest going with the
restricted character set that Yubikeys use (termed "modhex"), as that
is specifically selected to work across as wide a range of keyboard
layouts as possible. Wikipedia gives that character set as
[cbdefghijklnrtuv] (16 characters, mapping to hexadecimal digits).

Brute force attacks on the passphrases are only feasible if the
passphrase is short and/or otherwise poorly selected. A recovery
passphrase can be long, random, and use a very high iteration count if
so desired; you get a 2^256 work factor (given what we know today,
more than enough for anyone who doesn't plan to outlast the heat death
of the universe) with just 64 modhex characters, even if the attacker
knows how the passphrase was generated, as long as it's properly
_random_. That's _plenty_ short enough to write down by hand on a
piece of paper. If you're paranoid, add to that a few seconds' worth
of iteration count, and attacking that passphrase is in no way easier,
and quite likely harder, than attacking the master key directly.

-- 
Michael Kjörling • https://michael.kjorling.se • michael@kjorling.se
 “Remember when, on the Internet, nobody cared that you were a dog?”

  reply	other threads:[~2019-12-10 20:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-20 21:53 [dm-crypt] Anyone know why I can't access my volumes? Philipp Rösch
2019-10-21  7:50 ` Michael Kjörling
2019-10-21 14:33   ` Philipp Rösch
2019-10-21 14:50     ` Arno Wagner
2019-10-21 14:56       ` Philipp Rösch
2019-10-24  7:26         ` Carl-Daniel Hailfinger
2019-10-24 12:34           ` Arno Wagner
2019-10-24 19:35           ` Philipp Rösch
2019-12-10 16:34             ` Philipp Rösch
2019-12-10 17:42               ` Chris Murphy
2019-12-10 20:00                 ` Michael Kjörling [this message]
2019-12-10 21:18                   ` Chris Murphy
2019-12-10 21:51               ` Arno Wagner
  -- strict thread matches above, loose matches on Subject: below --
2019-10-21 18:16 Arno Wagner
2019-10-21 18:23 ` Philipp Rösch

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=ckdbfzbs3f3tzzngmrcmzcbw@localhost \
    --to=michael@kjorling.se \
    --cc=dm-crypt@saout.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox