fscrypt_fname_encrypt(9)
π fscrypt_fname_encrypt β encrypt a filename
okay so this is a page from the Kernel API Manual (yes, the kernel has lore too, bestie) and honestly? it's giving "small function, big responsibilities" π₯
β¨ NAME β¨
fscrypt_fname_encrypt β literally just: encrypt a filename π that's the whole vibe.
π SYNOPSIS π
int fscrypt_fname_encrypt(const struct inode *inode, const struct qstr *iname,
u8 *out, unsigned int olen);
π¦ ARGUMENTS π¦
inodeβ the inode of the parent directory (for regular filenames), or of the symlink (for symlink targets). heads up: the key must already be set up before you call this, no cap πβ¨inameβ the filename you wanna encrypt. the main character, the one we're protecting π«Άoutβ (output) the encrypted filename goes here. this is where the slay happens πolenβ the size of the encrypted filename. it must be at leastiname->len. any extra space gets filled with NUL padding before encryption, so don't be weird about it π
πΈ RETURN πΈ
0on success β iconic, we ate π-errnoon failure β π not the errno
π SEE ALSO π
- Kernel file
./fs/crypto/fname.c fname_decrypt(9)fscrypt_fname_encrypted_size(9)fscrypt_fname_alloc_buffer(9)fscrypt_fname_free_buffer(9)fscrypt_fname_disk_to_usr(9)fscrypt_setup_filename(9)fscrypt_match_name(9)fscrypt_fname_siphash(9)
like, the whole friend group fr fr π§π go read them, iykyk
π reminder bestie:olenmust be at leastiname->len. this is not a suggestion, it's the law. the extra bytes get NUL-padded before encryption, so keep that in mind before you come for this function.
and that's the whole page, periodt π this came out of ./fs/crypto in October 2026, so go be obsessed 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