aes_cbc_encrypt(9)
π aes_cbc_encrypt(9) β Kernel API Manual β¨
okay so bestie, welcome to the glow-up of aes_cbc_encrypt, straight out of the Kernel API Manual. this is the one that encrypts your data with AES-CBC, and she is lowkey iconic. let's get into it π
πΈ NAME πΈ
aes_cbc_encrypt β encrypt data using AES-CBC. that's it, that's the vibe. π
β¨ SYNOPSIS β¨
void aes_cbc_encrypt (u8 *dst , const u8 *src , size_t len , u8
iv[static AES_BLOCK_SIZE] , aes_encrypt_arg key );
she takes five args and returns void, no cap. literally the whole signature, untouched, because we do not mess with code in this house π
π«Ά ARGUMENTS π«Ά
dstβ the destination buffer. she can be in-place or out-of-place, either is fine, live your truth. but for any other overlaps? the behavior is unspecified, so don't come crying to me if you get weird with it πsrcβ the source data. the actual thing you're encrypting, the main character of this operation πlenβ number of bytes to encrypt. must be a multiple ofAES_BLOCK_SIZE, no exceptions, periodt. β¨ivβ the initialization vector. it gets updated with the next value, i.e. the last ciphertext block, so it's carrying the state forward for you like the queen it is π. (or left unchanged iflen == 0, in which case she simply did not attend the function π¦)keyβ the key, already prepared usingaes_preparekeyoraes_prepareenckey. do NOT just hand her a raw key, she needs the prepared one, iykyk π
π DESCRIPTION π
this one supports incremental encryption, which is honestly such a serve. π§
the way that it works: the length of each chunk must be a multiple of AES_BLOCK_SIZE, and the updated iv must be passed in each time. so you're feeding it chunk by chunk, and the iv keeps getting refreshed by the previous call. keep that chain alive bestie, or the whole thing falls apart π
β CONTEXT β
any context. she's flexible like that. π
π SEE ALSO π
- Kernel file
./include/crypto/aes-cbc.h aes_cbc_decrypt(9)aes_cbc_cts_encrypt(9)aes_cbc_cts_decrypt(9)
go read those too, they're the rest of the friend group and they all ate ππ
and that's the whole page, bestie! π this gem is from the Kernel API Manual, source/version ./include/crypto, dated October 2026. mwah, go encrypt responsibly β¨π«Άπ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms