shishi_encrypt_ivupdate(3)
π shishi_encrypt_ivupdate π
okay bestie, pull up a chair, because this one is from the shishi manual (section 3, library calls, iykyk) and it's literally the glow-up function for your encryption era β¨
β¨ NAME β¨
shishi_encrypt_ivupdate β API function πΈ
π SYNOPSIS π
#include <shishi.h>
int shishi_encrypt_ivupdate(Shishi * handle, Shishi_key * key, int
keyusage, const char * iv, size_t ivlen, char ** ivout, size_t *
ivoutlen, const char * in, size_t inlen, char ** out, size_t * outlen);
π¦ ARGUMENTS π¦
like, so many parameters, but every single one is doing its little job and we respect that π
Shishi * handleβ the shishi handle, the one you got fromshishi_init(). your main character, basically πShishi_key * keyβ the key we're encrypting with πint keyusageβ an integer saying what exactly this key is encrypting, so the key derivation knows what's upconst char * ivβ input array holding the initialization vector π§size_t ivlenβ how big that initialization vector input array ischar ** ivoutβ output array with the newly allocated updated initialization vector (yes, freshly allocated, we love a new buffer)size_t * ivoutlenβ the size of that output array with the updated initialization vectorconst char * inβ input array with the data you wanna encrypt πsize_t inlenβ size of the input array with the data to encryptchar ** outβ output array with the newly allocated encrypted data β¨size_t * outlenβ output variable holding the size of that newly allocated output array
π DESCRIPTION π
so basically it encrypts data using the specified initialization vector and key. periodt. π«
the key that actually gets used is derived using the key usage. and if key usage is 0, then no key derivation is used at all, no cap. π«Ά
the OUT buffer must be deallocated by the caller. that's on you, bestie, not on shishi. π
and if IVOUT or IVOUTLEN is NULL, then the updated IV just... doesn't get saved anywhere. it's giving "we move on" π
now, important lore: DECRYPT(ENCRYPT(data)) does not necessarily yield data exactly. nope, not even close. some encryption types add pad so the data fits into the block size of the encryption algorithm. and the pad is not guaranteed to look any special way, although existing implementations often pad with the zero byte. π
which means you may have to "frame" your data, so it's possible to infer the original length after decryption. compare ASN.1 DER, which contains such information. iconic behaviour, honestly β
π RETURN VALUE π
returns SHISHI_OK iff successful. that's it, that's the whole vibe check β
π REPORTING BUGS π
found a bug? not cute. report it to <bug-shishi@gnu.org>.
- GNU Shishi home page:
http://www.gnu.org/software/shishi/ - General help using GNU software:
http://www.gnu.org/gethelp/
π COPYRIGHT π
Copyright Β© 2002-2022 Simon Josefsson.
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. slay, and also legally binding π
πΈ SEE ALSO πΈ
the full documentation for shishi is maintained as a Texinfo manual. if the info and shishi programs are properly installed at your site, the command
info shishi
should give you access to the complete manual. go read it, bestie πβ¨
that's the whole page, fr fr β this one's from shishi version 1.0.3, section 3, page shishi_encrypt_ivupdate(3). mwah, take care of those buffers ππ
π¦
π¦ where this page comes from
- debian bookworm: shishi-doc 1.0.3-1 Β· GPL-3.0-or-later
- debian trixie: shishi-doc 1.0.3-5 Β· GPL-3.0-or-later
- nixos 26.05: shishi 1.0.3
- nixpkgs unstable: shishi 1.0.3
- ubuntu noble: shishi-doc 1.0.3-2.1build2 Β· GPL-3.0-or-later
- ubuntu questing: shishi-doc 1.0.3-5
- ubuntu resolute: shishi-doc 1.0.3-5build1 Β· GPL-3.0-or-later
- ubuntu stonking: shishi-doc 1.0.3-7 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms