gsasl_scram_secrets_from_password(3)

πŸ’… NAME

gsasl_scram_secrets_from_password β€” it's an API function, bestie, and it's literally the one that turns your password into all the SCRAM secrets you need πŸŽ€

It lives in the gsasl manual, section 3 (that's the library-functions girlies), so if you see gsasl_scram_secrets_from_password(3) floating around, that's her πŸ’–


✨ SYNOPSIS

#include <gsasl.h>

int gsasl_scram_secrets_from_password(Gsasl_hash hash, const char *
password, unsigned int iteration_count, const char * salt, size_t
saltlen, char * salted_password, char * client_key, char * server_key,
char * stored_key);

🌸 ARGUMENTS

  • Gsasl_hash hash β€” a Gsasl_hash element, like, for example GSASL_HASH_SHA256. pick your fave hash, she doesn't judge πŸ¦‹
  • const char * password β€” the input parameter holding the password. yes. that password. πŸ™ˆ
  • unsigned int iteration_count β€” how many PBKDF2 rounds to apply. more rounds = more work = more slay, but also more CPU, just saying πŸ’€
  • const char * salt β€” an input character array, saltlen long, holding the salt for PBKDF2. seasoning matters πŸ§‚βœ¨
  • size_t saltlen β€” the length of salt. she's gotta know how long the seasoning is πŸŽ€
  • char * salted_password β€” a pre-allocated output array that gets the derived salted password πŸ‘‘
  • char * client_key β€” a pre-allocated output array that gets the derived client key πŸ’œ
  • char * server_key β€” a pre-allocated output array that gets the derived server key πŸ’™
  • char * stored_key β€” a pre-allocated output array that gets the derived stored key 🌈

πŸ’– DESCRIPTION

Okay so. This is the helper function that generates SCRAM secrets from a password. That's the whole vibe. One password in, four secrets out, main character energy ✨

⚠️ Real talk though: the salted_password, client_key, server_key, and stored_key buffers must have room to hold the digest for the given hash. Use GSASL_HASH_MAX_SIZE β€” it's big enough for all hashes, no cap 🫢

Return value: returns GSASL_OK if it all worked out, or an error code if it did not 😭


πŸ¦‹ SINCE

1.10 β€” she's been around, an icon since day one πŸ’…


😀 REPORTING BUGS

Found a bug? Do not suffer in silence, bestie β€” report it to <bug-gsasl@gnu.org> πŸ“§

General guidelines for reporting bugs live at: https://www.gnu.org/gethelp/

The GNU SASL home page is: https://www.gnu.org/software/gsasl/


Copyright Β© 2002-2026 Simon Josefsson.

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. (So slay, but respectfully πŸ’–)


πŸ‘€ SEE ALSO

The full documentation for gsasl is maintained as a Texinfo manual. If the info and gsasl programs are properly installed at your site, this command:

info gsasl

should give you access to the complete manual. Obsessed, honestly πŸŽ€

As an alternative you may obtain the manual from:

https://www.gnu.org/software/libidn/gsasl/manual/

and that's the whole page, bestie !! this was gsasl 2.2.4, straight from the gsasl manual, section 3 β€” go forth and derive those secrets 🫢✨

πŸ“¦ where this page comes from