Package com.openstego.desktop
Class OpenStego
- java.lang.Object
-
- com.openstego.desktop.OpenStego
-
public class OpenStego extends java.lang.Object
This is the main class for OpenStego. It includes themain(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 java.lang.String
NAMESPACE
Constant for the namespace for labels
-
Constructor Summary
Constructors Constructor Description OpenStego(OpenStegoPlugin plugin)
Constructor using the default configurationOpenStego(OpenStegoPlugin plugin, OpenStegoConfig config)
Constructor usingOpenStegoConfig
objectOpenStego(OpenStegoPlugin plugin, java.util.Map<java.lang.String,java.lang.String> propMap)
Constructor with configuration data in the form ofMap
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
checkMark(byte[] stegoData, java.lang.String stegoFileName, byte[] origSigData)
Method to check the correlation for the given image and the original signaturedouble
checkMark(java.io.File stegoFile, java.io.File origSigFile)
Method to check the correlation for the given image and the original signature (alternate API)byte[]
embedData(byte[] msg, java.lang.String msgFileName, byte[] cover, java.lang.String coverFileName, java.lang.String stegoFileName)
Method to embed the message data into the cover databyte[]
embedData(java.io.File msgFile, java.io.File coverFile, java.lang.String stegoFileName)
Method to embed the message data into the cover data (alternate API)byte[]
embedMark(byte[] sig, java.lang.String sigFileName, byte[] cover, java.lang.String coverFileName, java.lang.String stegoFileName)
Method to embed the watermark signature data into the cover databyte[]
embedMark(java.io.File sigFile, java.io.File coverFile, java.lang.String stegoFileName)
Method to embed the watermark signature data into the cover data (alternate API)java.util.List<?>
extractData(byte[] stegoData, java.lang.String stegoFileName)
Method to extract the message data from stego datajava.util.List<?>
extractData(java.io.File stegoFile)
Method to extract the message data from stego data (alternate API)byte[]
extractMark(byte[] stegoData, java.lang.String stegoFileName, byte[] origSigData)
Method to extract the watermark data from stego databyte[]
extractMark(java.io.File stegoFile, java.io.File origSigFile)
Method to extract the watermark data from stego data (alternate API)byte[]
generateSignature()
Method to generate the signature data using the given pluginOpenStegoConfig
getConfig()
Get method for configuration databyte[]
getDiff(byte[] stegoData, java.lang.String stegoFileName, byte[] coverData, java.lang.String coverFileName, java.lang.String diffFileName)
Method to get difference between original cover file and the stegged filebyte[]
getDiff(java.io.File stegoFile, java.io.File coverFile, java.lang.String diffFileName)
Method to get difference between original cover file and the stegged filestatic void
main(java.lang.String[] args)
Main method for calling openstego from command line.
-
-
-
Field Detail
-
NAMESPACE
public static final java.lang.String NAMESPACE
Constant for the namespace for labels- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OpenStego
public OpenStego(OpenStegoPlugin plugin) throws OpenStegoException
Constructor using the default configuration- Parameters:
plugin
- Stego plugin to use- Throws:
OpenStegoException
-
OpenStego
public OpenStego(OpenStegoPlugin plugin, OpenStegoConfig config) throws OpenStegoException
Constructor usingOpenStegoConfig
object- Parameters:
plugin
- Stego plugin to useconfig
- OpenStegoConfig object with configuration data- Throws:
OpenStegoException
-
OpenStego
public OpenStego(OpenStegoPlugin plugin, java.util.Map<java.lang.String,java.lang.String> propMap) throws OpenStegoException
Constructor with configuration data in the form ofMap
- Parameters:
plugin
- Plugin objectpropMap
- Map containing the configuration data- Throws:
OpenStegoException
-
-
Method Detail
-
embedData
public byte[] embedData(byte[] msg, java.lang.String msgFileName, byte[] cover, java.lang.String coverFileName, java.lang.String stegoFileName) throws OpenStegoException
Method to embed the message data into the cover data- Parameters:
msg
- Message data to be embeddedmsgFileName
- Name of the message filecover
- Cover data into which message data needs to be embeddedcoverFileName
- Name of the cover filestegoFileName
- Name of the output stego file- Returns:
- Stego data containing the embedded message
- Throws:
OpenStegoException
-
embedData
public byte[] embedData(java.io.File msgFile, java.io.File coverFile, java.lang.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 embeddedcoverFile
- Cover file into which data needs to be embeddedstegoFileName
- Name of the output stego file- Returns:
- Stego data containing the embedded message
- Throws:
OpenStegoException
-
embedMark
public byte[] embedMark(byte[] sig, java.lang.String sigFileName, byte[] cover, java.lang.String coverFileName, java.lang.String stegoFileName) throws OpenStegoException
Method to embed the watermark signature data into the cover data- Parameters:
sig
- Signature data to be embeddedsigFileName
- Name of the signature filecover
- Cover data into which signature data needs to be embeddedcoverFileName
- Name of the cover filestegoFileName
- Name of the output stego file- Returns:
- Stego data containing the embedded signature
- Throws:
OpenStegoException
-
embedMark
public byte[] embedMark(java.io.File sigFile, java.io.File coverFile, java.lang.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 embeddedcoverFile
- Cover file into which data needs to be embeddedstegoFileName
- Name of the output stego file- Returns:
- Stego data containing the embedded signature
- Throws:
OpenStegoException
-
extractData
public java.util.List<?> extractData(byte[] stegoData, java.lang.String stegoFileName) throws OpenStegoException
Method to extract the message data from stego data- Parameters:
stegoData
- Stego data from which the message needs to be extractedstegoFileName
- 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 java.util.List<?> extractData(java.io.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, java.lang.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 extractedstegoFileName
- Name of the stego fileorigSigData
- Original signature data- Returns:
- Extracted watermark
- Throws:
OpenStegoException
-
extractMark
public byte[] extractMark(java.io.File stegoFile, java.io.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 extractedorigSigFile
- Original signature file- Returns:
- Extracted watermark
- Throws:
OpenStegoException
-
checkMark
public double checkMark(byte[] stegoData, java.lang.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 watermarkstegoFileName
- Name of the stego fileorigSigData
- Original signature data- Returns:
- Correlation
- Throws:
OpenStegoException
-
checkMark
public double checkMark(java.io.File stegoFile, java.io.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 extractedorigSigFile
- 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, java.lang.String stegoFileName, byte[] coverData, java.lang.String coverFileName, java.lang.String diffFileName) throws OpenStegoException
Method to get difference between original cover file and the stegged file- Parameters:
stegoData
- Stego data containing the embedded datastegoFileName
- Name of the stego filecoverData
- Original cover datacoverFileName
- Name of the cover filediffFileName
- Name of the output difference file- Returns:
- Difference data
- Throws:
OpenStegoException
-
getDiff
public byte[] getDiff(java.io.File stegoFile, java.io.File coverFile, java.lang.String diffFileName) throws OpenStegoException
Method to get difference between original cover file and the stegged file- Parameters:
stegoFile
- Stego file containing the embedded datacoverFile
- Original cover filediffFileName
- 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(java.lang.String[] args)
Main method for calling openstego from command line.- Parameters:
args
- Command line arguments
-
-