Wednesday 18 September 2013

Installing JSteg in Ubuntu

JSteg is another great tool I have been reading about whilst brushing up on my Stego, the book is linked in my previous post.

JSteg

wget http://zooid.org/~paul/crypto/jsteg/jpeg-v4.tar.Z

 cp makefile.ansi Makefile

cp jmemansi.c jmemsys.c

make

sudo cp cjpeg djpeg /usr/local/bin
 Test it:

cjpeg -h

usage: cjpeg [switches] [inputfile]
Switches (names may be abbreviated):
  -quality N     Compression quality (0..100; 5-95 is useful range)
  -grayscale     Create monochrome JPEG file
  -optimize      Optimize Huffman table (smaller file, but slow compression)
  -targa         Input file is Targa format (usually not needed)
Switches for advanced users:
  -restart N     Set restart interval in rows, or in blocks with B
  -smooth N      Smooth dithered input (N=1..100 is strength)
  -maxmemory N   Maximum memory to use (in kbytes)
  -verbose  or  -debug   Emit debug output
Switches for wizards:
  -qtables file  Use quantization tables given in file
  -sample HxV[,...]  Set JPEG sampling factors

  djpeg -h
usage: djpeg [switches] [inputfile]
Switches (names may be abbreviated):
  -colors N      Reduce image to no more than N colors
  -gif           Select GIF output format
  -pnm           Select PBMPLUS (PPM/PGM) output format (default)
  -quantize N    Same as -colors N
  -targa         Select Targa output format
Switches for advanced users:
  -blocksmooth   Apply cross-block smoothing
  -grayscale     Force grayscale output
  -nodither      Don't use dithering in quantization
  -onepass       Use 1-pass quantization (fast, low quality)
  -maxmemory N   Maximum memory to use (in kbytes)
  -verbose  or  -debug   Emit debug output

HTH
 
 

Install StegHide in Ubuntu

I've recently been brushing up on my Stego, and have been reading an excellent book called "Data Hiding"; highly recommended reading.

Anyway I've been installing most of the tools used in the book and have found that most of them are quite old and take a bit of work to compile. I'm making notes here, on how I've achieved the install on my host, currently Ubuntu 12.04

StegHide

You need a few dependencies here:

sudo apt-get install -y libjpeg-dev libmcrypt-dev libmhash-dev

Then you can try to compile the source; I still couldnt get it to complie, so installed a .deb from Launchpad!


wget http://launchpadlibrarian.net/5049761/steghide_0.5.1-8_amd64.deb && sudo dpkg -i steghide_0.5.1-8_amd64.deb

Try it:

steghide 
steghide version 0.5.1

the first argument must be one of the following:
 embed, --embed          embed data
 extract, --extract      extract data
 info, --info            display information about a cover- or stego-file
   info       display information about
 encinfo, --encinfo      display a list of supported encryption algorithms
 version, --version      display version information
 license, --license      display steghide's license
 help, --help            display this usage information

embedding options:
 -ef, --embedfile        select file to be embedded
   -ef        embed the file
 -cf, --coverfile        select cover-file
   -cf        embed into the file
 -p, --passphrase        specify passphrase
   -p       use to embed data
 -sf, --stegofile        select stego file
   -sf        write result to instead of cover-file
 -e, --encryption        select encryption parameters
   -e []|[]  specify an encryption algorithm and/or mode
   -e none               do not encrypt data before embedding
 -z, --compress          compress data before embedding (default)
   -z                 using level (1 best speed...9 best compression)
 -Z, --dontcompress      do not compress data before embedding
 -K, --nochecksum        do not embed crc32 checksum of embedded data
 -N, --dontembedname     do not embed the name of the original file
 -f, --force             overwrite existing files
 -q, --quiet             suppress information messages
 -v, --verbose           display detailed information

extracting options:
 -sf, --stegofile        select stego file
   -sf        extract data from
 -p, --passphrase        specify passphrase
   -p       use to extract data
 -xf, --extractfile      select file name for extracted data
   -xf        write the extracted data to
 -f, --force             overwrite existing files
 -q, --quiet             suppress information messages
 -v, --verbose           display detailed information

options for the info command:
 -p, --passphrase        specify passphrase
   -p       use to get info about embedded data

To embed emb.txt in cvr.jpg: steghide embed -cf cvr.jpg -ef emb.txt
To extract embedded data from stg.jpg: steghide extract -sf stg.jpg

HTH