This code is built on top of the implementations of the steganography algorithms from "Neural Linguistic Steganography," Zachary M. Ziegler*, Yuntian Deng*, Alexander M. Rush.
There is a breaking change in pytorch 1.2, make sure to use pytorch 1.0 as in requirements.txt.
Experiments in the paper use the medium (345M parameter) GPT model via pytorch_transformers. For compute reasons the default in this code base is the small version but the medium or large versions can be used by changing the model_name
parameter of get_model
.
The steganography algorithms implemented are:
- Our proposed arithmetic coding-based algorithm
- The Huffman algorithm from RNN-Stega: Linguistic Steganography Based on Recurrent Neural Networks
- The binning algorithm from Generating Steganographic Text with LSTMs
An example of encoding and decoding a message is in run_single.py
. The algorithm used is determined by the mode
parameter.
In Terminal, type export FLASK_APP=app.py
. Then, flask run
.