Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127822 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 BD9FD1A00BC for ; Tue, 1 Jul 2025 14:18:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1751379408; bh=R8kygayVv+5r9630+Lf2dgtQfI7mdurLJK0IzHw3ZnA=; h=Date:From:To:In-Reply-To:References:Subject:From; b=S5rVq7ihuVgLUf7QtcoWhVeMrHamsC85F8/oygT2MQeS0olfVirk/u1s0oTnWjW/o kMA2Q+e+NTgpudbRXoFFHZqpD+hmveHTDeQsENnWO0EIO67lWeECJK5a8HzfC4L05w PPp6VZTvT3Pw24L7iyyfPxAeaLecmxKInGJJZloCLschcQyNFajXcHt5eJpBSc1sB0 SeQBLLLIBTR307CnSQQqt1Re+VQNRNmvR8/TAVzvxhYa3kSJHc5GxmkQCewJ9Y+fOP vys5ltjLuTBr9yKqHchuNa7/Py3gp1HhgrAjXqblrRz9ynQAZOP/ggDkZiADRD4CST HKPv60NiZ6v3g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A24591801D5 for ; Tue, 1 Jul 2025 14:16:47 +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=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE 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 fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) (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 ; Tue, 1 Jul 2025 14:16:47 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id 2B64BEC0436 for ; Tue, 1 Jul 2025 10:18:40 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-10.internal (MEProxy); Tue, 01 Jul 2025 10:18:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm2; t=1751379520; x=1751465920; bh=mHGl1pVn2gD7CqY9NB8As ukoFPZ/0u30BMjHFW7+UNc=; b=pdg5U8dPxmO/0TeQsC6iUBVT0yv3ywE9U8pog qHFouS5gRB8SQSxxvwshvp7jB8xQGGnZ8q5GN6E1AfHepXSjy9RBV+LJlxXUIy9a vg1YlDDcbxLaK8/W9yrI0r6Idns7gU12i0zI/rEKeLWn7C/Yh60mO2qxMlqoY8Ys mn8dOT2s9qyLTDKVACqvl5+lUpRp6DxDlTjc7ZKiGspAasnyEb2/S46CHCknuUoS LVsWCn9/oOTwPwZywJz8SF+t1aybzqn5IVS92EmFPIPhyKaNKBFsPLSIzAfCFAdF eUObpmT9izviLzixryDBFJca8PV0BZ6orBNRJTYHICLMQpYYQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1751379520; x=1751465920; bh=m HGl1pVn2gD7CqY9NB8AsukoFPZ/0u30BMjHFW7+UNc=; b=FcAI7DPYR4wOS2He+ fZrYi+SAls7M7UneIHiTzEwrdo8t0K6Susa+shwoOFbaN2X1ifidHio9aVgp/qyA m9KG+Zs/cW70cEihrAp/CCN3w33FUMMg1GIaQk05rMq3QK5sfuXsOW/+hD5qPuuW m4JWeEMAaaUqyMIWjWdeQ60fWh9mt9gvtcqotJ/TZipy3s2lmS34ML2lmSWZrVgF i+Nvixp1WIgItJVbqunc4/fSptqzJqK9vdSaHSlBiCBsc269YQXqfPCvXL1w3EIB H7Cf7C+Y7eFl2y7h2FIq4pmxhSt9E4aLPIX985u3oj0O+UyrANtKCjcs9aX8AuwH bQjqw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddugeejgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefoggffhffvkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedfnfgrrhhrhicu ifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomheqne cuggftrfgrthhtvghrnhepudegvdelgfeugeehfeejteffudevleethfefgeejffffleeg tddtveekgeekudfgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmpdhnsggprhgtphht thhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehinhhtvghrnhgrlhhsse hlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id CA0D2700063; Tue, 1 Jul 2025 10:18:39 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: T1184f03bea8a86d1 Date: Tue, 01 Jul 2025 09:18:19 -0500 To: "php internals" Message-ID: <0a17ccaf-46e1-441a-b53d-9a3c6b893a03@app.fastmail.com> In-Reply-To: References: Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Add RFC 4648 compliant data encoding API Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") 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; 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" from 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