Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, Plans uses the
crypt()
function to hash user passwords, which has the advantage of being portable but uses a somewhat weak MD5-based hash by default. PHP 5.6+/7+ includes a new API for hashing passwords that currently uses the bcrypt algorithm. It is backwards compatible with existing password hashes and will upgrade them to bcrypt as users log in.There is one user-facing change here that will need to be called out: Users who have not changed their passwords in more than approximately five years will have passwords stored using an even more ancient DES-based algorithm, which only cares about the first eight characters of passwords. Once this PR is pushed to production, the first time users with really old passwords log in, we will remember the full password they typed. Future logins will require the same password to be typed in identically. Some users may be expecting the previous behavior, and may be surprised by the change. A MOTD will be posted calling out this change.
Additionally, this PR adds a polyfill library for the new password hashing algorithm, so Plans will maintain backwards compatibility to currently-supported PHP versions. (I think we're able to run on PHP 5.2+ currently?)