KCAPI_PBKDF(3)

✨ KCAPI_PBKDF ✨

okay bestie, welcome to the kcapi_pbkdf page from section 3 of the manual πŸ’– this is the one that turns your lil password into a whole actual cryptographic key. no cap.


🌸 NAME 🌸

kcapi_pbkdf β€” Password-based Key Derivation Function. it's giving key factory but make it password-flavored πŸ”‘


πŸŽ€ SYNOPSIS πŸŽ€

ssize_t kcapi_pbkdf(const char * hashname, const uint8_t * pw,
                    uint32_t pwlen, const uint8_t * salt,
                    size_t saltlen, uint32_t count, uint8_t * key,
                    size_t keylen);

like. look at her. eight arguments and not one of them is optional πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • hashname β€” [in] the kernel crypto API name of a keyed hash, bestie. e.g. hmac(sha1). yes you have to spell it exactly like that.
  • pw β€” [in] the Password that a key shall be derived from. your secret. guard it with your life fr fr πŸ™ˆ
  • pwlen β€” [in] Length of password string. gotta tell her how long it is, she's not psychic.
  • salt β€” [in] the Salt as defined in SP800-132. iconic spec behavior.
  • saltlen β€” [in] Length of salt buffer.
  • count β€” [in] Numbers of iterations to be performed for the PBKDF. more iterations = more pain for the attackers = more slay for you πŸ”₯
  • key β€” [out] Buffer to store the generated key in. this is where the magic lands ✨
  • keylen β€” [in] Size of the key to be generated (i.e. length of the key buffer). the length of the buffer, not the length of the key inside it, bestie, don't get it twisted.

πŸ’œ DESCRIPTION πŸ’œ

This function is an implementation of the PBKDF as defined in SP800-132. that's the whole vibe. she derives keys from passwords, correctly, per spec. periodt.

returns 0 upon success; a negative errno-style error code if an error occurred. so like. zero means we ate. anything negative means we did not eat 😭

ngl bestie, always check the return value. a negative errno is the function telling you something went wrong, and she will not text you twice.

πŸ‘‘ AUTHOR πŸ‘‘

Stephan Mueller <smueller@chronox.de> Author.

the literal author. main character energy, honestly.


that's it, that's the page β€” this is the libkcapi Manual version 1.5.0, dated July 2025 πŸ’– go derive some keys, bestie, and stay salty πŸ§‚βœ¨

πŸ“¦ where this page comes from