Скачиваний:
15
Добавлен:
01.05.2014
Размер:
43.08 Кб
Скачать
/*
* DiffieHellmanW.java
*
* Created on April 25, 2007, 11:06 PM
*/

package diffiehellmann;
import javax.swing.*;
import java.math.BigInteger;
import java.util.Random;
/**
*
* @author adm
*/
public class DiffieHellmanW extends javax.swing.JFrame {
int count =0;
String ts = null;
BigInteger p, q, s1, s2;
long ip, iq, is1, is2;
long y1,y2;
long key, key2;
/** Creates new form DiffieHellmanW */
public DiffieHellmanW() {
initComponents();
//jDialog1 = new JDialog(this);
jButtonExchange.setEnabled(false);
jButtonGen.setEnabled(true);
setIconImage(java.awt.Toolkit.getDefaultToolkit().getImage("images\\yo.gif"));
}

public void clear() {
this.jTextFieldKey1.setText("");
this.jTextFieldKey2.setText("");
this.jTextFieldP1.setText("");
this.jTextFieldP2.setText("");
this.jTextFieldQ1.setText("");
this.jTextFieldQ2.setText("");
this.jTextFieldS1.setText("");
this.jTextFieldS2.setText("");
this.jTextFieldY11.setText("");
this.jTextFieldY12.setText("");
this.jTextFieldY21.setText("");
this.jTextFieldY22.setText("");

this.jTextPaneLog.setText("");
}

public void genSrc() {
p = new BigInteger(100, 10, new Random());
q = new BigInteger(100,10, new Random());
s1 = new BigInteger(50,5, new Random());
s2 = new BigInteger(50,5, new Random());
ip = Math.abs(p.intValue());
iq=Math.abs(q.intValue());
is1 = Math.abs(s1.intValue());
is2 = Math.abs(s2.intValue());
this.jTextFieldP1.setText(""+ ip);
this.jTextFieldP2.setText(""+ ip);
this.jTextFieldQ1.setText(""+iq);
this.jTextFieldQ2.setText(""+iq);
this.jTextFieldS1.setText(""+is1);
this.jTextFieldS2.setText(""+is2);

addToLog("----START------\nGen: P,Q,Secrets");
}
public void addToLog(String txt) {
jTextPaneLog.setText(jTextPaneLog.getText() +txt+ "\n");
}


//q^s mod p
// modexp return a ^ x mod n
public void genY() {
y1 = U.modexp(iq, is1, ip);
y2 = U.modexp(iq, is2, ip);
jTextFieldY11.setText(""+y1);
jTextFieldY21.setText(""+y2);
jTextFieldY12.setText(""+y1);
jTextFieldY22.setText(""+y2);

}
public void genSecret() {
key = U.modexp(y2, is1, ip);
jTextFieldKey1.setText(""+key);
key2 = U.modexp(y1, is2, ip);
jTextFieldKey2.setText(""+key2);

}

/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
jDialog1 = new javax.swing.JDialog(this);
jScrollPane2 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
jButton1 = new javax.swing.JButton();
jSplitPane1 = new javax.swing.JSplitPane();
jPanel1 = new javax.swing.JPanel();
jSeparator1 = new javax.swing.JSeparator();
jTextFieldP1 = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jTextFieldP2 = new javax.swing.JTextField();
jTextFieldQ1 = new javax.swing.JTextField();
jTextFieldQ2 = new javax.swing.JTextField();
jTextFieldS1 = new javax.swing.JTextField();
jTextFieldS2 = new javax.swing.JTextField();
jTextFieldY11 = new javax.swing.JTextField();
jTextFieldY12 = new javax.swing.JTextField();
jTextFieldY21 = new javax.swing.JTextField();
jTextFieldY22 = new javax.swing.JTextField();
jTextFieldKey1 = new javax.swing.JTextField();
jTextFieldKey2 = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
jButtonExchange = new javax.swing.JButton();
jButtonGen = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
jTextPaneLog = new javax.swing.JTextPane();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenuItem1 = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
jMenuItem3 = new javax.swing.JMenuItem();
jMenuItem2 = new javax.swing.JMenuItem();

jDialog1.setTitle("\u041e\u0431 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u043e\u0431\u043c\u0435\u043d\u0430 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 \u0414\u0438\u0444\u0444\u0438-\u0425\u0435\u043b\u043b\u043c\u0430\u043d\u0430");
jDialog1.getAccessibleContext().setAccessibleParent(null);
jTextArea1.setColumns(20);
jTextArea1.setLineWrap(true);
jTextArea1.setRows(5);
jTextArea1.setText("\u0410\u041b\u0413\u041e\u0420\u0418\u0422\u041c \u041e\u0411\u041c\u0415\u041d\u0410 \u041a\u041b\u042e\u0427\u0410\u041c\u0418 \u0414\u0418\u0424\u0424\u0418-\u0425\u0415\u041b\u041b\u041c\u0410\u041d\u0410\n\n\u041c\u0435\u0442\u043e\u0434 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u0430\u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c RSA. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430\u0437\u0432\u0430\u043d \u043f\u043e \u0444\u0430\u043c\u0438\u043b\u0438\u044f\u043c \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0435\u0439 \u0414\u0438\u0444\u0444\u0438 (Diffie) \u0438 \u0425\u0435\u043b\u043b\u043c\u0430\u043d\u0430 (Hellman). \n\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043a\u0440\u0443\u0433 \u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0434\u0432\u0443\u043c \u0430\u0431\u043e\u043d\u0435\u043d\u0442\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u043a\u0443, \u0430 \u0432 \u0438\u0445 \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0435\u043d\u0438\u0438 \u043d\u0435\u0442 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043e\u0433\u043e\u0432\u043e\u0440\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430. \u041e\u0434\u043d\u0430\u043a\u043e, \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u0430\u043d\u0430\u043b, \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u0439 \u043e\u0442 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u043f\u043e \u043d\u0435\u043c\u0443, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0430\u043d\u044b, \u043d\u043e \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b (\u0442\u0430\u043a\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438\u043c\u0435\u044e\u0442 \u043c\u0435\u0441\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e). \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0432\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447, \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0435\u0433\u043e \u043f\u043e \u0441\u0435\u0442\u0438, \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443. \n\n\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u043e\u0431\u043e\u0438\u043c \u0430\u0431\u043e\u043d\u0435\u043d\u0442\u0430\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 v \u0438 n. \u041e\u043d\u0438, \u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u0438 \u0432\u0441\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043b\u0438\u0446\u0430\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \"\u0437\u0430\u0448\u0438\u0442\u044b\" \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u043a\u043e\u043c\u0443 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447, \u043e\u0431\u0430 \u0430\u0431\u043e\u043d\u0435\u043d\u0442\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0438\u043b\u0438 \u043f\u0441\u0435\u0432\u0434\u043e\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 : \u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0431\u043e\u043d\u0435\u043d\u0442 \u2013 \u0447\u0438\u0441\u043b\u043e x, \u0432\u0442\u043e\u0440\u043e\u0439 \u0430\u0431\u043e\u043d\u0435\u043d\u0442 \u2013 \u0447\u0438\u0441\u043b\u043e y. \u0417\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0431\u043e\u043d\u0435\u043d\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (v^x) mod n \u0438 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0435\u0442 \u0435\u0433\u043e \u0432\u0442\u043e\u0440\u043e\u043c\u0443, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 (v^y) mod n \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u043e\u043c\u0443. \u0417\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0431\u0430 \u044d\u0442\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043d\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 (\u0432\u043c\u0435\u0448\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438) \u043d\u0435 \u043c\u043e\u0436\u0435\u0442. \u041d\u0430 \u0432\u0442\u043e\u0440\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0431\u043e\u043d\u0435\u043d\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u043c\u0435\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u0443 \u043d\u0435\u0433\u043e x \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e \u0441\u0435\u0442\u0438 (vy) mod n \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (((v^y) mod n)x)mod n, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0430\u0431\u043e\u043d\u0435\u043d\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u043c\u0435\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u0443 \u043d\u0435\u0433\u043e y \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e \u0441\u0435\u0442\u0438 (v^x) mod n \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (((v^x) mod n)y)mod n. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c\u0430 \u0447\u0435\u0440\u0435\u0437 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0432\u0437\u044f\u0442\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443 (\u0442\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u043c\u043c\u0443\u0442\u0430\u0442\u0438\u0432\u043d\u0430 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u043f\u043e\u043b\u0435), \u0442\u043e \u0435\u0441\u0442\u044c \u0443 \u043e\u0431\u043e\u0438\u0445 \u0430\u0431\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435 \u0447\u0438\u0441\u043b\u043e : ((v^x*y) mod n. \u0415\u0433\u043e \u043e\u043d\u0438 \u0438 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0437\u0434\u0435\u0441\u044c \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a \u0441\u043d\u043e\u0432\u0430 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 RSA \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c \u043f\u043e \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u043d\u044b\u043c (v^x) mod n \u0438 (v^y) mod n \u0441\u0430\u043c\u0438 \u0447\u0438\u0441\u043b\u0430 x \u0438 y \u2013 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0438 \u043e\u0447\u0435\u043d\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0435\u043c\u043a\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u0435\u0441\u043b\u0438 \u0447\u0438\u0441\u043b\u0430 v,n,x,y \u0432\u044b\u0431\u0440\u0430\u043d\u044b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438. \n\n\n\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0435\u0449\u0435 \u0440\u0430\u0437 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0414\u0438\u0444\u0444\u0438-\u0425\u0435\u043b\u043b\u043c\u0430\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043b\u0438\u043d\u0438\u044f\u0445 \u0441\u0432\u044f\u0437\u0438, \u043d\u0430\u0434\u0435\u0436\u043d\u043e \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u0445 \u043e\u0442 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u0431\u044b \u043e\u043d \u0431\u044b\u043b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u043d\u0430 \u043b\u044e\u0431\u044b\u0445 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u043a\u0430\u043d\u0430\u043b\u0430\u0445, \u0442\u043e \u0434\u0430\u0432\u043d\u043e \u0441\u043d\u044f\u043b \u0431\u044b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439 \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0437\u0430\u043c\u0435\u043d\u0438\u043b \u0441\u043e\u0431\u043e\u0439 \u0432\u0441\u044e \u0430\u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u0443\u044e \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044e. \u041e\u0434\u043d\u0430\u043a\u043e, \u0432 \u0442\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043a\u0430\u043d\u0430\u043b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u043a\u043b\u0438\u043d\u0438\u0432\u0430\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043b\u044e\u0447\u0435\u0439 \"\u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0430-\u043f\u043e\u0441\u0440\u0435\u0434\u043d\u0438\u043a\u0430\" \u043f\u043e \u0442\u043e\u0439 \u0436\u0435 \u0441\u0430\u043c\u043e\u0439 \u0441\u0445\u0435\u043c\u0435, \u0447\u0442\u043e \u0438 \u0434\u043b\u044f \u0430\u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u043e\u0439 \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438. \n");
jTextArea1.setOpaque(false);
jScrollPane2.setViewportView(jTextArea1);

jButton1.setText("\u0417\u0430\u043a\u0440\u044b\u0442\u044c");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

org.jdesktop.layout.GroupLayout jDialog1Layout = new org.jdesktop.layout.GroupLayout(jDialog1.getContentPane());
jDialog1.getContentPane().setLayout(jDialog1Layout);
jDialog1Layout.setHorizontalGroup(
jDialog1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jDialog1Layout.createSequentialGroup()
.addContainerGap()
.add(jDialog1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(org.jdesktop.layout.GroupLayout.LEADING, jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 488, Short.MAX_VALUE)
.add(jButton1))
.addContainerGap())
);
jDialog1Layout.setVerticalGroup(
jDialog1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jDialog1Layout.createSequentialGroup()
.addContainerGap()
.add(jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 422, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButton1)
.addContainerGap())
);

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0431\u043c\u0435\u043d\u0430 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 \u0414\u0438\u0444\u0444\u0438-\u0425\u0435\u043b\u043b\u043c\u0430\u043d\u0430");
setResizable(false);

jLabel1.setText("\u0423\u0447\u0430\u0441\u0442\u043d\u0438\u043a \u043e\u0431\u043c\u0435\u043d\u0430 (1)");

jLabel2.setText("\u0423\u0447\u0430\u0441\u0442\u043d\u0438\u043a \u043e\u0431\u043c\u0435\u043d\u0430 (2)");

jLabel3.setText("P");

jLabel4.setText("Q");

jLabel5.setText("\u0421\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u044e\u0449\u0438\u0445\u0441\u044f");

jLabel6.setText("\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f");

jLabel7.setText("S");

jLabel8.setText("(Q^S1) mod P \u0438 (Q^S2) mod P");

jLabel9.setText("\u0421\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 = Y2^S1 mod P = Y1^S2 mod P");

jLabel10.setText("Y");

org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.add(jSeparator1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 288, Short.MAX_VALUE))
.add(jPanel1Layout.createSequentialGroup()
.add(21, 21, 21)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 125, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(org.jdesktop.layout.GroupLayout.LEADING, jTextFieldP1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 95, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jTextFieldY11, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 95, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jTextFieldY21, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 95, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jTextFieldKey1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 95, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jTextFieldQ1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 95, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jTextFieldS1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 95, Short.MAX_VALUE))
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.add(13, 13, 13)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabel3)
.add(jLabel4)))
.add(jPanel1Layout.createSequentialGroup()
.add(14, 14, 14)
.add(jLabel7))
.add(jPanel1Layout.createSequentialGroup()
.add(14, 14, 14)
.add(jLabel10)))
.add(15, 15, 15)))
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 128, Short.MAX_VALUE)
.add(jTextFieldP2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 118, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jTextFieldQ2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 116, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jTextFieldS2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 116, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jTextFieldY12, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 117, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jTextFieldY22, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 116, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jTextFieldKey2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 115, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(18, 18, 18)))
.addContainerGap())
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(58, Short.MAX_VALUE)
.add(jLabel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 165, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(85, 85, 85))
.add(jPanel1Layout.createSequentialGroup()
.add(57, 57, 57)
.add(jLabel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 211, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap(40, Short.MAX_VALUE))
.add(jPanel1Layout.createSequentialGroup()
.add(43, 43, 43)
.add(jLabel8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 254, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap(11, Short.MAX_VALUE))
.add(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.add(jLabel9, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 288, Short.MAX_VALUE)
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel2)
.add(jLabel1))
.add(12, 12, 12)
.add(jLabel6)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jTextFieldP1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jLabel3)
.add(jTextFieldP2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jTextFieldQ1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jLabel4)
.add(jTextFieldQ2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(23, 23, 23)
.add(jLabel5)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jTextFieldS1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jLabel7)
.add(jTextFieldS2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(15, 15, 15)
.add(jLabel8)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jTextFieldY11, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jTextFieldY12, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jTextFieldY21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jTextFieldY22, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
.add(jPanel1Layout.createSequentialGroup()
.add(20, 20, 20)
.add(jLabel10)))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 36, Short.MAX_VALUE)
.add(jLabel9)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jTextFieldKey1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jTextFieldKey2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
);
jSplitPane1.setLeftComponent(jPanel1);

jButtonExchange.setText("\u041e\u0431\u043c\u0435\u043d");
jButtonExchange.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonExchangeActionPerformed(evt);
}
});

jButtonGen.setText("\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c");
jButtonGen.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonGenActionPerformed(evt);
}
});

jButton3.setText("\u041e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});

jTextPaneLog.setEditable(false);
jScrollPane1.setViewportView(jTextPaneLog);

org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel2Layout.createSequentialGroup()
.addContainerGap(23, Short.MAX_VALUE)
.add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(org.jdesktop.layout.GroupLayout.LEADING, jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE)
.add(jButtonExchange, 0, 0, Short.MAX_VALUE)
.add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
.add(jButton3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(jButtonGen, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addContainerGap())
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.add(jButtonGen)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButtonExchange)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 230, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButton3)
.addContainerGap())
);
jSplitPane1.setRightComponent(jPanel2);

jMenu1.setText("\u0424\u0430\u0439\u043b");
jMenu1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenu1ActionPerformed(evt);
}
});

jMenuItem1.setText("\u0412\u044b\u0445\u043e\u0434");
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem1ActionPerformed(evt);
}
});

jMenu1.add(jMenuItem1);

jMenuBar1.add(jMenu1);

jMenu2.setText("\u041f\u043e\u043c\u043e\u0449\u044c");
jMenuItem3.setText("\u041e\u0431 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435");
jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem3ActionPerformed(evt);
}
});

jMenu2.add(jMenuItem3);

jMenuItem2.setText("\u041e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435");
jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem2ActionPerformed(evt);
}
});

jMenu2.add(jMenuItem2);

jMenuBar1.add(jMenu2);

setJMenuBar(jMenuBar1);

org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(jSplitPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 467, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(jSplitPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
jDialog1.setVisible(false);
}//GEN-LAST:event_jButton1ActionPerformed

private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
// TODO add your handling code here:

//this.add(jDialog1.setParentComponent(this);
jDialog1.setSize(400,500);
jDialog1.setVisible(true);
}//GEN-LAST:event_jMenuItem3ActionPerformed

private void jButtonExchangeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonExchangeActionPerformed
// TODO add your handling code here:
jButtonGenActionPerformed(evt);
}//GEN-LAST:event_jButtonExchangeActionPerformed

private void jButtonGenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGenActionPerformed
// TODO add your handling code here:
switch (count ) {
case 0:
count ++;
clear();
genSrc();
jButtonExchange.setEnabled(true);
jButtonGen.setEnabled(false);
addToLog("p: "+ip);
addToLog("q: "+iq);
addToLog("secret 1: "+is1);
addToLog("secret 2: "+is2);
break;
case 1:
addToLog("----EXCHANGE-- ");
addToLog("Y1="+y1);
addToLog("Y2="+y2);
ts = jButtonExchange.getText();
jButtonExchange.setText("GET KEYS");
count ++;
genY();
break;
case 2:
count =0;
genSecret();
addToLog("----Gen secret keys-- ");
addToLog("KEY-1="+key);
addToLog("KEY-2="+key2);
addToLog("----FINISH-- ");
JOptionPane.showMessageDialog(this,
"Obmen zavershen!", "Exchange complete",
JOptionPane.PLAIN_MESSAGE);
jButtonExchange.setEnabled(false);
jButtonGen.setEnabled(true);
jButtonExchange.setText(ts);
break;
default:
count = 0;
jButtonExchange.setEnabled(false);
jButtonGen.setEnabled(true);
clear();
}
}//GEN-LAST:event_jButtonGenActionPerformed

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
// TODO add your handling code here:
jMenuItem2ActionPerformed(evt);
}//GEN-LAST:event_jButton3ActionPerformed

private void jMenu1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jMenu1ActionPerformed

private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
// TODO add your handling code here:
JOptionPane.showMessageDialog(this,
"Lab 3 in SZI\n\rFilippov K.\n\rMwenge Mulenga\n\rBubba",
"O programme:", JOptionPane.PLAIN_MESSAGE);
}//GEN-LAST:event_jMenuItem2ActionPerformed

private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
// TODO add your handling code here:
System.exit(0);
}//GEN-LAST:event_jMenuItem1ActionPerformed

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
//Mclass.main(args);
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new DiffieHellmanW().setVisible(true);
}
});

}

// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButtonExchange;
private javax.swing.JButton jButtonGen;
private javax.swing.JDialog jDialog1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem jMenuItem1;
private javax.swing.JMenuItem jMenuItem2;
private javax.swing.JMenuItem jMenuItem3;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JSplitPane jSplitPane1;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JTextField jTextFieldKey1;
private javax.swing.JTextField jTextFieldKey2;
private javax.swing.JTextField jTextFieldP1;
private javax.swing.JTextField jTextFieldP2;
private javax.swing.JTextField jTextFieldQ1;
private javax.swing.JTextField jTextFieldQ2;
private javax.swing.JTextField jTextFieldS1;
private javax.swing.JTextField jTextFieldS2;
private javax.swing.JTextField jTextFieldY11;
private javax.swing.JTextField jTextFieldY12;
private javax.swing.JTextField jTextFieldY21;
private javax.swing.JTextField jTextFieldY22;
private javax.swing.JTextPane jTextPaneLog;
// End of variables declaration//GEN-END:variables

}
Соседние файлы в папке diffiehellmann