From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1j1mID-00089z-30 for mharc-grub-devel@gnu.org; Wed, 12 Feb 2020 02:18:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54291) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1mI9-00086K-Vo for grub-devel@gnu.org; Wed, 12 Feb 2020 02:18:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1mI8-00069t-W6 for grub-devel@gnu.org; Wed, 12 Feb 2020 02:18:37 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:37324) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1mI8-00069Z-QC for grub-devel@gnu.org; Wed, 12 Feb 2020 02:18:36 -0500 Received: by mail-wr1-x443.google.com with SMTP id w15so858780wru.4 for ; Tue, 11 Feb 2020 23:18:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=0p0ccsZcUIx1ucqWtMS/QnjrDfHuSLdY7OoMI3R09vc=; b=kgIJcrw3gkU8OELHgW/2DC90J2myOgmL1q1+hTfTB0G0znWJY79CjUS68KnCA0oAiE 8mwbW11g8LRN4FcBz70YG3tXl+NXYhoIkMbqMqRZKX5w2OjGArtPaAnu0oW8lOsGXObF 62+O7dnVviJ/FJ1ksSATJo1GLqjzCN3BJOiLatcvmnTYd7u8gWrFSU6y/RJXOb3CmsoK cgM/Cqseg14mCZfwV3NKTDk6vHBj7TFg/npvl6BSgww9+o7j1cP2Q0ULbxmXqbDqu5OD Y5BHAMRwh66bGEs9hI7D/ND70EIjKzfSNqDmih8p5dw9y4ZX1AeeDWL0FYkGlt4DODAe u6Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0p0ccsZcUIx1ucqWtMS/QnjrDfHuSLdY7OoMI3R09vc=; b=qB8kymL+yd41JY0l569j5Ces9oscGzIpuiqDG9pjj47FnfQnG7ZK0Uo0hGU9ZjEhUp UuwDRNcDfYCeLrxvgGI1VORXR7Ds4AclvyhAd7U+aM6RdHZlKjWcy4+IpguBAobt9rQh 7ETCv4ZlDmw2+CEKfBk42U9fMF+4Jq5fI1R7NtK0JfsKmmcxo6yrkcoGfSAh/3fye/ew 3sjg7TQ1yw1sKNeofAEEJjZTEfuOYh0YiJAXZCWsg62Cz+LCiflOTm86g3PSb85DsROM jpl0LkqOe849tr/UTv8YLQxRMj4k4rHB/VITnDyuY8zip1y6X6onLTglHB9N20d0JL98 BjKw== X-Gm-Message-State: APjAAAXGsrlpxlA0Tzf142cJmZTk1lRQ8UGh1tTrtSNgVlmlnddmGr2n 8h7SUs6UYjLJuXh0PnOtyf0= X-Google-Smtp-Source: APXvYqwDBfDI+7edzshBtnp+DZNhwzIFbOGdw5Hn8mZaXkxKIDqR8FQU868u8cUVLgkNGEM+vYCeqg== X-Received: by 2002:a5d:670a:: with SMTP id o10mr13438072wru.227.1581491914384; Tue, 11 Feb 2020 23:18:34 -0800 (PST) Received: from [172.22.36.87] (redhat-nat.vtp.fi.muni.cz. [78.128.215.6]) by smtp.gmail.com with ESMTPSA id g2sm8296064wrw.76.2020.02.11.23.18.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Feb 2020 23:18:33 -0800 (PST) Subject: Re: [PATCH 0/5] Support Argon2 KDF in LUKS2 To: Daniel Kiper , Patrick Steinhardt Cc: grub-devel@gnu.org, Daniel Kiper , gmazyland@gmail.com, leif@nuviainc.com, agraf@csgraf.de, pjones@redhat.com, mjg59@google.com, phcoder@gmail.com References: <20200211215359.m7dpfsq45zssqvtq@tomti.i.net-space.pl> From: Milan Broz Message-ID: <5a584f9d-a863-edc1-05ec-e8a1803c1c60@gmail.com> Date: Wed, 12 Feb 2020 08:18:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200211215359.m7dpfsq45zssqvtq@tomti.i.net-space.pl> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Feb 2020 07:18:39 -0000 On 11/02/2020 22:53, Daniel Kiper wrote: > Adding Milan, Leif, Alex, Peter, Mathew and Vladimir. > > On Thu, Feb 06, 2020 at 03:27:28PM +0100, Patrick Steinhardt wrote: >> Hi, >> >> as promised back when LUKS2 support was merged, here's the code that >> enables decrypting LUKS2 partitions that use Argon2 as their key derival >> function. Most of this is simple legwork, but I expect two things to be >> potentially controversial: >> >> - I've changed how EFI allocates memory. On my test systems, I was >> only able to allocate roughly 800MB, which isn't enough for the >> default of 1GB memory parameter that cryptsetup uses with Argon2. >> Instead of taking a quarter of available memory, we now take half >> of it, which amounts to ~1.6GB on 32 bit systems. > > That is huge for the bootloader. What about systems with less than 3 GiB of RAM? > Could we reduce amount of RAM required by Argon2? No, this is the principle of memory-hard function :) The primary reason is to increase attacker cost for dictionary attacks. Anyway, there are some limits in cryptsetup - we try to never use more than half of physical memory and maximum is hard-compiled to 4GiB. (But physical memory limit applies when formatting device, then is stored in the LUKS2 keyslot header. So if you format it on device with much larger RAM and it is later not available, it fails to open. It is more complicated though - we have benchmark during format that prioritize unlocking time, so PBKDF memory is usually decreased on low-memory systems anyway.) > >> - The import of Argon2 itself. I've imported code from the >> cryptsetup project, but I've modified it quite a bit to fit into > > Milan mentioned something about libgcrypt. Milan, when the Argon2 code > may land in libgcrypt? Once we have volunteer to implement it / port it to gcrypt :-) BTW if you have embedded Argon2 code, you should also add some test vectors to your testsuite. (You can use these we have in cryptsetup - see tests/crypto-vectors.c) Milan