An image steganography with high embedding capacity based on a genetic algorithm
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Genstego: Image Steganography Based on a Genetic Algorithm

genstego is an image steganography package based on deap. It is able to embed/decode secret images into/from a host image. The main idea of genstego, is to model steganography as a search and optimization problem using genetic algorithms.

The genetic algorithm allows finding an optimal stochastic solution. Therefore, making the steganalysis more complex. Also, genstego provides a set of different optimal solutions in the last generation.

At this moment, genstego only use grayscale images as host and stego messages. But, it can be modified to use color images, or to hide different formats like text messages, sound files, etc…

You can find a Spanish version of this README here.


Run in Python 3.

genstego use the following packages: numpy, PIL, matplotlib, deap

It is easily installed by pip

pip install <package>


To run there are two required arguments: -ht and -s. First one is the path to the host image and second to the secret image.

usage: [-h] -ht HOST -s SECRET [-g GENERATIONS] [-p POPULATION]
                   [-c CROSSOVER] [-m MUTATION]

Usage example:

python genstego. py -ht img/lenna-256.ppm -s img/grumpy-115.png -g 300 -p 200

As a python package

It can also be imported into other programs. The main methods are: genstego.embed() embeds a secret message. And, genstego.decode() decodes secret messages.