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.

Windows users: If steganohide doesn't work after installing, run it with the full path:

C:\Users\YOUR_USERNAME\AppData\Local\Python\pythoncore-3.14-64\Scripts\steganohide.exe

Or add the Scripts folder to your PATH.


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.2.tar.gz (4.6 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.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: steganohide-1.1.2.tar.gz
  • Upload date:
  • Size: 4.6 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.2.tar.gz
Algorithm Hash digest
SHA256 27d7f380b89e4c95a82ed70036e969636af160035551b5f8e84e941132b75337
MD5 7fca824fa438ac2137c4da951047353e
BLAKE2b-256 5708f1b75f0110b83a4678134a1f7aa87206c8b6d20361604d487c66a57c199c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: steganohide-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.8 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f6ea09968a8d5a4d37d0c2bf59feb69a480eab027015751125bd3a92e1c17961
MD5 87d2e4a434cced57e51d517f250dc8fc
BLAKE2b-256 b95667158accafe546275784458afc2ad42fa53b1a79c53fe5cbd74e395b973a

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