net.sourceforge.openstego
Class OpenStego

java.lang.Object
  extended bynet.sourceforge.openstego.OpenStego

public class OpenStego
extends java.lang.Object

This is the main class for OpenStego. It includes the main(java.lang.String[]) method which provides the command line interface for the tool. It also has API methods which can be used by external programs when using OpenStego as a library.


Constructor Summary
OpenStego()
          Constructor using the default configuration
OpenStego(java.util.Map propMap)
          Constructor with configuration data in the form of Map
OpenStego(StegoConfig config)
          Constructor using StegoConfig object
 
Method Summary
 java.awt.image.BufferedImage embedData(byte[] data, java.awt.image.BufferedImage image)
          Method to embed the data into an image
 java.awt.image.BufferedImage embedData(java.io.File dataFile, java.io.File imageFile)
          Method to embed the data into an image (alternate API)
 byte[] extractData(java.awt.image.BufferedImage image)
          Method to extract the data from an image
 byte[] extractData(java.io.File imageFile)
          Method to extract the data from an image (alternate API)
static void main(java.lang.String[] args)
          Main method for calling openstego from command line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenStego

public OpenStego()
Constructor using the default configuration


OpenStego

public OpenStego(StegoConfig config)
Constructor using StegoConfig object

Parameters:
config - StegoConfig object with configuration data

OpenStego

public OpenStego(java.util.Map propMap)
Constructor with configuration data in the form of Map

Parameters:
propMap - Map containing the configuration data
Method Detail

embedData

public java.awt.image.BufferedImage embedData(byte[] data,
                                              java.awt.image.BufferedImage image)
                                       throws java.io.IOException
Method to embed the data into an image

Parameters:
data - Data to be embedded
image - Source image data into which data needs to be embedded
Returns:
Image with embedded data
Throws:
java.io.IOException

embedData

public java.awt.image.BufferedImage embedData(java.io.File dataFile,
                                              java.io.File imageFile)
                                       throws java.io.IOException
Method to embed the data into an image (alternate API)

Parameters:
dataFile - File containing the data to be embedded
imageFile - Source image file into which data needs to be embedded
Returns:
Image with embedded data
Throws:
java.io.IOException

extractData

public byte[] extractData(java.awt.image.BufferedImage image)
                   throws java.io.IOException
Method to extract the data from an image

Parameters:
image - Image from which data needs to be extracted
Returns:
Extracted data
Throws:
java.io.IOException

extractData

public byte[] extractData(java.io.File imageFile)
                   throws java.io.IOException
Method to extract the data from an image (alternate API)

Parameters:
imageFile - Image file from which data needs to be extracted
Returns:
Extracted data
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Main method for calling openstego from command line.
   Usage:
        java -jar <path_to>/openstego.jar -embed <data_file> <image_file>
     OR java -jar <path_to>/openstego.jar -extract <image_file>
 
For '-embed' option, openstego will embed the data into the given image file, and save the file as PNG after appending '_out' to the file name.

For '-extract' option, openstego will output the extracted data on the standard OUT stream, so make sure that output is redirected to required file.

Parameters:
args - Command line arguments
Throws:
java.io.IOException