shishi_decrypt_iv_etype(3)

πŸ“¦
version 1.0.3 Β· 2 versions
  • 1.0.3 Β· debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 1.0.2 Β· ubuntu jammy
, in debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– shishi_decrypt_iv_etype πŸ’–

okay bestie, welcome to the shishi manual, section 3 β€” this one's about shishi_decrypt_iv_etype(3), and yes she's an API function, no cap. grab a boba, we're decrypting ✨


🌸 NAME 🌸

shishi_decrypt_iv_etype β€” it's an API function, that's the whole name, she's lowkey mysterious like that πŸ’…


✨ SYNOPSIS ✨

#include <shishi.h>

int shishi_decrypt_iv_etype(Shishi * handle, Shishi_key * key, int
keyusage, int32_t etype, const char * iv, size_t ivlen, const char * in,
size_t inlen, char ** out, size_t * outlen);

πŸŽ€ ARGUMENTS πŸŽ€

okay so here's the whole cast, main character energy each one:

  • Shishi * handle β€” your shishi handle, the one you got from shishi_init(). she's the whole foundation fr.
  • Shishi_key * key β€” the key you're decrypting with πŸ”‘
  • int keyusage β€” an integer that says what this key is decrypting. like, context, yk?
  • 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 β€” the size of that initialization vector input array.
  • const char * in β€” input array with the data you wanna decrypt.
  • size_t inlen β€” size of the data-to-decrypt input array.
  • char ** out β€” output array with the newly allocated decrypted data. she's fresh, she's new ✨
  • size_t * outlen β€” output variable with the size of that newly allocated output array.

πŸ’œ DESCRIPTION πŸ’œ

so what does she do? she decrypts data as per encryption method using specified initialization vector and key. that's the vibe. πŸ’…

the key that actually gets used is derived using the key usage. and listen β€” if key usage is 0, then no key derivation is used. periodt.

⚠️ the OUT buffer must be deallocated by the caller. don't forget, bestie, that's a you problem if you do 😭
🫢 also, the next IV is lost β€” so if you need it, go see shishi_decrypt_ivupdate_etype instead. iykyk.

and now the part that's giving plot twist: note that DECRYPT(ENCRYPT(data)) does not necessarily yield data exactly. not me being honest 😭 some encryption types add pad to make the data fit into the block size of the encryption algorithm. and the pad is not guaranteed to look in any special way, although existing implementations often pad with the zero byte.

what that means for you: you may have to "frame" data, so it's possible to infer the original length after decryption. compare ASN.1 DER, which contains such information. 🌈


⭐ RETURN VALUE ⭐

returns SHISHI_OK iff successful. that's it, that's the whole flex πŸ‘‘


πŸ”₯ REPORTING BUGS πŸ”₯

found a bug? report it to <bug-shishi@gnu.org>. πŸ›


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. she's generous like that πŸ’–


🌈 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 her, she ate πŸ“šβœ¨


and that's the whole page, bestie πŸŽ€ this was shishi version 1.0.3, page shishi_decrypt_iv_etype(3), copyright vibes running 2002-2022. mwah πŸ’‹πŸ¦‹