Steganography and Steganalysis in Python



pysteg is a selection of tools and API functions and classes, intended for research in steganography and steganalysis. It has been created as companion software for my book Machine Learning in Image Steganalysis which will be published by Wiley & sons in the Autumn of 2012.

Admittedly the documentation is not as complete as intended. On the other hand, the software is still evolving, so please write to me and ask if you have any questions, would like to do joint work in the area, or have any other comments.

In addition to the pysteg package itself, the suite includes the itml and svm packages which are intended to be more generic, but have been included here because they arise from the same project.

Top level packages

The pysteg Package

Steganography and Steganalysis.

Author:© 2012: Hans Georg Schaathun <>

The package is mainly a collection of subpackages and modules addressing separate issues of steganography and steganalysis, including steganographic embedding, steganalysis, and image processing.

The tools are designed for research. Thus the embedding routines focus on the embedding of random data. The package has evolved over time and the different subpackages are at different stages of in their life cycles. The most notable subpackages are as follows:


  • jpeg - load and process JPEG images without decompressing
  • jsteg - steganography in the JPEG domain
  • ssteg - steganography in the spatial domains
  • features - steganalysis (feature extraction)
  • sql - a database system to store and process features


  • imtools - auxiliary functions for image processing
  • tools - auxiliary functions which do not fit elsewhere
  • tsteg - a testing function for the jsteg subpackage

The itml Package

Feature Selection using Information Theory.

This library includes the necessary functions to rank features for machine learning using Mutual Information. The theory mainly follows Gavin Brown (2009).

It also includes other ML-related modules and packages, and should be refactored as an ML package with subpackages including one for information theory.

Copyright:© 2011: Hans Georg Schaathun <>

The svm Package

Copyright:© 2010: Hans Georg Schaathun <>

Indices and tables