Git Product home page Git Product logo

scrypt_elixir's Introduction

ScryptElixir

ScryptElixir

Elixir wrapper for the Scrypt key derivation function. https://www.tarsnap.com/scrypt.html

Usage

This library provides raw scrypt hashing functionality as well as an implementation of the original suggested KDF.

  • hash/6 is a lower level function that allows for a custom salt length and derived key length. The result is the raw binary scrypt hash. This function allows for custom salts and derived key lengths.
  • kdf/4 is a function that creates an Scrypt header that utilizes HMAC to ensure hash integrity. This implementation enforces a 32 byte salt length and 64 byte derived key length.
  • kdf/5 creates an Scrypt header, but allows for a custom 32 byte salt.
  • verify?/6 validates an Scrypt hash using the supplied parameters, returning a boolean.
  • verify_kdf?/2 validates an Scrypt header using the supplied password.

Both functions rely on a core set of parameters:

  • password - the core binary being hashed
  • salt - a pseudo-randomly generated string of bytes used for hashing
  • logN - exponent for CPU/memory cost (2^logN)
  • r - blocksize

Installation

The package can be installed by adding scrypt_elixir to your list of dependencies in mix.exs:

def deps do
  [
    {:scrypt_elixir, "~> 0.1.0"}
  ]
end

Documentation can be found at https://hexdocs.pm/scrypt_elixir.

scrypt_elixir's People

Contributors

christianjgreen avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.