View Source bcrypt_nif (bcrypt v1.2.1)

Bcrypt Erlang wrapper.
The wrapper around the OpenBSD Blowfish password hashing algorithm, as described in: "A Future-Adaptable Password Scheme" by Niels Provos and David Mazieres.

Link to this section Summary

Functions

Create a context which hashes passwords in a separate thread.
Generate a random text salt for use with hashpw/3. LogRounds defines the complexity of the hashing, increasing the cost as 2^log_rounds.
Hash the specified password and the salt using the OpenBSD Blowfish password hashing algorithm. Returns the hashed password.

Link to this section Functions

-spec create_ctx() -> Context when Context :: term().
Create a context which hashes passwords in a separate thread.
-spec gen_salt(LogRounds) -> Result when LogRounds :: integer(), Result :: [byte()].
Generate a random text salt for use with hashpw/3. LogRounds defines the complexity of the hashing, increasing the cost as 2^log_rounds.
Link to this function

hashpw(Ctx, Ref, Pid, Password, Salt)

View Source
-spec hashpw(Ctx, Ref, Pid, Password, Salt) -> Result
          when
              Ctx :: term(),
              Ref :: reference(),
              Pid :: pid(),
              Password :: [byte()],
              Salt :: [byte()],
              Result :: ok.
Hash the specified password and the salt using the OpenBSD Blowfish password hashing algorithm. Returns the hashed password.