Skip to content
Tech News
← Back to articles

Base84 deserves a place in file names

read original more articles
Why This Matters

Cross-platform tools that encrypt file names need an encoding whose output is valid on Windows, macOS and Linux alike — Base64 is safe but wasteful, and Base91 breaks on Windows. TurboCrypt's move to a newly defined Base84 alphabet fills a surprisingly empty niche for compact, portable, filesystem-safe names, with a Zig implementation available.

Key Takeaways

The TurboCrypt git and file encryption tool was originally designed for Unix systems.

And it used to encrypt file names and encode the resulting ciphertext using Base91.

Why Base91? Because it’s a perfect fit for encrypted file names, producing strings that can be stored as valid files on Unix and macOS.

“But my filesystem can store arbitrary file names”! That may be true for some filesystems, but this is without taking libraries and applications into consideration. For example, the macOS Finder would not like this at all.

So, Base91 worked fine for encrypted file and directory names.

Then people asked for Windows support, where several characters in the Unix filesystem-safe alphabet are forbidden.

So, TurboCrypt is switching to Base84.

Something surprisingly not defined nor (apparently) used anywhere, even though it’s a perfect fit for anything that should be encoded as portable filesystem-safe names.

Why Base84?

There are 94 printable ASCII characters excluding the space. But Windows rules exclude nine of them:

... continue reading