Copyright | (c) Leo D 2023 |
---|---|
License | BSD-3-Clause |
Maintainer | leo@apotheca.io |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Derive a key from a passphrase
Synopsis
- type PBKDFName = ByteString
- pwdhash :: PBKDFName -> Int -> Int -> Int -> Int -> ByteString -> ByteString -> IO ByteString
- pwdhashTimed :: PBKDFName -> Int -> Int -> ByteString -> ByteString -> IO (Int, Int, Int, ByteString)
- pattern PBKDF2 :: PBKDFName
- pbkdf2 :: MACName -> PBKDFName
- pattern Scrypt :: PBKDFName
- pattern Argon2d :: PBKDFName
- pattern Argon2i :: PBKDFName
- pattern Argon2id :: PBKDFName
- pattern Bcrypt_PBKDF :: PBKDFName
- pattern OpenPGP_S2K :: PBKDFName
- openPGP_S2K :: HashName -> PBKDFName
Password hashing
type PBKDFName = ByteString Source #
:: PBKDFName | algo: PBKDF algorithm, e.g., Scrypt or "PBKDF2(SHA-256)" |
-> Int | param1: the first PBKDF algorithm parameter |
-> Int | param2: the second PBKDF algorithm parameter (may be zero if unneeded) |
-> Int | param3: the third PBKDF algorithm parameter (may be zero if unneeded) |
-> Int | out_len: the desired length of the key to produce |
-> ByteString | passphrase: the password to derive the key from |
-> ByteString | salt[]: a randomly chosen salt |
-> IO ByteString | out[]: buffer to store the derived key, must be of out_len bytes |
Warning: pwdhash and pwdhashTimed's parameter order may be inconsistent. See botan-lowtestBotanLowPwdHashSpec.hs for more information.
:: PBKDFName | algo: PBKDF algorithm, e.g., Scrypt or "PBKDF2(SHA-256)" |
-> Int | msec: the desired runtime in milliseconds |
-> Int | out_len: the desired length of the key to produce |
-> ByteString | passphrase: the password to derive the key from |
-> ByteString | salt[]: a randomly chosen salt |
-> IO (Int, Int, Int, ByteString) | out[]: buffer to store the derived key, must be of out_len bytes |
Warning: pwdhash and pwdhashTimed's parameter order may be inconsistent. See botan-lowtestBotanLowPwdHashSpec.hs for more information.
Password hashing algorithms
pattern Bcrypt_PBKDF :: PBKDFName Source #
pattern OpenPGP_S2K :: PBKDFName Source #
openPGP_S2K :: HashName -> PBKDFName Source #