资源简介
信息安全实习二 实现了图形化界面 包含完整的实习报告。
代码片段和文件信息
package app;
import java.awt.Color;
import java.awt.Container;
import javax.swing.Jframe;
import javax.swing.JLabel;
import javax.swing.JTextArea;
import javax.swing.JButton;
import security.SDec;
import security.SEnc;
import security.Skey_DES;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class Test extends Jframe {
private static final long serialVersionUID = 1L;
private Container content;
private JLabel mingwen1Label;
private JLabel miwenLabel;
private JLabel mingwenLabel;
private JTextArea mingwen1textArea;
private JTextArea miwentextArea;
private JTextArea mingwentextArea;
private JButton jiamiButton;
private JButton jiemiButton;
private JButton cancelButton;
public Test() {
getContentPane().setBackground(Color.ORANGE);
this.settitle(“分组加密算法“);
this.setBounds(350 200 640 480);
// 获取容器对象
content = this.getContentPane();
// 设定容器的布局管理器样式为null
content.setLayout(null);
mingwen1Label = new JLabel(“请输入明文: “);
mingwen1Label.setBounds(126 45 120 30);
mingwen1Label.setBackground(Color.blue);
mingwen1Label.setForeground(Color.white);
mingwen1Label.setOpaque(true);
mingwen1Label.setHorizontalAlignment(JLabel.CENTER);
content.add(mingwen1Label);
mingwen1textArea = new JTextArea();
mingwen1textArea.setLineWrap(true);
mingwen1textArea.setBounds(324 45 180 85);
mingwen1textArea.setLineWrap(true);
getContentPane().add(mingwen1textArea);
miwenLabel = new JLabel(“密文: “);
miwenLabel.setBounds(126 159 120 30);
miwenLabel.setBackground(Color.blue);
miwenLabel.setForeground(Color.white);
miwenLabel.setOpaque(true);
miwenLabel.setHorizontalAlignment(JLabel.CENTER);
content.add(miwenLabel);
miwentextArea = new JTextArea();
miwentextArea.setBounds(324 159 180 85);
miwentextArea.setEditable(false);
miwentextArea.setLineWrap(true);
getContentPane().add(miwentextArea);
mingwenLabel = new JLabel(“明文:“);
mingwenLabel.setBounds(126 273 120 30);
mingwenLabel.setBackground(Color.blue);
mingwenLabel.setForeground(Color.white);
mingwenLabel.setOpaque(true);
mingwenLabel.setHorizontalAlignment(JLabel.CENTER);
content.add(mingwenLabel);
mingwentextArea = new JTextArea();
mingwentextArea.setBounds(324 277 180 85);
mingwentextArea.setEditable(false);
mingwentextArea.setLineWrap(true);
getContentPane().add(mingwentextArea);
jiamiButton = new JButton(“加密“);
jiamiButton.setBounds(139 401 90 20);
getContentPane().add(jiamiButton);
jiamiButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
try {
// 调用获取密钥的方法
Skey_DES.skey();
// 调用加密方法将获取的明文字符串加密并显示
miwentextArea.setText(SEnc
.jiami(mingwen1textArea.getText()));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 232 2011-04-14 22:07 GroupSecret\.classpath
文件 387 2011-04-14 22:07 GroupSecret\.project
文件 1079 2011-04-19 17:27 GroupSecret\bin\app\Test$1.class
文件 932 2011-04-19 17:27 GroupSecret\bin\app\Test$2.class
文件 734 2011-04-19 17:27 GroupSecret\bin\app\Test$3.class
文件 3021 2011-04-19 17:27 GroupSecret\bin\app\Test.class
文件 1365 2011-04-19 17:10 GroupSecret\bin\security\SDec.class
文件 1963 2011-04-19 17:17 GroupSecret\bin\security\SEnc.class
文件 946 2011-04-19 17:11 GroupSecret\bin\security\Skey_DES.class
文件 282 2011-04-17 10:25 GroupSecret\key1.dat
文件 24 2011-04-19 17:27 GroupSecret\keyl.dat
文件 48 2011-04-19 17:27 GroupSecret\SEnc.dat
文件 4036 2011-04-19 17:27 GroupSecret\src\app\Test.java
文件 874 2011-04-19 18:22 GroupSecret\src\shixi2\SDec.java
文件 1042 2011-04-19 18:22 GroupSecret\src\shixi2\SEnc.java
文件 614 2011-04-19 18:22 GroupSecret\src\shixi2\Skey_DES.java
目录 0 2011-04-19 17:28 GroupSecret\bin\app
目录 0 2011-04-19 17:28 GroupSecret\bin\security
目录 0 2011-04-19 17:28 GroupSecret\src\app
目录 0 2011-04-19 17:28 GroupSecret\src\shixi2
目录 0 2011-04-19 17:28 GroupSecret\bin
目录 0 2011-04-19 18:22 GroupSecret\src
目录 0 2011-04-19 17:28 GroupSecret
----------- --------- ---------- ----- ----
17579 23
评论
共有 条评论