- 分享
- 0
- 人气
- 0
- 主题
- 203
- 帖子
- 11942
- UID
- 29537
- 积分
- 2800
- 阅读权限
- 25
- 注册时间
- 2006-3-13
- 最后登录
- 2016-2-29
- 在线时间
- 21910 小时
|
CODE 如下:
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.io.*;
import java.security.*;
import java.lang.*;
import java.math.*;
import java.util.*;
import java.security.spec.*;
public class DSA extends java.applet.Applet {
// member declarations
java.awt.Label lblIput = new java.awt.Label();
java.awt.TextField InputTxt = new java.awt.TextField();
java.awt.Button cmdsign = new java.awt.Button();
java.awt.TextField Rtxt = new java.awt.TextField();
java.awt.Button Cmdverify = new java.awt.Button();
java.awt.Button cmdhash = new java.awt.Button();
java.awt.TextField textField2 = new java.awt.TextField();
java.awt.TextField textField1 = new java.awt.TextField();
java.awt.TextField textField3 = new java.awt.TextField();
java.awt.Label lbhash = new java.awt.Label();
java.awt.Label lbS = new java.awt.Label();
java.awt.Label lby = new java.awt.Label();
java.awt.Label label2 = new java.awt.Label();
java.awt.Label lbverify = new java.awt.Label();
java.awt.Button cmdReset = new java.awt.Button();
BigInteger p,q,g,x,y,k,K,X,Y,R,S,hshm,P,Q,G;
int xcmp,kcmp;
String m;
String p1 = ("fd7f53811d75122952df4a9c2eece4e7f611b7523cef4400c31e3f80b6512669455d402251fb593d8d58fabfc5f5ba30f6cb9b556cd7813b801d346ff26660b76b9950a5a49f9fe8047b1022c24fbba9d7feb7c61bf83b57e7c6a8a6150f04fb83f6d3c51ec3023554135a169132f675f3ae2b61d72aeff22203199dd14801c7");
String q1 = ("9760508f15230b[词语过滤-#261]292b982a2eb840bf0581cf5");
String g1 = ("f7e1a085d69b3ddecbbcab5c36b857b97994afbbfa3aea82f9574c0b3d0782675159578ebad4594fe67107108180b449167123e84c281613b7cf09328cc8a6e13c167a8b547c8d28e0a3ae1e2bb3a675916ea37f0bfa213562f1fb627a01243bcca4f1bea8519089a883dfe15ae59f06928b665e807b552564014c3bfecf492a");
// END GENERATED CODE
boolean isStandalone = false;
public DSA() {initComponents();
}
// Retrieve the value of an applet parameter
public String getParameter(String key, String def) {
return isStandalone ? System.getProperty(key, def) :
(getParameter(key) != null ? getParameter(key) : def);
}
// Get info on the applet parameters
public String[][] getParameterInfo() {
return null;
}
// Get applet information
public String getAppletInfo() {
return "Applet Information";
}
// Initialize the applet
public void init() {
try {
initComponents();
}
catch (Exception e) {
e.printStackTrace();
}
}
public void initComponents() {
// the following code sets the frame's initial state
lblIput.setFont(new java.awt.Font("Dialog", 0, 14));
lblIput.setVisible(true);
lblIput.setLocation(new java.awt.Point(30, 30));
lblIput.setText("INPUT MESSAGE");
lblIput.setSize(new java.awt.Dimension(130, 40));
InputTxt.setLocation(new java.awt.Point(200, 10));
InputTxt.setVisible(true);
InputTxt.setSize(new java.awt.Dimension(250, 100));
cmdsign.setVisible(true);
cmdsign.setLabel("SIGN");
cmdsign.setLocation(new java.awt.Point(240, 260));
cmdsign.setSize(new java.awt.Dimension(120, 40));
Rtxt.setLocation(new java.awt.Point(20, 360));
Rtxt.setVisible(true);
Rtxt.setSize(new java.awt.Dimension(620, 40));
Cmdverify.setVisible(true);
Cmdverify.setLabel("VERIFY");
Cmdverify.setLocation(new java.awt.Point(290, 630));
Cmdverify.setSize(new java.awt.Dimension(120, 40));
cmdhash.setVisible(true);
cmdhash.setLabel("HASH");
cmdhash.setLocation(new java.awt.Point(240, 120));
cmdhash.setSize(new java.awt.Dimension(120, 40));
textField2.setLocation(new java.awt.Point(20, 460));
textField2.setVisible(true);
textField2.setSize(new java.awt.Dimension(620, 40));
textField1.setLocation(new java.awt.Point(20, 570));
textField1.setVisible(true);
textField1.setSize(new java.awt.Dimension(620, 40));
textField3.setLocation(new java.awt.Point(20, 210));
textField3.setVisible(true);
textField3.setSize(new java.awt.Dimension(620, 40));
lbhash.setVisible(true);
lbhash.setLocation(new java.awt.Point(30, 170));
lbhash.setText("The Message after Hsahing is:");
lbhash.setSize(new java.awt.Dimension(300, 30));
lbS.setVisible(true);
lbS.setLocation(new java.awt.Point(20, 420));
lbS.setText("The value of s is :");
lbS.setSize(new java.awt.Dimension(300, 30));
lby.setVisible(true);
lby.setLocation(new java.awt.Point(20, 520));
lby.setText("The value of y is :");
lby.setSize(new java.awt.Dimension(300, 40));
label2.setVisible(true);
label2.setLocation(new java.awt.Point(20, 320));
label2.setText("The value of r is :");
label2.setSize(new java.awt.Dimension(300, 30));
lbverify.setVisible(true);
lbverify.setLocation(new java.awt.Point(50, 680));
lbverify.setText("TO BE VERIFIED ");
lbverify.setSize(new java.awt.Dimension(570, 50));
cmdReset.setVisible(true);
cmdReset.setLabel("Reset");
cmdReset.setLocation(new java.awt.Point(290, 750));
cmdReset.setSize(new java.awt.Dimension(120, 40));
setLocation(new java.awt.Point(0, 0));
setLayout(null);
add(lblIput);
add(InputTxt);
add(cmdsign);
add(Rtxt);
add(Cmdverify);
add(cmdhash);
add(textField2);
add(textField1);
add(textField3);
add(lbhash);
add(lbS);
add(lby);
add(label2);
add(lbverify);
add(cmdReset);
setSize(new java.awt.Dimension(650, 1320));
// event handling
cmdsign.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
cmdsignActionPerformed(e);
}
});
Cmdverify.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
CmdverifyActionPerformed(e);
}
});
cmdhash.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
button3ActionPerformed(e);
}
});
cmdReset.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
cmdResetActionPerformed(e);
}
});
// END GENERATED CODE
} |
|