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.Bcrypt

Description

Generate and validate Bcrypt password hashes

Synopsis

Documentation

pattern BOTAN_BCRYPT_WORK_FACTOR_FAST :: (Eq a, Num a) => a Source #

Should not cause noticable CPU usage

pattern BOTAN_BCRYPT_WORK_FACTOR_GOOD :: (Eq a, Num a) => a Source #

May cause noticable CPU usage

pattern BOTAN_BCRYPT_WORK_FACTOR_STRONG :: (Eq a, Num a) => a Source #

May block for several seconds

botan_bcrypt_generate Source #

Arguments

:: Ptr Word8

out: buffer holding the password hash, should be of length 64 bytes

-> Ptr CSize

out_len: the desired output length in bytes

-> ConstPtr CChar

password: the password

-> BotanRNG

rng: a random number generator

-> CSize

work_factor: how much work to do to slow down guessing attacks

-> Word32

flags: should be 0 in current API revision, all other uses are reserved and return BOTAN_FFI_ERROR_BAD_FLAG

-> IO CInt

0 on success, a negative value on failure

Create a password hash using Bcrypt

Output is formatted bcrypt $2a$...

botan_bcrypt_is_valid Source #

Arguments

:: ConstPtr CChar

pass: the password to check against

-> ConstPtr CChar

hash: the stored hash to check against

-> IO CInt

0 if if this password/hash combination is valid, 1 if the combination is not valid (but otherwise well formed), negative on error

Check a previously created password hash