inejge / pwhash

A collection of password hashing routines in pure Rust
MIT License
61 stars 11 forks source link

bcrypt - Bad hash #7

Closed ghost closed 7 years ago

ghost commented 7 years ago

So, yes bcrypt works fine using it with the same libary (pwhash), but when I try to use it on different libaries, those hashes are invalid?!

344260f7-9fda-43b3-bd77-d89a263cc29e

Why are that bad hashes?

inejge commented 7 years ago

Could you paste the failing hash as text, not an image? Also, what's the URL of the service which you've used for checking?

ghost commented 7 years ago

@inejge $2b$08$0AL.Cm0PXvytOKvZS8uwde8zkKzV1OwRGXaIylmYrbpgqPF.DKg7C

inejge commented 7 years ago

What's the cleartext password for that hash? I notice that a) the hash is not the same as the one partially displayed above, and b) verifying with the cleartext value "d" fails.

ghost commented 7 years ago

It failed everytime. Wether I use h or jdjejejdidiejsnwoodjebsiud2j as password. There seems to be something wrong with the salt stuff..

inejge commented 7 years ago

Well, I've found the site you've used (bcrypt-generator.com), and made a few checks using the following simple generator, which creates a bcrypt hash from its first argument:

extern crate pwhash;

use std::env;

use pwhash::bcrypt;

fn main() {
    println!("{}", bcrypt::hash(&env::args().nth(1).unwrap()).unwrap());
}

They all worked. E.g., for the cleartext password h the program generated the hash $2b$08$khyvSkhhSKzLqk0x16Y8L.d6S4rERwRWv0RFwv01J4vZdwnoKyvbO in one run (try those values).

I'm not sure what problem you're encountering, but I don't think that the bcrypt functions are to blame.

inejge commented 7 years ago

Since I couldn't reproduce the failure, I'm going to close this issue.

ghost commented 7 years ago

Sorry for that. Was a error on my code. And thank you for keeping this libary alive.