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(OpenStegoConfig config)
          Constructor using OpenStegoConfig object
 
Method Summary
 java.awt.image.BufferedImage embedData(byte[] data, java.lang.String dataFileName, 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)
 java.util.List extractData(java.awt.image.BufferedImage image)
          Method to extract the data from an image
 java.util.List extractData(java.io.File imageFile)
          Method to extract the data from an image (alternate API)
 java.awt.image.BufferedImage generateRandomImage(int dataLength)
          Method to generate a random image filled with noise.
static java.util.List getSupportedReadFormats()
          Method to get the list of supported image formats for reading
static java.util.List getSupportedWriteFormats()
          Method to get the list of supported image formats for writing
static void main(java.lang.String[] args)
          Main method for calling openstego from command line.
 java.awt.image.BufferedImage readImage(java.io.File imageFile)
          Method to load the image file
 void writeImage(java.awt.image.BufferedImage image, java.lang.String imageFileName)
          Method to write the image file
 
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(OpenStegoConfig config)
Constructor using OpenStegoConfig object

Parameters:
config - OpenStegoConfig object with configuration data

OpenStego

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

Parameters:
propMap - Map containing the configuration data
Throws:
OpenStegoException
Method Detail

embedData

public java.awt.image.BufferedImage embedData(byte[] data,
                                              java.lang.String dataFileName,
                                              java.awt.image.BufferedImage image)
                                       throws OpenStegoException
Method to embed the data into an image

Parameters:
data - Data to be embedded
dataFileName - Name of the data file
image - Source image data into which data needs to be embedded. If null then random image is generated and used as the cover file
Returns:
Image with embedded data
Throws:
OpenStegoException

embedData

public java.awt.image.BufferedImage embedData(java.io.File dataFile,
                                              java.io.File imageFile)
                                       throws OpenStegoException
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. If null then random image is generated and used as the cover file
Returns:
Image with embedded data
Throws:
OpenStegoException

extractData

public java.util.List extractData(java.awt.image.BufferedImage image)
                           throws OpenStegoException
Method to extract the data from an image

Parameters:
image - Image from which data needs to be extracted
Returns:
Extracted data (List's first element is the file name and second element is byte array of data)
Throws:
OpenStegoException

extractData

public java.util.List extractData(java.io.File imageFile)
                           throws OpenStegoException
Method to extract the data from an image (alternate API)

Parameters:
imageFile - Image file from which data needs to be extracted
Returns:
Extracted data (List's first element is the file name and second element is byte array of data)
Throws:
OpenStegoException

readImage

public java.awt.image.BufferedImage readImage(java.io.File imageFile)
                                       throws OpenStegoException
Method to load the image file

Parameters:
imageFile - Image file
Returns:
Buffered image
Throws:
OpenStegoException

generateRandomImage

public java.awt.image.BufferedImage generateRandomImage(int dataLength)
                                                 throws OpenStegoException
Method to generate a random image filled with noise. The size of the image will be calculated based on the length of data (after compression) that needs to be embedded, and the 'maxBitsUsedPerChannel' parameter.

Parameters:
dataLength - Length of data in bytes which the image should be able to accommodate
Returns:
Random image filled with noise
Throws:
OpenStegoException

writeImage

public void writeImage(java.awt.image.BufferedImage image,
                       java.lang.String imageFileName)
                throws OpenStegoException
Method to write the image file

Parameters:
image - Image data
imageFileName - Image file name
Throws:
OpenStegoException

main

public static void main(java.lang.String[] args)
                 throws OpenStegoException
Main method for calling openstego from command line.

Parameters:
args - Command line arguments
Throws:
OpenStegoException

getSupportedReadFormats

public static java.util.List getSupportedReadFormats()
Method to get the list of supported image formats for reading

Returns:
List of supported image formats for reading

getSupportedWriteFormats

public static java.util.List getSupportedWriteFormats()
Method to get the list of supported image formats for writing

Returns:
List of supported image formats for writing