import [Link].
*;
import [Link].*;
import [Link].*;
public class Home extends JFrame implements ActionListener
{
private JButton compose,breakmsg;
Home()
{
super("Steganography");
Container con=getContentPane();
[Link](null);
compose=new JButton("Compose");
[Link](this);
[Link](300,350,150,50);
breakmsg=new JButton("Break");
[Link](this);
[Link](550,350,150,50);
[Link](compose);
[Link](breakmsg);
}
public void actionPerformed(ActionEvent ae)
{
if([Link]()==compose)
{
[Link]();
ComposePage cp=new ComposePage();
[Link](1035,790);
[Link](true);
}
if([Link]()==breakmsg)
{
[Link]();
BreakPage bp=new BreakPage();
[Link](1035,790);
[Link](true);
}
}
public static void main(String args[])
{
Home h=new Home();
[Link](1035,790);
[Link](true);
}
}
import [Link].*;
import [Link].*;
import [Link].*;
public class Home2 extends JFrame implements ActionListener
{
private JButton compose,breakmsg;
Home()
{
super("Steganography");
Container con=getContentPane();
[Link](null);
compose=new JButton("Compose");
[Link](this);
[Link](300,350,150,50);
breakmsg=new JButton("Break");
[Link](this);
[Link](550,350,150,50);
[Link](compose);
[Link](breakmsg);
}
public void actionPerformed(ActionEvent ae)
{
if([Link]()==compose)
{
[Link]();
ComposePage cp=new ComposePage();
[Link](1035,790);
[Link](true);
}
if([Link]()==breakmsg)
{
[Link]();
BreakPage bp=new BreakPage();
[Link](1035,790);
[Link](true);
}
}
public static void main(String args[])
{
Home h=new Home();
[Link](1035,790);
[Link](true);
}
}
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
//import [Link].*;
public class BreakPage extends JFrame implements ActionListener
{
private JLabel code_label,picture_label;
private JTextField code_text,picture_text;
private JButton picture_load_button,break_button,home_button;
String filepath="",secret_code="",secret_info="";
Container con=null;
JLabel jl;
byte img_byte[]=new byte[6000];
FileDialog fd;
//////// Variables for creating an image from an integer
array ///////////////////////////
Image img;
Dimension d;
int iw,ih;
int w=10,h=10;
int pix[];
int hist[]=new int[256];
int t[];
int max_hist=0;
boolean ok;
Image newimg;
int key,k;
String user_key="";
BreakPage()
{
super("Break");
con=getContentPane();
[Link](null);
code_label=new JLabel("Security Code");
code_label.setBounds(230,200,150,50);
code_text=new JTextField(200);
code_text.setBounds(400,200,250,40);
picture_label=new JLabel("Picture");
picture_label.setBounds(230,300,250,40);
picture_text=new JTextField(200);
picture_text.setBounds(400,300,250,50);
picture_load_button=new JButton("Load");
picture_load_button.setBounds(700,300,150,30);
picture_load_button.addActionListener(this);
break_button=new JButton("Break");
break_button.setBounds(400,400,150,30);
break_button.addActionListener(this);
home_button=new JButton("Home");
home_button.setBounds(700,400,150,30);
home_button.addActionListener(this);
jl=new JLabel();
[Link](700,500,150,30);
fd=new FileDialog(new JFrame());
[Link](code_label);
[Link](code_text);
[Link](picture_label);
[Link](picture_text);
[Link](picture_load_button);
[Link](break_button);
[Link](home_button);
[Link](jl);
}
public void actionPerformed(ActionEvent ae)
{
if([Link]()==picture_load_button)
{
[Link](true);
filepath=[Link]()+[Link]();
picture_text.setText(filepath);
}else if([Link]()==break_button)
{
String sc=code_text.getText();
int star_flag=0;
String star_value="";
for(int i=0;i<[Link]();i++)
{
if([Link](i)=='*')
star_flag=1;
if(star_flag==1&& star_flag!=2)
{
i=++i;
star_value=[Link](i);
star_flag=2;
}
}
[Link]("star value
er:"+[Link](star_value));
k=[Link]()+1+[Link](star_value);
try{
img=[Link];
key=k;
[Link]("key ckeck in temp:"+key);
user_key=sc;
Container con=getContentPane();
iw=[Link](null);
ih=[Link](null);
pix=new int[iw*ih];
t=new int[iw*ih];
PixelGrabber pg=new PixelGrabber(img,0,0,iw,ih,pix,0,iw);
ColorModel cm=[Link]();
int ww=[Link]();
int hh=[Link]();
[Link]();
int secret_check[]=new int[[Link]()];
byte sc_byte[]=[Link]();
for(int i=0;i<[Link]();i++)
secret_check[i]=sc_byte[i];
int secret_info[]=new int[key];
byte b[]=new byte[key];
int j=0,loop=0,flag=0,star2_flag=0;
[Link]("hi welcome");
for(int i=0;i<[Link];i++)
{
if((i%20)==0 && k>0 && flag==0)
{
[Link]("one");
if(loop<user_key.length() &&
secret_check[loop]==pix[i] && star2_flag<2)
{
[Link]("two");
if((char)secret_check[loop]=='*')
{
star2_flag++;
}
k--;
loop++;
}else if(star2_flag>=1)
{
[Link]("else if");
secret_info[j]=pix[i];
b[j]=(byte)pix[i];
[Link]("secrect pix :"+new
String(""+(char)b[j])+"");
j++;
k--;
}
else
{
[Link]("star flag :"+star2_flag);
[Link]("else");
flag=1;
}
}
}
if(flag==0)
{
String s=new String(b);
s=new String([Link](1));
[Link]("secret information :"+s);
[Link]("key :"+key);
[Link](null,"Secret Information is :
"+s);
}
else
[Link](null,"code you entered is not
valid");
newimg =[Link](new MemoryImageSource(ww,hh,cm,pix, 0,
ww));
}catch(Exception e)
{
[Link](e);
}
}else
{
[Link]();
Home h=new Home();
[Link](1035,790);
[Link](true);
}
}
public static void main(String args[])
{
BreakPage bp=new BreakPage();
[Link](1035,740);
[Link](true);
}
}
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
public class ComposePage extends JFrame implements ActionListener
{
private JLabel code_label,secret_label,picture_label;
private JTextField code_text,secret_text,picture_text;
private JButton picture_load_button,hide_button,home_button;
String filepath="",secret_code="",secret_info="",user_key="";
Container con=null;
JLabel jl;
byte img_byte[]=new byte[6000];
FileDialog fd;
//////// Variables for creating an image from an integer
array ///////////////////////////
Image img;
Dimension d;
int iw,ih;
int w=10,h=10;
int pix[];
int hist[]=new int[256];
int t[];
int max_hist=0;
boolean ok;
static Image newimg;
int key,k;
ComposePage()
{
super("Compose");
con=getContentPane();
[Link](null);
code_label=new JLabel("Security Code");
code_label.setBounds(230,100,150,50);
code_text=new JTextField(200);
code_text.setBounds(400,100,250,40);
secret_label=new JLabel("Secret Information");
secret_label.setBounds(230,200,150,50);
secret_text=new JTextField(200);
secret_text.setBounds(400,200,250,40);
picture_label=new JLabel("Picture");
picture_label.setBounds(230,300,250,40);
picture_text=new JTextField(200);
picture_text.setBounds(400,300,250,50);
picture_load_button=new JButton("Load");
picture_load_button.setBounds(700,300,150,30);
picture_load_button.addActionListener(this);
hide_button=new JButton("Hide");
hide_button.setBounds(400,400,150,30);
hide_button.addActionListener(this);
home_button=new JButton("Home");
home_button.setBounds(700,400,150,30);
home_button.addActionListener(this);
jl=new JLabel();
[Link](700,500,150,30);
fd=new FileDialog(new JFrame());
[Link](code_label);
[Link](code_text);
[Link](secret_label);
[Link](secret_text);
[Link](picture_label);
[Link](picture_text);
[Link](picture_load_button);
[Link](hide_button);
[Link](home_button);
//[Link](jl);
}
public void actionPerformed(ActionEvent ae)
{
if([Link]()==picture_load_button)
{
[Link](true);
filepath=[Link]()+[Link]();
picture_text.setText(filepath);
}else if([Link]()==hide_button)
{
int starflag=0;
secret_code=code_text.getText();
for(int i=0;i<secret_code.length();i++)
{
if(secret_code.charAt(i)=='*')
{
starflag=1;
}
}
if(starflag==0)
{
secret_info=secret_text.getText();
user_key=secret_code+"*"+new
String(""+secret_info.length());
[Link]("user key :"+user_key);
String secret_code_info=user_key+"*"+secret_info+"*";
byte secret_byte_array[]=secret_code_info.getBytes();
int secret_int_array[]=new int[secret_byte_array.length];
try{
if([Link]("") &&
(secret_text.getText()).equals(""))
[Link](null,"image and
secret info are empty. enter them");
else if(secret_info.length()==0 &&
[Link]()>0)
[Link](null,"enter
secret info");
else if([Link]()==0 &&
(secret_text.getText()).length()>0)
[Link](null,"load an
image");
else
{
ImageIcon ic=new ImageIcon(filepath);
img=[Link]();
iw=[Link](null);
ih=[Link](null);
pix=new int[iw*ih];
t=new int[iw*ih];
PixelGrabber pg=new
PixelGrabber(img,0,0,iw,ih,pix,0,iw);
ColorModel cm=[Link]();
int ww=[Link]();
int hh=[Link]();
[Link]();
key=secret_byte_array.length;
int k=key;
int j=0;
for(int i=0;i<[Link];i++)
{
if((i%20)==0 && k>0)
{
secret_int_array[j]=(int)secret_byte_array[j];
[Link]("user
key :"+secret_int_array[j]);
pix[i]=secret_int_array[j];
j++;
k--;
}
}
newimg =[Link](new
MemoryImageSource(ww,hh,cm,pix, 0, ww));
[Link](new ImageIcon(newimg));
[Link](null,"your secret
code: "+user_key+"");
MediaTracker mediaTracker = new
MediaTracker(new Container());
[Link](newimg, 0);
[Link](0);
int thumbWidth = 400;//[Link](400);
int thumbHeight = 400;//[Link](400);
double thumbRatio = (double)thumbWidth /
(double)thumbHeight;
int imageWidth = [Link](null);
int imageHeight = [Link](null);
double imageRatio = (double)imageWidth /
(double)imageHeight;
if (thumbRatio < imageRatio)
{
thumbHeight = (int)(thumbWidth /
imageRatio);
}
else
{
thumbWidth = (int)(thumbHeight *
imageRatio);
}
// draw original image to thumbnail image
object and
// scale it to the new size on-the-fly
BufferedImage thumbImage = new
BufferedImage([Link](null), [Link](null),
BufferedImage.TYPE_INT_RGB);
Graphics2D graphics2D =
[Link]();
[Link](RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BILINEAR);
[Link](newimg, 0, 0,
[Link](null), [Link](null), null);
// save thumbnail image to OUTFILE
File f=new File("[Link]");
BufferedOutputStream out = new
BufferedOutputStream(new
FileOutputStream(f));
JPEGImageEncoder encoder =
[Link](out);
JPEGEncodeParam param = encoder.
getDefaultJPEGEncodeParam(thumbImage);
int quality = 80;//[Link](args[4]);
quality = [Link](0, [Link](quality, 100));
[Link]((float)quality / 100.0f,
false);
[Link](param);
[Link](thumbImage);
[Link]();
[Link]("Done.");
test t=new test(newimg);
[Link](1035,790);
[Link](true);
}
}catch(Exception e)
{
[Link](e);
}
}else
[Link](null,"Do not enter '*' in
secrect code");
}else
{
[Link]();
Home h=new Home();
[Link](1035,790);
[Link](true);
}
}
public static void main(String args[])
{
ComposePage cp=new ComposePage();
[Link](1035,740);
[Link](true);
}
}