Mongodb v0.1.1 Mongo.PBKDF2

PBKDF2 implements PBKDF2 (Password-Based Key Derivation Function 2), part of PKCS #5 v2.0 (Password-Based Cryptography Specification). It can be used to derive a number of keys for various purposes from a given secret. This lets applications have a single secure secret, but avoid reusing that key in multiple incompatible contexts. see http://tools.ietf.org/html/rfc2898#section-5.2

Summary

Functions

Returns a derived key suitable for use.

Options

  • :iterations - defaults to 1000 (increase to at least 2^16 if used for passwords);
  • :length - a length in octets for the derived key. Defaults to 32;
  • :digest - an hmac function to use as the pseudo-random function. Defaults to :sha256;

Functions

generate(secret, salt, opts \\ [])

Returns a derived key suitable for use.

Options

  • :iterations - defaults to 1000 (increase to at least 2^16 if used for passwords);
  • :length - a length in octets for the derived key. Defaults to 32;
  • :digest - an hmac function to use as the pseudo-random function. Defaults to :sha256;