資源簡介
用java實現Caesar密碼算法,Playfair算法,Hill算法。帶有界面。SSL,IPsec配置文檔
代碼片段和文件信息
package?rsa;
import?java.awt.BorderLayout;
import?java.awt.EventQueue;
import?javax.swing.Jframe;
import?javax.swing.JPanel;
import?javax.swing.border.EmptyBorder;
import?javax.swing.JLabel;
import?javax.swing.JScrollPane;
import?javax.swing.JButton;
import?javax.swing.JTextArea;
import?java.awt.event.ActionListener;
import?java.math.BigInteger;
import?java.awt.event.ActionEvent;
public?class?RSA?extends?Jframe?{
private?JPanel?contentPane;
private?static?JTextArea?textArea;
private?static?JTextArea?textArea_1;
private?static?int?p;
private?static?int?q;
private?static?int?n;
private?static?int?e;
private?static?int?d;
????private?static?int?_n;
????public??static?String?M_code;
????public??static?String?C_code;
????public??static?String?N_code;
????public??static?String?D_code;
????private?static?int?pq_num?=?100;
????private?static?int?d_num?=?100;
/**
?*?Launch?the?application.
?*/
public?static?void?main(String[]?args)?{
EventQueue.invokeLater(new?Runnable()?{
public?void?run()?{
try?{
RSA?frame?=?new?RSA();
frame.setVisible(true);
frame.settitle(“RSA算法“);?
MyRSA();
}?catch?(Exception?e)?{
e.printStackTrace();
}
}
});
}
/**
?*?Create?the?frame.
?*/
public?RSA()?{
setDefaultCloseOperation(Jframe.EXIT_ON_CLOSE);
setBounds(100?100?450?300);
contentPane?=?new?JPanel();
contentPane.setBorder(new?EmptyBorder(5?5?5?5));
setContentPane(contentPane);
contentPane.setLayout(null);
JLabel?label?=?new?JLabel(“\u660E\u6587“);
label.setBounds(70?64?40?15);
contentPane.add(label);
JLabel?label_1?=?new?JLabel(“\u5BC6\u6587“);
label_1.setBounds(70?187?40?15);
contentPane.add(label_1);
JScrollPane?scrollPane?=?new?JScrollPane();
scrollPane.setBounds(120?30?212?79);
contentPane.add(scrollPane);
textArea?=?new?JTextArea();
scrollPane.setViewportView(textArea);
JScrollPane?scrollPane_1?=?new?JScrollPane();
scrollPane_1.setBounds(120?153?212?79);
contentPane.add(scrollPane_1);
textArea_1?=?new?JTextArea();
scrollPane_1.setViewportView(textArea_1);
JButton?button?=?new?JButton(“\u52A0\u5BC6“);
button.addActionListener(new?ActionListener()?{
public?void?actionPerformed(ActionEvent?e)?{
M_code=textArea.getText();
C_code=Encryption(M_code);
textArea_1.append(C_code);
}
});
button.setBounds(140?120?62?23);
contentPane.add(button);
JButton?button_1?=?new?JButton(“解密“);
button_1.addActionListener(new?ActionListener()?{
public?void?actionPerformed(ActionEvent?e)?{
N_code=textArea_1.getText();
D_code=Encryption(N_code);
????textArea.append(D_code);
}
});
button_1.setBounds(249?120?62?23);
contentPane.add(button_1);
}
public?int?getD(){
????????return?d;
????}
????
????public?int?getN(){
????????return?n;
????}
????
????private?static?void?s
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-01-13?17:01??信息安全第二三次作業\
?????目錄???????????0??2018-01-13?17:00??信息安全第二三次作業\.git\
?????文件??????????23??2017-12-10?12:09??信息安全第二三次作業\.git\HEAD
?????文件?????????210??2017-12-20?20:49??信息安全第二三次作業\.git\config
?????文件??????????73??2017-12-10?12:09??信息安全第二三次作業\.git\desc
?????目錄???????????0??2018-01-13?17:00??信息安全第二三次作業\.git\hooks\
?????文件?????????478??2017-12-10?12:09??信息安全第二三次作業\.git\hooks\applypatch-msg.sample
?????文件?????????896??2017-12-10?12:09??信息安全第二三次作業\.git\hooks\commit-msg.sample
?????文件?????????189??2017-12-10?12:09??信息安全第二三次作業\.git\hooks\post-update.sample
?????文件?????????424??2017-12-10?12:09??信息安全第二三次作業\.git\hooks\pre-applypatch.sample
?????文件????????1642??2017-12-10?12:09??信息安全第二三次作業\.git\hooks\pre-commit.sample
?????文件????????1348??2017-12-10?12:09??信息安全第二三次作業\.git\hooks\pre-push.sample
?????文件????????4951??2017-12-10?12:09??信息安全第二三次作業\.git\hooks\pre-reba
?????文件?????????544??2017-12-10?12:09??信息安全第二三次作業\.git\hooks\pre-receive.sample
?????文件????????1239??2017-12-10?12:09??信息安全第二三次作業\.git\hooks\prepare-commit-msg.sample
?????文件????????3610??2017-12-10?12:09??信息安全第二三次作業\.git\hooks\update.sample
?????文件????????1362??2017-12-22?19:03??信息安全第二三次作業\.git\index
?????目錄???????????0??2018-01-13?17:00??信息安全第二三次作業\.git\info\
?????文件?????????240??2017-12-10?12:09??信息安全第二三次作業\.git\info\exclude
?????目錄???????????0??2018-01-13?17:00??信息安全第二三次作業\.git\logs\
?????文件????????4796??2017-12-22?19:03??信息安全第二三次作業\.git\logs\HEAD
?????目錄???????????0??2018-01-13?17:00??信息安全第二三次作業\.git\logs\refs\
?????目錄???????????0??2018-01-13?17:00??信息安全第二三次作業\.git\logs\refs\heads\
?????文件????????4796??2017-12-22?19:03??信息安全第二三次作業\.git\logs\refs\heads\master
?????目錄???????????0??2018-01-13?17:00??信息安全第二三次作業\.git\ob
?????目錄???????????0??2018-01-13?17:00??信息安全第二三次作業\.git\ob
?????文件?????????208??2017-12-15?19:25??信息安全第二三次作業\.git\ob
?????目錄???????????0??2018-01-13?17:00??信息安全第二三次作業\.git\ob
?????文件?????????171??2017-12-10?15:23??信息安全第二三次作業\.git\ob
?????目錄???????????0??2018-01-13?17:00??信息安全第二三次作業\.git\ob
?????文件??????????48??2017-12-10?13:19??信息安全第二三次作業\.git\ob
............此處省略613個文件信息
評論
共有 條評論