ecryptfs_enc...ode_filename(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ecryptfs_encrypt_and_encode_filename β€” Kernel API Manual, bestie edition ✨

okay so real talk, this is a page from the Kernel API Manual (the header up top is literally ecryptfs_enc...ode_filename(9) β€” yes the title got squished and truncated, we love a dramatic ellipsis πŸ’€) and it's all about turning a cute little plaintext filename into cryptographic confetti. let's get into it πŸŽ€


✨ NAME ✨

ecryptfs_encrypt_and_encode_filename β€” converts a plaintext file name to cipher text πŸ”

like, it takes your readable name and makes it unreadable. glow-up via encryption, no cap.


🌸 SYNOPSIS 🌸

int ecryptfs_encrypt_and_encode_filename (char **encoded_name , size_t
*encoded_name_size , struct ecryptfs_mount_crypt_stat *mount_crypt_stat
, const char *name , size_t name_size );

that's the whole signature, character for character, don't @ me 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • encoded_name β€” the encrypted name πŸ’– the function hands it back to you through this pointer-to-pointer, so it's giving main character energy.
  • encoded_name_size β€” the length of the encrypted name πŸ“ (yes, you gotta track the size, it's that kind of relationship).
  • mount_crypt_stat β€” the crypt_stat struct associated with the file name to encode πŸ—‚οΈ it's the struct that's tied to the name you're encoding.
  • name β€” the plaintext name 🌼 your innocent, readable, pre-glow-up filename.
  • name_size β€” the length of the plaintext name ✨ keep it exact bestie.

πŸ’œ DESCRIPTION πŸ’œ

So what it does: it encrypts and encodes a filename into something that constitutes a valid filename for a filesystem, using printable characters πŸ”₯

which is lowkey the whole point β€” filesystems are picky about what characters they'll accept, so this thing makes sure the encrypted output is all printable and legal. iconic behavior, honestly πŸ‘‘

We assume that we have a properly initialized crypto context, pointed to by crypt_stat->tfm 🧚 so like… don't come in here with an uninitialized context, that's not the vibe.

Returns zero on success; non-zero on otherwise ⭐ that's it, that's the return value contract. zero = slay, non-zero = something went sideways 😭

⚠️ heads up: the properly-initialized crypto context pointed to by crypt_stat->tfm is an assumption, not something this function checks for you. read the room (and the code) before calling.

🌈 SEE ALSO 🌈

Kernel file ./fs/ecryptfs/crypto.c β€” and the whole friend group of related functions, all (9)s, all here, no gatekeeping:

like I said β€” full friend group, all invited to the function party πŸŽ‰


and that's the page, bestie 🫢 this one came out of ./fs/ecryptfs in October 2026, filed under the very dramatically truncated name ecryptfs_enc...ode_filename(9). go encrypt something. periodt πŸ’…βœ¨

πŸ“¦ where this page comes from