Skip to main content

Steganography tool based on DeepLearning GANs

Project description

“SteganoGAN” An open source project from Data to AI Lab at MIT.

PyPI Shield Travis CI Shield

SteganoGAN

Overview

SteganoGAN is a steganographic tool that uses adversarial training to hide messages in images.

Installation

The simplest and recommended way to install SteganoGAN is using pip:

pip install steganogan

Alternatively, clone the repository and install it from source running the make install command.

git clone git@github.com:DAI-Lab/SteganoGAN.git
cd SteganoGAN
make install

For development, you can use the make install-develop command instead in order to install all the required dependencies for testing, code linting and notebook running.

Usage

Command Line

SteganoGAN includes a command line interface, which allows to easily hide messages in images and later on read them back.

Hide a message inside an image

To encode an image, after SteganoGAN has been installed, just execute steganogan encode passing the path to the image to be used as cover and the message to hide in it:

steganogan encode [options] path/to/cover/image.png "Message to hide"

Read a message from an image

To decode a message from a generated image, execute steganogan decode passing the path to the image:

steganogan decode [options] path/to/generated/image.png

Additional options

The script has some additional options to control its behavior:

  • -o, --output PATH: Path where the generated image will be stored. Defaults to output.png.
  • -a, --architecture ARCH: Architecture to use, basic or dense. Defaults to dense.
  • -v, --verbose: Be verbose.
  • --cpu: force CPU usage even if CUDA is available. This might be needed if there is a GPU available in the system but the VRAM amount is too low.

NOTE: Make sure to use the same architecture for both encoding and decoding, otherwise SteganoGAN won't be able to decode the message.

Python

The main way to interact with SteganoGAN from Python is through the class steganogan.SteganoGAN.

This class can be loaded by giving it the path to a pretrained model:

>>> from steganogan import SteganoGAN
>>> steganogan = SteganoGAN.load('research/models/dense.steg')
Using CUDA device

Once we have loaded our model, we are ready to give it an input image path, the path of the image that we want to generate, and the message that we want to hide:

>>> steganogan.encode('research/input.png', 'research/output.png', 'This is a super secret message!')
Encoding completed.

This will generate an output.png image that will look almost like the input one and will contain the message hidden inside it.

After this, when we want to extract the message from the image, we can simply pass it to the decode method:

>>> steganogan.decode('research/output.png')
'This is a super secret message!'

Fitting a new model

A usage example notebook has been included in the research folder with a step by step guide about how to fit a new model on a new images dataset, save it to a file, and later on reload it and use it to encode and decode messages.

A convenience script has been also included in the research/data folder to download a couple of demo datasets to train models with.

History

0.1.0 - First release to PyPi

  • SteganoGAN class which can be fitted, saved, loaded and used to encode and decode messages.
  • Basic command line interface that allow using pretrained models.
  • Basic and Dense pretrained models for demo purposes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

steganogan-0.1.0.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

steganogan-0.1.0-py2.py3-none-any.whl (1.6 MB view details)

Uploaded Python 2Python 3

File details

Details for the file steganogan-0.1.0.tar.gz.

File metadata

  • Download URL: steganogan-0.1.0.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for steganogan-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2e09e8002d6e788f0a1c7a60a3b58fd8fc617779a07a0a8d4e09e95f05fd24df
MD5 e9564ac38d619929097a2a2d6f7229c2
BLAKE2b-256 f60807f16cdb8c788cd79ee7a432dfe2097855076df04aeae9116db823b92c3b

See more details on using hashes here.

File details

Details for the file steganogan-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: steganogan-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for steganogan-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 29388e4b9b8ad442b36e35e68e6797359574d0f0e9e9ad087cd93453236f90bc
MD5 a8aa89e794e0161f62da3e9589ee109a
BLAKE2b-256 dff9b60692654a0d613958aac7eaf7a35637f09624a75d64a25b3387f0afd8ce

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page