garfcode
v0.4.0
Published
Generate three-panel Garfield comics from any text file using AI
Readme
garfcode
Generate three-panel Garfield comic strips from any text file using AI.
Powered by the Garfield Intelligence Layer.
Installation
npm install -g garfcodeRequires Node.js 18+.
Setup
Configure your API keys:
garfcode configThis will prompt for your Anthropic and OpenAI API keys and save them to ~/.garfcoderc. You can also set them as environment variables (ANTHROPIC_API_KEY, OPENAI_API_KEY).
Usage
Point garfcode at any text file to generate a three-panel Garfield comic:
garfcode article.txtThis will generate panel_1.png, panel_2.png, panel_3.png, and comic.json in your current directory.
Options
garfcode <textfile> [options]
garfcode <textfile> --secure --pubkey <keyfile> [options]
garfcode --decrypt <dir> --key <keyfile> [options]
garfcode keygen [options]
garfcode config
Commands:
config Set up API keys (saved to ~/.garfcoderc)
keygen Generate a SecureGarf RSA key pair
SecureGarf Options:
--secure Encrypt text into steganographic comic panels
--pubkey <file> Path to public key PEM (required with --secure)
--decrypt <dir> Decrypt text from a SecureGarf comic directory
--key <file> Path to private key PEM (required with --decrypt)
General Options:
--output <dir> Output directory (default: current directory)
--help, -h Show this help messageExamples
# Generate a comic from a blog post
garfcode blog-post.txt
# Save output to a specific directory
garfcode notes.md --output ./my-comic
# Pipe anything through it
curl -s https://example.com/article | tee /tmp/article.txt && garfcode /tmp/article.txtHow It Works
- Reads your text file as source material
- Uses Claude to write a three-panel comic script with classic Garfield humor
- Uses OpenAI's image generation to draw each panel in authentic newspaper comic strip style
- Saves the panels as PNG images with a metadata JSON file
SecureGarf

SecureGarf is an encrypted steganography protocol built into garfcode. It hides any text inside an innocuous Garfield comic strip. The recipient decrypts it with a private key; anyone else just sees a comic about lasagna.
Quick Start
# 1. Generate a key pair (one-time setup)
garfcode keygen --output ./keys
# Creates: keys/securegarf.pub (public) + keys/securegarf.key (private)
# 2. Encrypt a message into a comic strip
garfcode secret-message.txt --secure --pubkey ./keys/securegarf.pub --output ./comic
# Creates: comic/securegarf.png + comic/comic.json
# 3. Decrypt the message from the comic strip
garfcode --decrypt ./comic --key ./keys/securegarf.key
# Creates: decrypted.txt with the original messageKey Management
Generate a reusable RSA-2048 key pair with garfcode keygen. The key pair supports unlimited encrypt/decrypt cycles.
- Public key (
securegarf.pub) — give to anyone who wants to send you encrypted comics. This key can only encrypt, not decrypt. - Private key (
securegarf.key) — keep this secret. It is the only way to decrypt messages sent to you.
garfcode keygen --output ./my-keysThe private key is saved with restricted file permissions (0600).
Encrypting
The sender needs the recipient's public key and configured API keys (Anthropic + OpenAI).
garfcode message.txt --secure --pubkey ./recipient-pubkey.pub --output ./outgoingThis generates a single comic strip image (securegarf.png) that:
- Looks like a normal Garfield comic about an innocuous topic (Mondays, lasagna, naps, etc.)
- Contains the full encrypted message hidden via steganography
- Can be shared over email, Signal, or any chat app
The comic topic is randomly selected and has no relation to the hidden text.
Decrypting
The recipient needs their private key. No API keys are required for decryption.
garfcode --decrypt ./incoming-comic --key ./my-keys/securegarf.key
# Writes: decrypted.txt in the current directory
# Or specify an output directory:
garfcode --decrypt ./incoming-comic --key ./my-keys/securegarf.key --output ./recovered
# Writes: recovered/decrypted.txtHow SecureGarf Works
SecureGarf combines three techniques: hybrid encryption, dialog-derived key material, and compression-robust steganography.
Encryption Scheme
- The input text is gzip-compressed to minimize payload size
- A random 32-byte key is generated and XOR'd with a SHA-256 hash of the comic's dialog text, producing the AES key. This makes the dialog a required component of decryption.
- The compressed text is encrypted with AES-256-GCM using the derived key
- The random key (not the AES key) is encrypted with the recipient's RSA-2048 public key (OAEP padding, SHA-256)
- The encrypted payload is:
IV (12 bytes) | auth tag (16 bytes) | RSA-encrypted key (256 bytes) | AES ciphertext
Steganography: Quantization Index Modulation (QIM)
The three comic panels are combined into a single 3072x1024 horizontal strip. The encrypted payload is then embedded using QIM on the blue channel of 4x4 pixel blocks:
- Each block's average blue channel value is quantized to encode one bit (step size 24)
- Every bit is encoded 5 times across shuffled block positions (repetition coding with majority voting)
- This survives JPEG compression at quality 70+, making the strip safe to transmit through messaging apps that re-compress images
Capacity: ~4.9 KB of encrypted data per strip. With gzip compression, this handles approximately 15-20 KB of plaintext text.
Why Dialog Matters
The comic's dialog text (visible in the speech/thought bubbles) is hashed and XOR'd into the AES encryption key. This means:
- The private key alone cannot decrypt the message
- The correct dialog must also be present (it is stored in the steganographic payload alongside the encrypted data)
- If someone modifies the dialog, the derived AES key changes and decryption fails
The dialog is embedded in the steganographic header, so the strip image is fully self-contained for decryption.
Limitations
- Capacity: ~15-20 KB of uncompressed text per strip (depends on gzip compression ratio)
- Image integrity: Heavy image manipulation (cropping, resizing, aggressive filters) can corrupt the embedded data. Normal JPEG compression from messaging apps is fine.
- Not a replacement for established crypto tools. SecureGarf is a fun, novel protocol. For high-stakes secure communication, use standard tools like GPG or Signal's native encryption.
Requirements
- Anthropic API key — for comic script generation
- OpenAI API key — for panel image generation
- Decryption and key generation require no API keys
License
Copyright 2026 Arbuckle Systems. All rights reserved.
