Pages

Tuesday, March 20, 2012

Quick steganography with Matlab

A. LSB Steganography

  • This concept (using the last significant bit of something) is general, and applies not only to RGB bmps, but to many kinds of  images, audio, video, etc. Implementation is simple [3].



B. DCT Steganography

  • This idea of hiding information in DCT coefficients is implemented by the JSTEG tool, which is the software from Independent JPEG Group JPEG, modifed for 1-bit steganography, developed by Derek Upham. The source is available here. From the README file, ' The JPEG encoding procedure divides an image into 8x8 blocks of pixels in the YCbCr colorspace.  Then they are run through a discrete cosine transform (DCT) and the resulting frequency coefficients are scaled to remove the ones which a human viewer would not detect under normal conditions.  If steganographic data is being loaded into the JPEG image, the loading occurs after this step.  The lowest-order bits of all non-zero frequency coefficients are replaced with successive bits from the steganographic source file, and these modified coefficients are sent to the Huffmann coder.'
  • It's a variation of LSB steganography, using DCT quantization coefficients.
  • Clearly detailed process + a tool for extraction (not detection), at [1]
  • The JEG Toolbox for Matlab can be used to access the DCT coefficients (and other cool stuff not available directly from Matlab  like quantization tables, Huffman coding tables, color space information, and comment markers). In the JPEG encoding process, these coefficients are quantized, zig-zag ordered and then compressed (Run-Length-Encding + Hufffman), so they aren't accessible from Matlab directly. 
  • There are techniques for detection and defeating this method of steganography. An analysis presented in [7]


Links:
1. Extracting data embedded with JSTEG
2. JPEG on Wiki
3. Watermark/stego Matlab project source, implementing DCT and LSB hiding schemes
4. Phil Sallee's Matlab JPEG Toolbox
5. JSTEG Steganalysis
Hide and Seek: An Introduction to Steganography
7. J.R. Krenn, Steganography and Steganalysis