Liking cljdoc? Tell your friends :D

geheimtur.util.credentials

Provides different hashing/verification functions.

Provides different hashing/verification functions.
raw docstring

bcrypt-hashclj

(bcrypt-hash password & {:keys [log-rounds]})

Hashes a given plaintext password using bcrypt and an optional :log-rounds (log2 of the number of rounds of hashing to apply, defaults to 10 as of this writing).

Hashes a given plaintext password using bcrypt and an optional
:log-rounds (log2 of the number of rounds of hashing to apply,
defaults to 10 as of this writing).
raw docstring

bcrypt-verifyclj

(bcrypt-verify password hash)

Returns true if the plaintext [password] corresponds to [hash], the result of previously hashing that password.

Returns true if the plaintext [password] corresponds to [hash],
the result of previously hashing that password.
raw docstring

create-credentials-fnclj

(create-credentials-fn identity-fn
                       &
                       {:keys [password-key hash-verify-fn]
                        :or {password-key :password
                             hash-verify-fn bcrypt-verify}})

Creates a credentials function. Accepts:

[identity-fn] - a function of one argument, that returns the user's identity corresponding to the given argument value.

:password-key - a key to be used to resolve the hash of user's password from the identity map returned by identity-fn. Defaults to :password.

:hash-verify-fn - a hash verification function. Defaults to bcrypt-verify.

Creates a credentials function. Accepts:

[identity-fn] - a function of one argument, that returns the user's
identity corresponding to the given argument value.

:password-key - a key to be used to resolve the hash of user's password
from the identity map returned by identity-fn. Defaults to :password.

:hash-verify-fn - a hash verification function. Defaults to `bcrypt-verify`.
raw docstring

gen-saltclj

(gen-salt)
(gen-salt size)

Generates a random salt array.

Generates a random salt array.
raw docstring

pbkdf2-hashclj

(pbkdf2-hash password & {:keys [iterations salt] :or {iterations 10000}})

Hashes a given plaintext password using PBKDF2, an optional :iterations count (defaults to 10000) and an optional salt (a byte array, defaults to a random array of size 8).

Hashes a given plaintext password using PBKDF2, an optional
:iterations count (defaults to 10000) and an optional salt
(a byte array, defaults to a random array of size 8).
raw docstring

pbkdf2-verifyclj

(pbkdf2-verify password hash)

Returns true if the plaintext [password] corresponds to [hash], the result of previously hashing that password.

Returns true if the plaintext [password] corresponds to [hash],
the result of previously hashing that password.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close