Re: [openpgp] The Argon2 proposal seems incomplete (Draft 6)

Daniel Huigens <d.huigens@protonmail.com> Wed, 27 July 2022 17:10 UTC

Return-Path: <d.huigens@protonmail.com>
X-Original-To: openpgp@ietfa.amsl.com
Delivered-To: openpgp@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8F8DCC159483 for <openpgp@ietfa.amsl.com>; Wed, 27 Jul 2022 10:10:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.106
X-Spam-Level:
X-Spam-Status: No, score=-2.106 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=protonmail.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YvWJucUDeNhf for <openpgp@ietfa.amsl.com>; Wed, 27 Jul 2022 10:10:52 -0700 (PDT)
Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5ADC4C157B57 for <openpgp@ietf.org>; Wed, 27 Jul 2022 10:10:52 -0700 (PDT)
Date: Wed, 27 Jul 2022 17:10:41 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1658941849; x=1659201049; bh=nCBobGK2ujRDl9F/XMbCigbz/AD6SgGzHJjjjoLmwwk=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=WbZ5mfRcneYVJ8ZH1bovjWIKMeu1kteNe8n+aZ4IYIpUsERiyqpsDcZb3iyPBPYaA YSNwiWs0COtp3ie9NA0svr1LV7AY5pCey3e40gzcroonqsYizbINKzPnUZu1ryqqR/ 7lrss8laQsyvG1OkWcpod8rf2dPAsYv5ShW31sS4zSYit2JOgqQUljTDnYEGgzwzdS AdjEtekQShpwhVT5YGLzWpsrPGcWuQ+dEOaLYc0MA/03cLC+MFZm7kxkMimkQeFXCy Uv9fIRE7p3LlSZSfVZg3L0TcrxZWEQ6KFilM46cF6EzCMNXjoiWJMlsfAjpGPcWer0 mVvQqdizK1yRA==
To: Bruce Walzer <bwalzer@59.ca>
From: Daniel Huigens <d.huigens@protonmail.com>
Cc: Justus Winter <justus@sequoia-pgp.org>, openpgp@ietf.org
Reply-To: Daniel Huigens <d.huigens@protonmail.com>
Message-ID: <72aonJYPB4TXEg3SF2qjQbLoXgpMDC0T2vJQPEOOc_Y4jJHBi_yBRs9Oz_4LU1fVZGJtKgOhhBX_krs1pyjC-0jUU9p9ICNZABE9wEQmWww=@protonmail.com>
In-Reply-To: <YuFc+w02FiRQmHcg@watt.59.ca>
References: <YuAErZRsF/KbOw1s@watt.59.ca> <87edy7keb6.fsf@thinkbox> <YuFc+w02FiRQmHcg@watt.59.ca>
Feedback-ID: 2934448:user:proton
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/mTBIqnGrHx8KRptNlDMr9GKw_Hc>
Subject: Re: [openpgp] The Argon2 proposal seems incomplete (Draft 6)
X-BeenThere: openpgp@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "Ongoing discussion of OpenPGP issues." <openpgp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/openpgp>, <mailto:openpgp-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/openpgp/>
List-Post: <mailto:openpgp@ietf.org>
List-Help: <mailto:openpgp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/openpgp>, <mailto:openpgp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Jul 2022 17:10:56 -0000

On Wednesday, July 27th, 2022 at 11:42, Bruce Walzer wrote:

> The incorrect fact in this case is
> that Argon2 will work in some sort of slower degraded mode in the case
> where not enough memory is available.

I didn't claim that it "will work" unconditionally; what I wrote is:

> The decrypting implementation doesn't necessarily have to allocate 2TB,
> it can do with less, it will just be slow.

Emphasis on *can*; I didn't claim that RFC 9106 mandates this, and I
also haven't checked what common implementations do, but it is possible,
by recomputing blocks that are not stored when needed.

In any case, I personally think that it's perfectly reasonable to return
an error if the Argon2 parameters call for allocating 2TB. That is way
beyond the values recommended by RFC 9106. And in general, if decrypting
a message requires more memory than is available it can return an error,
of course.

If your point is that we should agree on acceptable parameters to use
when generating a message, to prevent that from happening, I agree;
I would propose to use the first recommended value (2GiB) as an upper
bound, *unless* the implementation knows that the message will be
decrypted on the same device it was encrypted on, and knows that there
is more memory available.

Arguably, that's what the current text already says: it's recommended
to use the recommended options in RFC 9106, and for applications that
can't or don't want to tailor to specific hardware, the option with
2GiB of RAM is recommended. However, if you want to propose some text
to make that clearer, I think that would be welcome.

Best,
Daniel