Created
August 11, 2017 11:27
-
-
Save brynedwards/48aee3cd7f5bc739283a17e4576da6c7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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