crypton-2.2.5: Cryptography Primitives
LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Crypto.KDF.PBKDF2

Description

Password Based Key Derivation Function 2

Synopsis

Documentation

type PRF password Source #

Arguments

 = password

the password parameters

-> Bytes

the content

-> Bytes

prf(password,content)

The PRF used for PBKDF2

prfHMAC :: (HashAlgorithm a, ByteArrayAccess password) => a -> PRF password Source #

PRF for PBKDF2 using HMAC with the hash algorithm as parameter

data Parameters Source #

Parameters for PBKDF2

Constructors

Parameters 

Fields

  • iterCounts :: Int

    the number of user-defined iterations for the algorithms. e.g. WPA2 uses 4000. (must be > 0)

  • outputLength :: Int

    the number of bytes to generate out of PBKDF2 (must not be negative)

generate :: (ByteArrayAccess password, ByteArrayAccess salt, ByteArray ba) => PRF password -> Parameters -> password -> salt -> ba Source #

generate the pbkdf2 key derivation function from the output

Parameters outside the ranges documented for Parameters raise CryptoError_ParameterInvalid; tryGenerate reports the same condition as CryptoFailed.

tryGenerate :: (ByteArrayAccess password, ByteArrayAccess salt, ByteArray ba) => PRF password -> Parameters -> password -> salt -> CryptoFailable ba Source #

generate the pbkdf2 key derivation function from the output, reporting parameters the implementation refuses rather than raising.

fastPBKDF2_SHA1 :: (ByteArrayAccess password, ByteArrayAccess salt, ByteArray out) => Parameters -> password -> salt -> out Source #

PBKDF2 with HMAC-SHA1, using the bundled C implementation.

Parameters outside the ranges documented for Parameters raise CryptoError_ParameterInvalid; tryFastPBKDF2_SHA1 reports the same condition as CryptoFailed.

tryFastPBKDF2_SHA1 :: (ByteArrayAccess password, ByteArrayAccess salt, ByteArray out) => Parameters -> password -> salt -> CryptoFailable out Source #

PBKDF2 with HMAC-SHA1, reporting parameters the implementation refuses rather than raising.

fastPBKDF2_SHA256 :: (ByteArrayAccess password, ByteArrayAccess salt, ByteArray out) => Parameters -> password -> salt -> out Source #

PBKDF2 with HMAC-SHA256, using the bundled C implementation.

Parameters outside the ranges documented for Parameters raise CryptoError_ParameterInvalid; tryFastPBKDF2_SHA256 reports the same condition as CryptoFailed.

tryFastPBKDF2_SHA256 :: (ByteArrayAccess password, ByteArrayAccess salt, ByteArray out) => Parameters -> password -> salt -> CryptoFailable out Source #

PBKDF2 with HMAC-SHA256, reporting parameters the implementation refuses rather than raising.

fastPBKDF2_SHA512 :: (ByteArrayAccess password, ByteArrayAccess salt, ByteArray out) => Parameters -> password -> salt -> out Source #

PBKDF2 with HMAC-SHA512, using the bundled C implementation.

Parameters outside the ranges documented for Parameters raise CryptoError_ParameterInvalid; tryFastPBKDF2_SHA512 reports the same condition as CryptoFailed.

tryFastPBKDF2_SHA512 :: (ByteArrayAccess password, ByteArrayAccess salt, ByteArray out) => Parameters -> password -> salt -> CryptoFailable out Source #

PBKDF2 with HMAC-SHA512, reporting parameters the implementation refuses rather than raising.