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:
- Report bugs to <bugs@gnutls.org> π§
- Home page:
https://www.gnutls.orgπ
π COPYRIGHT π
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
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms