Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: add equivalents to PHP's password_hash() and password_verify() functions #19

Open
twostraws opened this issue Jan 23, 2017 · 0 comments

Comments

@twostraws
Copy link

Everyone knows secure coding is hard, so it's very helpful that BlueCryptor provides a great deal of advanced functionality to make a developer's life easier. Sadly, even with helpful API around, using them badly results in an insecure project – in fact one could even argue that it's less secure, because its developers have a false sense of security in their poor implementation. (Probably the most famous example, from some years ago.)

When it comes to storing passwords, PHP has two excellent functions that take a lot of the worry away from developers: password_hash() and password_verify(). The former accepts a plain text password as its first parameter, and created a password hash using Blowfish. To make this work, it also creates a salt for you. The complete string that gets returned contains the algorithm that was used, salt, and cost (presumably rounds?) as part of the hash, which means it's a single value that can be stored in a database attached to a user.

When it comes time to authenticate the user, password_verify() is used. This takes the plain-text password from the user along with the hash string returned from password_hash(), and returns true if they match. This is possible because password_hash() contains all the extra information – validation is pretty simple.

Storing important information such as passwords is always going to be an important part of any web project. As a result, it would be helpful if BlueCryptor added functions similar to these two from PHP that effectively eliminate a wide variety of coder errors and ensure best practice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants