gnutls_cipher_encrypt2(3)
π gnutls_cipher_encrypt2(3) π
okay bestie, so this one lives in the gnutls manual, and it's the glow-up version of encrypting your data. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
gnutls_cipher_encrypt2 β it's an API function, periodt π
πΈ SYNOPSIS πΈ
#include <gnutls/crypto.h>
int gnutls_cipher_encrypt2(gnutls_cipher_hd_t handle, const void *
ptext, size_t ptext_len, void * ctext, size_t ctext_len);
like, look at her. she's a function signature and she's serving π
π ARGUMENTS π
gnutls_cipher_hd_t handleβ bestie this is literally just agnutls_cipher_hd_ttype. that's the whole vibe of it.const void * ptextβ the data you wanna encrypt. your lil secret. π€«size_t ptext_lenβ how much data you're encrypting, in length form. count it, don't guess it.size_t ptext_len... wait no, it'ssize_t ctext_lenβ the available length for the encrypted data. it's giving "how much room do we have for the glow-up" π¦void * ctextβ the encrypted data goes here. the after pic. β¨
ngl the order in the original is handle, ptext, ptext_len, ctext, ctext_len β keep that energy, don't shuffle it π
π DESCRIPTION π
so what does she do? she encrypts the given data using the algorithm specified by the context. that's it, that's the job, and she ate π
but β and this is the important part, no cap β for block ciphers, ptext_len must be a multiple of the block size. like, non-negotiable. do not come in here with a weird length and expect things to be cute. π
and for the supported ciphers, the encrypted data length will equal the plaintext size. so it's not gonna puff up or shrink on you. the way that's so reassuring fr fr π
β RETURNS β
zero. or a negative error code if something went wrong. so like, 0 = slay, negative = not slay, go check your error handling bestie π₯
π SINCE π
2.12.0 β she's been iconic since way back, iykyk π
π¦ REPORTING BUGS π¦
found a bug? don't suffer in silence, tell the girlies:
- report bugs to <bugs@gnutls.org>
- home page: https://www.gnutls.org
seriously, report it. bugs don't fix themselves and we are NOT about that silent-struggle life π«Ά
π 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, just keep 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/
and that's the whole page bestie, we're done here πΈβ¨
π§ this has been thegnutlsmanual, version3.8.13, pagegnutls_cipher_encrypt2(3). go encrypt something responsibly, 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