Skip to main content

Stegano

Workflow

Stegano, a pure Python Steganography module.

Steganography is the art and science of writing hidden messages in such a way that no one, apart from the sender and intended recipient, suspects the existence of the message, a form of security through obscurity. Consequently, functions provided by Stegano only hide messages, without encryption. Steganography is often used with cryptography.

Installation

$ poetry install stegano

You will be able to use Stegano in your Python programs.

If you only want to install Stegano as a command line tool:

$ pipx install stegano

pipx installs scripts (system wide available) provided by Python packages into separate virtualenvs to shield them from your system and each other.

Usage

A tutorial is available.

Use Stegano as a library in your Python program

If you want to use Stegano in your Python program you just have to import the appropriate steganography technique. For example:

>>> from stegano import lsb
>>> secret = lsb.hide("./tests/sample-files/Lenna.png", "Hello World")
>>> secret.save("./Lenna-secret.png")
>>>
>>> clear_message = lsb.reveal("./Lenna-secret.png")

For reversible data hiding (the original cover can be restored exactly after the message is extracted), use the histogram-shifting technique:

>>> from stegano import rdh
>>> secret = rdh.hide("./tests/sample-files/Lenna-grayscale.png", "Hello World")
>>> secret.save("./Lenna-secret.png")
>>>
>>> clear_message = rdh.reveal("./Lenna-secret.png")
>>> cover = rdh.recover("./Lenna-secret.png")  # restores the original image

Use Stegano as a command line tool

Hide and reveal a message

$ stegano-lsb hide -i ./tests/sample-files/Lenna.png -m "Secret Message" -o Lena1.png
$ stegano-lsb reveal -i Lena1.png
Secret Message

Reversibly hide a message and recover the cover

$ stegano-rdh hide -i ./tests/sample-files/Lenna-grayscale.png -m "Secret Message" -o stego.png
$ stegano-rdh reveal -i stego.png
Secret Message
$ stegano-rdh recover -i stego.png -o cover.png   # cover.png == the original image

Hide the message with the Sieve of Eratosthenes

$ stegano-lsb hide -i ./tests/sample-files/Lenna.png -m 'Secret Message' --generator eratosthenes -o Lena2.png

The message will be scattered in the picture, following a set described by the Sieve of Eratosthenes. Other sets are available. You can also use your own generators.

This will make a steganalysis more complicated.

Running the tests

$ python -m unittest discover -v

Running the static type checker:

$ mypy stegano

Contributions

Contributions are welcome. If you want to contribute to Stegano I highly recommend you to install it in a Python virtual environment with poetry.

Donations

If you wish and if you like Stegano, you can donate via GitHub Sponsors:

GitHub Sponsors

or with Bitcoin to this address:
bc1q56u6sj7cvlwu58v5lemljcvkh7v2gc3tv8mj0e

Thank you !

License

This software is licensed under GNU General Public License version 3

Copyright (C) 2010-2026 Cédric Bonhomme

For more information, the list of authors and contributors is available.

Release files for stegano 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stegano 3.0.0
File Size Uploaded
stegano-3.0.0.tar.gz 42.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stegano 3.0.0
File Interpreter ABI Platform
stegano-3.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 86.6 kB

Release files / stegano-3.0.0.tar.gz

Download URL stegano-3.0.0.tar.gz
Size 42.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0208ab81aba2e7c8b852da7d9b3471136605037232a5af82279f6fdcb4cbc289
BLAKE2b-256 checksum
How to use checksums
400a6abe31663c02847a00b1fcec7404aff71d0db4339182c65ba87c3d7ff686
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release files / stegano-3.0.0-py3-none-any.whl

Download URL stegano-3.0.0-py3-none-any.whl
Size 44.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9109c48dc23b779e951fd73f55958a1ba9e94ea57e610e46946dc579dd7a198d
BLAKE2b-256 checksum
How to use checksums
9d5606acc98730dbf3e9d9258c7e4ba70e7573f73e76947a037789a44b20ae86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 release files

2.5.0

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.11.5

2 release files

0.11.2

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.9

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

1 release file

0.9.5

1 release file

0.9.4

1 release file

0.9.3

1 release file

0.9.2

1 release file

0.9.1

1 release file

0.9.0

1 release file

0.8.6

1 release file

0.8.5

1 release file

0.8.4

1 release file

0.8.3

1 release file

0.8.2

1 release file

0.8.1

1 release file

0.8

1 release file

0.7.1

1 release file

0.7

1 release file

0.6.9

1 release file

0.6.8

1 release file

0.6.7

1 release file

0.6.6

1 release file

0.6.5

1 release file

0.6.4

1 release file

0.6.3

1 release file

0.6.2

1 release file

0.6.1

1 release file

0.6

1 release file

0.5.5

1 release file

0.5.4

1 release file

0.5.3

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5

1 release file

0.4.6

3 release files

0.4.5

3 release files

0.4.4

5 release files

0.4.3

3 release files

0.4.2

3 release files

0.4.1

3 release files

0.4

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page