Overview of packages

The package consists of a number of subpackages at different stages of development. In most cases, the python docstrings give reasonable documentation, so please browse the code. Below is an overview of the most important packages.

Steganalysis (new packages)

Steganalysis is the most interesting part of the suite, and a good place to get started.


This is one of the latest subpackages to be started. It provides the setup for an SQL database to calculate, store, and analyse features. A queuing system is implemented to allow parallel calculation of features using a client-server model. Additionally, there are modules and functions to train and test SVM classifiers and analyse features and as well as classifier output.


This subpackage provides functions to extract features, and it has been planned for use with pysteg.sql. It largely follows the code examples given in my book.


Generic Machine Learning utilities, building on the mlpy library. It has been planned for use with pysteg.sql. (Not tested yet.)

Old approach

The above packages were developed after the book, and a different approach was used for the extensive experiments reported therein. Although the older approach served well for such a contained project, it is clear that it scales very poorly. It is being abandoned in favour of the sql/features subpackages, but there are still many feature extraction functions which have not been ported to the features package.


This is a complex subpackage for feature extraction. A tree structure is defined to store feature vectors hierarchically and extract subvectors at whim. It relies on the pickle library in python, and the files tend to grow very large and become slow to read and parse.

Machine learning in general


Tools for feature selection. (Not documented yet.)


Tools for SVM training and testing. It is built on the python API included in libSVM but provides additional tools to integrate with pysteg as well as some fixes to work on my system. The intention is to deprecate it and replace it with the pysteg.ml, building on the mlpy interface instead of the standard libsvm interface.

Steganographic embedding

The modules for steganographic embedding are relatively short and cohesive, and should be easy to understand.


Embedding in JPEG images, including Jsteg, Outguess 0.1, F3, F4, and F5. There are two versions of F4 and F5, one based on Andreas Westfeld’s paper and one on his java implementation.


This includes LSB replacement and LSB matching in pixmap images.

Image processing


The jpeg toolbox defines the <code>jpeg</code> class which gives direct access to the coefficient and quantisation matrices of a JPEG image loaded from file. This allows JPEG steganography on pre-compressed files, without having to double compress. This is inspired by Phil Salee’s toolbox for Matlab, and used det libjpeg library in the same way. It has, however, been recoded for the python interface.

pysteg (other modules)

There are a number of other subpackages and submodules which have not been documented. This includes both auxiliary modules on which above modules depend and additional tools which have only briefly been used.


The root of the src directory contains a collection of scripts. The ones called sql*.py relate to the pysteg.sql package and have been fairly well tested and documented with the package. The others include deprecated scripts and the docs are too outdated to publish.

Table Of Contents

Previous topic

Getting started

Next topic

The jpeg Package

This Page