Steganography in LZ77 redundancy
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

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. implements a steganography algorithm for LZ4, 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.


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



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


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.

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