Steganography tool based on DeepLearning GANs
Project description
An open source project from Data to AI Lab at MIT.
SteganoGAN
- License: MIT
- Documentation: https://DAI-Lab.github.io/SteganoGAN
- Homepage: https://github.com/DAI-Lab/SteganoGAN
Overview
SteganoGAN is a tool for creating steganographic images using adversarial training.
Installation
To get started with SteganoGAN, we recommend using pip
:
pip install steganogan
Alternatively, you can clone the repository and install it from source by running make install
:
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 and linting.
NOTE SteganoGAN currently requires torch
version to be 1.0.0
in order to work properly.
Usage
Command Line
SteganoGAN includes a simple command line interface for encoding and decoding steganographic images.
Hide a message inside an image
To create a steganographic image, you simply need to supply the path to the cover image and the secret message:
steganogan encode [options] path/to/cover/image.png "Message to hide"
Read a message from an image
To recover the secret message from a steganographic image, you simply supply the path to the steganographic image that was generated by a compatible model:
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 tooutput.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.
WARNING: Make sure to use the same architecture specification (--architecture
) during both
the encoding and decoding stage; otherwise, SteganoGAN
will fail to decode the message.
Python
The primary way to interact with SteganoGAN from Python is through the steganogan.SteganoGAN
class. This class can be instantiated using a pretrained model:
>>> from steganogan import SteganoGAN
>>> steganogan = SteganoGAN.load('steganogan/pretrained/dense.steg')
Using CUDA device
Once we have loaded our model, we can give it the input image path, the output image path, and the secret message:
>>> steganogan.encode('research/input.png', 'research/output.png', 'This is a super secret message!')
Encoding completed.
This will generate an output.png
image that closely resembles the input image but contains the
secret message. In order to recover the message, we can simply pass output.png
to the decode
method:
>>> steganogan.decode('research/output.png')
'This is a super secret message!'
Research
We provide example scripts in the research
folder which demonstrate how you can train your own
SteganoGAN
models from scratch on arbitrary datasets. In addition, we provide a convenience
script in research/data
for downloading two popular image datasets.
What's next?
For more details about SteganoGAN and all its possibilities and features, please check the project documentation site!
Citing SteganoGAN
If you use SteganoGAN for your research, please consider citing the following work:
Zhang, Kevin Alex and Cuesta-Infante, Alfredo and Veeramachaneni, Kalyan. SteganoGAN: High Capacity Image Steganography with GANs. MIT EECS, January 2019. (PDF)
@article{zhang2019steganogan,
title={SteganoGAN: High Capacity Image Steganography with GANs},
author={Zhang, Kevin Alex and Cuesta-Infante, Alfredo and Veeramachaneni, Kalyan},
journal={arXiv preprint arXiv:1901.03892},
year={2019},
url={https://arxiv.org/abs/1901.03892}
}
History
0.1.3
- Cap dependencies in order to avoid outside changes that caused
staganogan
to malfunctioned.
Resolved Issues
- Issue #50: Cap pillow and other dependencies.
- Issue #55: Update reedsolo.
0.1.2
- Add option to work with a custom pretrained model from CLI and Python
- Refactorize Critics and Decoders to match Encoders code style
- Make old pretrained models compatible with new code versions
- Cleanup unneeded dependencies
- Extensive unit testing
0.1.1
- Add better pretrained models.
- Improve support for non CUDA devices.
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
Built Distribution
File details
Details for the file steganogan-0.1.3.tar.gz
.
File metadata
- Download URL: steganogan-0.1.3.tar.gz
- Upload date:
- Size: 4.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e08127d5cbe2e245ac0f89bdc34148133c31eaf95050272f40f003d1601bf188 |
|
MD5 | 66e45a2f4c772f63039a06a42bc0ff1c |
|
BLAKE2b-256 | 1f9176ef95a34807c224fb62a17f5b945044b787af805e1573e2751178c450f3 |
File details
Details for the file steganogan-0.1.3-py2.py3-none-any.whl
.
File metadata
- Download URL: steganogan-0.1.3-py2.py3-none-any.whl
- Upload date:
- Size: 2.8 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02b6a470948fd9a1b7734facf5f465af5e0a9fa83fb8c49d83df15b718ec135c |
|
MD5 | fbde79984f50a579848c8b11b5e28da6 |
|
BLAKE2b-256 | c181ecf0986b7b16369e840e20fa20c323191052980f77ce0450006ba4ed6cfb |