Steganography in LZ77 redundancy
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
COPYING
README
README.md
TODO
lz4c.py
lz4compare.py
lz4steg.py
lz77steg.py
snappyc.py
snappycompare.py
snappysteg.py

README.md

LZ77 Steganography

LZ41 and Snappy2 are two high speed compression algorithms based on LZ77 of Lempel and Ziv. They use no entropy coding so steganography based on their backreference/match redundancy is easy and completely transparent to users of the compressed cover.

lz4steg.py implements a steganography algorithm for LZ4, snappysteg.py is the same but for Snappy. The below description is for the LZ4 version but the other one works just the same.

For an in-depth description of what's going on and some numbers, see my blog post on this3.

Requirements

  • python 2.7 or pypy (recommended for speed)
  • optional: snappy and/or lz4 from PyPI (if you want to compress and compare)

Usage

./lz4steg.py FILE

Scans an lz4 compressed file for steganographic storage, reporting some numbers. The relevant number is the number of storage bytes, which is what the below commands can store into the file (less one for NULL).

./lz4steg.py -m MESSAGE FILE

Stores the message given into the file, writing the modified file to stdout. You can supply an output file with the -o switch or modify the cover inplace with -i. The message is stored NULL terminated, so it should not contain zero bytes.

./lz4steg.py -d FILE

Decodes the stored message from the file, writing it to stdout. The message is assumed to be NULL terminated, so if you've stored binary data you may only see a part of the message.