Skip to content

daniellerch/hstego

Repository files navigation

What is HStego?

HStego is a tool for hiding data in bitmap and JPEG images. This tool uses some of the most advanced steganography methods known today, along with an upper limit on the amount of data that can be hidden so that it cannot be reliably detected by modern steganography tools.

WARNING: This tool is in a ALPHA stage. Use at your own risk.
If you find any problem, please open an issue.

Documentation:


Download

HStego is available as a standalone binary for Linux and for Windows. These binaries have a graphical user interface, although they can be used using the command line.

Download Links:

GUI examples:

The interface is quite intuitive. During hiding HStego prompts for the image, the message to hide, a password, and the resulting stego image. The procedure can be seen in the following images.

During extraction the procedure is similar. HStego asks for the stego image and for the password.

Command line examples:

HStego can be used from the command line. Here are some examples of how to use it.

Example using bitmap images:

hstego.py embed secret.txt cover.png stego.png MyP4ssw0rd101
hstego.py extract stego.png content.txt MyP4ssw0rd101

Example using JPEG images:

hstego.py embed secret.txt cover.jpg stego.jpg MyP4ssw0rd101
hstego.py extract stego.jpg content.txt MyP4ssw0rd101

Install from source code

You can install HStego with the following commands:

sudo pip3 install imageio numpy scipy pycryptodome numba Pillow
sudo pip3 install git+https://github.com/daniellerch/hstego.git@v0.4

Uninstall with:

sudo pip3 uninstall hstego

Your operating system may need to install some libraries. In case of Debian based systems you can use the following commands:

sudo apt-get install build-essential python-dev libjpeg-dev python3-tk

Python examples

HStego can also be used as a Python library. Check out the following examples:

Example using bitmap images:

import hstegolib
hill = hstegolib.S_UNIWARD()

# Hide a message
hill.embed("cover.png", "secret.txt", "MyP4ssw0rd101", "stego.png")

# Extract the message
hill.extract("stego.png", "MyP4ssw0rd101", "content.txt")

Example using JPEG images:

import hstegolib
juniw = hstegolib.J_UNIWARD()

# Hide a message
juniw.embed("cover.jpg", "secret.txt", "MyP4ssw0rd101", "stego.jpg")

# Extract the message
juniw.extract("stego.png", "MyP4ssw0rd101", "content.txt")

Technical details:

HStego can hide information in bitmap and JPEG images. HStego gets the best place for hiding the data in bitmap images using the S-UNIWARD cost function, and for hiding data into JPEG images using the function J-UNIWARD + Cost Polarization. The final embedding is done using Syndrome Trellis Codes.

Even using this advanced methods, powerful steganalysis tools based on deep learning could detect the hidden information if we hide too much data. Therefore, HStego limits the maximum amount of information to 5% of the total capacity. This 5% has been calculated using the Aletheia steganalysis tool and this is the maximum that can be hidden without being reliably detected, under adverse conditions.

Acknowledgments:

HStego implements the J-UNIWARD with cost polarization for JPEG images and the S-UNIWARD method for bitmap images.

NOTE: In versions prior to 0.4, HStego used the HILL cost function for the spatial domain and the J-UNIWARD method for JPEG images.

These methods are described in the following papers:

The embedding is implemeted using Syndrome Trellis Codes:

Part of the C/C++ code used by HStego comes from the Digital Data Embedding Laboratory.

This software would not have been possible without their excellent work.