Skip to content

Instantly share code, notes, and snippets.

@brynedwards
Created August 11, 2017 11:27
Show Gist options
  • Save brynedwards/48aee3cd7f5bc739283a17e4576da6c7 to your computer and use it in GitHub Desktop.
Save brynedwards/48aee3cd7f5bc739283a17e4576da6c7 to your computer and use it in GitHub Desktop.
#!/usr/bin/env stack
-- stack --resolver lts-9.0 script
{-# LANGUAGE OverloadedStrings #-}
import Crypto.KDF.PBKDF2
import Data.ByteString.Base16 (encode)
import qualified Data.ByteString.Char8 as C
main :: IO ()
main = C.putStrLn (encode hash)
where
hash = fastPBKDF2_SHA256 parameters password salt
parameters = Parameters 100000 32
password = "password" :: C.ByteString
salt = "salt" :: C.ByteString
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment