Skip to main content

Gibberifire 🔥

PyPI version Python versions License CI

Gibberifire is a Python library and CLI tool designed to "protect" text by corrupting what either humans or LLMs see. It can inject invisible/visually identical Unicode noise to keep text human-readable but model-hostile, or, conversely, encode text so it is LLM-readable but human-gibberish.

Warning: This tool is for education and research. Obfuscation can be removed by models or cleaning scripts. API stability is not guaranteed until 1.0.0 (SemVer 0.x rules).

Features

  • Invisible Protection: Uses Zero-Width Spaces (ZWSP), Homoglyphs, Combining Characters, and Bidirectional (Bidi) markers to fool LLMs while keeping humans comfortable.
  • Human-Obscuring Encoding: New encoding method (hex/emoji) makes text hard to read for humans but straightforward for LLMs to decode.
  • Reversibility: Provides a clean method to restore the original text for both directions.
  • Detection: Can detect if text has been "protected"/encoded.
  • Configurable Profiles: Use built-in profiles (low, medium, high, encoded) or create your own flexible configuration.
  • Async Support: Fully supports asynchronous operations.
  • CLI: Unix-style command line interface (works with pipes).

Installation

pip install gibberifire

Usage

CLI

The CLI is designed to work with standard input (STDIN) and standard output (STDOUT).

Basic Usage:

# Protect text from a pipe
echo "Hello World" | gibberifire protect > protected.txt

# Clean text
cat protected.txt | gibberifire clean

# Detect protection (returns exit code 0 if protected, 1 if clean)
cat file.txt | gibberifire detect

With Profiles:

# Use 'high' profile
cat data.txt | gibberifire protect -p high > protected.txt

# Clean using specific profile pipeline (recommended)
cat protected.txt | gibberifire clean -p high > restored.txt

# Make text LLM-readable but human-gibberish
echo "Secret plan" | gibberifire protect -p encoded > encoded.txt

# Clean using the same profile
cat encoded.txt | gibberifire clean -p encoded > restored.txt

With Custom Config:

cat data.txt | gibberifire -c ./my_config.yaml protect -p custom_profile

Python API

from gibberifire import Gibberifire, Profile, PipelineStep
from gibberifire.core.models import ZWSPParams, HomoglyphParams, DEFAULT_PROFILES

profile = DEFAULT_PROFILES["medium"]
gf = Gibberifire(profile=profile)

protected = gf.protect("Hello, World!")
print(protected)

cleaned = gf.clean(protected)
assert cleaned == "Hello, World!"

Async API

import asyncio

from gibberifire import AsyncGibberifire, PipelineStep, Profile
from gibberifire.core.models import ZWSPParams


async def main() -> None:
    custom_profile = Profile(
        description="Async demo using a lighter ZWSP mix",
        pipeline=[
            PipelineStep(
                method="zwsp",
                params=ZWSPParams(min_burst=2, max_burst=6, seed=42),
            ),
        ],
    )

    async with AsyncGibberifire(profile=custom_profile) as gf:
        protected = await gf.protect("Async hello from Gibberifire!")
        print(protected)

        if await gf.is_protected(protected):
            restored = await gf.clean(protected)
            print(restored)


asyncio.run(main())

Configuration File Example

profiles:
  my_custom_profile:
    description: "Custom protection mix"
    pipeline:
      - method: zwsp
        params:
          min_burst: 2
          max_burst: 5
          preserve_emoji: true
          seed: 123
      - method: homoglyph
        params:
          probability: 0.3

Further Reading

  • See the Deep Dive section for a detailed walkthrough of methods, defaults, and limitations.

Versioning & Releases

  • SemVer 0.x: breaking changes are possible until 1.0.0.
  • Release notes live in CHANGELOG.md.

Contributing & Security

  • Contributions are welcome—see CONTRIBUTING.md.
  • Responsible use, limitations, and reporting guidance are in SECURITY.md. There is no warranty; use at your own risk.

License

MIT. See LICENSE.

Release files for gibberifire 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gibberifire 0.1.0
File Size Uploaded
gibberifire-0.1.0.tar.gz 15.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gibberifire 0.1.0
File Interpreter ABI Platform
gibberifire-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 39.5 kB

Release files / gibberifire-0.1.0.tar.gz

Download URL gibberifire-0.1.0.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b8483a4685dfdbd10ae209add92e8f0517ccedb8ebb2d48122def183e975522a
BLAKE2b-256 checksum
How to use checksums
8dd4940913798b31ceb61302898f8b93ed97dd28dc84d3857f2151f34d900280
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / gibberifire-0.1.0-py3-none-any.whl

Download URL gibberifire-0.1.0-py3-none-any.whl
Size 24.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba949d1e484cd994ab2a8369396d216241cb1a9497be28fad1d558983fb77825
BLAKE2b-256 checksum
How to use checksums
567ec4b85a2109697c75782d7b109da917767f8b7373d3b55f78fc013af20b21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page