Pbkdf2

Pbkdf2 password hashing algorithm for Elixir.

Pbkdf2 is a well-tested password-based key derivation function that can be configured to remain slow and resistant to brute-force attacks even as computational power increases.

This library can be used on its own, or it can be used together with Comeonin, which provides a higher-level api.

Installation

  1. Add pbkdf2_elixir to the deps section of your mix.exs file:
def deps do
  [
    {:pbkdf2_elixir, "~> 0.12"}
  ]
end
  1. Optional: during tests (and tests only), you may want to reduce the number of rounds so it does not slow down your test suite. If you have a config/test.exs, you should add:
config :pbkdf2_elixir, :rounds, 1

Use

In most cases, you will just need to use the following three functions:

See the documentation for the Pbkdf2 module for more information.

For a lower-level api, see the documentation for Pbkdf2.Base.

For further information about password hashing and using Pbkdf2 with Comeonin, see the Comeonin wiki.

Deployment

See the Comeonin deployment guide.

License

BSD.