Hide and reveal data in PNG images using LSB steganography
Project description
pixelsteg
Hide arbitrary data inside PNG images using LSB steganography. No cloud, no accounts — pure Python.
pip install pixelsteg
Usage
# Check how much a PNG can hold
steg capacity photo.png
# Hide a file
steg hide secret.txt photo.png output.png
# Extract it
steg reveal output.png
# Write extracted data to a file
steg reveal output.png recovered.txt
# With a password (XOR encryption)
steg hide secret.txt photo.png output.png --password hunter2
steg reveal output.png --password hunter2
# Double capacity (2 bits per channel, slight quality loss)
steg hide secret.txt photo.png output.png --bits 2
steg reveal output.png --bits 2
How it works
Each pixel in a PNG has R, G, B channels (0–255). This tool replaces the least significant bit(s) of each channel with bits from your payload. A 1-bit change per channel is imperceptible to the human eye — a pixel at value 200 becoming 201 is invisible.
A small header (8 bytes: 4 magic + 4 length) is written first, then the payload follows. Optional XOR encryption scrambles the payload before writing.
Capacity: ~3 bits per pixel at 1 bit/channel. A 1000×1000 image holds ~366 KB.
Notes
- Output must be PNG (lossless). JPEG would destroy the hidden bits.
- Use
--bits 2for double capacity; pixels can shift by up to 3 — still very hard to see, but technically detectable with steganalysis tools. - The password is simple XOR — not cryptographically strong. Use it to obscure, not secure.
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 pixelsteg-0.1.0.tar.gz.
File metadata
- Download URL: pixelsteg-0.1.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75c936b800ec1a0f27a3c4dd0847d94dfd95358d9bb0eadc41bf28a4cd51c099
|
|
| MD5 |
b02883af82845e37b054f86d04a4d1f1
|
|
| BLAKE2b-256 |
d583033449f2ed6949a9e406e3d9e80f4e868750c40a401f3206a1b941d08820
|
File details
Details for the file pixelsteg-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pixelsteg-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e38e2be561ab95df423eee096be65def1dbc2bd29f8abd12e6ad039ab12a2a9d
|
|
| MD5 |
7c88df976dccacc1f439978941cb9c7e
|
|
| BLAKE2b-256 |
d7fc7fca664454b62df6f90e4365c6f08cfe74a882e90aba0d7a71d8e4b8104b
|