GNUTLS_SRP_SET_SERVER_FAKE_SALT_SEED(3)
π gnutls_srp_set_server_fake_salt_seed(3) π
okay bestie, so this one lives in the gnutls manual, and it's genuinely one of those lowkey-genius little functions that's just quietly out here protecting your users from being doxxed by username. no cap. let's get into it π«Ά
β¨ NAME β¨
gnutls_srp_set_server_fake_salt_seed β it's an API function, and it's the one that makes fake salts for fake users look exactly as real as the real ones. the way that it does that?? iconic. π
πΈ SYNOPSIS πΈ
#include <gnutls/gnutls.h>
void
gnutls_srp_set_server_fake_salt_seed(gnutls_srp_server_credentials_t
cred, const gnutls_datum_t * seed, unsigned int salt_length);
π ARGUMENTS π
gnutls_srp_server_credentials_t credβ bestie, this is agnutls_srp_server_credentials_ttype. that's it, that's the whole vibe. πconst gnutls_datum_t * seedβ this is the seed data. here's the tea: it only needs to be valid until the function returns, so don't stress about keeping it alive forever. and the size of the seed must be greater than zero. zero bytes? absolutely not, we don't do that here. π«unsigned int salt_lengthβ the length of the generated fake salts. so like, how long do you want your fake little salts to be. π§
π¦ DESCRIPTION π¦
so this function sets the seed that's used to generate salts for invalid (non-existent) usernames. yep, fake users. we're generating fake credentials for people who literally don't exist and it's for security. obsessed. β¨
here's why, because this part is actually so smart: in order to prevent attackers from guessing valid usernames, when a user does not exist gnutls generates a salt and a verifier and proceeds with the protocol as usual. the authentication will ultimately fail, but the client cannot tell whether the username is valid (exists) or invalid. it's giving equal treatment, it's giving no information leaked, it's giving main character energy for your privacy. π
now the caveat, and listen up because this matters: if an attacker learns the seed, given a salt (which is part of the handshake) which was generated when the seed was in use, it can tell whether or not the authentication failed because of an unknown username. so like... guard the seed. π
but chill, okay? this seed cannot be used to reveal application data or passwords. so it's a username-privacy thing, not a password-leak thing. important distinction, bestie. π
also, salt_length should represent the salt length your application uses. and heads up: generating fake salts longer than 20 bytes is not supported. 20 bytes is the ceiling. do not go past it. periodt. π
by default the seed is a random value, different each time a gnutls_srp_server_credentials_t is allocated, and fake salts are 16 bytes long. so the defaults are already slaying, you only need to touch this if you have a specific reason. π
β SINCE β
3.3.0 β so it's been here a while, it's a seasoned queen. π
π REPORTING BUGS π
found a bug? do not suffer in silence, bestie, tell the devs:
- 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. so like, go off, share it, just keep the notice. π«Ά
π 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/
and that's the whole page, bestie, you ate that π
gnutls version 3.8.13, manual page gnutls_srp_set_..._fake_salt_seed(3) β mwah, go forth and generate your fake salts responsibly πβ¨π¦
π¦ 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