shishi_decrypt_ivupdate(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_ivupdate β€” the glow-up for your IV πŸ’–

okay bestie, welcome to shishi_decrypt_ivupdate(3), part of the shishi manual family. this is the function that decrypts your data and hands you back a fresh, updated initialization vector so you can keep the chain going. it's giving ✨continuity✨. let's get into it 🫢


🌸 SYNOPSIS 🌸

#include <shishi.h>

int shishi_decrypt_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 arguments, but every single one of them is doing its little job and we respect that πŸ’…

  • Shishi * handle β€” the shishi handle, which you got from shishi_init(). your whole main character entry pass.
  • Shishi_key * key β€” the key you're decrypting with. the ✨key✨, literally.
  • int keyusage β€” an integer that says what this key is being used to decrypt. it's how the key knows its role.
  • const char * iv β€” input array holding the initialization vector.
  • size_t ivlen β€” the size of that input array with the initialization vector. gotta know how big it is, no cap.
  • char ** ivout β€” output array with the newly allocated updated initialization vector. fresh IV, hot off the press πŸ”₯
  • size_t * ivoutlen β€” the size of that output array with the updated initialization vector.
  • const char * in β€” input array with the data you wanna decrypt.
  • size_t inlen β€” size of the input array with the data to decrypt.
  • char ** out β€” output array with the newly allocated decrypted data. this is the one you've been waiting for πŸ’–
  • size_t * outlen β€” output variable with the size of that newly allocated output array.

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically: this decrypts your data using the initialization vector and key you specified. the key it actually uses is derived using the key usage β€” so if keyusage is 0, then no key derivation happens at all. periodt.

the OUT buffer? yeah, the caller has to deallocate it. it's yours now, you own it, take care of it 🫢

and if IVOUT or IVOUTLEN is NULL, then the updated IV just... isn't saved anywhere. it simply vibes off into the void. πŸ«₯

⚠️ okay this part is important so pay attention bestie: DECRYPT(ENCRYPT(data)) does not necessarily give you back data exactly. some encryption types add pad to make the data fit into the block size of the encryption algorithm. and worse β€” that pad is not guaranteed to look in any special way, although existing implementations often pad with the zero byte. so what does that mean for you? it means you may have to "frame" your data, so it's possible to infer the original length after decryption. think of it like ASN.1 DER, which contains exactly this kind of information. slay πŸŽ€

⭐ RETURN VALUE ⭐

returns SHISHI_OK iff successful. that's it, that's the whole vibe check βœ…


πŸ’€ REPORTING BUGS πŸ’€

found a bug? don't suffer in silence, bestie. report bugs 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. iconic, 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, this command:

info shishi

should give you access to the complete manual. iykyk 🧚


that's the whole page, bestie! this was shishi_decrypt_ivupdate(3) from shishi version 1.0.3 β€” go forth, decrypt responsibly, and remember to free your buffers πŸ’–βœ¨πŸŽ€