botan-bindings-0.0.1.0: Raw Botan bindings
Copyright(c) Leo D 2023
LicenseBSD-3-Clause
Maintainerleo@apotheca.io
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageHaskell2010

Botan.Bindings.PwdHash

Description

Derive a key from a passphrase

Synopsis

Documentation

pattern BOTAN_PBKDF_PBKDF2 :: (Eq a, IsString a) => a Source #

pattern BOTAN_PBKDF_SCRYPT :: (Eq a, IsString a) => a Source #

pattern BOTAN_PBKDF_ARGON2D :: (Eq a, IsString a) => a Source #

pattern BOTAN_PBKDF_ARGON2I :: (Eq a, IsString a) => a Source #

pattern BOTAN_PBKDF_ARGON2ID :: (Eq a, IsString a) => a Source #

pattern BOTAN_PBKDF_OPENPGP_S2K :: (Eq a, IsString a) => a Source #

botan_pwdhash Source #

Arguments

:: ConstPtr CChar

algo: PBKDF algorithm, e.g., "PBKDF2(SHA-256)" or Scrypt

-> CSize

param1: the first PBKDF algorithm parameter

-> CSize

param2: the second PBKDF algorithm parameter (may be zero if unneeded)

-> CSize

param3: the third PBKDF algorithm parameter (may be zero if unneeded)

-> Ptr Word8

out[]: buffer to store the derived key, must be of out_len bytes

-> CSize

out_len: the desired length of the key to produce

-> ConstPtr CChar

passphrase: the password to derive the key from

-> CSize

passphrase_len: if > 0, specifies length of password. If len == 0, then strlen will be called on passphrase to compute the length.

-> ConstPtr Word8

salt[]: a randomly chosen salt

-> CSize

salt_len: length of salt in bytes

-> IO CInt

0 on success, a negative value on failure

Derive a key from a passphrase using algorithm-specific parameters

botan_pwdhash_timed Source #

Arguments

:: ConstPtr CChar

algo: PBKDF algorithm, e.g., Scrypt or "PBKDF2(SHA-256)"

-> Word32

msec: the desired runtime in milliseconds

-> Ptr CSize

param1: will be set to the first password hash parameter

-> Ptr CSize

param2: will be set to the second password hash parameter

-> Ptr CSize

param3: will be set to the third password hash parameter

-> Ptr Word8

out[]: buffer to store the derived key, must be of out_len bytes

-> CSize

out_len: the desired length of the key to produce

-> ConstPtr CChar

passphrase: the password to derive the key from

-> CSize

passphrase_len: if > 0, specifies length of password. If len == 0, then strlen will be called on passphrase to compute the length.

-> ConstPtr Word8

salt[]: a randomly chosen salt

-> CSize

salt_len: length of salt in bytes

-> IO CInt

0 on success, a negative value on failure

Derive a key from a passphrase using parameters generated over a specific duration