Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 A Java Framework for Experimentation with Steganography Dr. Kenny Hunt The University of Wisconsin – La Crosse.

Similar presentations


Presentation on theme: "1 A Java Framework for Experimentation with Steganography Dr. Kenny Hunt The University of Wisconsin – La Crosse."— Presentation transcript:

1 1 A Java Framework for Experimentation with Steganography Dr. Kenny Hunt The University of Wisconsin – La Crosse

2 2 Overview Definitions Overview of LSB technique Software architecture Discussion Demo

3 3 Definitions Steganography “the art of concealing the existence of information within seemingly innocuous carriers” “an encrypted message may draw suspicion while a hidden message will not” Neil Johnson Image Processing and Steganography “the art of concealing the existence of information within seemingly innocuous digital images”

4 4 Background (Bit Planes) An Image is a 2D array of pixels Each pixel (in gray-scale) is 8 bits Each bit carries information Not all bits carry the same amount A7A7 A6A6 A5A5 A4A4 A3A3 A2A2 A1A1 A0A0 1286432168421 Binary Representation of 25 A7A7 A6A6 A5A5 A4A4 A3A3 A2A2 A1A1 A0A0 00011001 Binary Representation of 153 A7A7 A6A6 A5A5 A4A4 A3A3 A2A2 A1A1 A0A0 10011001 Binary Representation of 24 A7A7 A6A6 A5A5 A4A4 A3A3 A2A2 A1A1 A0A0 00011000

5 5 Bit Planes A0A0 A7A7 One pixel split into it’s 8-bits

6 6 Background (Bit Planes) White indicates an ON bit and black an OFF bit (a)8-bit grayscale source image (b)Most significant bit plane (a7) of the source (c)Least significant bit plane (a0) of the source (d)Bit plane a4 of the source image (a)(b)(c)(d)

7 7 The Big Idea (LSB embedding) An image contains more information than can be perceived. Replace the “imperceptible bits” of a cover image with the bits of a “secret message”. Cover Image A0A0 A1A1 A2A2 A3A3 A4A4 A5A5 A6A6 A7A7 Secret Message M0M0 M1M1 M2M2 A3A3 A4A4 A5A5 A6A6 A7A7 Stego Image (Cover image with message) The Challenge: Write Java code to LSB embed a secret message in an image. The secret message can be “any object”.

8 8 Java Framework Design a set of classes to perform LSB embedding Isolate the task of embedding/extracting > Steganographer +embed(cover:BufferedImage, msg:Object):BufferedImage +extract(stego:BufferedImage):Object LSBSteganographer +embed(cover:BufferedImage, msg:Object):BufferedImage +extract(stego:BufferedImage):Object +getChannelCapacity():int +setChannelCapacity(channels:int)

9 9 Java Framework ImageInputStream extends InputStream +ImageInputStream(source:BufferedImage, numChannels:int) +hasMoreBits():boolean +getNextBit():int +getNextByte():int +read():int ImageOutputStream extends OutputStream +ImageOutputStream(destination:BufferedImage, numChannels:int) +hasMoreBits():boolean +writeBit(int b) +writeByte(int b) +write(int b) Isolate the task of writing/reading data to/from an image

10 10 Java Framework class ImageOutpuStream extends OutputStream { private BufferedImage buffer; private int row, col, band, channel, numChannels; // The least significant bit of b is written to the buffer public void writeBit(int b) throws IOException { if(!hasMoreBits()) throw new IOException(“Out of capacity”); int newPixel = buffer.getRaster().getSample(col,row,band); newPixel = setBit(newPixel, b, channel); buffer.getRaster().setSample(col,row,band,newPixel); advanceIndices(); } Implement the task of writing to an image Maintain row, column, band, channel as an “insertion point” The writeByte and write methods are then built on the writeBit.

11 11 Java Framework (humor me…assume the message is an image) class LSBSteganographer implements Steganographer { private int numberOfChannels; public Image embed(BufferedImage cover, Object message) { Image result = cover.copy(); int k = getNumberOfChannels(); OutputStream rOut = new ImageOutputStream(result, k); writeHeaderInformation(message, rout); for every pixel P in message rOut.writeByte(P); return result; } This code writes image data to an OutputStream. Java has code that does this!

12 12 Java Framework (assume the message is an image) class LSBSteganographer implements Steganographer { private int numberOfChannels; public Image embed(BufferedImage cover, Object message) { Image result = cover.copy(); int k = getNumberOfChannels(); OutputStream rOut = new ImageOutputStream(result, k); ImageIO.write((BufferedImage)message, “PNG”, rout); return result; } Real live honest-to-goodness Java code! What if the message is not an image? Can we embed it in the cover?

13 13 Java Framework (assume the message is NOT an image) class LSBSteganographer implements Steganographer { private int numberOfChannels; public Image embed(BufferedImage cover, Object message) { Image result = cover.copy(); int k = getNumberOfChannels(); OutputStream rOut = new ImageOutputStream(result, k); DataOutputStream fout = new DataOutputStream(rOut); fout.writeObject(message); return result; } Real live honest-to-goodness Java code! The contract for “writeObject” is that the written object be “Serializable”. BufferedImages are not. Therefore, must make a specific exception for image types. Image from http://i33www.ira.uka.de/applets/mocca/images/janus.gif

14 14 Java Framework (make no assumptions!) class LSBSteganographer implements Steganographer { private int numberOfChannels; public Image embed(BufferedImage cover, Object message) { Image result = cover.copy(); int k = getNumberOfChannels(); OutputStream rOut = new ImageOutputStream(result, k); if(message instanceof Serializable) { DataOutputStream fout = new DataOutputStream(rOut); fout.writeObject(message); } else if(message instanceof BufferedImage) { ImageIO.write(message, “PNG”, rout); } else throw new IllegalArgumentException(); return result; } Image from http://i33www.ira.uka.de/applets/mocca/images/janus.gif

15 15 Classroom Use Assignment given in an Image Processing course Emphasizes bit-level operations Could even give the UML class diagrams Emphasizes good software design Could even give the students low-level code I give no design or code Review the design at the conclusion of the exercise


Download ppt "1 A Java Framework for Experimentation with Steganography Dr. Kenny Hunt The University of Wisconsin – La Crosse."

Similar presentations


Ads by Google