Академический Документы
Профессиональный Документы
Культура Документы
CHAPTER 1
INTRODUCTION
1
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
CHAPTER 2
PROBLEM DEFINITON
2
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
CHAPTER 3
LITERATURE SURVEY
On the other hand, there are so many situations, when the signed
message is sensitive to the signature receiver. Signatures used in such
3
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
4
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
5
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
Simple
Secure
Portable
Object-oriented
Robust
Multithreaded
Architecture-neutral
Interpreted and High performance
Distributed
Dynamic
Simple:
Secure:
6
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
environment and not allowing it access to other parts of the computer. The
ability to download applets with confidence that no harm will be done and that
no security will be breached is considered by many to be the single most
important aspect of Java.
Portable:
Object-oriented:
Robust:
7
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
Multithreaded:
Architecture-Neutral:
A central issue for the java designers was that of code longevity and
portability. One of the main problems facing programmers is that no
guarantee exists that if you write a program today, it will run tomorrow –
even on the same machine. Operating system upgrades, processor upgrades,
and changes in core system resources can all combine to make a program
malfunction. The Java designers made several hard decisions in the Java
language and the Java Virtual Machine in an attempt to alter this situation.
Their goal was “write once; run anywhere, any time, forever.” To a great
extent, this goal was accomplished.
8
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
9
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
Java is also unusual in that each Java program is both compiled and
interpreted. With a compiler, you translate a Java program into an
intermediate language called Java byte codes--the platform-independent
codes interpreted by the Java interpreter. With an interpreter, each Java byte
code instruction is parsed and run on the computer. Compilation happens just
once; interpretation occurs each time the program is executed. This figure
illustrates how this works.
Java byte codes can be considered as the machine code instructions for
the Java Virtual Machine (Java VM). Every Java interpreter, whether it's a
Java development tool or a Web browser that can run Java applets, is an
implementation of the Java VM. The Java VM can also be implemented in
hardware. Java byte codes help make "write once, run anywhere" possible.
The Java program can be compiled into byte codes on any platform that has a
Java compiler. The byte codes can then be run on any implementation of the
Java VM. For example, the same Java program can run on Windows NT,
Solaris, and Macintosh.
10
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
11
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
12
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
CHAPTER 4
PROJECT REQUIREMENT DEFINITION
For the successful execution of the project the some presumptions are
made and they have to be taken care of.
Message can be sent by a single user or the entire group. Any group can
send the message. Here we assume that only one message can be sent at a
time and another message can be sent only when the receiver has agreed to
view the message. Also, we have implemented the project in such a way that
only one group can be the sender and the other groups are disabled. One user
cannot send a message to an entire group nor is it possible for a whole group
to send a message to a single user.
All the users in a group are required to sign in, in order to validate the
message and send it. There is no facility for only a few users of the group to
sign the message and send it to a few users in the other group.
The message can be seen by the receiver only after correct login. It is
only after the receiver has received a message that the sender can send
another message.
The user would ideally enter their respective key all by himself but since
it’s difficult to ensure that the key values in an ascending order as to satisfy
the criteria n1 < n2 < ….< ni the third part is made to generate the values for
encryption on behalf of the user thus taking burden off the user.
13
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
14
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
CHAPTER 5
SYSTEM REQUIREMENTS DEFINITION
SOFTWARE SPECIFICATON
• Java1.4 or More
• Swings
• Windows 98
HARDWARE SPECIFICATION
• Hard disk: 40 GB
• RAM: 128mb
• Processor: Pentium 4
• Monitor: 15” color monitor
• Floppy drive: 1.44 MB
• Mouse: HCL
• CD Drive: LG 52X
• Printer: Laser
USER REQUIREMENTS
Once identified, the user requirements effectively lay the foundation for
developers, testers and implementers to begin determining the functionality,
responsiveness and interoperability required of that system. Here we are
required to create a threshold-multisignature scheme which allows a group of
members to sign the message collaboratively.
15
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
CHAPTER 6
GANTT CHART
W eeks
Tasks 1 2 3 4 5 6 7 8 9 10 11 12 13 14
L it e r a tu r e S u r v e y
P r o je c t A p p r o v a l
R e q u ir e m e n t A n a ly s is
S y s t e m D e s ig n
D e t a ile d D e s ig n
Im p le m e n t a t io n
In t e g r a t io n
U n it T e s t in g
F u n c t io n a l T e s t in g
D o c u m e n t a t io n
P r o je c t D e p lo y m e n t
P r o je c t C o m p le t io n
Key:
Project End
16
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
CHAPTER 7
SYSTEM DESIGN
• A structured multisignature scheme is an order-sensitive multisignature.
• Participating signers need to sign messages with a specified signing
order.
• Assume t signers U1, U2,…, Ut in a group.
•
• Follow RSA scheme
• Select two large secret primes pi and qi
• Publish product ni
• Publicly known products n1, n2,…, nt need to satisfy n1 < n2 < … < nt
• Send S1 to U2
• Send S2 to U3
17
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
18
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
19
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
20
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
21
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
CHAPTER 8
DETAILED DESIGN
22
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
8.1.1 LOGIN
Start:
Read username and password
Check for availability in database
If (available)
Display successful login message
Goto sender module
Else
Display invalid login message
Endif
End
8.1.2 SENDER
start:
select receiver group and username
read the message
send the receiver address, sender address and message to third party
end
8.1.3. RECEIVER
Start:
Read groupnumber, username and password
Check for availability in database
If (available)
Display successful login message
Give request to third party
Read response from third party
If (message = no message found)
Display the message
Else
Extract sender info from message
Display sender info and message
Endif
End
23
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
8.1.4 THIRDPARTY
Start:
Read message
Extract sender info from message
If (sender = group1)
If (sender = admin)
Generate p and q values
Generate n1,n2,n3 and n4 such that n1<n2<n3<n4
Generate e1,e2,e3,e4
Generate d1,d2,d3,d4
Generate s1 using n1 and e1
Generate s2 using n2 and e2
Generate s3 using n3 and e3
Generate s4 using n4 and e4
Save cipher s4 and decryption keys in database
Else
Generate p and q values
Generate n
Generate e
Generate d
Generate s using n and e
Save cipher s and decryption key in database
End if
Else
If (sender = admin)
Check for message in database
If (no message found)
Send response as no message found
Else
Get the cipher and decryption keys
Generate s3 using n4 and d4
Generate s2 using n3 and d3
Generate s1 using n2 and d2
Generate message using n1 and d1
Send message and sender info to receiver
Endif
Else
Check for message in database
If (no message found)
Send response as no message found
Else
Get the cipher and decryption key
24
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
25
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
ADMINLOGIN
Connectdb()
Sender()
New SENDER
sender()
HOME1 Recvrfm()
New
adminlogin()
New login()
LOGIN
Connectdb()
Sender()
New sender()
SENDERHELP
showwin()
Receiver Module:
RECVR
RECEIVER RECEIVER HELP
readusn()
new recvr() Readpass() Showwin()
Validate()
sendreqtoTP()
readresponse()
displaythemessage()
26
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
THIRDPARTYPROCESS
mainmethod()
THIRD PARTY Senderside()
Reciverside()
Generatepq()
new Generaten()
thirdpartyprocess() Generate()
Generated()
Encrypt()
Decrypt()
27
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
CHAPTER 9
IMPLEMENTATION
Sender Module
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public adminlogin()
{
Jfadmin = new JFrame("Group Login");
Container cp=jfadmin.getContentPane();
cp.setLayout(null);
cp.setBackground(Color.green);
Font f = new Font("Helvetica",Font.BOLD,20);
JLabel jl1 = new JLabel("USER1 LOGIN:");
JLabel jl2 = new JLabel("USER2 LOGIN:");
JLabel jl3 = new JLabel("USER3 LOGIN:");
28
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
29
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
jlp1.reshape(10,100,100,20);
jlp2.reshape(10,190,100,20);
jlp3.reshape(10,280,100,20);
jlp4.reshape(10,360,100,20);
cp.add(jlp1);
cp.add(jlp2);
cp.add(jlp3);
cp.add(jlp4);
jt1 = new JTextField();
jt2 = new JTextField();
jt3 = new JTextField();
jt4 = new JTextField();
jt1.reshape(150,70,100,20);
jt2.reshape(150,160,100,20);
jt3.reshape(150,250,100,20);
jt4.reshape(150,330,100,20);
cp.add(jt1);
cp.add(jt2);
cp.add(jt3);
cp.add(jt4);
jp1 = new JPasswordField();
jp2 = new JPasswordField();
jp3 = new JPasswordField();
jp4 = new JPasswordField();
jp1.reshape(150,100,100,20);
jp2.reshape(150,190,100,20);
jp3.reshape(150,280,100,20);
jp4.reshape(150,360,100,20);
cp.add(jp1);
30
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
cp.add(jp2);
cp.add(jp3);
cp.add(jp4);
cp.add(jbexit);
jbexit.reshape(190,400,80,30);
cp.add(jbback);
jbback.reshape(10,400,80,30);
cp.add(jblogin);
jblogin.reshape(100,400,80,30);
jfadmin.setBounds(50,30,300,500);
jfadmin.setVisible(true);
jbexit.addActionListener(this);
jbback.addActionListener(this);
jblogin.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if (ae.getSource() == jbexit)
ystem.exit(0);
else
if(ae.getSource() == jbback)
{
jfadmin.dispose();
new home();
}
else
if (ae.getSource() == jblogin)
{
try
31
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
{
String u1 = jt1.getText();
String p1 = jp1.getText();
String u2 = jt2.getText();
String p2 = jp2.getText();
String u3 = jt3.getText();
String p3 = jp3.getText();
String u4 = jt4.getText();
String p4 = jp4.getText();
if(u1.equals(u2) || u1.equals(u3) || u1.equals(u4))
{
JOptionPane.showMessageDialog ((Component) null, "Enter correct
usernames.", "Click OK", JOptionPane.INFORMATION_MESSAGE);
}
else
if (u2.equals(u3) || u2.equals(u4) || u3.equals(u4))
{
JOptionPane.showMessageDialog ((Component) null, "Enter correct
usernames.", "Click OK", JOptionPane.INFORMATION_MESSAGE);
}
else
{
String grp = "group1";
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection ("jdbc:odbc:multi");
PreparedStatement pst = con.prepareStatement ("select * from login where
groupid=? and username=? and pass=?");
pst.setString(1,grp);
pst.setString(2,u1);
32
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
pst.setString(3,p1);
ResultSet rs = pst.executeQuery();
if (rs.next())
{
System.out.println ("valid user1");
PreparedStatement pst1=con.prepareStatement ("select * from login where
groupid=? and username=? and pass=?");
pst1.setString(1,grp);
pst1.setString(2,u2);
pst1.setString(3,p2);
ResultSet rs1 = pst1.executeQuery();
if (rs1.next())
{
System.out.println ("valid user2");
PreparedStatement pst2=con.prepareStatement ("select * from login where
groupid=? and username=? and pass=?");
pst2.setString(1,grp);
pst2.setString(2,u3);
pst2.setString(3,p3);
ResultSet rs2=pst2.executeQuery();
if (rs2.next())
{
System.out.println ("valid user3");
PreparedStatement pst3=con.prepareStatement ("select * from login where
groupid=? and username=? and pass=?");
pst3.setString(1,grp);
pst3.setString(2,u4);
pst3.setString(3,p4);
ResultSet rs3 = pst3.executeQuery();
33
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
if (rs3.next())
{
System.out.println("valid user4");
jfadmin.dispose();
new sender("admin");
}
else
{
JOptionPane.showMessageDialog ((Component) null, "Invalid user4 login",
"Click OK",JOptionPane.INFORMATION_MESSAGE);
}
}
else
{
JOptionPane.showMessageDialog ((Component) null, "Invalid user3 login",
"Click OK", JOptionPane.INFORMATION_MESSAGE);
}
}
else
{
JOptionPane.showMessageDialog((Component) null, "Invalid user2 login",
"Click OK", JOptionPane.INFORMATION_MESSAGE);
}
}
else
{
JOptionPane.showMessageDialog ((Component) null, "Invalid user1 login",
"Click OK", JOptionPane.INFORMATION_MESSAGE);
}
34
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
}
}
catch(Exception e)
{
System.out.println(e);
}
}
}
}
import java.net.*;
import java.io.*;
import java.sql.*;
import java.util.*;
import java.util.Random.*;
import java.math.BigInteger;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
35
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
int readcnt = 0;
BufferedReader in1;
BigInteger p,q;
ServerSocket ss;
Socket soc;
Thread t1;
thirdparty myparent;
this.myparent = parent;
try
t1 = new Thread(this,"get");
soc = insocket1;
t1.start();
catch(Exception e)
System.out.println(e);
36
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
/*----------------------------------------mainmethod----------------------------*/
void mainmethod()
try
while(true)
readcnt = in1.read(chstr);
if(readcnt <=0)
continue;
else
break;
System.out.println(instring);
myparent.jtaw.append("\n"+instring+"\n");
while(st.hasMoreTokens())
v.add(st.nextToken());
37
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
System.out.println("sgt ="+sgt);
if (sgt.equals("sender"))
senderside();
else
receiverside();
catch(Exception e)
System.out.println(e);
38
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
/*---------------------------------run------------------------------------------*/
try
while(true)
mainmethod();
catch(NullPointerException e)
/*-----------------------------------senderside-----------------------------------*/
void senderside()
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
39
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
String sg = v.get(1).toString();
String rg = v.get(3).toString();
System.out.println(v.elementAt(i));
if (sid.equals("admin"))
myparent.jtaw.append("Sender is admin\n");
generatePQ();
BigInteger n1 = generateN(p,q);
myparent.jtaw.append("n1="+n1+"\n");
BigInteger e1 = generateE(p,q,size);
myparent.jtaw.append("e1="+e1+"\n");
BigInteger d1 = generateD(p,q,e1);
myparent.jtaw.append("d1 ="+d1+"\n");
40
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
while(n2.compareTo(n1) == -1 || n2.compareTo(n1) == 0)
generatePQ();
n2 = generateN(p,q);
myparent.jtaw.append("\nn2 ="+n2+"\n");
BigInteger e2 = generateE(p,q,size);
BigInteger d2 = generateD(p,q,e2);
while(n3.compareTo(n2) == -1 || n3.compareTo(n2) == 0)
generatePQ();
n3 = generateN(p,q);
myparent.jtaw.append("\nn3 ="+n3+"\n");
BigInteger e3 = generateE(p,q,size);
BigInteger d3 = generateD(p,q,e3);
while(n4.compareTo(n3) == -1 || n4.compareTo(n3) == 0)
generatePQ();
n4 = generateN(p,q);
41
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
myparent.jtaw.append("\nn4 ="+n4+"\n");
BigInteger e4 = generateE(p,q,size);
BigInteger d4 = generateD(p,q,e4);
System.out.println("bigint: "+msg);
myparent.jtaw.append("Msg ="+msg+"\n");
BigInteger s1 = encrypt(msg,e1,n1);
myparent.jtaw.append("s1 ="+s1+"\n");
BigInteger s2 = encrypt(s1,e2,n2);
myparent.jtaw.append("s2 ="+s2+"\n");
BigInteger s3 = encrypt(s2,e3,n3);
myparent.jtaw.append("s3 ="+s3+"\n");
BigInteger s4 = encrypt(s3,e4,n4);
pst.setString(1,sg);
pst.setString(2,rg);
pst.setString(3,cypher.toString());
pst.setString(4,n1.toString());
pst.setString(5,n2.toString());
42
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
pst.setString(6,n3.toString());
pst.setString(7,n4.toString());
pst.setString(8,d1.toString());
pst.setString(9,d2.toString());
pst.setString(10,d3.toString());
pst.setString(11,d4.toString());
pst.executeUpdate();
else
myparent.jtaw.append("sender is user\n");
generatePQ();
BigInteger n = generateN(p,q);
myparent.jtaw.append("n ="+n+"\n");
BigInteger e = generateE(p,q,size);
myparent.jtaw.append("e ="+e+"\n");
BigInteger d = generateD(p,q,e);
myparent.jtaw.append("d ="+d+"\n");
myparent.jtaw.append("msg ="+msg+"\n");
System.out.println("Biginteger: "+msg);
myparent.jtaw.append("Cipher ="+cypher+"\n");
43
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
pst.setString(1,sg);
pst.setString(2,sid);
pst.setString(3,rg);
pst.setString(4,rid);
pst.setString(5,cypher.toString());
pst.setString(6,n.toString());
pst.setString(7,d.toString());
pst.executeUpdate();
catch(Exception e)
System.out.println(e);
/*---------------------------------------reciverside-------------------------------*/
void receiverside()
try
44
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
(soc.getOutputStream());
String rg = v.get(1).toString();
if (rid.equals("admin"))
pst1.setString(1,rg);
if (!(rs1.next()))
fout.write(data.getBytes());
fout.flush();
else
45
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
myparent.jtaw.append("cipher ="+cypher+"\n");
BigInteger s4 = decrypt(cypher,d4,n4);
myparent.jtaw.append("s4 ="+s4+"\n");
BigInteger s3 = decrypt(s4,d3,n3);
myparent.jtaw.append("s3 ="+s3+"\n");
BigInteger s2 = decrypt(s3,d2,n2);
myparent.jtaw.append("s2 ="+s2+"\n");
BigInteger s1 = decrypt(s2,d1,n1);
myparent.jtaw.append("s1 ="+s1+"\n");
System.out.println("s1: "+s1);
System.out.println("Message: "+msg);
myparent.jtaw.append("msg ="+msg+"\n");
46
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
fout.write(data.getBytes());
fout.flush();
else
pst1.setString(1,rg);
pst1.setString(2,rid);
if (!(rs1.next()))
fout.write(data.getBytes());
fout.flush();
else
47
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
myparent.jtaw.append("cipher ="+cypher+"\n");
myparent.jtaw.append("n ="+n+"\n");
myparent.jtaw.append("d ="+d+"\n");
BigInteger plain=decrypt(cypher,d,n);
myparent.jtaw.append("msg ="+msg+"\n");
fout.write(data.getBytes());
fout.flush();
catch(Exception e)
48
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
/*--------------------------generate p,q------------------------------------------*/
//If the "generate pq" button is pushed then get the desired size of p and q
//then let the BigInteger class generate the prime. The size of p and q
//is offset so that we can guarantee that p and q will not be too close
void generatepq()
try
//16=bitsize
catch(Exception ex)
System.out.println("getpq: "+ex);
49
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
return ntemp;
/*------------------------------------Generate e----------------------------------*/
int i = 0;
do
i = i + 1;
return e;
50
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
/*-------------------------------------Generate d------------------------------*/
BigInteger d = etemp.modInverse(phi_pq);
return d;
/*---------------------------------encrypt msg-----------------------------------*/
// So first I find the bit size of n, then subract one, and that is the
// size of the message that I will encrypt at one time. This ensures
// the message is shifted right and the result is shifted left and combined
// with c. The encrypted chunk must be the same bit size as n so that no
// data is lost.
// Encryption is done using the modPow function provide by the BigInt class.
51
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
BigInteger c, bitmask;
c = new BigInteger("0");
int i = 0;
while (m.compareTo(bitmask) == 1)
(i*ntemp.bitLength()).or (c);
m = m.shiftRight(ntemp.bitLength()-1);
i = i+1;
c = m.modPow(etemp,ntemp).shiftLeft(i*ntemp.bitLength()).or(c);
return c;
/*-----------------------------------------decrypt---------------------------------*/
//Decryption is done just as encryption above, only now the data is read in
// in chunks the same size as n, and the result, if correct, will be one bit
// less than the size of n (because that was the original chuck size).
52
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
BigInteger m, bitmask;
m = new BigInteger("0");
int i = 0;
BigInteger("1"));
while (c.compareTo(bitmask) == 1)
m = c.and(bitmask).modPow (dtemp,ntemp).shiftLeft(i*(ntemp.bitLength()-
1)).or(m);
c = c.shiftRight(ntemp.bitLength());
i = i+1;
m = c.modPow(dtemp,ntemp).shiftLeft(i*(ntemp.bitLength()-1)).or(m);
return m;
void fmethod()
53
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
Container cp = jf.getContentPane();
cp.setLayout(null);
cp.add(jl);
cp.add(jb);
jl.reshape(50,50,300,40);
jb.reshape(100,150,100,30);
jf.validate();
jf.setSize(400,300);
jf.setVisible(true);
jb.addActionListener(this);
if(ae.getSource() == jb)
System.exit(0);
JFrame jfw;
54
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
thirdparty()
try
//detailwindow();
cpw.setLayout(null);
cpw.add(jlw);
jlw.reshape(20,20,250,30);
cpw.add(jspw);
jspw.reshape(20,80,350,300);
jtaw.setEditable(false);
jfw.validate();
jfw.setSize(500,500);
jfw.setVisible(true);
while(true)
System.out.println("waiting");
55
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
System.out.println("connected");
catch(Exception e)
System.out.println("UHE");
f.fmethod();
Receiver Module
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)
//GEN-FIRST:event_jButton1ActionPerformed
if(evt.getSource()==jButton1)
String uname=jTextField1.getText();
String pass=jPasswordField1.getText();
56
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
String gid=jComboBox1.getSelectedItem().toString();
try
while(true)
readcnt=in1.read(chstr);
if(readcnt <=0)
continue;
else
break;
catch(Exception e)
System.out.println(instring);
while(st.hasMoreTokens())
57
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
v.add(st.nextToken());
if(uname.equals("admin"))
user = v.get(0).toString();
BigInteger r3 = decrypt(cypher,d3,n3);
BigInteger r2 = decrypt(r3,d2,n2);
BigInteger r1 = decrypt(r2,d1,n1);
jTextArea1.setText(new String(b));
else
try
connect();
58
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
pst.setString(1,gid);
pst.setString(2,uname);
rs = pst.executeQuery();
int k = 0;
if(rs.next())
if(pass.equals(rs.getString("pass")))
k = 1;
System.out.println("hi");
StringBuffer sb = null;
if(k == 1)
pst.setString(1,uname);
pst.setString(2,gid);
System.out.println("hi");
int i=0;
while(rs3.next())
59
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
int l=0;
jTextArea1.setText("");
n = new BigInteger(rs3.getString(6));
d = new BigInteger(rs3.getString(7));
BigInteger r3 = decrypt(msg,d,n);
else
JOptionPane.showMessageDialog(null,"InvalidPassword","info",1);
catch(Exception e)
System.out.println(e);
}//GEN-LAST:event_jButton1ActionPerformed
60
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Con = DriverManager.getConnection("jdbc:odbc:multi");
catch(Exception e)
/**
*/
java.awt.EventQueue.invokeLater(new Runnable()
new Receive().setVisible(true);
61
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
BigInteger m, bitmask;
m = new BigInteger("0");
int i = 0;
BigInteger("1"));
while (c.compareTo(bitmask) == 1)
m = c.and(bitmask).modPow(dtemp,ntemp).shiftLeft(i*(ntemp.bitLength()-
1)).or(m);
c = c.shiftRight(ntemp.bitLength());
i = i+1;
m = c.modPow(dtemp,ntemp).shiftLeft(i*(ntemp.bitLength()-1)).or(m);
return m;
62
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
CHAPTER 10
TESTING
10.1 UNIT TESTING
63
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
It involves the testing of the order in which the different modules are
combined to produce the functioning whole. Integration testing generally
throws light on the order of arrangement of units, modules, systems,
subsystems and the entire product. The proposed system, “ the client server
architecture “ inherits a bottom-up integration strategy in which all the
subsystem and the modules involved in it are independently tested and
integrated to from the entire system, which is then tested as a whole.
For the testing of this system it was required that the software be
tested for performing its basic functions that are as follows: -
Start the server first and then client, then there is no error. Start the server
and client, and then stop the server and a send a message from client. The
error is no server connection. Start client first, then the error is client is not
connected to the server.
64
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
USERNAME receiver^group2^admin
: user2 message from receiver VIEW
receiver is admin
PASSWORD checking for messages in database MESSAGE:
: user2 one message found
cypher=19788535774630773748 hello
USER4 s4=5026714486095450749
s3=1248857614252647091
LOGIN
s2=57977171130529114
s1=448378203247
USERNAME msg=hello
: user4 message sent to receiver
PASSWORD
: user4
LOGIN
65
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
LOGIN : USERLOGIN
receiver^group2^user1
message from receiver VIEW
receiver is a user MESSAGE
checking for messages in database
one message found
cypher=2744449612006375104 Pesit
n=1577210399
d=125241413
msg=pesit
msg sent to receiver
66
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
CHAPTER 11
SCREEN SHOTS
67
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
68
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
69
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
70
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
71
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
CHAPTER 12
CONCLUSION
All the security requirements needed are satisfied because of the strong
break-resistance. The threshold multisignature scheme remains secure even if
the threshold cryptosystem has been broken. This provides a huge advantage.
This scheme has been designed to deal with the latest attacks of
threshold signature scheme by using a traceability feature. Also the scheme is
a order sensitive .The decryption has to be performed in the same order as
the encryption. This further improves security.
72
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
CHAPTER 13
FUTURE ENHANCEMENTS
The project has been implemented for one group on the senders end. It can
be implemented for many groups and thus made more real time. In order to
enhance the already existing features we can try to implement a backup of
the third party on another system. If the existing system fails the other
system can immediately take control thus providing a good real time network.
It helps in dealing with crashes and other such related issues.
The project has been developed for one user to send a message to one user
only and for a group to send message to a group. We can take it to the next
level where a message can be sent from one user to multiple users and from
one group to one or more users.
Also we don’t have the option to include new users in our project. This feature
can be implemented to make the system more real time.
73
Department of CSE Jan’10 – Apr’10 HMRITM
MAJOR PROJECT: “DIRECTED THRESHOLD – MULTISIGNATURE SCHEME”
CHAPTER 14
BIBLIOGRAPHY
[1] Boyar, J., Chaum D., Damgard I. and Pederson T., (1991), Convertible
undeniable signatures. Advances in Cryptology – Crypto, 90, LNCS #
537,p.p.189-205.
[6] Shamir A. (1979). How to share a secret, communications of the ACM, 22:
p.p. 612 -613.
74
Department of CSE Jan’10 – Apr’10 HMRITM