freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于aes的小型數(shù)據(jù)安全傳輸系統(tǒng)---即時通訊應(yīng)用開發(fā)-在線瀏覽

2025-01-13 03:59本頁面
  

【正文】 w DatagramSocket()。 (data)。 } 這里是通過數(shù)據(jù)報對象綁定目標(biāo)主機 IP和端口號,并執(zhí)行發(fā)送操作 // 接收消息 //return String 消息 throws IOException public byte[] receive() throws IOException { DatagramPacket dp = new DatagramPacket(buffer, )。 ByteArrayOutputStream baos = new ByteArrayOutputStream()。 byte[] data = ()。 ()。 } //與消息發(fā)送方法不同,用于消息接受的的方法無須在數(shù)據(jù)包對象中綁定目標(biāo)主機 IP和端口號。 開發(fā)系統(tǒng)結(jié)構(gòu)如圖 : 需要構(gòu)建的一個會話窗口如下所示 ,采用 java Swing 相關(guān)的 API,構(gòu) 建這樣一個簡單的桌面應(yīng)用。 //128位 // 轉(zhuǎn)換密鑰 private static Key getKey() throws Exception { byte[] key = (())。 return secretKey。 // 實例化 (, getKey())。 // 執(zhí)行操作 } catch (Exception e) { ()。 } } //加密 param data待加密數(shù)據(jù) return byte[] 加密數(shù)據(jù) public static byte[] encrypt(byte[] data) { try { Cipher cipher = (ALGORITHM)。// 初始化,設(shè)置為加密模式 return (data)。//加密不成功顯示異常 return data。 //...... } 使用 Security 類的 decrypt()方法對數(shù)據(jù)編碼解密,如下: public void receive(String message)throws IOException{ //........ byte[] data = (())。 //...... } 6 第四章 系統(tǒng)測試 驗證服務(wù) 執(zhí)行 MainFrame 類的 main()方法,將獲得初始化對話框,如下圖所示:這里本地的主機 IP 為: ,欲訪問 IP為 的主機。 初始化窗口( 1) 初始化窗口( 2) 此時我們可以通過 UDP 協(xié)議進行聊天了,如下圖所示 sujian 和 bing 進行相互問候。 選中 31 行地方處,右鍵單擊 Follow UDP Stream 顯示截獲的發(fā)送數(shù)據(jù)報報文。 8 加密數(shù)據(jù)傳輸 聊天窗口數(shù)據(jù)顯示 使用網(wǎng)絡(luò)檢測工具 Wireshark 監(jiān)測 UDP 交互數(shù)據(jù)的部分截圖。 通過對稱加密算法,我們可以很方便的對聊天數(shù)據(jù)進行加密 /解密。如果基于該密鑰及算法的軟件被破譯,就意味著密鑰的破解,這也是對稱加密算法的軟肋。 通過此次系統(tǒng)的學(xué)習(xí),我深深的了解到,密碼學(xué)是企業(yè)應(yīng)用安全問題領(lǐng)域的一枚銀彈,是解決安全問題的核心所在。 計算機科學(xué)的迅速發(fā)展,使得數(shù)據(jù)安全傳輸在我們生活中變得越來越重要! 參考文獻: 《算機網(wǎng)絡(luò)安全教程(修訂版)》 志國等編著 清華大學(xué)出版社 《 java 加密與解密的藝術(shù)》 梁棟 編著 機械工業(yè)出版社 《 java 核心技術(shù)》(卷一) 葉 乃文 等 譯 機械工業(yè)出版社 10 附錄 1: 類 初始化窗口類 package AES1。 import 。 import 。 import 。 import 。 import 。 import 。 public class InitDialog extends JDialog { private static final long serialVersionUID = 8482349275221329655L。 //默認(rèn)寬度 private static final int DEFAULT_HEIGHT = 210。 // 接收端口 private int sendPort。 用戶昵稱 private String remoteHost。// 本地主機 private boolean cancelled = true。 } public boolean isCancelled() { return cancelled。 } public int getReceivePort() { return receivePort。 } public String getRemoteHost() { return remoteHost。 String local。 } catch (UnknownHostException e) { local = localhost。 final JTextField localHostField = new JTextField(local, 10)。 final JTextField sendPortField = new JTextField(8002, 10)。 11 // 構(gòu)建輸入面板 JPanel inputPanel = new JPanel()。 (())。 (remoteHostField)。 (localHostField)。 (receivePortField)。 (sendPortField)。 (usernameField)。// 構(gòu)建確認(rèn)按鈕 (new ActionListener() { Override public void actionPerformed(ActionEvent e) { // 賦值 remoteHost = ()。 receivePort = (())。 username = ()。 ()。 JButton cancelButton = new JButton(取消 )。 } })。// 構(gòu)建按鈕面板 (okButton)。 getContentPane().add(inputPanel, )。 // 設(shè)置最小尺寸 setMinimumSize(new Dimension(DEFAULT_WIDTH, DEFAULT_HEIGHT))。 // 設(shè)置窗口大小不可調(diào) setLoca
點擊復(fù)制文檔內(nèi)容
黨政相關(guān)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1