Skip to main content

A CLI tool to hide secret text inside PNG images using LSB steganography.

Project description

SteganoHide

Hide secret text messages inside perfectly normal-looking PNG images — and pull them back out again.

SteganoHide in Action

PyPI Python License: MIT

→ Try it: Install from PyPI


Quick Start

pip install steganohide
steganohide

That's it. The tool launches an interactive menu — no extra setup needed.


Features

  • Encode any text message into a standard PNG image with zero visible change
  • Decode hidden messages back out of encoded images instantly
  • Works on any PNG image — photos, screenshots, artwork, etc.
  • Uses a stop signal so the decoder knows exactly where your message ends
  • Simple interactive CLI menu — no flags or arguments to memorize
  • Pure Python with a single dependency (Pillow)

How to Run Locally

Requires Python 3.8+.

# Clone the repo
git clone https://github.com/ivadebandit/steganography-tool.git
cd steganography-tool

# Install dependencies
pip install pillow

# Run the tool
python steg_tool.py

You'll see:

================================
   Image Steganography Project
================================
1 - Hide a secret message (Encode)
2 - Reveal a secret message (Decode)

Enter 1 or 2:

Example Usage

Hiding a message:

Enter 1 or 2: 1

--- ENCODER ---
Path to your original image (e.g. photo.png): examples/picture.png
Secret message to hide: meet me at midnight
Save encoded image as (e.g. secret.png): examples/secret.png

Success! Encoded image saved as: 'examples/secret.png'
To a human viewer it looks completely normal.

Revealing it:

Enter 1 or 2: 2

--- DECODER ---
Path to the encoded image (e.g. secret.png): examples/secret.png

Scanning image: 'examples/secret.png'
Reading hidden data from pixels...

Hidden message revealed: 'meet me at midnight'

How It Works

Every PNG pixel has three color channels: Red, Green, and Blue (values 0–255). The ASCII character set also maps every printable character to a number 0–127 — which fits perfectly inside that 0–255 range.

SteganoHide overwrites the Red channel of successive pixels with the ASCII value of each character in your message. The human eye can't detect a difference between a Red value of 82 (background color) and 72 (the letter 'H'). But Python can read it back precisely.

A stop signal (Red = 0) is written after the final character so the decoder knows when to stop. The Green and Blue channels are never touched, preserving the image's appearance.

'H' → ord('H') → 72  → stored in pixel (0,0) Red channel
'I' → ord('I') → 73  → stored in pixel (1,0) Red channel
 0  (stop)            → stored in pixel (2,0) Red channel

Why PNG and not JPEG? JPEG compression is lossy — it rounds pixel values during save, destroying the hidden data. PNG is lossless, so pixel values are preserved exactly after save.


Project Structure

steganography-tool/
├── steg_tool.py       ← main CLI tool (encode + decode logic)
├── pyproject.toml     ← packaging config for PyPI
├── requirements.txt   ← Pillow dependency
├── LICENSE            ← MIT License
├── demo.gif           ← animated demo
└── examples/
    ├── picture.png    ← original input image
    └── secret.png     ← encoded output image

Limitations

  • Messages must be shorter than the total pixel count of the image
  • Only works with PNG files (JPEG will corrupt the hidden data on save)
  • Only ASCII characters are supported (values 0–127)
  • A Red channel value of 0 in the original image will be mistaken for the stop signal — avoid pure black images

Credits

Built with Pillow, the Python Imaging Library fork.


Made for Hack Club Stardance — a summer of building real things.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

steganohide-1.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

steganohide-1.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file steganohide-1.1.0.tar.gz.

File metadata

  • Download URL: steganohide-1.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for steganohide-1.1.0.tar.gz
Algorithm Hash digest
SHA256 8894ef57de7c5bbfacb8ca96d972950a08f7546e8bfb5e7cc90e2be2942115ad
MD5 8d77d37b8eb095c1ca924f7322163842
BLAKE2b-256 e6b88dfb9c23bef7d4d27d0e05b04687be60d943f26f75f3b831e58b64539b75

See more details on using hashes here.

File details

Details for the file steganohide-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: steganohide-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for steganohide-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e67ff9268e5b4fa3bcb18bb9beab669731600790e1e36e64831ec8b077435f01
MD5 e6ebab02d6e152e6e4725c04e3a46b7c
BLAKE2b-256 394d13d39d178024ef0dcfd012de7ce8b0fcf1e4abad51be1f84e5c630dc0a5b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page