All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Schniedermeyer <ms@citd.de>
To: dm-crypt@saout.de
Subject: Re: [dm-crypt] maximum keyfile size
Date: Thu, 28 Jun 2012 13:36:30 +0200	[thread overview]
Message-ID: <20120628113630.GA10275@citd.de> (raw)
In-Reply-To: <20120628102828.GA1523@fancy-poultry.org>

On 28.06.2012 12:28, Heinz Diehl wrote:
> On 28.06.2012, Milan Broz wrote: 
> 
> > Passphrase is interactively entered string
> > (from real terminal, not stdint), keyfile is everything else.
> 
> So the length of a keyfile is equivalent to the length of a
> passphrase, or is there any difference which should let me choose a
> bigger keyfile than one containing 64 chars for "maximum security",
> assumed I'm using 512 bit encryption?

If you shoot for maximum security that means you need at last 512 bit of 
ENTROPHY not characters (per se). As there are "values/bits missing" (at 
least the "\n") a 64 char key can't have the full 512 bit entrophy.

But when using e.g. base64 encoding you can pack the full 512 bits of 
entrophy into 85.33 chars. Personally i round that up to 528 bit, to get 
an even 88 chars. For base64 encoding the length should be divisible by 
3, otherwise you still get 88 chars (in this case) but the rest is 
filled with one or two "=" (Which you could also strip, it's no like you 
you need to be able to decode the string.)

head -c 66 /dev/random | openssl base64 -A
which gets you 88 chars.
or
head -c 64 /dev/random | openssl base64 -A | tr -d =
which gets you 86 chars.

Case one has 528 bits of entropy.
Case two has 512 bits of entrophy + 4 "empty" bits.


Bis denn

-- 
Real Programmers consider "what you see is what you get" to be just as 
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated, 
cryptic, powerful, unforgiving, dangerous.

  reply	other threads:[~2012-06-28 11:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-28  3:36 [dm-crypt] maximum keyfile size .. ink ..
2012-06-28  6:34 ` Heinz Diehl
2012-06-28  7:01   ` .. ink ..
2012-06-28  7:54     ` Milan Broz
2012-06-28 10:28       ` Heinz Diehl
2012-06-28 11:36         ` Matthias Schniedermeyer [this message]
     [not found]       ` <CAFnMBaSBBGvhvGHkH=T1gd3RwRkSy75SyhG+zkPow_gA4uAhFA@mail.gmail.com>
2012-06-28 11:22         ` .. ink ..

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=20120628113630.GA10275@citd.de \
    --to=ms@citd.de \
    --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 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.