Package com.openstego.desktop
Class OpenStegoPlugin<C extends OpenStegoConfig>
- java.lang.Object
-
- com.openstego.desktop.OpenStegoPlugin<C>
-
- Type Parameters:
C
- Config class for the plugin
- Direct Known Subclasses:
DataHidingPlugin
,WatermarkingPlugin
public abstract class OpenStegoPlugin<C extends OpenStegoConfig> extends Object
Abstract class for stego plugins for OpenStego. Abstract methods need to be implemented to add support for more steganographic algorithms
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OpenStegoPlugin.Purpose
Enumeration of plugin purposes
-
Constructor Summary
Constructors Constructor Description OpenStegoPlugin()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods 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 signatureprotected abstract C
createConfig()
Method to create default configuration data (specific to this plugin)protected abstract C
createConfig(CmdLineOptions options)
Method to create configuration data (specific to this plugin) based on the command-line optionsabstract byte[]
embedData(byte[] msg, String msgFileName, byte[] cover, String coverFileName, String stegoFileName)
Method to embed the message into the cover dataabstract byte[]
extractData(byte[] stegoData, String stegoFileName, byte[] origSigData)
Method to extract the message from the stego dataabstract String
extractMsgFileName(byte[] stegoData, String stegoFileName)
Method to extract the message file name from the stego dataabstract byte[]
generateSignature()
Method to generate the signature data.C
getConfig()
Method to get current configuration dataabstract String
getDescription()
Gives a short description of the pluginabstract byte[]
getDiff(byte[] stegoData, String stegoFileName, byte[] coverData, String coverFileName, String diffFileName)
Method to get difference between original cover file and the stegged filePluginEmbedOptionsUI
getEmbedOptionsUI(OpenStegoFrame stegoFrame)
Method to get the UI object for "Embed" action specific to this plugin.abstract double
getHighWatermarkLevel()
Method to get correlation value which above which it can be considered that watermark strength is highabstract double
getLowWatermarkLevel()
Method to get correlation value which below which it can be considered that watermark strength is lowabstract String
getName()
Gives the name of the pluginabstract List<OpenStegoPlugin.Purpose>
getPurposes()
Gives the purpose(s) of the pluginString
getPurposesLabel()
Gives the display label for purpose(s) of the pluginabstract List<String>
getReadableFileExtensions()
Method to get the list of supported file extensions for readingabstract String
getUsage()
Method to get the usage details of the pluginabstract double
getWatermarkCorrelation(byte[] origSigData, byte[] watermarkData)
Method to check the correlation between original signature and the extracted watermarkabstract List<String>
getWritableFileExtensions()
Method to get the list of supported file extensions for writingabstract void
populateStdCmdLineOptions(CmdLineOptions options)
Method to populate the standard command-line options used by this pluginvoid
resetConfig()
Method to reset configuration data to defaultvoid
resetConfig(CmdLineOptions options)
Method to reset configuration data to default
-
-
-
Field Detail
-
config
protected C extends OpenStegoConfig config
Configuration data to be used while embedding / extracting data
-
-
Method Detail
-
getName
public abstract String getName()
Gives the name of the plugin- Returns:
- Name of the plugin
-
getPurposes
public abstract List<OpenStegoPlugin.Purpose> getPurposes()
Gives the purpose(s) of the plugin- Returns:
- Purpose(s) of the plugin
-
getDescription
public abstract String getDescription()
Gives a short description of the plugin- Returns:
- Short description of the plugin
-
getPurposesLabel
public final String getPurposesLabel()
Gives the display label for purpose(s) of the plugin- Returns:
- Display lable for purpose(s) of the plugin
-
embedData
public abstract byte[] embedData(byte[] msg, String msgFileName, byte[] cover, String coverFileName, String stegoFileName) throws OpenStegoException
Method to embed the message into the cover data- Parameters:
msg
- Message to be embeddedmsgFileName
- Name of the message file. If this value is provided, then the filename should be embedded in the cover datacover
- Cover data into which message needs to be embeddedcoverFileName
- Name of the cover filestegoFileName
- Name of the output stego file- Returns:
- Stego data containing the message
- Throws:
OpenStegoException
- Processing issues
-
extractMsgFileName
public abstract String extractMsgFileName(byte[] stegoData, String stegoFileName) throws OpenStegoException
Method to extract the message file name from the stego data- Parameters:
stegoData
- Stego data containing the messagestegoFileName
- Name of the stego file- Returns:
- Message file name
- Throws:
OpenStegoException
- Processing issues
-
extractData
public abstract byte[] extractData(byte[] stegoData, String stegoFileName, byte[] origSigData) throws OpenStegoException
Method to extract the message from the stego data- Parameters:
stegoData
- Stego data containing the messagestegoFileName
- Name of the stego fileorigSigData
- Optional signature data file for watermark- Returns:
- Extracted message
- Throws:
OpenStegoException
- Processing issues
-
generateSignature
public abstract byte[] generateSignature() throws OpenStegoException
Method to generate the signature data. This method needs to be implemented only if the purpose of the plugin is Watermarking- Returns:
- Signature data
- Throws:
OpenStegoException
- Processing issues
-
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 watermarkstegoFileName
- Name of the stego fileorigSigData
- Original signature data- Returns:
- Correlation
- Throws:
OpenStegoException
- Processing issues
-
getWatermarkCorrelation
public abstract double getWatermarkCorrelation(byte[] origSigData, byte[] watermarkData) throws OpenStegoException
Method to check the correlation between original signature and the extracted watermark- Parameters:
origSigData
- Original signature datawatermarkData
- Extracted watermark data- Returns:
- Correlation
- Throws:
OpenStegoException
- Processing issues
-
getHighWatermarkLevel
public abstract double getHighWatermarkLevel() throws OpenStegoException
Method to get correlation value which above which it can be considered that watermark strength is high- Returns:
- High watermark
- Throws:
OpenStegoException
- Processing issues
-
getLowWatermarkLevel
public abstract double getLowWatermarkLevel() throws OpenStegoException
Method to get correlation value which below which it can be considered that watermark strength is low- Returns:
- Low watermark
- Throws:
OpenStegoException
- Processing issues
-
getDiff
public abstract 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 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
- Processing issues
-
getReadableFileExtensions
public abstract List<String> getReadableFileExtensions() throws OpenStegoException
Method to get the list of supported file extensions for reading- Returns:
- List of supported file extensions for reading
- Throws:
OpenStegoException
- Processing issues
-
getWritableFileExtensions
public abstract List<String> getWritableFileExtensions() throws OpenStegoException
Method to get the list of supported file extensions for writing- Returns:
- List of supported file extensions for writing
- Throws:
OpenStegoException
- Processing issues
-
populateStdCmdLineOptions
public abstract void populateStdCmdLineOptions(CmdLineOptions options) throws OpenStegoException
Method to populate the standard command-line options used by this plugin- Parameters:
options
- Existing command-line options. Plugin-specific options will get added to this list- Throws:
OpenStegoException
- Processing issues
-
getUsage
public abstract String getUsage() throws OpenStegoException
Method to get the usage details of the plugin- Returns:
- Usage details of the plugin
- Throws:
OpenStegoException
- Processing issues
-
getEmbedOptionsUI
public PluginEmbedOptionsUI getEmbedOptionsUI(OpenStegoFrame stegoFrame)
Method to get the UI object for "Embed" action specific to this plugin. This UI object will be embedded inside the main OpenStego GUI- Parameters:
stegoFrame
- Reference to the parent OpenStegoFrame object- Returns:
- UI object specific to this plugin for "Embed" action
-
getConfig
public C getConfig()
Method to get current configuration data- Returns:
- Configuration data
-
resetConfig
public void resetConfig() throws OpenStegoException
Method to reset configuration data to default- Throws:
OpenStegoException
- Processing issues
-
resetConfig
public void resetConfig(CmdLineOptions options) throws OpenStegoException
Method to reset configuration data to default- Parameters:
options
- Command-line options- Throws:
OpenStegoException
- Processing issues
-
createConfig
protected abstract C createConfig() throws OpenStegoException
Method to create default configuration data (specific to this plugin)- Returns:
- Configuration data
- Throws:
OpenStegoException
- Processing issues
-
createConfig
protected abstract C createConfig(CmdLineOptions options) throws OpenStegoException
Method to create configuration data (specific to this plugin) based on the command-line options- Parameters:
options
- Command-line options- Returns:
- Configuration data
- Throws:
OpenStegoException
- Processing issues
-
-