Commit 381b1523 by Facundo Javier Gelatti

Optimize imports

1 parent 37395020
Showing 41 changed files with 163 additions and 265 deletions
package org.stegosuite.application;
import java.util.Observable;
import java.util.Observer;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.ProgressBar;
import org.stegosuite.image.embedding.EmbeddingProgress;
import java.util.Observable;
import java.util.Observer;
public class EmbeddingProgressObserver
implements Observer {
......
package org.stegosuite.application.embedding;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.stegosuite.image.format.*;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.stegosuite.image.format.BMPImage;
import org.stegosuite.image.format.GIFImage;
import org.stegosuite.image.format.ImageFormat;
import org.stegosuite.image.format.JPGImage;
import org.stegosuite.image.format.PNGImage;
/**
* Creates instances of implementations of Embedding.java
*/
......
......@@ -5,8 +5,8 @@ import org.stegosuite.image.embedding.EmbeddingProgress;
import org.stegosuite.image.embedding.png.PNGLsbMultiColorChannel;
import org.stegosuite.image.embedding.png.filter.PNGPointFilterHomogeneous;
import org.stegosuite.image.embedding.png.filter.PNGPointFilterNone;
import org.stegosuite.image.format.PNGImage;
import org.stegosuite.image.format.ImageFormat;
import org.stegosuite.image.format.PNGImage;
import org.stegosuite.model.exception.SteganoEmbedException;
import org.stegosuite.model.exception.SteganoExtractException;
import org.stegosuite.model.payload.Payload;
......
package org.stegosuite.image.embedding;
import static java.util.stream.Collectors.toMap;
import org.eclipse.swt.graphics.ImageData;
import org.stegosuite.image.format.ImageFormat;
import org.stegosuite.util.ColorUtils;
import org.stegosuite.util.ImageSwtAwtConverter;
import java.awt.Color;
import java.awt.Point;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.Arrays;
import java.util.Map;
import org.eclipse.swt.graphics.ImageData;
import org.stegosuite.image.format.ImageFormat;
import org.stegosuite.util.ColorUtils;
import org.stegosuite.util.ImageSwtAwtConverter;
import static java.util.stream.Collectors.toMap;
public class Visualizer {
......
package org.stegosuite.image.embedding.bmp;
import java.awt.Color;
import java.awt.Point;
import java.util.Iterator;
import java.util.NoSuchElementException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.stegosuite.image.embedding.EmbeddingMethod;
......@@ -24,6 +19,10 @@ import org.stegosuite.model.payload.PayloadExtractor;
import org.stegosuite.util.ByteUtils;
import org.stegosuite.util.RgbChannel;
import java.awt.*;
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
* Embed/Extract on BMP-images using data-spreading method. This method will utilise all {@code 3}
* color channels, sequentially, meaning the payload will first be embedded into the
......
package org.stegosuite.image.embedding.bmp.filter;
import java.awt.Color;
import java.awt.Point;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.stegosuite.image.embedding.point.PointFilter;
import org.stegosuite.image.format.BMPImage;
import org.stegosuite.model.exception.SteganoImageException;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.*;
import java.util.List;
/**
* Removes all points that are part of homogeneous areas of a BMP image
*/
......
package org.stegosuite.image.embedding.bmp.filter;
import java.awt.Point;
import java.util.ArrayList;
import java.util.Collection;
import org.stegosuite.image.embedding.point.PointFilter;
import org.stegosuite.image.format.BMPImage;
import java.awt.*;
import java.util.ArrayList;
import java.util.Collection;
/**
* Allows embedding into all points of a BMP image
*/
......
package org.stegosuite.image.embedding.gif;
import java.awt.Color;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import org.stegosuite.image.embedding.EmbeddingMethod;
import org.stegosuite.image.embedding.EmbeddingProgress;
import org.stegosuite.image.embedding.point.PointFilter;
......@@ -24,6 +14,13 @@ import org.stegosuite.util.ByteUtils;
import org.stegosuite.util.ColorDistance;
import org.stegosuite.util.CryptoUtils;
import java.awt.*;
import java.math.BigInteger;
import java.util.*;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
/**
* GIFShuffle embedding and extracting procedures. Source: http://www.darkside.com.au/gifshuffle/
*
......
package org.stegosuite.image.embedding.gif;
import static java.util.stream.Collectors.toList;
import java.awt.Color;
import java.awt.Point;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.StandardOpenOption;
import java.util.AbstractMap.SimpleEntry;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.NoSuchElementException;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.stegosuite.image.embedding.EmbeddingMethod;
......@@ -43,6 +23,18 @@ import org.stegosuite.model.payload.block.MessageBlock;
import org.stegosuite.util.ColorDistance;
import org.stegosuite.util.ColorUtils;
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.StandardOpenOption;
import java.util.AbstractMap.SimpleEntry;
import java.util.*;
import java.util.List;
import java.util.Map.Entry;
import static java.util.stream.Collectors.toList;
/**
* "Normal" embedding and extracting procedures for GIF image, i.e. using a sorted color table.
*/
......
package org.stegosuite.image.embedding.gif.filter;
import static java.util.function.Function.identity;
import static java.util.stream.Collectors.toMap;
import java.awt.Color;
import java.awt.Point;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.IntStream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.stegosuite.image.embedding.point.PointFilter;
......@@ -21,6 +7,16 @@ import org.stegosuite.image.format.GIFImage;
import org.stegosuite.model.exception.SteganoImageException;
import org.stegosuite.util.ColorDistance;
import java.awt.*;
import java.io.File;
import java.util.*;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.IntStream;
import static java.util.function.Function.identity;
import static java.util.stream.Collectors.toMap;
/**
* Removes all points that are part of homogeneous areas of a GIF image
*/
......
package org.stegosuite.image.embedding.gif.filter;
import java.awt.Point;
import java.util.ArrayList;
import java.util.Collection;
import org.stegosuite.image.embedding.point.PointFilter;
import org.stegosuite.image.format.GIFImage;
import java.awt.*;
import java.util.ArrayList;
import java.util.Collection;
/**
* Allows embedding into all points of a GIF image
*/
......
package org.stegosuite.image.embedding.jpg;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.StandardOpenOption;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.stegosuite.image.embedding.EmbeddingMethod;
......@@ -28,6 +18,10 @@ import org.stegosuite.model.payload.block.FileBlock;
import org.stegosuite.model.payload.block.MessageBlock;
import org.stegosuite.util.FileUtils;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.StandardOpenOption;
public class JPGF5
extends EmbeddingMethod<JPGImage> {
......
package org.stegosuite.image.embedding.jpg.filter;
import java.awt.Point;
import java.util.ArrayList;
import java.util.Collection;
import org.stegosuite.image.embedding.point.PointFilter;
import org.stegosuite.image.format.JPGImage;
import java.awt.*;
import java.util.ArrayList;
import java.util.Collection;
/**
* Allows embedding into all points of a GIF image
*/
......
package org.stegosuite.image.embedding.png;
import java.awt.Color;
import java.awt.Point;
import java.util.Iterator;
import java.util.NoSuchElementException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.stegosuite.image.embedding.EmbeddingMethod;
......@@ -24,6 +19,10 @@ import org.stegosuite.model.payload.PayloadExtractor;
import org.stegosuite.util.ByteUtils;
import org.stegosuite.util.RgbChannel;
import java.awt.*;
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
* Embed/Extract on PNG-images using data-spreading method. This method will utilise all {@code 3}
* color channels, sequentially, meaning the payload will first be embedded into the
......
package org.stegosuite.image.embedding.png.filter;
import java.awt.Color;
import java.awt.Point;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.stegosuite.image.embedding.point.PointFilter;
import org.stegosuite.image.format.PNGImage;
import org.stegosuite.model.exception.SteganoImageException;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.*;
import java.util.List;
/**
* Removes all points that are part of homogeneous areas of a PNG image
*/
......
package org.stegosuite.image.embedding.png.filter;
import java.awt.Point;
import java.util.ArrayList;
import java.util.Collection;
import org.stegosuite.image.embedding.point.PointFilter;
import org.stegosuite.image.format.PNGImage;
import java.awt.*;
import java.util.ArrayList;
import java.util.Collection;
/**
* Allows embedding into all points of a PNG image
*/
......
package org.stegosuite.image.embedding.point;
import java.awt.Point;
import java.util.Collection;
import org.stegosuite.image.format.ImageFormat;
import java.awt.*;
import java.util.Collection;
/**
* A filter can be applied to prevent certain points from being generated by the PointGenerator
*/
......
package org.stegosuite.image.embedding.point;
import java.awt.Point;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Random;
import org.stegosuite.image.format.ImageFormat;
import org.stegosuite.util.CryptoUtils;
import java.awt.*;
import java.util.*;
import java.util.List;
/**
* This class is used for data spreading. It generates random 2D points using a key as a seed. Use
* the same key to generate the same sequence of points. All generated points are limited to the
......
package org.stegosuite.image.format;
import java.awt.image.BufferedImage;
import java.util.Arrays;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.stegosuite.util.ColorUtils;
import java.awt.image.BufferedImage;
import java.util.Arrays;
import java.util.List;
/**
* Represent BMP-images and provides methods to manipulate BMP pixels
*
......
package org.stegosuite.image.format;
import static java.util.stream.Collectors.toSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.stegosuite.model.exception.SteganoImageException;
import org.stegosuite.util.ColorDistance;
import org.stegosuite.util.ColorUtils;
import java.awt.Color;
import javax.imageio.*;
import javax.imageio.stream.ImageOutputStream;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.awt.image.IndexColorModel;
import java.awt.image.WritableRaster;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.imageio.IIOImage;
import javax.imageio.ImageIO;
import javax.imageio.ImageTypeSpecifier;
import javax.imageio.ImageWriteParam;
import javax.imageio.ImageWriter;
import javax.imageio.stream.ImageOutputStream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.stegosuite.model.exception.SteganoImageException;
import org.stegosuite.util.ColorDistance;
import org.stegosuite.util.ColorUtils;
import static java.util.stream.Collectors.toSet;
public class GIFImage
extends ImageFormat {
......
package org.stegosuite.image.format;
import java.io.File;
import org.stegosuite.model.exception.SteganoImageException;
import java.io.File;
public class JPGImage
extends ImageFormat {
......
package org.stegosuite.image.format;
import java.awt.image.BufferedImage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.awt.image.BufferedImage;
/**
* Represent PNG-images and provides methods to manipulate PNG pixels
*
......
......@@ -7,8 +7,7 @@
package org.stegosuite.image.jpgtemp.james; // westfeld
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.*;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
......
......@@ -19,17 +19,15 @@
// password switch
package org.stegosuite.image.jpgtemp.james;
import java.awt.Frame;
import java.awt.Image;
import java.awt.MediaTracker;
import org.stegosuite.image.jpgtemp.net.f5.crypt.F5Random;
import org.stegosuite.image.jpgtemp.net.f5.crypt.Permutation;
import java.awt.*;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.stegosuite.image.jpgtemp.net.f5.crypt.F5Random;
import org.stegosuite.image.jpgtemp.net.f5.crypt.Permutation;
/**
* JpegEncoder - The JPEG main program which performs a jpeg compression of an image.
*/
......
......@@ -14,8 +14,7 @@
package org.stegosuite.image.jpgtemp.james;
import java.awt.AWTException;
import java.awt.Image;
import java.awt.*;
import java.awt.image.PixelGrabber;
/**
......
package org.stegosuite.image.jpgtemp.net.f5;
import java.awt.Image;
import java.awt.Toolkit;
import org.stegosuite.image.jpgtemp.james.JpegEncoder;
import java.awt.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import org.stegosuite.image.jpgtemp.james.JpegEncoder;
public class Embed {
public static void main(final String args[]) {
......
package org.stegosuite.image.jpgtemp.net.f5;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.stegosuite.image.jpgtemp.net.f5.crypt.F5Random;
import org.stegosuite.image.jpgtemp.net.f5.crypt.Permutation;
import org.stegosuite.image.jpgtemp.net.f5.ortega.HuffmanDecode;
import org.stegosuite.model.exception.SteganoKeyException;
import java.io.*;
public class Extract {
private static File f; // carrier file
......
package org.stegosuite.image.jpgtemp.net.f5.image;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.*;
import java.awt.image.MemoryImageSource;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
......
......@@ -33,7 +33,8 @@ package org.stegosuite.image.jpgtemp.net.f5.ortega;
// constructor changed to byte array parameter
// added method rawDecode
//
import java.awt.TextArea;
import java.awt.*;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
......
package org.stegosuite.model.payload;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.stegosuite.model.exception.SteganoEncryptionException;
......@@ -13,6 +9,10 @@ import org.stegosuite.util.ByteUtils;
import org.stegosuite.util.CompressionUtils;
import org.stegosuite.util.CryptoUtils;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Arrays;
public class PayloadExtractor {
private static final Logger LOG = LoggerFactory.getLogger(PayloadExtractor.class);
......
package org.stegosuite.model.payload.block;
import org.stegosuite.util.ByteUtils;
import org.stegosuite.util.FileUtils;
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
......@@ -8,9 +11,6 @@ import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
import org.stegosuite.util.ByteUtils;
import org.stegosuite.util.FileUtils;
/**
* This block contains the contents of a file as well as its file name
*/
......
package org.stegosuite.ui.gui;
import java.util.Optional;
import java.util.ResourceBundle;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DropTarget;
import org.eclipse.swt.dnd.DropTargetAdapter;
import org.eclipse.swt.dnd.DropTargetEvent;
import org.eclipse.swt.dnd.FileTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.dnd.*;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.graphics.Cursor;
......@@ -20,19 +12,7 @@ import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.program.Program;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.ProgressBar;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.stegosuite.application.EmbeddingProgressObserver;
......@@ -46,6 +26,9 @@ import org.stegosuite.model.exception.SteganoExtractException;
import org.stegosuite.model.payload.block.FileBlock;
import org.stegosuite.ui.gui.ImageContainer.ImageState;
import java.util.Optional;
import java.util.ResourceBundle;
/**
* Contains the GUI for embedding/extracting data.
*/
......
package org.stegosuite.ui.gui;
import java.lang.reflect.Method;
import java.util.Objects;
import java.util.ResourceBundle;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
import java.lang.reflect.Method;
import java.util.Objects;
import java.util.ResourceBundle;
/**
* Contains methods for creating the GUI-elements and setting their default parameters.
*/
......
package org.stegosuite.ui.gui;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.widgets.Composite;
import java.util.HashMap;
import java.util.Map;
public class ImageContainer {
public enum ImageState {
......
package org.stegosuite.util;
import java.awt.Color;
import java.awt.*;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
......
package org.stegosuite.util;
import static java.util.function.Function.identity;
import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toMap;
import static java.util.stream.Collectors.toSet;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.awt.image.WritableRaster;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import static java.util.function.Function.identity;
import static java.util.stream.Collectors.*;
/**
* Utility class that provides various color-related methods such as color transformations, color
* comparisons, color sorting, etc.
......
package org.stegosuite.util;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.SecretKeySpec;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
......@@ -9,13 +15,6 @@ import java.security.spec.KeySpec;
import java.util.Arrays;
import java.util.Random;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.SecretKeySpec;
/**
*
* Some code in this class taken from: http://stackoverflow.com/a/992413/4862922
......
package org.stegosuite.util;
import java.awt.image.BufferedImage;
import java.awt.image.ComponentColorModel;
import java.awt.image.DirectColorModel;
import java.awt.image.IndexColorModel;
import java.awt.image.WritableRaster;
import java.util.stream.IntStream;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.PaletteData;
import org.eclipse.swt.graphics.RGB;
import java.awt.image.*;
import java.util.stream.IntStream;
public class ImageSwtAwtConverter {
/** Private constructor to hide the implicit public one */
......
package org.stegosuite.util;
import java.awt.Color;
import java.awt.*;