JPEG steganography in Python with Conseal

Steganography is the art and science of hiding secret messages in innocuous media objects such as images. Since most images on the internet are JPEG-compressed, many steganography methods have been designed for embedding into the quantized DCT coefficients of JPEG images. Popular JPEG steganography methods include nsF5, UERD, and J-UNIWARD.

An excellent starting point for studying steganography are the implementations gratefully provided by several research groups. Most implementations are written in Matlab, some also in C++. Since steganography involves a lot of signal processing, Matlab was a natural choice at the time these steganography methods were developed.

For our research on JPEG steganalysis, we had to embed thousands of images, control additional hyper-parameters, and inspect intermediate results. For these purposes, the Matlab code did not integrate well with our comfortable Python environment and our infrastructure. Hence, over time, we reimplemented the steganography methods in Python. Our implementations can be found in a repository called conseal. Conseal was a collaborative effort with my colleague Martin, who, besides developing most of the code and documentation, sketched the wonderful seal logo in tikz.

It should be noted that conseal only simulates the steganographic embedding, analogously to existing research implementations. This is sufficient for building accurate steganalysis methods. Turning the simulation into a practical tools still requires efficient message coding.

A critical requirement was to match the outputs of the original implementations. This ensures that steganalysis results are comparable to results obtained with other implementations. We have made our best effort to ensure equivalence by comparing the output images byte-by-byte, by evaluating alternative implementations, and by integrating them into unit tests. Nonetheless, it is the user’s responsibility to validate that the code matches the original implementation.

We welcome contributions to conseal, including issue reports and additional implementations of steganography methods.