Sreyas-Sreelal/samp-bcrypt

Salt?

AdrianBZG opened this issue · 2 comments

Hi,

I'm trying to reproduce the results of hashing with bcrypt with this plugin and outside with a Python script (https://zetcode.com/python/bcrypt/), but I get different results as the Python implementation requires a salt.

How is salt used in this plugin?

Hey, sorry for late reply. Unfortunately as for current version you can't use your own salt and use it with plugin, but I'm planning to update the plugin with this feature as the rust bcrypt crate already provides this functionality, all I have to do is implement it in the plugin.
https://docs.rs/bcrypt/0.10.0/bcrypt/fn.hash_with_salt.html
In addition, we can add support for multiple versions of BCrypt, and for backward compatibility we can just the check the mode user want to hash using a optional parameter. I will start working on it as soon as I can.

Also in the current version the salt is generated randomly using OS randomness, so it should work fine with python implementation too.

EDIT: yes it does work with python and pawn one (both can verify the password other one is generated).