Ruby bcrypt non-salt password comparison
|Added at||2017-01-02 02:01|
I'm confused about bcrypt password hash retrieval and comparison. They are indeed equal, yet the comparison returns false. BTW I am using Sinatra, not RAILS.
My code has salt in it, but I can't even get non-salted to work. I can't see what's wrong here as it all outputs as being equivalent.
I create the password and enter a record with hard-coded fields and the hashed password. I then perform a SELECT for the same username (no duplicates, so it's unique)(the boolean on the INSERT allows me to turn off the INSERT for repetitive SELECT trials), and I get the identical password hash.
Then it all falls apart. It won't compare to true. I have no idea why. I expected it to be true. The part I'm not getting past is from the bcrypt documentation:
I'm missing something, and would like to implement a salt as well. Cheers