Decayfmt – a file format that corrupts itself a little every time you open it
Decayfmt: The Art of Digital Erosion
decayfmt is a specialized file format written in Rust designed with a peculiar purpose: it permanently corrupts itself every single time it is opened.
In this system, decay is not a bug—it is a core feature. Once a file begins to rot, there is no way to reverse the process no recovery possible unless you have a separate backup.
📉 The Mechanics of Instability
The level of degradation is determined by an instability parameter (), which is embedded directly into the filename. There are two primary supported formats:
| Extension | Content Type | Example |
|---|---|---|
.idcy{x} | Images | vacation.idcy3 |
.tdcy{x} | Text | secret.tdcy7 |
The integer acts as a "destruction dial." A low value results in a graceful, slow fade, while a high value leads to rapid annihilation.
Visualizing the Decay
Imagine a single image opened multiple times:
- At (Gentle): The image degrades slowly over many opens, retaining its essence for a while.
- At (Severe): The image is nearly unrecognizable after one open and becomes pure static after three.
Textual Erosion
When text decays, decayfmt ensures that only printable characters are swapped in. This prevents the file from becoming raw binary noise and instead turns it into "readable nonsense."
Example of a sentence at (Slow Burn):
Original: This sentence is dying, and every time you read it you kill it a little more.
- Open 1: This sgntence is d+ingd !nd every time you re p it P~u kiKl it a little more}
- Open 3: This sgfxFn0e is d+ingd 3D6 every tibe you re " it P~u kiKl it a 1ittl m1re}
- Open 6: TIbm sgf}Fn0e ts d+iqgd yD6 ev*ry tibe you re " )t Pnu kiKB )t aC1it"l m1^e}
- Open 9: T/Sm sgf}Fk0- ts d|iqgd HD6 e@*rV tiFe you re " )t Pnu kiKB )tpaC1it"lYMm1^ }
- Open 12: h/Sm hgf}Nk0-'ts?K|iqgd HD6 e@`~V}t Fe y%u re " )2 Pnu kiKB )6UaC1it1lYMm1]b!
⚖️ Philosophy & Scope
decayfmtis a social contract enforced by mathematics, not by cryptography.
To be clear, this tool is NOT:
EncryptionDRM (Digital Rights Management)A secure data deletion tool
While the corruption is honest and irreversible using the file alone, the "security" is superficial; anyone with a hex editor or a backup can bypass the decay.
🛠️ Installation
Depending on your environment, choose one of the following methods:
- Via Cargo (Recommended): If you have Rust installed, run:
cargo install decayfmt - Via Pre-built Binary: Download from the releases page and add it to your
PATH.- Note for macOS: You may need to bypass Gatekeeper by right-clicking "Open" or running:
xattr -d com.apple.quarantine decayfmt
- Note for macOS: You may need to bypass Gatekeeper by right-clicking "Open" or running:
- From Source:
cargo build --release(The binary will be located attarget/release/decayfmt)
🚀 Quickstart Guide
You can witness the decay process immediately in your terminal:
# 1. Create a simple text file
echo "this sentence is about to start dying" > note.txt
# 2. Encode it with an instability of x=8
decayfmt encode --input note.txt --output note.tdcy8
# 3. Open it (and corrupt it)
decayfmt open note.tdcy8
Warning: Each time you run the open command, the file on disk is modified before it is printed. There is no "undo."
Windows PowerShell Tip: Use Set-Content note.txt "text" instead of redirection to avoid UTF-16 encoding issues.
📖 Detailed Usage
Encoding
Convert a standard image or text file into a decaying format:
decayfmt encode --input photo.png --output photo.idcy3
decayfmt encode --input note.txt --output note.tdcy7
The tool determines the type (image vs. text) and the instability () based on the output filename. If the filename is invalid, the tool will refuse to write the file.
Opening
decayfmt open photo.idcy3
decayfmt open note.tdcy7
- Text: Prints to the terminal. If no terminal is available, it opens in your system's default text editor.
- Dynamic Instability: Since is read from the filename, renaming the file will change the intensity of the corruption for the next open.
🔬 Technical Deep Dive
The Math of Decay
The probability that any given byte will be corrupted during an open is calculated using the following formula:
Probability Examples:
- corruption per open.
- corruption per open.
- corruption per open.
Implementation Details
- Randomness: The tool uses a cryptographically secure random number generator (CSPRNG) seeded by the OS. This ensures that corruption is non-deterministic and cannot be replayed.
- Images: The Red, Green, and Blue channels are corrupted independently. The Alpha channel is ignored, meaning the image will develop color noise but will not develop transparent holes.
- Text: Bytes are replaced by random printable ASCII characters. Because this happens at the byte level, high values may break UTF-8 encoding, resulting in replacement characters ().
- Structural Integrity: The process only substitutes bytes; it never adds or removes them. Consequently:
- File length remains constant.
- Byte positions are preserved.
- Layout and word lengths generally survive at low values.
- Spaces are treated as any other byte and are not protected.