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 a gnutls_cipher_hd_t type. 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's size_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:

seriously, report it. bugs don't fix themselves and we are NOT about that silent-struggle life 🫢

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 the gnutls manual, version 3.8.13, page gnutls_cipher_encrypt2(3). go encrypt something responsibly, mwah πŸ’œ
πŸ“¦ where this page comes from