gnutls_cipher_encrypt(3)

πŸ’– gnutls_cipher_encrypt β€” API function πŸ’–

okay bestie, welcome to the gnutls manual, and specifically to gnutls_cipher_encrypt(3). this is the one that actually does the encrypting. the glow-up of your plaintext. the main character moment. let's go 🫢


✨ SYNOPSIS ✨

#include <gnutls/crypto.h>

int gnutls_cipher_encrypt(gnutls_cipher_hd_t handle, void * ptext,
       size_t ptext_len);

like. look at it. three little params and it's out here changing lives πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_cipher_hd_t handle β€” bestie this is a gnutls_cipher_hd_t type. it's your cipher handle, your lil context baddie, and it's the one holding the algorithm tea.
  • void * ptext β€” the data to encrypt. yes, that's your plaintext, and yes, it's getting a whole new look ✨
  • size_t ptext_len β€” the length of data to encrypt. gotta tell it how many bytes we're working with, no guessing games here πŸ¦‹

🌸 DESCRIPTION 🌸

so what does this function actually do, you ask? it encrypts the given data using the algorithm specified by the context. that's it. that's the whole vibe. the context (aka your handle) already knows which algorithm it's on, so this function just takes your data and does the thing. no cap πŸ”₯


⭐ RETURNS ⭐

zero on success, or a negative error code on error. so if you get a negative number back, that's your signal that something went sideways β€” check it, don't ignore it, periodt πŸ’€


πŸ¦‹ SINCE πŸ¦‹

2.10.0 β€” she's been iconic since 2.10.0, an absolute veteran πŸ‘‘


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? don't suffer in silence, tell the girlies:

(not me giving you the exact email and URL, you're welcome 😭)


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. (yes bestie, it's free to share, 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/>

like, go read the whole thing, it's giving comprehensive πŸ“


and that's the page!! this was gnutls_cipher_encrypt(3) from gnutls version 3.8.13, brought to you with love. mwah. slay, stay encrypted, and drink water πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from