shishi_decrypt_ivupdate_etype(3)
๐ shishi_decrypt_ivupdate_etype(3) โ the shishi manual, section 3 ๐
okay bestie, gather round, because today we're decoding (literally) one of the shishi API functions ๐ฆ it's called shishi_decrypt_ivupdate_etype, and yes the name is a whole mouthful, but it's giving "I do exactly what my name says" energy and honestly? iconic. ๐
โจ NAME โจ
shishi_decrypt_ivupdate_etype โ an API function. that's it, that's the name, she's an API function and she's thriving ๐
๐ธ SYNOPSIS ๐ธ
#include <shishi.h>
int shishi_decrypt_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. a whole squad. a friend group, if you will. ๐ซถ
๐ ARGUMENTS ๐
Shishi * handleโ your shishi handle, the one you got fromshishi_init(). she's the main character, everything routes through her.Shishi_key * keyโ the key you're decrypting with. no key, no decryption, no vibes. ๐int keyusageโ an integer that says what this key is being used to decrypt. context matters bestie.int32_t etypeโ an integer telling us which cipher to use. pick your fighter. ๐ฅconst char * ivโ input array holding the initialization vector. the IV. the little sparkle that makes each encryption unique โจsize_t ivlenโ the size of that input IV array. how big is the sparkle.char ** ivoutโ output array with a newly allocated updated initialization vector. she's fresh, she's new, she's yours to free (more on that in a sec ๐ญ).size_t * ivoutlenโ the size of that output array with the updated IV.const char * inโ input array with the data you wanna decrypt. the mystery box ๐ฆsize_t inlenโ size of the input array with data to decrypt.char ** outโ output array with the newly allocated decrypted data. THE REVEAL. ๐size_t * outlenโ output variable holding the size of that newly allocated output array.
๐ DESCRIPTION ๐
So what does she actually do? She decrypts data according to the encryption method, using the initialization vector and key you handed her. ๐
The key that actually gets used? It's derived using the key usage. and here's the tea: if key usage is 0, no key derivation is used at all. zero. none. periodt.
The OUT buffer must be deallocated by the caller. not by her, not by your other functions, by you. don't leave her hanging with a memory leak, that's not the move. ๐ฎ
And if IVOUT or IVOUTLEN is NULL? then the updated IV just... isn't saved anywhere. she keeps it to herself. lowkey mysterious of her. ๐
โ ๏ธ okay this part is important, no cap: DECRYPT(ENCRYPT(data)) does not necessarily give you back your data exactly. some encryption types add pad to make the data fit into the block size of the encryption algorithm. and the pad? it's not guaranteed to look in any special way, even though existing implementations often pad with the zero byte. so like, you genuinely cannot trust the padding to be recognizable.
what does that mean for you, bestie? it 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. framing: it's giving "wrap it up so you know what you got." ๐
โญ RETURN VALUE โญ
Returns SHISHI_OK iff successful. that "iff" is doing a lot of heavy lifting and she's right to do it. ๐ฏ
๐ญ REPORTING BUGS ๐ญ
found a bug? report it to <bug-shishi@gnu.org>. they wanna hear it, fr fr.
- 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.
(that's the license, and it's generous, and we respect it ๐)
๐ 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, it's the whole lore. ๐
and that's the page, bestie!! ๐ this was shishi_decrypt_ivupdate_etype(3) from shishi version 1.0.3, and yes, the copyright has been holding it down since 2002. now go forth, decrypt responsibly, and free your 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