gnutls_pbkdf2(3)

✨ gnutls_pbkdf2 β€” the "turn ur password into a whole key" icon ✨

okay bestie, welcome to the gnutls manual πŸ’– this one's from the gnutls section of the manual pages, and it's literally just one function that does one extremely cool thing. buckle up πŸŽ€


🌸 NAME 🌸

gnutls_pbkdf2 β€” API function. that's it. that's the name. iconic, honestly πŸ‘‘


πŸ’… SYNOPSIS πŸ’…

#include <gnutls/crypto.h>

int gnutls_pbkdf2(gnutls_mac_algorithm_t mac, const gnutls_datum_t *
key, const gnutls_datum_t * salt, unsigned iter_count, void * output,
size_t length);

so you include <gnutls/crypto.h> and then you call it. easy. slay 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

like, here's what you're feeding it, one by one:

  • gnutls_mac_algorithm_t mac β€” the mac algorithm that gets used internally 🧚 this is the engine room, the vibe-setter, the one doing the actual cryptographic lifting behind the scenes.
  • const gnutls_datum_t * key β€” the initial keying material. this is ur starting stuff, the raw ingredient, the main character of the whole operation πŸ’œ
  • const gnutls_datum_t * salt β€” the salt 🌸 yes, like actual seasoning. sprinkle it in so the output isn't predictable. it matters. no cap.
  • unsigned iter_count β€” the iteration count. how many times it goes around the loop. lowkey this is the "how hard should I make it for the attacker" dial πŸ”₯
  • void * output β€” the output value. this is where the derived key lands when it's done, so like… make sure it's a real buffer, bestie πŸ™ˆ
  • size_t length β€” the desired length of the output key ⭐ you literally get to pick how long you want it. dream come true energy.

🌈 DESCRIPTION 🌈

okay so the whole moment here: this function will derive a variable length keying material from a password according to PKCS 5 PBKDF2 ✨

that's the entire description. variable length keying material, from a password, per PKCS 5 PBKDF2. and the way that it does exactly what it says and nothing more?? perfection πŸ’–


πŸ‘‘ RETURNS πŸ‘‘

Zero or a negative error code on error.

so like: 0 means yay πŸŽ‰, anything negative means something went sideways and you should probably go look at it. periodt.


πŸŽ€ SINCE πŸŽ€

3.6.13 β€” so it's been around a minute, it's not some brand new baby function, it's established. it ate. πŸ’…


πŸ’€ REPORTING BUGS πŸ’€

found something cursed? not me being the one to tell you, but like, do report it:


Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.

(translation: it's free, go wild, just don't delete the receipts 🧾✨)


πŸ”₯ SEE ALSO πŸ”₯

the full documentation for gnutls is maintained as a Texinfo manual πŸ“š if the /usr/share/doc/gnutls/ directory does not contain the HTML form, visit:

https://www.gnutls.org/manual/

iykyk β€” that's the place for the deep lore.


k byeeee πŸ’œ this was gnutls_pbkdf2(3) from the gnutls manual, version 3.8.13 β€” go derive some keys bestie, you've got this πŸŒΈπŸ¦‹πŸŽ€

πŸ“¦ where this page comes from