Class OpenStegoPlugin

  • Direct Known Subclasses:
    DataHidingPlugin, WatermarkingPlugin

    public abstract class OpenStegoPlugin
    extends java.lang.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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected OpenStegoConfig config
      Configuration data to be used while embedding / extracting data
    • Constructor Summary

      Constructors 
      Constructor Description
      OpenStegoPlugin()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract boolean canHandle​(byte[] stegoData)
      Method to find out whether given stego data can be handled by this plugin or not
      double checkMark​(byte[] stegoData, java.lang.String stegoFileName, byte[] origSigData)
      Method to check the correlation for the given image and the original signature
      OpenStegoConfig createConfig()
      Method to create default configuration data (specific to this plugin)
      OpenStegoConfig createConfig​(CmdLineOptions options)
      Method to create configuration data (specific to this plugin) based on the command-line options
      OpenStegoConfig createConfig​(java.util.Map<java.lang.String,​java.lang.String> propMap)
      Method to create configuration data (specific to this plugin) based on the property map
      abstract byte[] embedData​(byte[] msg, java.lang.String msgFileName, byte[] cover, java.lang.String coverFileName, java.lang.String stegoFileName)
      Method to embed the message into the cover data
      abstract byte[] extractData​(byte[] stegoData, java.lang.String stegoFileName, byte[] origSigData)
      Method to extract the message from the stego data
      abstract java.lang.String extractMsgFileName​(byte[] stegoData, java.lang.String stegoFileName)
      Method to extract the message file name from the stego data
      abstract byte[] generateSignature()
      Method to generate the signature data.
      OpenStegoConfig getConfig()
      Get method for config
      abstract java.lang.Class<? extends OpenStegoConfig> getConfigClass()
      Method to get the configuration class specific to this plugin
      abstract java.lang.String getDescription()
      Gives a short description of the plugin
      abstract byte[] 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 file
      abstract PluginEmbedOptionsUI getEmbedOptionsUI​(OpenStegoUI stegoUI)
      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 high
      abstract double getLowWatermarkLevel()
      Method to get correlation value which below which it can be considered that watermark strength is low
      abstract java.lang.String getName()
      Gives the name of the plugin
      abstract java.util.List<OpenStegoPlugin.Purpose> getPurposes()
      Gives the purpose(s) of the plugin
      java.lang.String getPurposesLabel()
      Gives the display label for purpose(s) of the plugin
      abstract java.util.List<java.lang.String> getReadableFileExtensions()
      Method to get the list of supported file extensions for reading
      abstract java.lang.String getUsage()
      Method to get the usage details of the plugin
      abstract double getWatermarkCorrelation​(byte[] origSigData, byte[] watermarkData)
      Method to check the correlation between original signature and the extracted watermark
      abstract java.util.List<java.lang.String> getWritableFileExtensions()
      Method to get the list of supported file extensions for writing
      abstract void populateStdCmdLineOptions​(CmdLineOptions options)
      Method to populate the standard command-line options used by this plugin
      • Methods inherited from class java.lang.Object

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

      • config

        protected OpenStegoConfig config
        Configuration data to be used while embedding / extracting data
    • Constructor Detail

      • OpenStegoPlugin

        public OpenStegoPlugin()
    • Method Detail

      • getName

        public abstract java.lang.String getName()
        Gives the name of the plugin
        Returns:
        Name of the plugin
      • getPurposes

        public abstract java.util.List<OpenStegoPlugin.Purpose> getPurposes()
        Gives the purpose(s) of the plugin
        Returns:
        Purpose(s) of the plugin
      • getDescription

        public abstract java.lang.String getDescription()
        Gives a short description of the plugin
        Returns:
        Short description of the plugin
      • getPurposesLabel

        public final java.lang.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,
                                         java.lang.String msgFileName,
                                         byte[] cover,
                                         java.lang.String coverFileName,
                                         java.lang.String stegoFileName)
                                  throws OpenStegoException
        Method to embed the message into the cover data
        Parameters:
        msg - Message to be embedded
        msgFileName - Name of the message file. If this value is provided, then the filename should be embedded in the cover data
        cover - Cover data into which message needs to be embedded
        coverFileName - Name of the cover file
        stegoFileName - Name of the output stego file
        Returns:
        Stego data containing the message
        Throws:
        OpenStegoException
      • extractMsgFileName

        public abstract java.lang.String extractMsgFileName​(byte[] stegoData,
                                                            java.lang.String stegoFileName)
                                                     throws OpenStegoException
        Method to extract the message file name from the stego data
        Parameters:
        stegoData - Stego data containing the message
        stegoFileName - Name of the stego file
        Returns:
        Message file name
        Throws:
        OpenStegoException
      • extractData

        public abstract byte[] extractData​(byte[] stegoData,
                                           java.lang.String stegoFileName,
                                           byte[] origSigData)
                                    throws OpenStegoException
        Method to extract the message from the stego data
        Parameters:
        stegoData - Stego data containing the message
        stegoFileName - Name of the stego file
        origSigData - Optional signature data file for watermark
        Returns:
        Extracted message
        Throws:
        OpenStegoException
      • 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
      • checkMark

        public final 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 watermark
        stegoFileName - Name of the stego file
        origSigData - Original signature data
        Returns:
        Correlation
        Throws:
        OpenStegoException
      • 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 data
        watermarkData - Extracted watermark data
        Returns:
        Correlation
        Throws:
        OpenStegoException
      • 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
      • 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
      • getDiff

        public abstract 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 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
      • canHandle

        public abstract boolean canHandle​(byte[] stegoData)
        Method to find out whether given stego data can be handled by this plugin or not
        Parameters:
        stegoData - Stego data containing the message
        Returns:
        Boolean indicating whether the stego data can be handled by this plugin or not
      • getReadableFileExtensions

        public abstract java.util.List<java.lang.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
      • getWritableFileExtensions

        public abstract java.util.List<java.lang.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
      • 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
      • getUsage

        public abstract java.lang.String getUsage()
                                           throws OpenStegoException
        Method to get the usage details of the plugin
        Returns:
        Usage details of the plugin
        Throws:
        OpenStegoException
      • getEmbedOptionsUI

        public abstract PluginEmbedOptionsUI getEmbedOptionsUI​(OpenStegoUI stegoUI)
                                                        throws OpenStegoException
        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:
        stegoUI - Reference to the parent OpenStegoUI object
        Returns:
        UI object specific to this plugin for "Embed" action
        Throws:
        OpenStegoException
      • getConfigClass

        public abstract java.lang.Class<? extends OpenStegoConfig> getConfigClass()
        Method to get the configuration class specific to this plugin
        Returns:
        Configuration class specific to this plugin
      • createConfig

        public final OpenStegoConfig createConfig​(java.util.Map<java.lang.String,​java.lang.String> propMap)
                                           throws OpenStegoException
        Method to create configuration data (specific to this plugin) based on the property map
        Parameters:
        propMap - Property map
        Returns:
        Configuration data
        Throws:
        OpenStegoException
      • getConfig

        public final OpenStegoConfig getConfig()
        Get method for config
        Returns:
        Configuration data