logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·04.11.26
← Back to news

Decayfmt – a file format that corrupts itself a little every time you open it

Original article
github.com|7 points|0 comments|by unprovable|Aug 21, 2026

Decayfmt: The Art of Digital Erosion

CI crates.io

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 (xxx), which is embedded directly into the filename. There are two primary supported formats:

ExtensionContent TypeExample
.idcy{x}Imagesvacation.idcy3
.tdcy{x}Textsecret.tdcy7

The integer xxx 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 x=3x=3x=3 (Gentle): The image degrades slowly over many opens, retaining its essence for a while.
  • At x=10x=10x=10 (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 x=1x=1x=1 (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

decayfmt is a social contract enforced by mathematics, not by cryptography.

To be clear, this tool is NOT:

  • Encryption
  • DRM (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
  • From Source: cargo build --release (The binary will be located at target/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 (xxx) 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 xxx 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 ppp that any given byte will be corrupted during an open is calculated using the following formula:

p=1−exp⁡(−x/10)p = 1 - \exp(-x / 10)p=1−exp(−x/10)

Probability Examples:

  • x=1≈9.5%x = 1 \approx 9.5\%x=1≈9.5% corruption per open.
  • x=5≈39%x = 5 \approx 39\%x=5≈39% corruption per open.
  • x=10≈63%x = 10 \approx 63\%x=10≈63% 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 xxx values may break UTF-8 encoding, resulting in replacement characters (\ufffd\ufffd\ufffd).
  • Structural Integrity: The process only substitutes bytes; it never adds or removes them. Consequently:
    1. File length remains constant.
    2. Byte positions are preserved.
    3. Layout and word lengths generally survive at low xxx values.
    4. Spaces are treated as any other byte and are not protected.