pbkdf2_elixir v0.9.0 Pbkdf2.Base View Source

Base module for the Pbkdf2 password hashing library.

Link to this section Summary

Link to this section Functions

Link to this function hash_password(password, salt, opts \\ []) View Source

Hash a password using Pbkdf2.

Options

There are four options:

  • rounds - the number of rounds

    • increasing this will make the hash function take longer and therefore make it more difficult to attack
    • the default is 160_000
  • output_fmt - the output format of the hash

    • the default is modular crypt format
  • digest - the sha algorithm that pbkdf2 will use

    • the default is sha512
  • length - the length, in bytes, of the hash

    • the default is 64 for sha512 and 32 for sha256
Link to this function verify_hash(hash, password, salt, rounds, digest, length, output_fmt) View Source

Verify an encoded Pbkdf2 hash.