Return-Path: Received: from tansi.org (ns.km10532-04.keymachine.de [87.118.102.195]) by mail.saout.de (Postfix) with ESMTP for ; Mon, 23 Nov 2009 16:46:42 +0100 (CET) Received: from gatewagner.dyndns.org (84-74-164-239.dclient.hispeed.ch [84.74.164.239]) by tansi.org (Postfix) with ESMTP id 62D2C4250002 for ; Mon, 23 Nov 2009 16:46:41 +0100 (CET) Date: Mon, 23 Nov 2009 16:46:39 +0100 From: Arno Wagner Message-ID: <20091123154639.GB25399@tansi.org> References: <4B032794.6090104@gmx.net> <20091118054555.GB28949@tansi.org> <4B03C5EE.7010702@gmx.net> <20091118102515.GB30910@tansi.org> <4B03D865.8070905@redhat.com> <4B03F5F2.9080609@redhat.com> <20091119074104.GC8694@tansi.org> <4B0A9C5F.7030705@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B0A9C5F.7030705@redhat.com> Subject: Re: [dm-crypt] different default key sizes for CREATE and LUKSFORMAT List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dm-crypt@saout.de On Mon, Nov 23, 2009 at 03:29:51PM +0100, Milan Broz wrote: > On 11/23/2009 02:45 PM, Roscoe wrote: > > On Thu, Nov 19, 2009 at 5:41 PM, Arno Wagner wrote: > >> If I understand this correctly, this is the "iteration-count" > >> parameter to PBKDF2. If so, then RFC 2898 recommends a minimum > >> count of 1000 anyways. This is hovever not protection against > >> a broken hash, as even a very weak hash should be extremely > >> hard to break when iterated 10 times. The main purpose of this > >> parameter is to make exhaustive search more expensive. I think > >> this should definitely go up to 1000. > > > > I'd like to point out that this use of PBKDF2 is is not as a KDF but > > as a hash function. The recommendations in the RFC 2898 will be from a > > KDF perspective. The idea of someone doing an exhaustive search in the > > LUKS mk context seems silly (RNG quality aside) > > You are right, but note for normal exhaustive key search (brute force, > because key is random here) you need to know some plain text > on the disk (not problem with known FS signature though). > > Here you have always digest of hashed key (+ known salt). > If the PBKDF2 with iterations is very quick and cheap, > the exhaustive search for key candidates is much more > simpler here than other technique. > > Adding iterations for mk digest is quite cheap and almost make > this search unusable (even if it is just theoretic or silly attack). > > Or am I missing anything? Well, it depends on th size of the key and its entropy contents. If it is a >= 128 bit high entropy key, then exhaustive search will not work, no matter what. If the entropy is lower (bad PRNG), a high interation count will make the search a lot harder. As we have seen in the past, messing up randomness for crypto does happen. Example: The last Debian problem ith OpenSSL, although the resulting key space was so small (16 bit), that requiring a second of hashing would only have lead to a day or so of attack time. But if a key has only, say, 40 bits of entropy, a second of hashing gives something like 17'000 years of CPU time for exhaustive search. Doable but expensive. Bottom line: This should not be needed, but it does make the whole construct more resilient against bad PRNG and it has not real cost as it is a one-time effort on volume mount. Arno -- Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: arno@wagner.name GnuPG: ID: 1E25338F FP: 0C30 5782 9D93 F785 E79C 0296 797F 6B50 1E25 338F ---- Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans If it's in the news, don't worry about it. The very definition of "news" is "something that hardly ever happens." -- Bruce Schneier