11.07.2015 Views

Java Art Chapter 6. Steganography

Java Art Chapter 6. Steganography

Java Art Chapter 6. Steganography

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Java</strong> Prog. Techniques for Games. <strong>Java</strong> <strong>Art</strong> <strong>Chapter</strong> <strong>6.</strong> Stego Draft #1 (7th June 09)Figure 7. Constructing a hiddenBytes[] Byte.The existing bits in hiddenBytes[j] (10010) are shifted to the left before the image'sLSB is inserted on the right.Once the length of the stego message is known, the rest of the image data is scannedby extractHiddenBytes() in getMessage().private static String getMessage(byte[] imBytes, int msgLen, intoffset){byte[] msgBytes = extractHiddenBytes(imBytes, msgLen, offset);// the message is msgLen bytes longif (msgBytes == null)return null;String msg = new String(msgBytes);// check the message is all charactersif (isPrintable(msg))return msg;elsereturn null;} // end of getMessage()extractHiddenBytes() extracts msgLen bytes, the number of bytes in the message.The byte array is converted to a string, and checked to see if it consists of printablecharacters. If the message has been corrupted, for example by someone cropping orscaling the image, then it's very likely that some of the message will be unreadable.2.4. Evaluating the <strong>Steganography</strong> ClassThe principle weakness of the <strong>Steganography</strong> class is that it uses an extremely wellknowntechnique for hiding a message. Probably every steganalysis tool supports LSBsearch. One answer is to vary the encoding technique, such as by storing a messagebit in a different part of an image byte.11 Andrew Davison © 2009

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!