trex.Algo
Class StegoAlgo

java.lang.Object
  |
  +--trex.Algo.StegoAlgo
Direct Known Subclasses:
StegoAlgoFFT, StegoAlgoRGB

public abstract class StegoAlgo
extends Object

This class defines the interface of steganography algorithms.

Version:
$Revision: 1.16 $
Author:
Bastian Friedrich <bastian@bastian-friedrich.de>

Field Summary
protected  String passPhrase
          Algorithm's current pass phrase.
 
Constructor Summary
StegoAlgo()
           
 
Method Summary
abstract  int defaultAmplification()
          Return the default amplification of this algorithm for the combinedPanel.
abstract  Component getConfigDialog()
          If hasConfigDialog() is true, return a panel with the config dialog.
abstract  String getDecrypted(ImageIcon img)
          Return the string contained in the ImageIcon.
abstract  ImageIcon getEncrypted(String data, ImageIcon img)
          Return an image hiding the data.
abstract  String getInfo()
          Return an info string about this algorithm.
abstract  boolean hasConfigDialog()
          Return whether this algorithm has a config dialog.
abstract  boolean hasPassPhrase()
          Return whether this algorithm needs a pass phrase.
abstract  boolean pictureLargeEnough(ImageIcon img, String data)
          Return whether the passed picture is large enough to carry the data
 void setPassPhrase(String pp)
          Set new pass phrase.
abstract  boolean validConfig()
          Return whether the config from pass phrase or config dialog are valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

passPhrase

protected String passPhrase
Algorithm's current pass phrase.

Constructor Detail

StegoAlgo

public StegoAlgo()
Method Detail

hasConfigDialog

public abstract boolean hasConfigDialog()
Return whether this algorithm has a config dialog.

Returns:
Config dialog availability.

hasPassPhrase

public abstract boolean hasPassPhrase()
Return whether this algorithm needs a pass phrase. Note that no pass phrase dialog is shown when the algorithm has a config dialog.

Returns:
Pass phrase necessity.

getInfo

public abstract String getInfo()
Return an info string about this algorithm. Should contain the algorithm's name and may include additional information.

Returns:
Info string.

getConfigDialog

public abstract Component getConfigDialog()
If hasConfigDialog() is true, return a panel with the config dialog. Note that this dialog has to include a potential pass phrase request, as hasPassPhrase() is ignored when there is a config dialog. Should return null when there is no config dialog.

Returns:
Panel containing config dialog.
See Also:
hasConfigDialog(), hasPassPhrase()

validConfig

public abstract boolean validConfig()
Return whether the config from pass phrase or config dialog are valid.

Returns:
Config validity.

setPassPhrase

public void setPassPhrase(String pp)
Set new pass phrase.

Parameters:
pp - New pass phrase.

getDecrypted

public abstract String getDecrypted(ImageIcon img)
                             throws DecryptImpossibleException
Return the string contained in the ImageIcon.

Parameters:
img - The image hiding the data.
Returns:
The hidden String.
DecryptImpossibleException

getEncrypted

public abstract ImageIcon getEncrypted(String data,
                                       ImageIcon img)
Return an image hiding the data.

Parameters:
data - Data to hide.
img - Envelope image.
Returns:
The ImageIcon hiding the data.

pictureLargeEnough

public abstract boolean pictureLargeEnough(ImageIcon img,
                                           String data)
Return whether the passed picture is large enough to carry the data

Parameters:
img - Image to hide data in
data - data to hide
Returns:
A boolean indicating whether the image is large enough for the data

defaultAmplification

public abstract int defaultAmplification()
Return the default amplification of this algorithm for the combinedPanel.

Returns:
Default amplification.