trex.Algo
Class StegoAlgoFFT

java.lang.Object
  |
  +--trex.Algo.StegoAlgo
        |
        +--trex.Algo.StegoAlgoFFT

public class StegoAlgoFFT
extends StegoAlgo

This algorithm stores data in the frequency domain.

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

Field Summary
 
Fields inherited from class trex.Algo.StegoAlgo
passPhrase
 
Constructor Summary
StegoAlgoFFT()
           
 
Method Summary
protected  javax.media.jai.PlanarImage cropImage(Object img, int width, int height)
          After the inverse DFT, the image can be cropped to the original image's size with this function.
 int defaultAmplification()
          Return the default amplification of this algorithm for the combinedPanel.
protected  javax.media.jai.PlanarImage embedData(String data, javax.media.jai.PlanarImage img, int w, int h)
          Embed data into image.
protected  String extractData(javax.media.jai.PlanarImage img, int w, int h)
          Get actual data from image.
protected  javax.media.jai.PlanarImage FormatTransformed(javax.media.jai.PlanarImage src, BufferedImage template)
          Reformat the image to "TYPE_BYTE" so it can be displayed.
 Component getConfigDialog()
          Return the config dialog.
 String getDecrypted(ImageIcon img)
          Get embedded data from image.
 ImageIcon getEncrypted(String data, ImageIcon img)
          This method is called from the application's StegData object.
 String getInfo()
          Static info.
 boolean hasConfigDialog()
          Algorithm has a config dialog.
 boolean hasPassPhrase()
          Algorithm doesn't have a pass phrase - uses a config dialog instead.
 boolean pictureLargeEnough(ImageIcon img, String data)
          Algorithm currently does not know how big an image has to be.
protected  javax.media.jai.PlanarImage squaredImage(Object img, int width, int height)
          As FFT needs Images of the dimension n^2 x m^2 for any natural n and m, the image is converted to an image of that size beforehand with this method.
 boolean validConfig()
          Config is valid when it's "I know it's senseless" button is checked.
 
Methods inherited from class trex.Algo.StegoAlgo
setPassPhrase
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StegoAlgoFFT

public StegoAlgoFFT()
Method Detail

pictureLargeEnough

public boolean pictureLargeEnough(ImageIcon img,
                                  String data)
Algorithm currently does not know how big an image has to be.

Specified by:
pictureLargeEnough in class StegoAlgo
Parameters:
img - Image to hide data in
data - data to hide
Returns:
true.

hasPassPhrase

public boolean hasPassPhrase()
Algorithm doesn't have a pass phrase - uses a config dialog instead.

Specified by:
hasPassPhrase in class StegoAlgo
Returns:
false.

hasConfigDialog

public boolean hasConfigDialog()
Algorithm has a config dialog.

Specified by:
hasConfigDialog in class StegoAlgo
Returns:
true.

validConfig

public boolean validConfig()
Config is valid when it's "I know it's senseless" button is checked.

Specified by:
validConfig in class StegoAlgo
Returns:
config validity.

extractData

protected String extractData(javax.media.jai.PlanarImage img,
                             int w,
                             int h)
                      throws DecryptImpossibleException
Get actual data from image.

Parameters:
img - (idft) Image to get data from.
w - Image width
h - Image height
Returns:
contained string.
DecryptImpossibleException

getDecrypted

public String getDecrypted(ImageIcon img)
                    throws DecryptImpossibleException
Get embedded data from image.

Specified by:
getDecrypted in class StegoAlgo
Parameters:
img - Image to get data from.
Returns:
Contained data.
DecryptImpossibleException

getConfigDialog

public Component getConfigDialog()
Return the config dialog. Construct it beforehand if necessary.

Specified by:
getConfigDialog in class StegoAlgo
Returns:
An instance of the config dialog.
See Also:
StegoAlgo.hasConfigDialog(), StegoAlgo.hasPassPhrase()

getInfo

public String getInfo()
Static info.

Specified by:
getInfo in class StegoAlgo
Returns:
"LSB in frequency domain (Fourier transformed)"

FormatTransformed

protected javax.media.jai.PlanarImage FormatTransformed(javax.media.jai.PlanarImage src,
                                                        BufferedImage template)
Reformat the image to "TYPE_BYTE" so it can be displayed.

Parameters:
src - Image to transform.
template - Image to take sample- and color model from.
Returns:
The transformed image.

embedData

protected javax.media.jai.PlanarImage embedData(String data,
                                                javax.media.jai.PlanarImage img,
                                                int w,
                                                int h)
Embed data into image. Currently a NOP.

Parameters:
data - Data to embed.
img - Envelope image.
w - Image width.
h - Image height.
Returns:
Stego-image containing the data.

squaredImage

protected javax.media.jai.PlanarImage squaredImage(Object img,
                                                   int width,
                                                   int height)
As FFT needs Images of the dimension n^2 x m^2 for any natural n and m, the image is converted to an image of that size beforehand with this method. It utilizes JAI's BorderExtenderWrap class, as Fourier transformation inherently works on periodic data. After embedding and idft, the image is cropped to it's original size with the cropImage(java.lang.Object, int, int) function.

Parameters:
img - Image to resize. Any format recognized by JAI is allowed.
width - Original image width.
height - Original image height.
Returns:
The resized image.

cropImage

protected javax.media.jai.PlanarImage cropImage(Object img,
                                                int width,
                                                int height)
After the inverse DFT, the image can be cropped to the original image's size with this function.

Parameters:
img - Image to crop.
width - New image width.
height - New image height.
Returns:
The cropped Image.

getEncrypted

public ImageIcon getEncrypted(String data,
                              ImageIcon img)
This method is called from the application's StegData object. It calls the JAI DFT/IDFT operations and starts the data embedding via the embedData(java.lang.String, javax.media.jai.PlanarImage, int, int) method.

Specified by:
getEncrypted in class StegoAlgo
Parameters:
data - Data to hide.
img - Envelope image.
Returns:
The ImageIcon hiding the data.

defaultAmplification

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

Specified by:
defaultAmplification in class StegoAlgo
Returns:
Default amplification: 255.