Metadata-Version: 2.1
Name: steganogan
Version: 0.1.1
Summary: Steganography tool based on DeepLearning GANs
Home-page: https://github.com/DAI-Lab/steganogan
Author: MIT Data To AI Lab
Author-email: dailabmit@gmail.com
License: MIT license
Keywords: steganogan
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Requires-Python: >=3.5
Description-Content-Type: text/markdown
Requires-Dist: imageio (>=2.4.1)
Requires-Dist: reedsolo (>=0.3)
Requires-Dist: scipy (>=1.1.0)
Requires-Dist: scikit-learn (==0.19.1)
Requires-Dist: torch (>=1.0.0)
Requires-Dist: torchvision (==0.2.1)
Requires-Dist: tqdm (==4.28.1)
Provides-Extra: dev
Requires-Dist: bumpversion (>=0.5.3) ; extra == 'dev'
Requires-Dist: pip (>=9.0.1) ; extra == 'dev'
Requires-Dist: watchdog (>=0.8.3) ; extra == 'dev'
Requires-Dist: m2r (>=0.2.0) ; extra == 'dev'
Requires-Dist: Sphinx (>=1.7.1) ; extra == 'dev'
Requires-Dist: sphinx-rtd-theme (>=0.2.4) ; extra == 'dev'
Requires-Dist: flake8 (>=3.5.0) ; extra == 'dev'
Requires-Dist: isort (>=4.3.4) ; extra == 'dev'
Requires-Dist: autoflake (>=1.1) ; extra == 'dev'
Requires-Dist: autopep8 (>=1.3.5) ; extra == 'dev'
Requires-Dist: twine (>=1.10.0) ; extra == 'dev'
Requires-Dist: wheel (>=0.30.0) ; extra == 'dev'
Requires-Dist: jupyter (==1.0.0) ; extra == 'dev'
Requires-Dist: coverage (>=4.5.1) ; extra == 'dev'
Requires-Dist: pytest (>=3.4.2) ; extra == 'dev'
Requires-Dist: tox (>=2.9.1) ; extra == 'dev'
Provides-Extra: test
Requires-Dist: coverage (>=4.5.1) ; extra == 'test'
Requires-Dist: pytest (>=3.4.2) ; extra == 'test'
Requires-Dist: tox (>=2.9.1) ; extra == 'test'

<p align="left">
<img width=15% src="https://dai.lids.mit.edu/wp-content/uploads/2018/06/Logo_DAI_highres.png" alt=“SteganoGAN” />
<i>An open source project from Data to AI Lab at MIT.</i>
</p>

[![PyPI Shield](https://img.shields.io/pypi/v/steganogan.svg)](https://pypi.python.org/pypi/steganogan)
[![Travis CI Shield](https://travis-ci.org/DAI-Lab/SteganoGAN.svg?branch=master)](https://travis-ci.org/DAI-Lab/SteganoGAN)

# 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`:

```bash
pip install steganogan
```

Alternatively, you can clone the repository and install it from source by running `make install`:

```bash
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.

## 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 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.

**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.


# History

## 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.


