# PASSWORD_DEFAULT value

- Thread: https://externals.io/message/120993
- Original archive: https://news-web.php.net/php.internals/120993
- Started by Vinicius Dias on 2023-09-06T16:08:41+00:00
- Messages: 5
- RFC: Add PASSWORD_BCRYPT_WRAP (Under discussion) — https://externals.io/rfc/password_bcrypt_wrap.md
- RFC: Increasing the default BCrypt cost (Implemented (PHP 8.4)) — https://externals.io/rfc/bcrypt_cost_2023.md
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #120993 — Vinicius Dias — 2023-09-06T16:08:41+00:00

URL: https://externals.io/message/120993#120993

Hey there, folks!

I was wondering here... Is there any reason for `PASSWORD_DEFAULT`'s
value not to be `PASSWORD_ARGON2ID`?

Would that change require an RFC?

---

## #120996 — tim@bastelstu.be — 2023-09-06T16:52:26+00:00

URL: https://externals.io/message/120993#120996 · In reply to: #120993

Hi


> I was wondering here... Is there any reason for `PASSWORD_DEFAULT`'s
> value not to be `PASSWORD_ARGON2ID`?
> 

To the best of my knowledge Argon2 is not available in a "default" 
installation of PHP without including any external dependencies.

Also Argon2 for settings that are reasonable for interactive 
authentication is worse than BCrypt according to:

https://twitter.com/TerahashCorp/status/1155119064248913920
and
https://twitter.com/TerahashCorp/status/1155129705034653698

Best regards
Tim Düsterhus

---

## #120998 — Hans Henrik Bergan — 2023-09-06T19:24:55+00:00

URL: https://externals.io/message/120993#120998 · In reply to: #120996

Argon2 is opt-in, not opt-out, at compile-time, so then we would have to
agree on it being acceptable for `PASSWORD_DEFAULT` to have different values
depending on compile-time options, maybe thats completely fine, or maybe it
isn't, idk.

But as Dusterhus points out, Argon2 is inferior to bcrypt anyway, according
to people much smarter than myself.

Oh and Argon2 has been around since 2015 and multiple vulnerabilities have
been discovered, speeding up brute force/dictionary attacks. Can't say the
same for bcrypt



> Hi
>
> 
> > […]
>
> To the best of my knowledge Argon2 is not available in a "default"
> installation of PHP without including any external dependencies.
>
> Also Argon2 for settings that are reasonable for interactive
> authentication is worse than BCrypt according to:
>
> https://twitter.com/TerahashCorp/status/1155119064248913920
> and
> https://twitter.com/TerahashCorp/status/1155129705034653698
>
> Best regards
> Tim Düsterhus
>
> --
> 
> To unsubscribe, visit: https://www.php.net/unsub.php

---

## #120999 — Vinicius Dias — 2023-09-06T19:33:14+00:00

URL: https://externals.io/message/120993#120999 · In reply to: #120998

This is very interesting. It's the first time I see recommendations
pro Bcrypt and against Argon2. Even Owasp recommends Argon2 over
Bcrypt [1].

I am not a cryptography expert so I believe that if there is a
discussion of which one is better PHP shouldn't change things for now,
so that totally answers the question of why the default is still
bcrypt.

Thank you both for replying.

[1] https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html



Vinicius Dias,
Zend Certified Engineer,
iMasters PHP Certified Professional




Em qua., 6 de set. de 2023 às 16:25, Hans Henrik Bergan
<divinity76@gmail.com> escreveu:
>
> Argon2 is opt-in, not opt-out, at compile-time, so then we would have to agree on it being acceptable for `PASSWORD_DEFAULT` to have different values depending on compile-time options, maybe thats completely fine, or maybe it isn't, idk.
>
> But as Dusterhus points out, Argon2 is inferior to bcrypt anyway, according to people much smarter than myself.
>
> Oh and Argon2 has been around since 2015 and multiple vulnerabilities have been discovered, speeding up brute force/dictionary attacks. Can't say the same for bcrypt
>
> 
> > […]

---

## #121005 — tim@bastelstu.be — 2023-09-07T17:31:03+00:00

URL: https://externals.io/message/120993#121005 · In reply to: #120999

Hi


> This is very interesting. It's the first time I see recommendations
> pro Bcrypt and against Argon2. Even Owasp recommends Argon2 over
> Bcrypt [1].
> 
> I am not a cryptography expert so I believe that if there is a
> discussion of which one is better PHP shouldn't change things for now,
> so that totally answers the question of why the default is still
> bcrypt.
> 

There is some opportunity for change or improvement. As a result of this 
thread I've created an "Increasing the default BCrypt cost" RFC. I'd be 
happy to see you within that RFC's discussion thread [1].

Best regards
Tim Düsterhus

[1] https://news-web.php.net/php.internals/121004
