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

x/crypto/bcrypt: API to check hash format #20896

ibukanov opened this issue Jul 3, 2017 · 0 comments


None yet
2 participants
Copy link

commented Jul 3, 2017 [1] does not provide an official API to verify that the hash format is good one. The current sources indicates [2] that one can use bcrypt.Cost() as that parses and verifies the whole hash string. But the documentation does not reflect that a successful return from the function indicates a valid hash. Also the documentation implies that bcrypt.ErrHashTooShort can only be returned from CompareHashAndPassword when the Cost function can also return it.

It would be nice to have an explicit API to check hash format and perhaps check that it was created by older version so a password change can be scheduled in such case.

[1] -
[2] -

@mvdan mvdan changed the title bcrypt: API to check hash format x/crypto/bcrypt: API to check hash format Jul 3, 2017

@gopherbot gopherbot added this to the Unreleased milestone Jul 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.