BcryptNet / bcrypt.net

BCrypt.Net - Bringing updates to the original bcrypt package
MIT License
824 stars 98 forks source link

EnhancedHashPassword veryfi in other language exp.: nodejs #88

Closed mlukacs-Suxess closed 3 years ago

mlukacs-Suxess commented 3 years ago

Hello, I have a database passwords with hasad this code : BCrypt.Net.BCrypt.EnhancedHashPassword("test"); // the result is : // $2a$11$LSbpD8Wu2xD4mr878RM9k.2Am7A4WkqApoNzp40BagIzQmpPowh3e And I like veryfi in other program, but the nodjs bcryt or bcryptjs cant verify this hash. ("$2a$11$LSbpD8Wu2xD4mr878RM9k.2Am7A4WkqApoNzp40BagIzQmpPowh3e")

And I can't modify the database password. What can be the solution? Thank you for the help.

ChrisMcKee commented 3 years ago

Hey; Probably help to throw in the version you hashed at; but basically if you are using enhanced in the current version which defaults at SHA384, when you're validating a password you need to hash the users password as entered using SHA384 the rest should be the same.

There are tests covering other languages https://github.com/BcryptNet/bcrypt.net/blob/main/src/BCrypt.Net.UnitTests/BCryptTests.cs#L202-L228 based on hashes generated by them.

mlukacs-Suxess commented 3 years ago

Thank you the help.