View Source bcrypt_nif (bcrypt v2.0.0)

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.

Summary

Functions

Create an opaque token for the asynchronous hashing interface.

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.

Functions

-spec create_ctx() -> Context when Context :: term().

Create an opaque token for the asynchronous hashing interface.

-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 :: iodata(),
              Salt :: iodata(),
              Result :: ok.

Hash the specified password and the salt using the OpenBSD Blowfish password hashing algorithm. Returns the hashed password.