《密码学与信息论》课程设计任务任务: 设计实现软件认证平台,要求实现一下功能: 1. 为用户提供试用期; 2. 实现付费用户的权限更新; 3. 实现已付费用户的权限撤销; 时间: 6月 20日-6月 21日要求: 6月 21 日下午 17:00 提交报告及程序。报告包含两部分内容: (1) 数据流向图【参见新版教材 P117 旧版教材 P135 图 5-1 】(2) 程序源代码 Alice 为服务器端, Bob 为客户机端参考资料: 1. Socket 传输程序。// package alice; import ; import ; import ; import ; import .ServerSocket; import .Socket; public class Alice { private ServerSocket server; private Socket client; private DataInputStream in; private OutputStream out; public void init(){ try { =new ServerSocket(8888); (" 等待连接..."); =(); =new DataInputStream(()); =(); } catch (IOException e){ // TODO Auto-generated catch block (); } } public int Recv(){ byte[] buf ; ByteArrayOutputStream out1 = new ByteArrayOutputStream(); (">"); try { while (() != 0){ (">"); (()); }} catch (IOException e1) { // TODO Auto-generated catch block (); } buf=(); (new String(buf)); return 1; } public int Send(byte[] databuf){ try { (databuf); (); (" 发送"+new String(databuf)); } catch (IOException e){ // TODO Auto-generated c
密码学与信息论课设 来自淘豆网www.taodocs.com转载请标明出处.