gnutls_sec_param_to_pk_bits(3)
β¨ gnutls_sec_param_to_pk_bits β¨
okay bestie, welcome to the gnutls manual, this one's a little API function called gnutls_sec_param_to_pk_bits and it's genuinely so useful, come sit with me π
πΈ NAME πΈ
gnutls_sec_param_to_pk_bits β it's an API function, that's the vibe π
π¦ SYNOPSIS π¦
#include <gnutls/gnutls.h>
unsigned int gnutls_sec_param_to_pk_bits(gnutls_pk_algorithm_t algo,
gnutls_sec_param_t param);
π ARGUMENTS π
gnutls_pk_algorithm_t algoβ this is a public key algorithm, like the actual crypto system you're working with πgnutls_sec_param_t paramβ and this one is a security parameter, i.e. the human-readable "how safe do I wanna be" number β¨
π DESCRIPTION π
so here's the situation bestie. when you're generating private and public key pairs, there's this genuinely difficult question lurking: which size of "bits" is the modulus gonna be in RSA, and what's the group size in DSA? π
and the "easy answer" everyone reaches for is 1024β¦ which is also, and I cannot stress this enough, wrong. not me trusting the wrong number π
that's literally what this function is for though: it takes a human understandable security parameter and converts it into an appropriate size for the specific algorithm you picked. no cap, it just does the math for you so you don't have to guess π«Ά
β RETURNS β
The number of bits, or (0).
π SINCE π
2.12.0 β she's been iconic for a while now π
π REPORTING BUGS π
found a bug? don't be shy, 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.
π₯ 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 fr fr π this was gnutls version 3.8.13, and yes the header and footer are literally the same function name twice β main character energy tbh. go forth and never hardcode 1024 again, mwah πβ¨
π¦ 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