Class OpenStego

java.lang.Object
com.openstego.desktop.OpenStego

public class OpenStego extends Object
This is the main class for OpenStego. It includes the main(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.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Constant for the namespace for labels
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor using the default configuration
    Constructor using OpenStegoConfig object
    Constructor with configuration data in the form of Map
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    checkMark(byte[] stegoData, String stegoFileName, byte[] origSigData)
    Method to check the correlation for the given image and the original signature
    double
    checkMark(File stegoFile, File origSigFile)
    Method to check the correlation for the given image and the original signature (alternate API)
    byte[]
    embedData(byte[] msg, String msgFileName, byte[] cover, String coverFileName, String stegoFileName)
    Method to embed the message data into the cover data
    byte[]
    embedData(File msgFile, File coverFile, String stegoFileName)
    Method to embed the message data into the cover data (alternate API)
    byte[]
    embedMark(byte[] sig, String sigFileName, byte[] cover, String coverFileName, String stegoFileName)
    Method to embed the watermark signature data into the cover data
    byte[]
    embedMark(File sigFile, File coverFile, String stegoFileName)
    Method to embed the watermark signature data into the cover data (alternate API)
    List<?>
    extractData(byte[] stegoData, String stegoFileName)
    Method to extract the message data from stego data
    List<?>
    extractData(File stegoFile)
    Method to extract the message data from stego data (alternate API)
    byte[]
    extractMark(byte[] stegoData, String stegoFileName, byte[] origSigData)
    Method to extract the watermark data from stego data
    byte[]
    extractMark(File stegoFile, File origSigFile)
    Method to extract the watermark data from stego data (alternate API)
    byte[]
    Method to generate the signature data using the given plugin
    Get method for configuration data
    byte[]
    getDiff(byte[] stegoData, String stegoFileName, byte[] coverData, String coverFileName, String diffFileName)
    Method to get difference between original cover file and the stegged file
    byte[]
    getDiff(File stegoFile, File coverFile, String diffFileName)
    Method to get difference between original cover file and the stegged file
    static void
    main(String[] args)
    Main method for calling openstego from command line.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • embedData

      public byte[] embedData(byte[] msg, String msgFileName, byte[] cover, String coverFileName, String stegoFileName) throws OpenStegoException
      Method to embed the message data into the cover data
      Parameters:
      msg - Message data to be embedded
      msgFileName - Name of the message file
      cover - Cover data into which message data needs to be embedded
      coverFileName - Name of the cover file
      stegoFileName - Name of the output stego file
      Returns:
      Stego data containing the embedded message
      Throws:
      OpenStegoException
    • embedData

      public byte[] embedData(File msgFile, File coverFile, String stegoFileName) throws OpenStegoException
      Method to embed the message data into the cover data (alternate API)
      Parameters:
      msgFile - File containing the message data to be embedded
      coverFile - Cover file into which data needs to be embedded
      stegoFileName - Name of the output stego file
      Returns:
      Stego data containing the embedded message
      Throws:
      OpenStegoException
    • embedMark

      public byte[] embedMark(byte[] sig, String sigFileName, byte[] cover, String coverFileName, String stegoFileName) throws OpenStegoException
      Method to embed the watermark signature data into the cover data
      Parameters:
      sig - Signature data to be embedded
      sigFileName - Name of the signature file
      cover - Cover data into which signature data needs to be embedded
      coverFileName - Name of the cover file
      stegoFileName - Name of the output stego file
      Returns:
      Stego data containing the embedded signature
      Throws:
      OpenStegoException
    • embedMark

      public byte[] embedMark(File sigFile, File coverFile, String stegoFileName) throws OpenStegoException
      Method to embed the watermark signature data into the cover data (alternate API)
      Parameters:
      sigFile - File containing the signature data to be embedded
      coverFile - Cover file into which data needs to be embedded
      stegoFileName - Name of the output stego file
      Returns:
      Stego data containing the embedded signature
      Throws:
      OpenStegoException
    • extractData

      public List<?> extractData(byte[] stegoData, String stegoFileName) throws OpenStegoException
      Method to extract the message data from stego data
      Parameters:
      stegoData - Stego data from which the message needs to be extracted
      stegoFileName - Name of the stego file
      Returns:
      Extracted message (List's first element is filename and second element is the message as byte array)
      Throws:
      OpenStegoException
    • extractData

      public List<?> extractData(File stegoFile) throws OpenStegoException
      Method to extract the message data from stego data (alternate API)
      Parameters:
      stegoFile - Stego file from which message needs to be extracted
      Returns:
      Extracted message (List's first element is filename and second element is the message as byte array)
      Throws:
      OpenStegoException
    • extractMark

      public byte[] extractMark(byte[] stegoData, String stegoFileName, byte[] origSigData) throws OpenStegoException
      Method to extract the watermark data from stego data
      Parameters:
      stegoData - Stego data from which the watermark needs to be extracted
      stegoFileName - Name of the stego file
      origSigData - Original signature data
      Returns:
      Extracted watermark
      Throws:
      OpenStegoException
    • extractMark

      public byte[] extractMark(File stegoFile, File origSigFile) throws OpenStegoException
      Method to extract the watermark data from stego data (alternate API)
      Parameters:
      stegoFile - Stego file from which watermark needs to be extracted
      origSigFile - Original signature file
      Returns:
      Extracted watermark
      Throws:
      OpenStegoException
    • checkMark

      public double checkMark(byte[] stegoData, String stegoFileName, byte[] origSigData) throws OpenStegoException
      Method to check the correlation for the given image and the original signature
      Parameters:
      stegoData - Stego data containing the watermark
      stegoFileName - Name of the stego file
      origSigData - Original signature data
      Returns:
      Correlation
      Throws:
      OpenStegoException
    • checkMark

      public double checkMark(File stegoFile, File origSigFile) throws OpenStegoException
      Method to check the correlation for the given image and the original signature (alternate API)
      Parameters:
      stegoFile - Stego file from which watermark needs to be extracted
      origSigFile - Original signature file
      Returns:
      Correlation
      Throws:
      OpenStegoException
    • generateSignature

      public byte[] generateSignature() throws OpenStegoException
      Method to generate the signature data using the given plugin
      Returns:
      Signature data
      Throws:
      OpenStegoException
    • getDiff

      public byte[] getDiff(byte[] stegoData, String stegoFileName, byte[] coverData, String coverFileName, String diffFileName) throws OpenStegoException
      Method to get difference between original cover file and the stegged file
      Parameters:
      stegoData - Stego data containing the embedded data
      stegoFileName - Name of the stego file
      coverData - Original cover data
      coverFileName - Name of the cover file
      diffFileName - Name of the output difference file
      Returns:
      Difference data
      Throws:
      OpenStegoException
    • getDiff

      public byte[] getDiff(File stegoFile, File coverFile, String diffFileName) throws OpenStegoException
      Method to get difference between original cover file and the stegged file
      Parameters:
      stegoFile - Stego file containing the embedded data
      coverFile - Original cover file
      diffFileName - Name of the output difference file
      Returns:
      Difference data
      Throws:
      OpenStegoException
    • getConfig

      public OpenStegoConfig getConfig()
      Get method for configuration data
      Returns:
      Configuration data
    • main

      public static void main(String[] args)
      Main method for calling openstego from command line.
      Parameters:
      args - Command line arguments