Bcryptrs (bcryptrs v0.1.4)
Bcryptrs is a drop in replacement for bcrypt_elixir that does not require C compiler
To use it simply add the dependency to mix.exs and replace every usage of Bcrypt with Bcryptrs
Don't forget to removew bcrypt_elixir from mix.exs and mix.lock
Summary
Functions
Returns a hash of probvided password. Optionally supports also a second argumet which is the cost
Runs hashing alghoritm in constant time. Used to avoid timing attacks against actors that check if an user exist
Verifies if a given password matches the stored hash
Functions
Returns a hash of probvided password. Optionally supports also a second argumet which is the cost
hashed_password = Bcryptrs.hash_pwd_salt(password)
Runs hashing alghoritm in constant time. Used to avoid timing attacks against actors that check if an user exist
case User.get(id) do
nil -> Bcryptrs.no_user_verify()
user -> Bcryptrs.verify_password(password, user.hashed_password)
end
Verifies if a given password matches the stored hash
Bcryptrs.verify_password(password, hashed_password)