Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127830 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id 059B81A00BC for ; Wed, 2 Jul 2025 06:26:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1751437465; bh=pOJNzZOE2vZ9A51sk1kEVXPjoqVjHh0LcuCOAHl6RIo=; h=References:In-Reply-To:From:Date:Subject:To:From; b=De1ezLhmT7ZOSPx+2I2aCW2DKosmhjxeYlcxeKGGMmEYWHDZ/OkI59Atl3BpReHwo KO7ZltNBT2hVUdXXsZdarST6fKAsRsplXW1/mcXbJF4Rbxy4lyOAWaZUebK9wJ9YVa USI7I2FvbSdWa7WUiesxo6Y/FIhelTACX0+jvXnvnvohEt/flv3xzs2BfdYOQw2l+w 8/lab6XB3KIEoRXngbMXfF+NRm/MWvtKLs445uS2jwhZSi58g6gR5n4/JTQwnAPz2G Hnoc4s7rID6xT0HdTg0XI32IQqdNewV4fWwMMKCv5NQtigqLLufVGuux+N93xp3on2 H6i2bpJsLbjTg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E53BC180053 for ; Wed, 2 Jul 2025 06:24:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (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 php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 2 Jul 2025 06:24:24 +0000 (UTC) Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-74924255af4so3496307b3a.1 for ; Tue, 01 Jul 2025 23:26:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751437576; x=1752042376; darn=lists.php.net; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=aU8DMYU202Gz8hWIeSVrT7/ikil+VxieI0BHZefANE0=; b=ST6e5Ih3aggG7d8021HscQll0jUthFi4bQaipMKy6DO6aUA3j8Ku6piKZQ1aeyiLnJ dWjnWQStfJg63jO48Edo8ocRU0ngQOyp3tuTS2a1HLQ4S2eQYWwX1g4xUvrfx5JBmjzl 0IPS1YOznL223LEFYrvmqQvygeis7W3kjNvY0G/6GYETe01V9lkAcNViFC0dEuNw78wt mV13dEgm0CrX3qqYvGn1JssCkzpr70eEM2MSIU9KXBG5OJKSwI/ckmEwkdi0wOfM1qtY BUtJv+AEUQaLyLMvlVeWvUuivzWQN4LpnPrNeLupK45X4LBZC56R8zTuknlZS+Id560I 9G3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751437576; x=1752042376; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aU8DMYU202Gz8hWIeSVrT7/ikil+VxieI0BHZefANE0=; b=cyNGez7LaCGo7s9zJ4Mb17GKQtkbpNDEz+ue04cIXD6j7bjRnY3pes6LZN7fZCwnXJ eXI70Qj2m+to4swMaM9QLvhBeyxgAeU0Lh3I3pR3MKYWQLkjSaJan41qs20tpQy+IpM5 pz4XTRoS53dhEiQN81Cq2He5m6ILGbAoQZyqTi/ttSjkcuFkJkxFIwDnRRm1Das7Np99 RdtMK4b0wcQ6W12K/OwgmAqXv7X6PaFFhNeEiMBMeKzj4HTGuVZV98QMY0CvYoM3j723 FyHfsuzMx3nfaD2PsFIBKHBhZG83PZemooBpHx++1+6eWGYyMibdV4gEu74TefWKHyKL 20yg== X-Gm-Message-State: AOJu0YwMLSvKPbY4cw7xmNmnU96d9gUVjbqEkvOBtdOyRtstCCHbDrH4 7VAKfSyfmgTKS0eoXZm7PLHcBPSNaWi+87n167G3fLgnxTmU5DhvvTH5NtWbzwdX+QsMzUnk3oX +7v3aND0qJgVMwLbgQlsoOOpdz6XxpVzSuRlx X-Gm-Gg: ASbGncu4PP4sZ94O3QioceMlLSwP/FJ8b4EUJ7M646wR7qEYNo8+Nza2XzpRxllVph5 Nr32Nre3cDK7Q4Zk0uj5jSjlTYI2/6evFRgTSSYrbvrOWfpbwASH/d5yuVgUp43a1WQQh77kN43 dsT8aksx4aJJOEN5VST5Zvkt9nqNSbtcV/sXw4d6YjhGZwuy1uEL6jZQ1j/hs3jhREPUoZrBoY0 w== X-Google-Smtp-Source: AGHT+IHYTcfJh3wAvvmmsHtmJfRapw5rMarbZhryHSginVzMhBGIWwEejJf2/xEvl9R425cF2k7RRoVRd4UC/VEUgg0= X-Received: by 2002:a05:6a00:2349:b0:74a:e29c:287d with SMTP id d2e1a72fcca58-74b5149d55dmr1913915b3a.11.1751437576385; Tue, 01 Jul 2025 23:26:16 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <0a17ccaf-46e1-441a-b53d-9a3c6b893a03@app.fastmail.com> In-Reply-To: <0a17ccaf-46e1-441a-b53d-9a3c6b893a03@app.fastmail.com> Date: Wed, 2 Jul 2025 08:26:04 +0200 X-Gm-Features: Ac12FXxmptDSL0dSMYTV-zUwM_3iSZS423Lyp6jn5JgxPzsynP8k9phndSkYEVE Message-ID: Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Add RFC 4648 compliant data encoding API To: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000963b3b0638ec567b" From: nyamsprod@gmail.com (ignace nyamagana butera) --000000000000963b3b0638ec567b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Larry, I have updated the wording of the RFC to give the reason for the default selected variant for each function family. I have also dropped the Variant suffix from the algorithm variant enum. Hope this answers your remarks On Tue, Jul 1, 2025 at 4:20=E2=80=AFPM Larry Garfield wrote: > On Fri, Jun 20, 2025, at 3:17 AM, ignace nyamagana butera wrote: > > > - it'd be great to default to url-safe base64. The RFC-compliant > > variant is a very common risk, it'd be great to be on the safe side by > > default > > > > I went with the RFC recommendation to set up the default. In case of > > Base64 the URL Safe variant is not the default. While we support URL > > safe variants there are plenty of applications which do not expect the > > URL Safe variant, for instance, the data URLs do not use the URL Safe > > variant. > > This should be included in the RFC, so it can be included in the future > documentation. > > > - why do we need to decide between constant-time and unprotected? Can't > > we always go for the constant-time behavior? If not, what about > > defaulting to constant-time, again, safe by default? > > > > In an ideal world I would use the constant-time behavior everytime, But > > this will depend largely on the implementation and if it can be applied > > to every scenario hence why I went defensive on this option. > > I don't follow. Every function listed allows a timing mode to be set, so > I presume that means every function *can* use constant-time. The > implementation is, well, this RFC. :-) So I don't see why we can't just > force constant-time everywhere and be secure-by-default. > > If there's a reason we cannot just blanket decide to use constant-time > everywhere always, we need concrete examples of why that's a bad idea; an= d > even then, I'd expect to be able to default to it. > > For the long-names issue that Tim pointed out, perhaps drop "Variant" fro= m > the enum names? As they're namespaced, `Base32::Ascii` seems fairly > self-explanatory. > > I am overall in favor of this RFC, modulo notes above. > > --Larry Garfield > --000000000000963b3b0638ec567b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Larry,

I have updated the= wording of the RFC to give the reason for the default selected variant for= each function family. I have also dropped the Variant suffix from the algo= rithm variant enum.=C2=A0

Hope this answers your r= emarks

On Tue, Jul 1, 2025 at 4:20=E2=80=AFPM La= rry Garfield <larry@garfieldte= ch.com> wrote:
On Fri, Jun 20, 2025, at 3:17 AM, ignace nyamagana butera wrote:

> - it'd be great to default to url-safe base64. The RFC-compliant <= br> > variant is a very common risk, it'd be great to be on the safe sid= e by
> default
>
> I went with the RFC recommendation to set up the default. In case of <= br> > Base64 the URL Safe variant is not the default. While we support URL <= br> > safe variants there are plenty of applications which do not expect the=
> URL Safe variant, for instance, the data URLs do not use the URL Safe =
> variant.

This should be included in the RFC, so it can be included in the future doc= umentation.

> - why do we need to decide between constant-time and unprotected? Can&= #39;t
> we always go for the constant-time behavior? If not, what about
> defaulting to constant-time, again, safe by default?
>
> In an ideal world I would use the constant-time behavior everytime, Bu= t
> this will depend largely on the implementation and if it can be applie= d
> to every scenario hence why I went defensive on this option.

I don't follow.=C2=A0 Every function listed allows a timing mode to be = set, so I presume that means every function *can* use constant-time.=C2=A0 = The implementation is, well, this RFC. :-)=C2=A0 So I don't see why we = can't just force constant-time everywhere and be secure-by-default.

If there's a reason we cannot just blanket decide to use constant-time = everywhere always, we need concrete examples of why that's a bad idea; = and even then, I'd expect to be able to default to it.

For the long-names issue that Tim pointed out, perhaps drop "Variant&q= uot; from the enum names?=C2=A0 As they're namespaced, `Base32::Ascii` = seems fairly self-explanatory.

I am overall in favor of this RFC, modulo notes above.

--Larry Garfield
--000000000000963b3b0638ec567b--