crypto_krb5_encrypt(9)
π crypto_krb5_encrypt(9) β the Kernel API Manual glow-up β¨
okay so bestie, welcome to the Kernel API Manual entry for crypto_krb5_encrypt(9) β the function that does the Kerberos encryption and the integrity thing in one go, and yes it's giving main character energy π₯
β¨ NAME β¨
crypto_krb5_encrypt β applies Kerberos encryption and integrity, together, periodt.
π¦ SYNOPSIS π¦
ssize_t crypto_krb5_encrypt (const struct krb5_enctype *krb5 , struct
crypto_aead *aead , struct scatterlist *sg , unsigned int nr_sg , size_t
sg_len , size_t data_offset , size_t data_len , bool preconfounded );
π ARGUMENTS π
like, every single one of them, no skipping π
krb5β the encoding to use. this is the vibe you're encrypting with β¨aeadβ the keyed crypto object to use. it's literally the keyed one, so it's important, iykyk.sgβ the scatterlist that defines the crypto buffer πΈnr_sgβ how many elements are insg. count 'em.sg_lenβ the size of the buffer π«Άdata_offsetβ where the data actually starts inside thesgbuffer, like an offset bestiedata_lenβ the length of the data. yes, the data. you got this.preconfoundedβTrueif the confounder is already inserted. that's it, that's the flag π
π DESCRIPTION π
so here's the tea β β using the specified Kerberos encoding, this function inserts a confounder and any padding as needed, then encrypts this and the data in place, and finally inserts an integrity checksum into the buffer. all in one function. iconic behaviour, honestly π
the buffer must include space for the confounder, the checksum, and any padding required β so no showing up with a buffer that's too small, that's not the move π. the caller can also preinsert the confounder into the buffer (for testing, for example π§ͺ).
and like, important detail: the resulting secured blob may be less than the size of the buffer. don't panic, it's fine, that's just how it be β¨
Returns the size of the secure blob if successful π β otherwise:
-ENOMEMon an allocation failure π-EFAULTif there is insufficient space π-EMSGSIZEif the confounder is too short or the data is misaligned π
ngl, other errors may also be returned from the crypto layer, so keep an eye out bestie π
π§ SEE ALSO π§
the whole friend group, fr fr:
- Kernel file
./crypto/krb5/krb5_api.c crypto_krb5_find_enctype(9)crypto_krb5_how_much_buffer(9)crypto_krb5_how_much_data(9)crypto_krb5_where_is_the_data(9)crypto_krb5_check_data_len(9)crypto_krb5_prepare_encryption(9)crypto_krb5_prepare_checksum(9)crypto_krb5_decrypt(9)crypto_krb5_get_mic(9)crypto_krb5_verify_mic(9)
and that's the whole page bestie, slay π β¨
β source lives at ./crypto/krb5, dated October 2026, and this little section was brought to you by crypto_krb5_encrypt(9) π«Ά go encrypt something safely, mwah π
π¦ 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