[Discussion] Changing PASSWORD_DEFAULT to Argon2
| From: | Andrey Andreev | Date: | Fri, 18 Sep 2026 20:20:51 +0000 |
| Subject: | [Discussion] Changing PASSWORD_DEFAULT to Argon2 | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-132542@lists.php.net to get a copy of this message | ||
Hi all,
I'd like to gather opinions on the possibility of switching
PASSWORD_DEFAULT from bcrypt to Argon2id.
A few reasons to do so:
- bcrypt has a limit of (and silently truncates at) 72 bytes, which may
seem like an acceptable thing at first glance, but does cause many headaches
- Argon2 is superior in every way and widely recognized as the gold
standard today; I've even encountered people who mistakenly believed it is
already PHP's default
- While both algorithms are (by today's understanding) considered safe from
quantum threat, Argon2's memory hardness makes it future-proof by design
But there is one contentious circumstance - bcrypt is entirely bundled with
PHP, while Argon2 has external dependencies: libargon2, libsodium, or
(since PHP 8.4) openssl. The addition of OpenSSL is key, because it's the
most ubiquitous and a practical must for almost any environment, IMO making
changing PASSWORD_DEFAULT viable. But am I right to think that, or is any
external dependency likely to kill the proposal? That's what I want to
gauge before fleshing out an RFC with the greater detail it deserves.
Cheers,
Andrey.