From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67F70C31E40 for ; Tue, 6 Aug 2019 20:43:52 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 351BF2070D; Tue, 6 Aug 2019 20:43:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lists.sourceforge.net header.i=@lists.sourceforge.net header.b="fTu9BELg"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="bh7OO5Ff"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="j1io6hhM"; dkim=neutral (0-bit key) header.d=google.com header.i=@google.com header.b="Jcbiz/rl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 351BF2070D Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=lists.sourceforge.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:To:Message-ID:Date:In-Reply-To:References: MIME-Version:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lU+EWeBcbMDr8cwonDCM66evdyTCn3M7TaKXYD7+j3I=; b=fTu9BELgwIU0oReNMvWMzG48Dp +FT4oyDm3D73LCEF05yiWi0vvWbcHTJTf8oxA5a4a0UWxehDon1dB9c301DJ1J556/B8zwBb7CAV6 gla9wlRgaF0GhnIGnS3RvdUlc51NHi80IcVPplWcEX+ZbItWMA9aZ5aEr6nm8Dhnnz7Q=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1hv6JD-0001sQ-Jb; Tue, 06 Aug 2019 20:43:51 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1hv6JC-0001sJ-CY for linux-f2fs-devel@lists.sourceforge.net; Tue, 06 Aug 2019 20:43:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Sender:Reply-To:Content-Transfer-Encoding :Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=VR5feK3MwIDa28M66pr8cZaax0HRBgUIy/YXtAlUVAg=; b=bh7OO5FfJOijX3ewlUhg/vPqxU YdKM5O1H45wHlk0A98oqfUJQxjvzRGQspKxj2wtF5cku2IAu7J/MQokI0H4AshUOoOmNgMKRGUp4k IcO09nOcmsHbJMoOHtSksFNBGGT5HdgplB+ZLueSAZjJYC/GC834uP7Isn2qDaCEm7Sw=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=VR5feK3MwIDa28M66pr8cZaax0HRBgUIy/YXtAlUVAg=; b=j1io6hhM8O7McFxNNRcuPx8gtx Tn2IwUu4E7LPaeLWtOO7FCZSBDzS23DDccsPP5XDAFj5RZkuhNohViE7BIohvhDc4j+5hl/m6m8BZ ry/nISX5VdUW68xDt9NMPRQl0cuVJuhSKVrs0AS7JISVH5rmz7H3dd+Dm6srNlYoynT4=; Received: from mail-lf1-f66.google.com ([209.85.167.66]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) id 1hv6J8-00DPV8-OP for linux-f2fs-devel@lists.sourceforge.net; Tue, 06 Aug 2019 20:43:50 +0000 Received: by mail-lf1-f66.google.com with SMTP id c19so62285080lfm.10 for ; Tue, 06 Aug 2019 13:43:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VR5feK3MwIDa28M66pr8cZaax0HRBgUIy/YXtAlUVAg=; b=Jcbiz/rlCveea1uGbs0To2AG2Fqr3qcVJByaj30biSJ6IGaZQU269n7UhHiJIq60zt F6m/iDUTKUaAxcfbj3aNcS1UVKWh0iBATpSeFcB2HZZd4zuUH74H+0AsiAw/3vHblfhG rGmoqX4hHVQvNh1Mo2WC3G6d946cIGSfRxOUfOJyomX+NAcaChMCm9wTSq80UpIDDyVy Wsy0W1UJUtub0zWt+iqZy9h9oHmBFsihiepiuxbUw6MWvMUQg0sLWv0bFV1e+nhfBD57 VYDaUrEm2FkddHey3B0zSP911OVgsWvOlf8N8vWL7OUIPVuLGhouTH4qcL5ZHCc7EUMj /u6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VR5feK3MwIDa28M66pr8cZaax0HRBgUIy/YXtAlUVAg=; b=YLpOxtVxIbR/Pwkpc00JoFPwjQgkX3w8tHyZdWhl2mr0WNMav8LH9pEWA4y5v8I3Eo 5qdbw20rMtRk4xqb3IpTClAWCWzBW/RhXMWdwgMcOFfRYuh2EmiWG1kX8CKFAIvy3k45 mgZAP2Vqr1J36niBXCg2RJtkhGnKAIq0lOgwHYkjBG44ST8/rLzVHF4q5C+Sj7c+5btC jMeg+F4tX72NQzQ3WWSNiU7hW4CjgwoCCX0b42OX/QfYy/Q/EHBg7Hpdi7ftaGYUI+2q pUioen96nsWCfcmOZO/CaYiT2eFjaGXMdn+zIXCmbzFbI7/dQzriv624B5EzbI0Q6+pI 5hug== X-Gm-Message-State: APjAAAU8gK5+njqPpkNNq3Nucn6xkedyR/bl8/m/gvw9T5Uv9WHfEGWH na8ejH3wvvW8f0z1u4kL4MaPkKg6RaDsF+DUm0B9BA== X-Google-Smtp-Source: APXvYqzWZs8IRpgox1WFTKnJpGnBDG26DorCdtZJQD2tgXVD7zBJA6DxGWkpIBTAdKDEhuxqp2JLjofjJIxta57O938= X-Received: by 2002:a19:6f4b:: with SMTP id n11mr3649844lfk.163.1565124219457; Tue, 06 Aug 2019 13:43:39 -0700 (PDT) MIME-Version: 1.0 References: <20190805162521.90882-1-ebiggers@kernel.org> <20190805162521.90882-13-ebiggers@kernel.org> In-Reply-To: <20190805162521.90882-13-ebiggers@kernel.org> Date: Tue, 6 Aug 2019 13:43:27 -0700 Message-ID: To: Eric Biggers X-Headers-End: 1hv6J8-00DPV8-OP Subject: Re: [f2fs-dev] [PATCH v8 12/20] fscrypt: add an HKDF-SHA512 implementation X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Paul Crowley via Linux-f2fs-devel Reply-To: Paul Crowley Cc: Satya Tangirala , Theodore Ts'o , linux-api@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fscrypt@vger.kernel.org, keyrings@vger.kernel.org, linux-mtd@lists.infradead.org, linux-crypto@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jaegeuk Kim , linux-ext4@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Mon, 5 Aug 2019 at 09:28, Eric Biggers wrote: > > From: Eric Biggers > > Add an implementation of HKDF (RFC 5869) to fscrypt, for the purpose of > deriving additional key material from the fscrypt master keys for v2 > encryption policies. HKDF is a key derivation function built on top of > HMAC. We choose SHA-512 for the underlying unkeyed hash, and use an > "hmac(sha512)" transform allocated from the crypto API. > > We'll be using this to replace the AES-ECB based KDF currently used to > derive the per-file encryption keys. While the AES-ECB based KDF is > believed to meet the original security requirements, it is nonstandard > and has problems that don't exist in modern KDFs such as HKDF: > > 1. It's reversible. Given a derived key and nonce, an attacker can > easily compute the master key. This is okay if the master key and > derived keys are equally hard to compromise, but now we'd like to be > more robust against threats such as a derived key being compromised > through a timing attack, or a derived key for an in-use file being > compromised after the master key has already been removed. > > 2. It doesn't evenly distribute the entropy from the master key; each 16 > input bytes only affects the corresponding 16 output bytes. > > 3. It isn't easily extensible to deriving other values or keys, such as > a public hash for securely identifying the key, or per-mode keys. > Per-mode keys will be immediately useful for Adiantum encryption, for > which fscrypt currently uses the master key directly, introducing > unnecessary usage constraints. Per-mode keys will also be useful for > hardware inline encryption, which is currently being worked on. > > HKDF solves all the above problems. > > Reviewed-by: Theodore Ts'o > Signed-off-by: Eric Biggers Looks good, feel free to add: Reviewed-by: Paul Crowley _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel