3:49 PM

depth latency code

package Secure.Appn.src;

import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.sql.*;
import java.util.*;
import java.util.StringTokenizer;
import java.security.*;
import java.math.*;
import java.util.Random;
import java.math.BigInteger;
import java.security.SecureRandom;

public class Design extends JFrame
{
Dimension dim;
Container cont;
boolean _flag1=true;
JDesktopPane form,refer;
JMenuBar mbar;
JMenu Opr,Conn;
JMenuItem start,attack,move,exit,rtab;
int clicks=0,convHM=0,nodes=0,cnode=0;
JPanel[] User;JFrame _fr;JPanel _send;
JPanel _sink,pan;
JLabel _msgLabel,_fromLabel,_toLabel,prolabel,prolabel1;
String pval="",qval="",kpubkey="",dprikey="",nval="",rsa="",dhm="",encval="",ktgs="",decval="",kv="";
JTextField _msgText,_fromText,_toText;
JButton _submit,_pack,_browse,_rtscts;
Connection connect;
ArrayList _pathNodes;
boolean _true=false;
SQLDB sqldb;
int _len;
String _comp,_add,Nvalue,Uname="",Uname1="",Uname2="",Pword="",Tgsid="",Tickettgs="",ttgs="",ttgsun="",ttgsid="",Ticketv="",sid="",ticv="",ticvun="",ticvid="";
FileInputStream _fis;
int _size;
ArrayList _al;
static int q=0;
String _Fext="",_refTo="";
static int p=0;
StringTokenizer str;
int val=0,val0=0;
String cnodee="",cxpos1="",cypos1="";
JScrollPane jsp;
int cx=0,cy=0,cx1=0,cy1=0;
JFrame fr;
JTextArea ta;

public Design() throws Exception
{
this.setTitle("SECURE ROUTING");
dim=Toolkit.getDefaultToolkit().getScreenSize();
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
cont=this.getContentPane();
sqldb=new SQLDB();
connect=sqldb.getConnect();
Statement stmd=connect.createStatement();
stmd.executeUpdate("delete from cal");
stmd.executeUpdate("delete from GetInfo");
stmd.executeUpdate("delete from NodeInfo");
stmd.executeUpdate("delete from NodeCoverageInfo");
stmd.executeUpdate("delete from AStab");
stmd.executeUpdate("delete from SERtab");
cont.setLayout(new BorderLayout());
_fr=this;



mbar=new JMenuBar();
Opr=new JMenu("Operation");Opr.setMnemonic('O');

start=new JMenuItem("Start");
start.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent we)
{
try
{

String _HM=JOptionPane.showInputDialog(null,"ENTER THE NUMBER OF NODES","PPP",1);
if(_HM.length() > 0)
{
convHM=0;
convHM=Integer.parseInt(_HM.trim());

User=new JPanel[convHM+1];
nodes=0;
clicks=0;
form.removeAll();
form.addMouseListener(new MouseAdapter()
{
public void mouseClicked(MouseEvent me)
{
try
{
if(clicks == (convHM+1)){
move.setEnabled(true);
_FindCover();
}else if(clicks <= convHM)
{
Statement stmt=connect.createStatement();
int NodeX=me.getX();
int NodeY=me.getY();
String Nname="";
Nname="Node "+String.valueOf(clicks);

Uname=JOptionPane.showInputDialog(null,"User Name :","Secure Routing Project",1);

Pword=JOptionPane.showInputDialog(null,"Pass Word :","Secure Routing Project",1);

Tgsid=JOptionPane.showInputDialog(null,"TGS id :","Secure Routing Project",1);

JOptionPane.showMessageDialog(null,"Informations are Transferred to Authentication Server(AS)","PPP",1);
Thread.sleep (500);
JOptionPane.showMessageDialog(null,"Authentication Server(AS) Transfer the Ticket TGS Information(Encrypted-User name ang TGS id) to Node "+clicks,"PPP",1);
Thread.sleep (500);
JOptionPane.showMessageDialog(null,"Authentication Server(AS) Provides KTGS(key) to Ticket Granting Server(TGS) for Split the Ticket TGS","PPP",1);
Thread.sleep (500);

g RSA r=new RSA();
rsa=r.rsa();
str=new StringTokenizer(rsa,"/");
while(str.hasMoreTokens())
{
pval=str.nextToken();
qval=str.nextToken();
kpubkey=str.nextToken();
dprikey=str.nextToken();
nval=str.nextToken();
}

JOptionPane.showMessageDialog(null,"KTGS key :"+nval,"PPP",1);
Thread.sleep (500);
Tickettgs=Uname+","+Tgsid;
encval=Encrypt(Tickettgs,kpubkey,nval);
System.out.println ("Ticket TGS(Encryption) :"+encval);
Thread.sleep (500);
JOptionPane.showMessageDialog(null,"Ticket TGS(Encrypted Value) :"+encval,"PPP",1);
stmt.executeUpdate("insert into AStab values("+clicks+",'"+Tickettgs+"')");

Uname1=JOptionPane.showInputDialog(null,"Enter UR User Name(for First Authentication) :","Secure Routing Project",1);
Thread.sleep (500);
JOptionPane.showMessageDialog(null,"Node "+clicks+" Transfer the Username and Ticket TGS Information to Ticket Granting Server(TGS)","PPP",1);

Thread.sleep(500);
ktgs=JOptionPane.showInputDialog(null,"Enter KTGS key to Split Ticket TGS :","Secure Routing Project",1);
if(ktgs.equals (nval))
{
decval=Decrypt(encval,dprikey,nval);
System.out.println ("Ticket TGS(Decryption) :"+decval);
JOptionPane.showMessageDialog(null,"KTGS(key) Splits the Ticket TGS","PPP",1);
StringTokenizer str=new StringTokenizer(decval,",");
while(str.hasMoreTokens ())
{
ttgsun=str.nextToken ();
ttgsid=str.nextToken ();
}
}else
{
JOptionPane.showMessageDialog(null,"KTGS(key) Mismatched","PPP",1);
}
if(Uname1.equals (ttgsun))
{
JOptionPane.showMessageDialog(null,"First Authentication Granted by Ticket Granting Server(TGS) for Node "+clicks,"PPP",1);
Thread.sleep (500);

JOptionPane.showMessageDialog(null,"Ticket Granting Server(TGS) Transfer the Ticket V Information(Encrypted-User name ang SID) to Node "+clicks,"PPP",1);
Thread.sleep (500);

JOptionPane.showMessageDialog(null,"Ticket Granting Server(TGS) Provides KV(key) to SERVER for Split the Ticket V","PPP",1);
Thread.sleep (500);
sid="1";

RSA r1=new RSA();
rsa=r1.rsa();
str=new StringTokenizer(rsa,"/");
while(str.hasMoreTokens())
{
pval=str.nextToken();
qval=str.nextToken();
kpubkey=str.nextToken();
dprikey=str.nextToken();
nval=str.nextToken();
}

JOptionPane.showMessageDialog(null,"KV key :"+nval,"PPP",1);
Ticketv=ttgsun+","+sid;
encval=Encrypt(Ticketv,kpubkey,nval);
System.out.println ("Ticket V(Encryption):"+encval);
Thread.sleep (500);
JOptionPane.showMessageDialog(null,"Ticket V(Encrypted Value) :"+encval,"PPP",1);
stmt.executeUpdate("insert into SERtab values("+clicks+",'"+Ticketv+"')");

Uname2=JOptionPane.showInputDialog(null,"Enter UR User Name(for Second Authentication) :","Secure Routing Project",1);
Thread.sleep (500);
JOptionPane.showMessageDialog(null,"Node "+clicks+" Transfer the Username and Ticket V Information to SERVER","PPP",1);

Thread.sleep(500);
kv=JOptionPane.showInputDialog(null,"Enter KV key to Split Ticket TGS :","Secure Routing Project",1);
if(kv.equals (nval))
{
decval=Decrypt(encval,dprikey,nval);
System.out.println ("Ticket V(Decryption) :"+decval);
JOptionPane.showMessageDialog(null,"KV(key) Splits the Ticket V","PPP",1);
StringTokenizer str1=new StringTokenizer(decval,",");
while(str1.hasMoreTokens ())
{
ticvun=str1.nextToken ();
ticvid=str1.nextToken ();
}
}else
{
JOptionPane.showMessageDialog(null,"KV(key) Mismatched","PPP",1);
}
if(Uname2.equals (ticvun))
{
JOptionPane.showMessageDialog(null,"Second Authentication Granted by SERVER for Node "+clicks,"PPP",1);
Thread.sleep (500);
JOptionPane.showMessageDialog(null,"USERNODE :"+ clicks +" ADDED","PPP",1);
stmt.executeUpdate("insert into cal values('"+clicks+"','"+String.valueOf(NodeX)+"','"+String.valueOf(NodeY)+"')");
stmt.executeUpdate("insert into NodeInfo values("+clicks+",'"+Nname+"',"+NodeX+","+NodeY+")");
stmt.executeUpdate("insert into GetInfo values("+clicks+",'"+Uname+"','"+Pword+"','"+Tgsid+"')");
clicks++;
DrawComponents();
_FindCover();
}else
{
JOptionPane.showMessageDialog(null,"Second Authentication Rejected by SERVER for Node "+clicks,"PPP",1);
clicks++;
}
}else
{
JOptionPane.showMessageDialog(null,"First Authentication Rejected by Ticket Granting Server(TGS) for Node "+clicks,"PPP",1);
clicks++;
}
}

}catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Error in Start - \n "+e.toString(),"PPP",0);
}
}
});


}else if(_HM == null)
{
JOptionPane.showMessageDialog(null,"Enter Number Of Nodes,Try Again ","PPP",0);
}else
{
JOptionPane.showMessageDialog(null,"Invalid Number Of Nodes,Try Again ","PPP",0);
}
}catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Error in Start \n "+e.toString(),"PPP",0);
}
}
});

move=new JMenuItem("MobileNode");
move.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent we)
{
try
{
System.out.println("Length : "+User.length);
for(int i=0;i<=User.length;i++)
{
if(i == User.length)
{
_FindCover();
RouteTable();
move.setEnabled(true);
}else
{

Mobile mobile=new Mobile(refer,User[i],"Node "+i);
Thread th=new Thread(mobile.mobuser);
th.start();

}
}

}catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Error in Move \n "+e.toString(),"PPP",0);
}
}
});

/* refresh=new JMenuItem("Refresh");
refresh.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
try{
for(int i=0;i {
User[i].setBackground(Color.orange);
}
Statement stt=connect.createStatement();
ResultSet rss=stt.executeQuery("select * from NodeInfo where Node="+Integer.parseInt(_refTo)+"");
while(rss.next())
{
String nname=rss.getString("NodeName");
User[Integer.parseInt(_refTo)].setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),nname,1,2,new Font("Times New Roman",Font.BOLD,11),Color.blue));
}

}catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Error in refresh \n "+e.toString(),"PPP",0);
}
}
}); */

/* exit=new JMenuItem("Exit");
exit.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
try{
System.exit (0);

}catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Error in exit \n "+e.toString(),"PPP",0);
}
}
});

Conn=new JMenu("Connection Set");Conn.setMnemonic('C');

rtab=new JMenuItem("Routing Table");
rtab.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
try{
connectionset();

}catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Error in routing \n "+e.toString(),"PPP",0);
}
}
});

Opr.add(start);
Opr.add(move);
//Opr.add(refresh);
Opr.add(exit);
Conn.add(rtab);

mbar.add(Opr);
mbar.add (Conn);

this.setJMenuBar(mbar);
_send=new JPanel();
_send.setLayout(new FlowLayout());
_msgLabel=new JLabel("Message");
_msgText=new JTextField(30);

_fromLabel=new JLabel("Source");
_fromText=new JTextField(7);

_toLabel=new JLabel("Destination");
_toText=new JTextField(7);

_submit=new JButton("Send");

_browse=new JButton("Browse_File");

_rtscts=new JButton("Req_Res");

_msgText.setFont(new Font("Times New Roman",Font.BOLD,12));
_msgText.setForeground(Color.blue);

_fromText.setFont(new Font("Times New Roman",Font.BOLD,12));
_fromText.setForeground(Color.red);

_toText.setFont(new Font("Times New Roman",Font.BOLD,12));
_toText.setForeground(Color.red);


_send.add(_msgLabel);
_send.add(_msgText);
_send.add(_fromLabel);
_send.add(_fromText);
_send.add(_toLabel);
_send.add(_toText);
_send.add(_submit);
_send.add(_browse);
_send.add(_rtscts);


_submit.setEnabled(false);
_rtscts.setEnabled(false);


_submit.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent we)
{
try
{
String _From=_fromText.getText().trim();
String _To=_toText.getText().trim();
String _Msg=_msgText.getText().trim();
if(_From.length() > 0)
{if(_To.length() > 0)
{if(_Msg.length() > 0)
{if(_NodeExist("Node "+_From)== true)
{if(_NodeExist("Node "+_To)== true)
{if(_NodeEqual("Node "+_From,"Node "+_To)== true)
{
//Process Start
int _fint=_NodeIndex("Node "+_From);
int _tint=_NodeIndex("Node "+_To);
String _to=String.valueOf(_tint);
String _frm=String.valueOf(_fint);
System.out.println("From :"+ _frm +" , To : "+_to );
if(_fint < _tint)
{
_FindCover();
_pathNodes=new ArrayList();
_pathNodes.add("Node "+_To);
_FindPath("Node "+_From,"Node "+_To);
_ShowPath();
ArrayList _list=_orderChange(_pathNodes);
System.out.println("Length:"+_len);
System.out.println("Size:"+_size);
System.out.println("Extension:"+_comp);
_movePacket(_list,_Msg,_len,_size);
_Data("Node "+_From,"Node "+_To,_Msg);
}else
{
_FindCover();
_pathNodes=new ArrayList();
_pathNodes.add("Node "+_From);
_FindPath("Node "+_To,"Node "+_From);
_ShowPath();
ArrayList _list=_orderNotChange(_pathNodes);
_movePacket(_list,_Msg,_len,_size);
_Data("Node "+_From,"Node "+_To,_Msg);
}

}else
{JOptionPane.showMessageDialog(null,"From/To Node Are Same","_alert",0);
_fromText.setText("");_toText.setText("");_fromText.requestFocus();
}}else
{JOptionPane.showMessageDialog(null,"To Node Not Exist","_alert",0);
_toText.setText("");_toText.requestFocus();
}}else
{JOptionPane.showMessageDialog(null,"From Node Not Exist","_alert",0);
_fromText.setText("");_fromText.requestFocus();
}}else
{JOptionPane.showMessageDialog(null,"Messages Are Invalid","_alert",0);
_msgText.setText("");_msgText.requestFocus();
}}else
{JOptionPane.showMessageDialog(null,"To Node Invalid","_alert",0);
_toText.setText("");_toText.requestFocus();
}}else
{JOptionPane.showMessageDialog(null,"From Node Invalid","_alert",0);
_fromText.setText("");_fromText.requestFocus();
}
}catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Error in Submit \n "+e.toString(),"_alert",0);
}
}
});*/

_browse.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
try{


JFileChooser _f=new JFileChooser();
int retval = _f.showDialog(new JFrame(), null);

if (retval == JFileChooser.CANCEL_OPTION) {
JOptionPane.showMessageDialog(null,"Choose File Please ","Protocol Project",0);

}else{
File _file=_f.getSelectedFile();
System.out.println("_file"+_file);
if(q==0)
{
_Fext=_file.getName();
q++;
}else
{
_Fext=_Fext+","+_file.getName();
}
}
_msgText.setText(_Fext);

_rtscts.setEnabled(true);
}catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Error in Browse \n "+e.toString(),"_alert",0);
}
}
});

_rtscts.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
try{
String _From=_fromText.getText().trim();
String _To=_toText.getText().trim();
String _Msg=_msgText.getText().trim();

int a=Integer.parseInt(_From);

for(int z=0;z {
User[z].setBackground(Color.pink);
}
User[a].setBackground(Color.orange);

JOptionPane.showMessageDialog(null,"NODE " + _From + " PASS THE REQUESTS TO ALL NODES","_information",1);

_toText.setText(_From);
_fromText.setText(_To);

String _Fromm=_fromText.getText().trim();
String _Too=_toText.getText().trim();

JOptionPane.showMessageDialog(null,"GETTING THE ACKNOWLEDGEMENT FROM SHORTEST PATH","_information",1);
JOptionPane.showMessageDialog(null,"DiffeHellman Start");



if(_Fromm.length() > 0)
{if(_Too.length() > 0)
{if(_NodeExist("Node "+_Fromm)== true)
{if(_NodeExist("Node "+_Too)== true)
{if(_NodeEqual("Node "+_Fromm,"Node "+_Too)== true)
{
//Process Start
int _fint=_NodeIndex("Node "+_Fromm);
int _tint=_NodeIndex("Node "+_Too);
String _to=String.valueOf(_tint);
String _frm=String.valueOf(_fint);
System.out.println("From :"+ _frm +" , To : "+_to );
if(_fint < _tint)
{
_FindCover();
_pathNodes=new ArrayList();
_pathNodes.add("Node "+_Too);
_FindPath("Node "+_Fromm,"Node "+_Too);
_ShowPath();
ArrayList _list=_orderChange(_pathNodes);
_moveRequest(_list,_Msg);
//_Data(_From,_To,_Msg);
//JOptionPane.showMessageDialog(null,"Signing "+nodes,"NDRI",0);
}else
{

_FindCover();
_pathNodes=new ArrayList();
_pathNodes.add("Node "+_Fromm);
_FindPath("Node "+_Too,"Node "+_Fromm);
_ShowPath();
ArrayList _list=_orderNotChange(_pathNodes);
_moveRequest(_list,_Msg);
//_Data(_From,_To,_Msg);



}

}else
{JOptionPane.showMessageDialog(null,"From/To Node Are Same","_alert",0);
_flag1=false;
_fromText.setText("");_toText.setText("");_fromText.requestFocus();
}}else
{JOptionPane.showMessageDialog(null,"To Node Not Exist","_alert",0);
_flag1=false;
_toText.setText("");_toText.requestFocus();
}}else
{JOptionPane.showMessageDialog(null,"From Node Not Exist","_alert",0);
_flag1=false;
_fromText.setText("");_fromText.requestFocus();
}}else
{JOptionPane.showMessageDialog(null,"To Node Invalid","_alert",0);
_flag1=false;
_toText.setText("");_toText.requestFocus();
}}else
{JOptionPane.showMessageDialog(null,"From Node Invalid","_alert",0);
_flag1=false;
_fromText.setText("");_fromText.requestFocus();
}
_fromText.setText(_Too);
_toText.setText(_Fromm);
_submit.setEnabled(true);
if(_flag1==true)
{
DiffeHellman d = new DiffeHellman();
d.dhm();
}
}catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Error in Req_Rep \n "+e.toString(),"_alert",0);
}
}
});

form=new JDesktopPane();
refer=form;
form.setLayout(null);
form.setBackground(new Color(136,68,113));

pan=new JPanel();
pan.setLayout(null);
pan.setBounds(0,dim.height-150,dim.width,150);
pan.setBackground(Color.white);

form.add(pan);
cont.add(_send,BorderLayout.NORTH);
cont.add(form,BorderLayout.CENTER);
this.setSize(dim.width,dim.height);
this.setLocation(0,0);
this.show();

}

/* public ArrayList _orderChange(ArrayList _item) throws Exception
{
ArrayList _itm;
_itm=new ArrayList();
for(int i=_item.size()-1;i>=0;i--)
{
String _snode=_item.get(i).toString();
int _snod=_NodeIndex(_snode);
_itm.add(String.valueOf(_snod));
}
return _itm;
}
public ArrayList _orderNotChange(ArrayList _item) throws Exception
{
ArrayList _itm;
_itm=new ArrayList();
for(int i=0;i<_item.size();i++)
{
String _snode=_item.get(i).toString();
int _snod=_NodeIndex(_snode);
_itm.add(String.valueOf(_snod));
}
return _itm;
}
public void _Data(String from,String to,String msg) throws Exception
{
StringTokenizer _str=new StringTokenizer(msg,",");
while(_str.hasMoreTokens())
{
String _ms=_str.nextToken();
File _f=new File("Users//"+to);
_f.mkdirs();
FileOutputStream _fout=new FileOutputStream(_f.getAbsolutePath()+"//Data.txt",true);
String _data="From : "+ from +" , Data :"+ _ms +"\r\n";
_fout.write(_data.getBytes());
_fout.close();
}

}

public String Encrypt(String ttgs,String publicKey,String commonKey)throws Exception
{
String tictgs=ttgs;
String pubkey=publicKey;
String commkey=commonKey;
BigInteger py=new BigInteger(pubkey);
BigInteger cy=new BigInteger(commkey);
BigInteger bn;String emsg="";

for(int i=0;i {
String ch=String.valueOf((int)tictgs.charAt(i));
BigInteger g_data=new BigInteger(ch);
bn =g_data.modPow(py,cy);
emsg=emsg+bn.toString()+'@';
}
return emsg;
}

public String Decrypt(String encmsg,String privateKey,String commonKey)throws Exception
{
String emsg=encmsg;
String prikey=privateKey;
String commkey=commonKey;
BigInteger py=new BigInteger(prikey);
BigInteger cy=new BigInteger(commkey);
BigInteger bn;String dmsg="";
int i=0;
String a[]=new String[5000000];

StringTokenizer s=new StringTokenizer(emsg,"@");
while(s.hasMoreTokens())
{
String tt=s.nextToken();
a[i]=tt;
i++;
}

for(int j=0;j {
bn = new BigInteger(a[j]).modPow(py,cy);
char ch=(char)bn.intValue();
dmsg=dmsg+ch;
}
return dmsg;
}

public synchronized void DrawComponents()
{
try{
form.removeAll();
Statement stm=connect.createStatement();
ResultSet rtm=stm.executeQuery("select * from NodeInfo where NodeName<>null");
while(rtm.next())
{
int node=rtm.getInt("Node");cnode=0;cnode=node;
int xpos=rtm.getInt("Nodex");
int ypos=rtm.getInt("Nodey");
String name=rtm.getString("NodeName");
User[node]=new JPanel();
User[node].setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),name,1,2,new Font("Times New Roman",Font.BOLD,11),Color.blue));
User[node].setBounds(xpos,ypos,70,40);
User[node].setBackground(Color.orange);
form.add(User[node]);
}




}catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Error in _DrawComponents: \n"+e.toString(),"PPP",0);
}
}

public void connectionset()
{
try
{
if(!_fromText.getText().equals("") || !_toText.getText().equals(""))
{
val=Integer.parseInt(_fromText.getText());
val0=Integer.parseInt(_toText.getText());
System.out.println("got the values");
Statement stv2=connect.createStatement();
stv2.executeUpdate("delete from conset");
System.out.println("deleted");
System.out.println("conditions applied");
for(int i=val;i<=val0;i++)
{
show_connectionset(i);
conshow(i);
}


}else
{
JOptionPane.showMessageDialog(null,"Empty sender/receiver.");
}
}catch(Exception mm)
{
System.out.println("in distance-->"+mm.toString());
}
}

public void show_connectionset(int node) throws Exception
{
String n=String.valueOf(node);
System.out.println("connection set started");
Statement stv=connect.createStatement();
ResultSet rsv=stv.executeQuery("select * from cal where node='"+n+"'");
if(rsv.next())
{
String n1=rsv.getString("node");
String cxpos=rsv.getString("xpos");
String cypos=rsv.getString("ypos");

Thread.sleep(100);
Statement stv1=connect.createStatement();
ResultSet rsv1=stv1.executeQuery("select * from cal where node >'"+n+"'");
System.out.println("selected");
while(rsv1.next())
{
cnodee="";cxpos1="";cypos1="";
cx=0;cy=0;cx1=0;cy1=0;
String cn=rsv1.getString("node");
cxpos1=rsv1.getString("xpos");
cypos1=rsv1.getString("ypos");
cx=Integer.parseInt(cxpos);
cy=Integer.parseInt(cypos);
cx1=Integer.parseInt(cxpos1);
cy1=Integer.parseInt(cypos1);
if(((cx+300) > cx1))
{
System.out.println("*****************************************");
System.out.println("Enode:"+n1+"\tEx:"+cxpos+"\tEy:"+cypos);
System.out.println("Cnode:"+cn+"\tCx:"+cxpos1+"\tCy:"+cypos1);
System.out.println("*****************************************");

Statement stv2=connect.createStatement();
stv2.executeUpdate("insert into conset values('"+n1+"','"+cn+"')");
System.out.println("inserted");


}
}

Statement stv6=connect.createStatement();
ResultSet rsv6=stv6.executeQuery("select * from cal where node <'"+n+"'");
System.out.println("again selected");
while(rsv6.next())
{
cnodee="";cxpos1="";cypos1="";
cx=0;cy=0;cx1=0;cy1=0;
String cn=rsv6.getString("node");
cxpos1=rsv6.getString("xpos");
cypos1=rsv6.getString("ypos");
cx=Integer.parseInt(cxpos);
cy=Integer.parseInt(cypos);
cx1=Integer.parseInt(cxpos1);
cy1=Integer.parseInt(cypos1);
if(((cx-300) < cx1))
{
System.out.println("*****************************************");
System.out.println("Enode:"+n1+"\tEx:"+cxpos+"\tEy:"+cypos);
System.out.println("Cnode:"+cn+"\tCx:"+cxpos1+"\tCy:"+cypos1);
System.out.println("*****************************************");

Statement stv7=connect.createStatement();
stv7.executeUpdate("insert into conset values('"+n1+"','"+cn+"')");
System.out.println("again inserted");

}
}
}
}

public void conshow(int v)
{
try
{
String v1=String.valueOf(v);
Statement stc2=connect.createStatement();
ResultSet rsc2=stc2.executeQuery("select * from conset where node<>null");
System.out.println("connection show");
if(rsc2.next())
{

////////////////////////////////////
fr=new JFrame("RT");
cont=fr.getContentPane();
cont.setLayout(new BorderLayout());
ta=new JTextArea();
jsp=new JScrollPane(ta);
cont.add(jsp,BorderLayout.CENTER);
fr.setDefaultCloseOperation(1);
fr.setResizable(false);
fr.setSize(100,100);
////////////////////////////////////

Statement stc1=connect.createStatement();
ResultSet rsc1=stc1.executeQuery("select * from cal where node='"+v1+"'");
while(rsc1.next())
{

String xpos=rsc1.getString("xpos");
String ypos=rsc1.getString("ypos");
Statement stc=connect.createStatement();
ta.append("Node\tRoutingSet\t\n");
ResultSet rsc=stc.executeQuery("select * from conset where node='"+v1+"'");
while(rsc.next())
{
String Node=rsc.getString("node");
String CS=rsc.getString("cs");
ta.append(Node+"\t"+CS+"\n");
System.out.println(Node+"\t"+CS);
}
fr.setLocation((Integer.parseInt(xpos)+100),(Integer.parseInt(ypos)-20));

}
fr.show();

}
}catch(Exception e)
{
JOptionPane.showMessageDialog(null,e);
}
}

public void _FindCover() throws Exception
{
String _fincover="";
Statement _stmt=connect.createStatement();
_stmt.executeUpdate("delete from NodeCoverageInfo");
ResultSet _rst=_stmt.executeQuery("select * from NodeInfo");
while(_rst.next())
{
int _node=_rst.getInt("Node");
String _nodname=_rst.getString("NodeName");
int _nodxpos=_rst.getInt("Nodex");
int _nodypos=_rst.getInt("Nodey");
Statement _stmt1=connect.createStatement();
ResultSet _rst1=_stmt1.executeQuery("select * from NodeInfo where NodeName<>'"+_nodname+"'");
while(_rst1.next())
{
String _nodname1=_rst1.getString("NodeName");
int _nodxpos1=_rst1.getInt("Nodex");
int _nodypos1=_rst1.getInt("Nodey");

if(_CoverExist(_nodxpos,_nodypos,_nodxpos1,_nodypos1) == true)
{
_Coverupdate(_node,_nodname,_nodname1);
}
}
}

}

public void RouteTable() throws Exception
{

Statement _stm=connect.createStatement();
ResultSet _rtm=_stm.executeQuery("select * from NodeInfo where NodeName<>null");
while(_rtm.next())
{
String _name=_rtm.getString("NodeName");
int _ind=_rtm.getInt("Node");
Statement _stm1=connect.createStatement();
ResultSet _rtm1=_stm1.executeQuery("select * from NodeCoverageInfo where NodeName='Node "+_ind+"'");
if(_rtm1.next())
{
String _cov=_rtm1.getString("CoverageNodeName");
User[_ind].setToolTipText("Routing Table : Node : "+ _ind +" : CoverageNode :"+ _cov);
}else
{
User[_ind].setToolTipText("Routing Table : Node : "+ _ind +" : CoverageNode : Not Yet Updated");
}
}
}

public boolean _CoverExist(int _ex,int _ey,int _cx,int _cy)throws Exception
{
boolean _flag=false;
if(_cx >= (_ex-300) & _cx <= (_ex+300))
{
if(_cy >= (_ey-300) & _cy <= (_ey+300))
{
_flag=true;
}
}
return _flag;
}

public void _Coverupdate(int _no,String _en,String _cn)throws Exception
{
Statement _stu=connect.createStatement();
ResultSet _rtu=_stu.executeQuery("select * from NodeCoverageInfo where NodeName='"+_en+"'");
if(_rtu.next() == true)
{
String _acn=_rtu.getString("CoverageNodeName");
_acn=_acn+","+_cn;
Statement _stu1=connect.createStatement();
_stu1.executeUpdate("update NodeCoverageInfo set CoverageNodeName='"+_acn+"' where NodeName='"+_en+"'");
}else
{
Statement _stu1=connect.createStatement();
_stu1.executeUpdate("insert into NodeCoverageInfo values("+_no+",'"+_en+"','"+_cn+"','null')");
}
}

//Finding Path
public void _ShowPath() throws Exception
{
for(int x=0;x {
User[x].setBackground(Color.orange);
}
for(int i=0;i<_pathNodes.size();i++)
{
String _snode=_pathNodes.get(i).toString();
int _snod=_NodeIndex(_snode);
User[_snod].setBackground(Color.green);
}
}
public void _FindPath(String _f,String _t) throws Exception
{
System.out.println("From :"+ _f +" , To : "+_t );
if(_InterPresent(_t,_f) == true)
{
_pathNodes.add(_f);
String path="";
for(int i=0;i<_pathNodes.size();i++)
{
if(i==0)
{
path=_pathNodes.get(i).toString();
}else
{
path=path+"<-"+_pathNodes.get(i).toString();
}
}
if(path.length() == 0)
{
System.out.println("Path Not Found");
}else{
System.out.println("Final Path Found is : "+ path);
}
}else
{

String _fin=_Interval(_f,_t);
System.out.println("_Fin +:"+ _fin);
_pathNodes.add(_fin);
if(_fin.length() == 0)
{
JOptionPane.showMessageDialog(null,"Cant Able to Find Path.\nBetter You can Restart your program.\nOtherwise Change From & To..","alert",0);
}else
{
if(_InterPresent(_f,_fin) == true)
{
_pathNodes.add(_f);
String path="";
for(int i=0;i<_pathNodes.size();i++)
{
if(i==0)
{
path=_pathNodes.get(i).toString();
}else
{
path=path+"<-"+_pathNodes.get(i).toString();
}
}
if(path.length() == 0)
{
System.out.println("Path Not Found");
}else{
System.out.println("Final Path Found is : "+ path);
}
}else
{

_FindPath(_f,_fin);

}
}
}
}

public String _Interval(String _f,String _t) throws Exception
{
System.out.println("From :"+ _f +" , To : "+_t );
String _res="";boolean _flag=false;
Statement _stmt=connect.createStatement();
ResultSet _rst=_stmt.executeQuery("select * from NodeCoverageInfo where NodeName<>'"+_f+"'");
while(_rst.next() == true)
{
String _Nod=_rst.getString("NodeName");
String _Val=_rst.getString("CoverageNodeName");
StringTokenizer _st=new StringTokenizer(_Val,",");
while(_st.hasMoreTokens()){
String _cnode=_st.nextToken();
if(_cnode.equalsIgnoreCase(_t))
{
_res=_Nod;
_flag=true;
}
}
if(_flag == true){break;}
}
return _res;
}

public boolean _InterPresent(String _f,String _fin) throws Exception
{
boolean _flag=false;
System.out.println("From :"+ _f +" , To : "+_fin );
Statement _stmt=connect.createStatement();
ResultSet _rst=_stmt.executeQuery("select * from NodeCoverageInfo where NodeName='"+_fin+"'");
if(_rst.next() == true)
{
String _Nod=_rst.getString("NodeName");
String _Val=_rst.getString("CoverageNodeName");
StringTokenizer _st=new StringTokenizer(_Val,",");
while(_st.hasMoreTokens()){
String _cnode=_st.nextToken();
if(_cnode.equalsIgnoreCase(_f))
{
_flag=true;;
}
}

}
return _flag;
}
public boolean _NodeEqual(String _fnode,String _tnode)
{
boolean _flag=false;
if(!_fnode.equals(_tnode))
{
_flag=true;
}
return _flag;
}

public boolean _NodeExist(String _node) throws Exception
{
boolean _flag=false;
Statement _stmt=connect.createStatement();
ResultSet _rst=_stmt.executeQuery("select * from NodeInfo where NodeName='"+_node+"'");
if(_rst.next() == true)
{
_flag=true;
}

return _flag;
}

public int _NodeIndex(String _node)throws Exception
{
int _val=0;
Statement _stmt=connect.createStatement();
ResultSet _rst=_stmt.executeQuery("select * from NodeInfo where NodeName='"+_node+"'");
if(_rst.next() == true)
{
_val=_rst.getInt("Node");
}
return _val;
}
//Move Requests
public void _moveRequest(ArrayList _list,String _msg) throws Exception
{
Mobile _mob=new Mobile(refer,_list,_msg);
Thread _th=new Thread(_mob.mobrequests);
_th.start();

}
//Move Packets
public void _movePacket(ArrayList _list,String _msg,int _length,int _size) throws Exception
{
Mobile _mob=new Mobile(refer,_list,_msg,_length,_size);
Thread _th=new Thread(_mob.mobpacks);
_th.start();

}

public static void main(String args[])
{
try
{
Design des=new Design();
des.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent we)
{
System.exit(0);
}
});
}catch(Exception e)
{

}
}
}

class SQLDB
{
Connection conn;
public SQLDB()
{
System.out.println("SQLDB Constructer Called..........");
}

public Connection getConnect()
{
conn=null;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn=DriverManager.getConnection("jdbc:odbc:secure");
}catch(Exception e)
{
System.out.println("Error in DB Conect :"+ e.toString());
}
return conn;
}
}

class Mobile
{
JDesktopPane jdp;JPanel pans;SQLDB sqldb;
Connection connect;String name;ArrayList _list;String _msg;
int _length;int _size;static int p=0;
public Mobile(JDesktopPane jdp,JPanel pans,String name)
{
try
{
this.jdp=jdp;this.pans=pans;
sqldb=new SQLDB();this.name=name;
connect=sqldb.getConnect();
System.out.println("Mobile Constructer Called..........");
}catch(Exception e)
{
System.out.println("Error in Mobile :"+ e.toString());

}
}

public Mobile(JDesktopPane jdp,ArrayList _path,String msg)
{
try
{
this.jdp=jdp;this._list=_path;
sqldb=new SQLDB();this._msg=msg;
connect=sqldb.getConnect();
System.out.println("Request Move Constructer Called..........");
}catch(Exception e)
{
System.out.println("Error in Mobile :"+ e.toString());

}
}

public Mobile(JDesktopPane jdp,ArrayList _path,String msg,int length,int size)
{
try
{
this.jdp=jdp;this._list=_path;
sqldb=new SQLDB();this._msg=msg;
this._length=length;
this._size=size;

connect=sqldb.getConnect();
System.out.println("Packet Move Constructer Called..........");
}catch(Exception e)
{
System.out.println("Error in Mobile :"+ e.toString());

}
}


Runnable mobuser=new Runnable()
{
public void run()
{
try
{
Statement stm=connect.createStatement();
ResultSet rtm=stm.executeQuery("select * from NodeInfo where NodeName='"+name+"'");
if(rtm.next())
{
int node=rtm.getInt("Node");
int xpos=rtm.getInt("Nodex");
int ypos=rtm.getInt("Nodey");
int nx=(int)(Math.random()*800);
int ny=(int)(Math.random()*500);
Statement stm1=connect.createStatement();
stm1.executeUpdate("update NodeInfo set Nodex='"+nx+"',Nodey='"+ny+"' where NodeName='"+name+"'");
System.out.println("Updated For : "+ name);
_moveNodes(xpos,ypos,nx,ny,pans);
}
}catch(Exception e)
{
System.out.println("Error in MobUser Runnable : "+ e.toString());
}
}
};

Runnable mobpacks=new Runnable()
{
public void run()
{
try
{

// DiffeHellman d = new DiffeHellman();
// d.dhm();
System.out.println("Length:"+_length);
System.out.println("Size:"+_size);
StringTokenizer _str=new StringTokenizer(_msg,",");
int cou=_str.countTokens();
JLabel _pac[]=new JLabel[cou];
for(int x=0;x<=_pac.length;x++)
{
if(x == _pac.length)
{
JOptionPane.showMessageDialog(null,"INFORMATION TRANSFORMED SUCCESSFULLY....","_alert",1);
// JOptionPane.showMessageDialog(null,"Signing"+node+"NDR",1);
// JOptionPane.showMessageDialog(null,"Signing "+nodes,"NDRI",0);

}else
{
while(_str.hasMoreTokens())
{
String _ms=_str.nextToken();
System.out.println("_ms:"+_ms);
_pac[x]=new JLabel("DATA");
_pac[x].setBounds(0,0,0,0);
_pac[x].setVisible(false);
_pac[x].setForeground(Color.pink);
jdp.add(_pac[x]);
for(int i=0;i<=_list.size();i++)
{
if(i==_list.size()-1)
{}else if(i==_list.size())
{
jdp.remove(_pac[x]);
}else
{
String _snode=_list.get(i).toString();
String _dnode=_list.get(i+1).toString();
_soudes(Integer.parseInt(_snode),Integer.parseInt(_dnode),_pac[x],_ms,_size,_msg);
}
}

}
}
}
}catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Enter Data With Proper Extension....","_alert",0);
System.out.println("Error in Mobpacks Runnable : "+ e.toString());
}
}
};

Runnable mobrequests=new Runnable()
{
public void run()
{
try
{
//DiffeHellman d = new DiffeHellman();
//d.dhm();
JButton _pac=new JButton();
_pac.setText("ACK");
_pac.setBounds(0,0,0,0);

_pac.setVisible(false);
jdp.add(_pac);
for(int i=0;i<=_list.size();i++)
{
if(i==_list.size()-1)
{}else if(i==_list.size())
{
jdp.remove(_pac);
}else
{
String _snode=_list.get(i).toString();
String _dnode=_list.get(i+1).toString();
_soudes1(Integer.parseInt(_snode),Integer.parseInt(_dnode),_pac);
}
}

}catch(Exception e)
{
System.out.println("Error in Mobpacks Runnable : "+ e.toString());
}
}
};

public void _soudes1(int so,int de,JButton _bu) throws Exception
{
Statement _stmt=connect.createStatement();
ResultSet _rst=_stmt.executeQuery("select * from NodeInfo where Node="+so+"");
if(_rst.next())
{
int _node=_rst.getInt("Node");
int _vx=_rst.getInt("Nodex");
int _vy=_rst.getInt("Nodey");
Statement _stmt1=connect.createStatement();
ResultSet _rst1=_stmt1.executeQuery("select * from NodeInfo where Node="+de+"");
if(_rst1.next())
{
int _node1=_rst1.getInt("Node");
int _vx1=_rst1.getInt("Nodex");
int _vy1=_rst1.getInt("Nodey");
_moveRequest(_vx,_vy,_vx1,_vy1,_bu);
}
}
}
public void _soudes(int so,int de,JLabel _bu,String _ms,int _si,String _msg) throws Exception
{
Statement _stmt=connect.createStatement();
ResultSet _rst=_stmt.executeQuery("select * from NodeInfo where Node="+so+"");
if(_rst.next())
{
int _node=_rst.getInt("Node");
int _vx=_rst.getInt("Nodex");
int _vy=_rst.getInt("Nodey");
Statement _stmt1=connect.createStatement();
ResultSet _rst1=_stmt1.executeQuery("select * from NodeInfo where Node="+de+"");
if(_rst1.next())
{
int _node1=_rst1.getInt("Node");
int _vx1=_rst1.getInt("Nodex");
int _vy1=_rst1.getInt("Nodey");
_movePacks(_vx,_vy,_vx1,_vy1,_bu,_ms,_si,_msg);
}
}
}

public synchronized void _moveNodes(int _OX,int _OY,int _NX,int _NY,JPanel _pan)throws Exception
{
int sleepTime=10,_newx1=0,_newy1=0,_incx=0,_incy=0;
_newx1 = _NX;
_newy1 = _NY;
_pan.setBackground(Color.orange);
int _sxpos=_OX;
int _sypos=_OY;
int _expos=_newx1;
int _eypos=_newy1;

if(_sxpos < _expos){

for(int i=_sxpos;i<=_expos;i++){
_pan.setBounds(i,_sypos,70,40);
Thread.sleep(sleepTime);
}

if(_sypos < _eypos){

for(int j=_sypos;j<=_eypos;j++){
_pan.setBounds(_newx1,j,70,40);
Thread.sleep(sleepTime);
}
}else
{
for(int j=_sypos;j>=_eypos;j--){
_pan.setBounds(_newx1,j,70,40);
Thread.sleep(sleepTime);
}
}
}else if(_sxpos > _expos){
for(int i=_sxpos;i>=_expos;i--){
_pan.setBounds(i,_sypos,70,40);
Thread.sleep(sleepTime);
}
if(_sypos < _eypos){

for(int j=_sypos;j<=_eypos;j++){
_pan.setBounds(_newx1,j,70,40);
Thread.sleep(sleepTime);
}
}else
{
for(int j=_sypos;j>=_eypos;j--){
_pan.setBounds(_newx1,j,70,40);
Thread.sleep(sleepTime);
}
}

}

}

public synchronized void _moveRequest(int _OX,int _OY,int _NX,int _NY,JButton _pan)throws Exception
{
int sleepTime=5,_newx1=0,_newy1=0,_incx=0,_incy=0;
_newx1 = _NX;
_newy1 = _NY;
_pan.setBackground(Color.yellow);
_pan.setVisible(true);
int _sxpos=_OX;
int _sypos=_OY;
int _expos=_newx1;
int _eypos=_newy1;
if(_sxpos < _expos){

for(int i=_sxpos;i<=_expos;i++){
_pan.setBounds(i,_sypos,70,30);
Thread.sleep(sleepTime);
}

if(_sypos < _eypos){

for(int j=_sypos;j<=_eypos;j++){
_pan.setBounds(_newx1,j,70,30);
Thread.sleep(sleepTime);
}
}else
{
for(int j=_sypos;j>=_eypos;j--){
_pan.setBounds(_newx1,j,70,30);
Thread.sleep(sleepTime);
}
}


}else if(_sxpos > _expos){
for(int i=_sxpos;i>=_expos;i--){
_pan.setBounds(i,_sypos,70,30);
Thread.sleep(sleepTime);
}
if(_sypos < _eypos){

for(int j=_sypos;j<=_eypos;j++){
_pan.setBounds(_newx1,j,70,30);
Thread.sleep(sleepTime);
}
}else
{
for(int j=_sypos;j>=_eypos;j--){
_pan.setBounds(_newx1,j,70,30);
Thread.sleep(sleepTime);
}
}

}
_pan.setVisible(false);
}
public synchronized void _movePacks(int _OX,int _OY,int _NX,int _NY,JLabel _pan,String _mss,int _si,String _ms)throws Exception
{
int sleepTime=5,_newx1=0,_newy1=0,_incx=0,_incy=0;
String _extension="";
byte[] byt;
int _value=0;int _length=0;
StringTokenizer str;
String pval="",qval="",kpubkey="",dprikey="",nval="",rsa="",encval="",decval="";
_newx1 = _NX;
_newy1 = _NY;
_pan.setBackground(Color.yellow);
_pan.setVisible(true);
int _sxpos=_OX;
int _sypos=_OY;
int _expos=_newx1;
int _eypos=_newy1;
int _size=_si;
String _msg=_ms;
String _msss=_mss;

_value=_msss.indexOf(".");
_length=_msss.length();
_extension=_msss.substring(_value,_length);

System.out.println("Length..."+_length);
System.out.println("Msg..."+_msg);
System.out.println("Split..."+_msss);
System.out.println("Extension..."+_extension);


JOptionPane.showMessageDialog(null,"INFORMATION IS TRANSFORMING.....","_information",1);


JOptionPane.showMessageDialog(null,"This node is Signing","Signing Process",1);
// JOptionPane.showMessageDialog(null,"Signing "+_value,"NDRI",0);
_pan.setForeground(Color.YELLOW);

RSA r=new RSA();
rsa=r.rsa();
str=new StringTokenizer(rsa,"/");
while(str.hasMoreTokens())
{
pval=str.nextToken();
qval=str.nextToken();
kpubkey=str.nextToken();
dprikey=str.nextToken();
nval=str.nextToken();
}



encval=Encrypt(_msg,kpubkey,nval);

System.out.println ("Encrypted Information :"+encval);

if(_sxpos < _expos){

for(int i=_sxpos;i<=_expos;i++){
_pan.setBounds(i,_sypos,75,30);
Thread.sleep(sleepTime);
}

if(_sypos < _eypos){

for(int j=_sypos;j<=_eypos;j++){
_pan.setBounds(_newx1,j,75,30);
Thread.sleep(sleepTime);
}
}else
{
for(int j=_sypos;j>=_eypos;j--){
_pan.setBounds(_newx1,j,75,30);
Thread.sleep(sleepTime);
}
}
}else if(_sxpos > _expos){
for(int i=_sxpos;i>=_expos;i--){
_pan.setBounds(i,_sypos,75,30);
Thread.sleep(sleepTime);
}
if(_sypos < _eypos){

for(int j=_sypos;j<=_eypos;j++){
_pan.setBounds(_newx1,j,75,30);
Thread.sleep(sleepTime);
}
}else
{
for(int j=_sypos;j>=_eypos;j--){
_pan.setBounds(_newx1,j,75,30);
Thread.sleep(sleepTime);
}
}

}

decval=Decrypt(encval,dprikey,nval);

System.out.println ("Decrypted File :"+decval);


_pan.setVisible(false);
}

public String Encrypt(String msg,String publicKey,String commonKey)throws Exception
{
String mess=msg;
String pubkey=publicKey;
String commkey=commonKey;
BigInteger py=new BigInteger(pubkey);
BigInteger cy=new BigInteger(commkey);
BigInteger bn;String emsg="";

for(int i=0;i {
String ch=String.valueOf((int)mess.charAt(i));
BigInteger g_data=new BigInteger(ch);
bn =g_data.modPow(py,cy);
emsg=emsg+bn.toString()+'@';
}
return emsg;
}

public String Decrypt(String encmsg,String privateKey,String commonKey)throws Exception
{
String emsg=encmsg;
String prikey=privateKey;
String commkey=commonKey;
BigInteger py=new BigInteger(prikey);
BigInteger cy=new BigInteger(commkey);
BigInteger bn;String dmsg="";
int i=0;
String a[]=new String[5000000];

StringTokenizer s=new StringTokenizer(emsg,"@");
while(s.hasMoreTokens())
{
String tt=s.nextToken();
a[i]=tt;
i++;
}

for(int j=0;j {
bn = new BigInteger(a[j]).modPow(py,cy);
char ch=(char)bn.intValue();
dmsg=dmsg+ch;
}
return dmsg;
}


}


0 comments: