You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 17, 2024. It is now read-only.
This PR adds an extra class for the argon2i password hash algorithm introduced with PHP7.2.
There are some open questions with this:
Do we really want to have 1 new class for each algorithm PHP addes? "Argon2id" is just around the corner...
PHP's password_verify() accepts currently both Bcrypt and Argon2i hashes. So basically you could either use the Bcrypt class or the Argon2i class to verify either hashes.
This makes it pretty easy to migrate users from Bcrypt to Argon2i:
Use the new Argon2i class as the dependency
old bcrypt passwords are still verified correctly
new password will be created with argon2i
Do we need a wrapper function for password_needs_rehash() ? This would mean we need some kind of inter-class upgrade path (from class Bcrypt to Argon2i in future php-versions).
Although we dont know WHY password_needs_rehash() returns false: is it because of the algorithm or the cost value(s)?
This class is marked as PHP7.2+ only (it throws an exception in the constructor). Do we want to provide fallbacks of some kind for older PHP Versions?
Other than the algorithm no other PHP7.2+ specific features were used in this class (e. g. scalar type hints and return types) because a syntax error is much more heavy and harder to catch than a constructor-exception (Pre 7.0).
Should type hints and return types get added because its a PHP7.2+ class anyway?
This PR adds an extra class for the argon2i password hash algorithm introduced with PHP7.2.
There are some open questions with this:
Do we really want to have 1 new class for each algorithm PHP addes? "Argon2id" is just around the corner...
PHP's
password_verify()accepts currently both Bcrypt and Argon2i hashes. So basically you could either use theBcryptclass or theArgon2iclass to verify either hashes.This makes it pretty easy to migrate users from Bcrypt to Argon2i:
Argon2iclass as the dependencyDo we need a wrapper function for
password_needs_rehash()? This would mean we need some kind of inter-class upgrade path (from classBcrypttoArgon2iin future php-versions).Although we dont know WHY
password_needs_rehash()returns false: is it because of the algorithm or the cost value(s)?This class is marked as PHP7.2+ only (it throws an exception in the constructor). Do we want to provide fallbacks of some kind for older PHP Versions?
Other than the algorithm no other PHP7.2+ specific features were used in this class (e. g. scalar type hints and return types) because a syntax error is much more heavy and harder to catch than a constructor-exception (Pre 7.0).
Should type hints and return types get added because its a PHP7.2+ class anyway?
Originally posted by @MatthiasKuehneEllerhold at zendframework/zend-crypt#58