-
Notifications
You must be signed in to change notification settings - Fork 90
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
Cannot parse sha256/sha512 Password-Hashes #576
Comments
Please provide a complete reproduction of the problem |
password_hash::Output::decode("bLTg4cpho8PIUrjfsE7qlU08Qx2UEfw..xOc6I1wpGVtyVYToGrr7BzRdAAnEr5lYFr1Z9WcCf1xNZ1HG9qFW1", password_hash::Encoding::Crypt).expect("Expected Hash to decode") |
Seems like this was already addressed in RustCrypto/traits@fd48936 , but I don't have that yet, because I am still using the 2 years old version 0.5.0 and 0.6.0 is still in release candidate stage after 8 months. |
The only support for that hash format is in the It's a legacy MCF encoding (where MCF isn't really a "standard" but a collection of algorithm-specific encodings), whereas the |
I want my application to support lazily re-hashing the passwords though. |
We'd need to look into if there are proper PHC encodings for sha-crypt hashes |
I cannot parse sha256_crypt or sha512_crypt Password-Hashes with this library, because none of the encodings fit.
I tested with the password
password
hashed by https://www.dcode.fr/crypt-hashing-function to sha512 at 5000 rounds:$6$$bLTg4cpho8PIUrjfsE7qlU08Qx2UEfw..xOc6I1wpGVtyVYToGrr7BzRdAAnEr5lYFr1Z9WcCf1xNZ1HG9qFW1
.The crate you use for decoding the output hash seems to have a Decoder/Encoder ready for that use-case:
Base64ShaCrypt
Edit: I also just realised, that this probably belongs to https://github.com/RustCrypto/traits/
The text was updated successfully, but these errors were encountered: