Monday, February 11, 2008

Addition of Plugin Support in OpenStego

Today, I released OpenStego v0.4.0, with support for external plugins for steganographic algorithms. Most of the source files were restructured / refactored to provide this support.

New plugins can be added by implementing this abstract class from OpenStego:
  • net.sourceforge.openstego.OpenStegoPlugin
It consists of the following abstract methods:
  • getName(): This method should return a short name for the algorithm / plugin
  • getDescription(): This method should return a one line description of the algorithm / plugin
  • embedData(): This method should embed the given message into the given cover data and return back the stego data
  • extractMsgFileName(): This method should return the embedded message file name from the given stego data
  • extractData(): This method should return the embedded message data from the given stego data
  • canHandle(): This method should return true if this plugin can handle the given stego data
  • getReadableFileExtensions(): This method should return the list of file extensions that this plugin can read (where file is the coverfile)
  • getWritableFileExtensions(): This method should return the list of file extensions that this plugin can write (where file is the stegofile)
  • populateStdCmdLineOptions(): This method should populate the new command line options that it is going to handle
  • getUsage(): This method should return the help message to be displayed for this plugin
  • getEmbedOptionsUI(): This method should return an object which implements the net.sourceforge.openstego.ui.PluginEmbedOptionsUI class. This class extends the JPanel class. The object returned by this method is embedded inside the OpenStego GUI, when this plugin is selected
  • createConfig(): Three methods to create instance of OpenStegoConfig object (or its sub-class if this plugin extends the same)
OpenStego supports multiple languages and so, ideally, any new plugin added to OpenStego should also support the same. The following class can be used for handling multilingual labels:
  • net.sourceforge.openstego.util.LabelUtil
A new namespace should be added to LabelUtil class for each new plugin. Same namespace can also be used for exception messages while throwing OpenStegoException.

After implementing the OpenStegoPlugin class, create a new file named "OpenStegoPlugins.external" and put the fully qualified name of the new class in the file. Make sure that this file is put directly under the CLASSPATH while invoking the application.

That's all to adding new plugin for OpenStego.

Please refer to the "net.sourceforge.openstego.plugin.lsb" package sources for sample plugin implementation.

3 comments:

DrDanny Crain said...
This comment has been removed by the author.
DrDanny Crain said...

Hello Samir,
am using the commandline but i keep getting the error : No plugin found with the name= lsb
will be grateful for your help

Samir Vaidya said...

Try with "randomlsb". "lsb" is deprecated in newer versions.