shishi_decrypt_etype(3)
π shishi_decrypt_etype β bestie, it's decryption o'clock π
okay so this is a page from the shishi manual, section 3 (that's the library-functions section, iykyk π«Ά). It's called shishi_decrypt_etype and it's literally the girl whose whole job is: take the scrambled data, hand you back the real data. slay.
β¨ SYNOPSIS β¨
#include <shishi.h>
int shishi_decrypt_etype(Shishi * handle, Shishi_key * key, int
keyusage, int32_t etype, const char * in, size_t inlen, char ** out,
size_t * outlen);
that's the whole vibe. one function call, eight arguments, zero chill πΈ
π ARGUMENTS π
Shishi * handleβ your shishi handle, the one you got fromshishi_init(). it's the passport, don't lose it πShishi_key * keyβ the key you're decrypting with. the moment.int keyusageβ an integer saying what exactly this key is decrypting. context is everything bestie.int32_t etypeβ an integer saying which cipher to use. pick your fighter β¨const char * inβ the input array holding the data you want decrypted.size_t inlenβ how big that input array is. size matters, fr fr.char ** outβ the output array where the freshly allocated decrypted data lands. new memory, just for you πsize_t * outlenβ an output variable that tells you how big that newly allocated output array is.
π DESCRIPTION π
So. This function decrypts data according to the encryption method you specified, using the key you handed over. π¦
Here's the tea though: the key that actually gets used is derived using the key usage. And if key usage is 0, then no key derivation happens at all β raw key, no middleman. periodt.
β οΈ The OUT buffer must be deallocated by the caller. that's on you, not on shishi. free it or leak it, your choice (pls free it π).
The default IV is what gets used here. If you need to change the IV, go see shishi_decrypt_iv_etype. And the next IV? gone. lost. not coming back. if you need it, shishi_decrypt_ivupdate_etype is your girl.
Now for the part everyone forgets and then cries about π«Ά: DECRYPT(ENCRYPT(data)) does not necessarily give you data back exactly. 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 particular way either β existing implementations often pad with the zero byte, but that's a "often", not a promise. π
Which means... you may have to "frame" your data, so that after decryption it's actually possible to infer the original length. Think of it like tagging your luggage so you know which bag is yours at baggage claim. Compare ASN.1 DER, which contains exactly that kind of information. β
π RETURN VALUE π
Returns SHISHI_OK iff successful. that's it. that's the whole answer. slay.
π REPORTING BUGS π
Found a bug? Report it to <bug-shishi@gnu.org>. They want to know, bestie, don't gatekeep π«Ά
- 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. (iconic of them honestly π)
π 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 giving encyclopedia but make it fun π
shishi version 1.0.3 β that's the source and the version, and this page is shishi_decrypt_etype(3), section 3, GNU Shishi. mwah, go decrypt 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