shishi_encrypt_ivupdate_etype(3)
π shishi_encrypt_ivupdate_etype β the manual page, bestie edition π
okay so you're reading the shishi manual, section 3 (that's the library-call girlies β¨), and this specific page is all about shishi_encrypt_ivupdate_etype. she's an API function. she encrypts stuff AND hands you back an updated initialization vector, which is a lot for one function but she ate, no cap π
πΈ SYNOPSIS πΈ
#include <shishi.h>
int shishi_encrypt_ivupdate_etype(Shishi * handle, Shishi_key * key, int
keyusage, int32_t etype, const char * iv, size_t ivlen, char ** ivout,
size_t * ivoutlen, const char * in, size_t inlen, char ** out, size_t *
outlen);
look at all those parameters. twelve of them. she's high maintenance but she delivers π
π ARGUMENTS π
Shishi * handleβ the shishi handle, bestie. you get one fromshishi_init(), obviously.Shishi_key * keyβ the key you're encrypting with. the main character of this operation fr.int keyusageβ an integer saying what exactly this key is encrypting. context matters, always πint32_t etypeβ an integer saying which cipher to use. pick your fighter β¨const char * ivβ input array holding the initialization vector.size_t ivlenβ how big that input array with the initialization vector is.char ** ivoutβ output array with the freshly allocated updated initialization vector. new IV, who dis π¦size_t * ivoutlenβ how big the output array with the updated initialization vector is.const char * inβ input array with the data you wanna encrypt.size_t inlenβ size of that input array with the data to encrypt.char ** outβ output array with the newly allocated encrypted data. the glow-up π«Άsize_t * outlenβ output variable holding the size of that newly allocated output array.
π DESCRIPTION π
so what does she actually do. she encrypts data as per the encryption method, using the initialization vector and key you specified. iconic behaviour honestly.
the key that actually gets used? it's derived using the key usage. and if key usage is 0, then no key derivation is used at all β zero, none, skipped, periodt.
the OUT buffer must be deallocated by the caller. that's your job, not hers. and if IVOUT or IVOUTLEN is NULL, the updated IV just... isn't saved anywhere. gone. into the void π
π¨ okay important thing, listen up:DECRYPT(ENCRYPT(data))does not necessarily give you backdataexactly. like, not even close sometimes. some encryption types add pad to make the data fit into the block size of the encryption algorithm. and the pad isn't guaranteed to look any special way, though existing implementations often pad with the zero byte. so basically you may have to "frame" your data so it's possible to infer the original length after decryption. compare ASN.1 DER, which contains exactly that kind of information. so like, don't be shocked when round-tripping isn't a perfect circle, it's giving expected behaviour π
β RETURN VALUE β
returns SHISHI_OK iff successful. that's the only answer we accept π
π REPORTING BUGS π
found a bug? 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/
(no gatekeeping, just tell them directly π«Ά)
π 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.
π§ 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 the whole thing, iykyk πβ¨
and that's the page, bestie!! this was shishi_encrypt_ivupdate_etype(3) from shishi, version 1.0.3 ππ thanks for reading, you're literally so smart for making it to the end, slay, go encrypt something responsibly π
β¨πΈ
π¦ 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