Protect text from AI using invisible Unicode characters
Project description
Gibberifire 🔥
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(SemVer0.xrules).
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
cleanmethod 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 until1.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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gibberifire-0.1.0.tar.gz.
File metadata
- Download URL: gibberifire-0.1.0.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8483a4685dfdbd10ae209add92e8f0517ccedb8ebb2d48122def183e975522a
|
|
| MD5 |
9cc77342ef3c102e63c0a412584b9568
|
|
| BLAKE2b-256 |
8dd4940913798b31ceb61302898f8b93ed97dd28dc84d3857f2151f34d900280
|
File details
Details for the file gibberifire-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gibberifire-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.0 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba949d1e484cd994ab2a8369396d216241cb1a9497be28fad1d558983fb77825
|
|
| MD5 |
b5e43864b4a1374d0e437353889906f9
|
|
| BLAKE2b-256 |
567ec4b85a2109697c75782d7b109da917767f8b7373d3b55f78fc013af20b21
|