Bcryptrs (bcryptrs v0.1.3)
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
hash_pwd_salt(password)
Returns a hash of probvided password. Optionally supports also a second argumet which is the cost
hashed_password = Bcryptrs.hash_pwd_salt(password)
hash_pwd_salt(password, cost)
no_user_verify()
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
no_user_verify(cost)
verify_pass(password, hash)
Verifies if a given password matches the stored hash
Bcryptrs.verify_password(password, hashed_password)