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

Comparing $2y$ hashes #24

Open
kevinhikaruevans opened this issue Apr 30, 2014 · 4 comments
Open

Comparing $2y$ hashes #24

kevinhikaruevans opened this issue Apr 30, 2014 · 4 comments

Comments

@kevinhikaruevans
Copy link

I have some hashes in my database which were previously created with PHP's bcrypt function.

If I try to run bcrypt.compareSync with the PHP's $2y$ versioned hash, it errors with "Invalid salt revision". Would it be possible to support $2y$ hashes instead of just $2a$?

@kalvish21
Copy link

I'm having same issue with django. Django has $2b$ hashes. Any reason for that not to be supported?

@akoskm
Copy link

akoskm commented Jun 17, 2017

Exactly the same error with PHP generated hashes. Using "bcrypt-nodejs": "^0.0.3".

@japita-se
Copy link

confirmed. same error

@TaylorDale
Copy link

TaylorDale commented Aug 30, 2018

Manipulate the PHP hash with the following

phphash = phphash.replace(/^\$2y(.+)$/i, '$2a$1');

Works for me. From https://stackoverflow.com/questions/23015043/verify-password-hash-in-nodejs-which-was-generated-in-php

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

No branches or pull requests

5 participants