Bug #78516 [Com]: password_hash(): Memory cost is outside of allowed memory range
| From: | patrick at heppler dot net | Date: | Mon, 09 Sep 2019 16:11:45 +0000 |
| Subject: | Bug #78516 [Com]: password_hash(): Memory cost is outside of allowed memory range | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-222662@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78516&edit=1
ID: 78516
Comment by: patrick at heppler dot net
Reported by: patrick at heppler dot net
Summary: password_hash(): Memory cost is outside of allowed
memory range
Status: Not a bug
Type: Bug
Package: hash related
Operating System: CentOS 7.6
PHP Version: 7.4.0RC1
Block user comment: N
Private report: N
New Comment:
Okay, but with PHP 7.2.22 and PHP 7.3.9 I can use
password_hash('secret',PASSWORD_ARGON2I,['memory_cost'=>1024])
password_hash('secret',PASSWORD_ARGON2ID,['memory_cost'=>1024])
and it works. So I thought it's a bug.
Previous Comments:
------------------------------------------------------------------------
[2019-09-09 10:23:30] requinix@php.net
Argon2 requires a minimum of 8KB.
------------------------------------------------------------------------
[2019-09-09 10:17:58] patrick at heppler dot net
Description:
------------
Using password_hash with PASSWORD_ARGON2I or PASSWORD_ARGON2ID and a memory_cost of less than 8192
throws:
password_hash(): Memory cost is outside of allowed memory range
Test script:
---------------
password_hash('secret',PASSWORD_ARGON2ID,['memory_cost'=>8191])
password_hash('secret',PASSWORD_ARGON2I,['memory_cost'=>8191])
Expected result:
----------------
A hashed password
Actual result:
--------------
PHP Warning: password_hash(): Memory cost is outside of allowed memory range
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78516&edit=1