1 / 56

網際網路的資訊安全

網際網路的資訊安全. 陳以德. Outline(1/2). 密碼學簡介 網路傳輸的危險性 加密與解密 對稱性加密( Substitution , Transposition , AES) 非對稱性加密( RSA) MAC 電子簽章. Outline(2/2). 防火牆 (Firewall) 簡單交通記錄系統 Packet Filtering Application Gateway Proxy Server Screened Host Firewall. E. A. B. 明文在網路上傳輸的危險性. pw: 天地玄黃. pw: 天地玄黃.

zubin
Download Presentation

網際網路的資訊安全

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 網際網路的資訊安全 陳以德

  2. Outline(1/2) • 密碼學簡介 • 網路傳輸的危險性 • 加密與解密 • 對稱性加密(Substitution, Transposition, AES) • 非對稱性加密(RSA) • MAC • 電子簽章

  3. Outline(2/2) • 防火牆(Firewall) • 簡單交通記錄系統 • Packet Filtering • Application Gateway • Proxy Server • Screened Host Firewall

  4. E A B 明文在網路上傳輸的危險性 pw:天地玄黃 pw:天地玄黃 Sniffer pw:天地玄黃 eavesdropper

  5. 其他傳輸Attack • Eavesdropping • OS漏洞 • Password的竊取 • Spoofing, Spam, Intrusion • Session Hijacking • 特洛依木馬Troy、virus、trapdoor • Covert Channel

  6. E A B 加密系統的應用 pw:天地玄黃 pw:天地玄黃 解密 加密 @#$%&* @#$%&* NetXray @#$%&* eavesdropper

  7. Encryption K 密文 e 明文 C M K d Decryption 加 密 與 解 密

  8. 對稱,秘密與公開金匙 對稱金匙(Symmetric Key)系統 Ke=Kd 非對稱金匙(Asymmetric Key)系統 Ke≠Kd

  9. 表 白  雖萍水相逢,但覺你是很好的人, 仔細思考後,決定向你用以最最笨拙 的方式表白,也許我沒有你想要的優 點,也許是一廂情願,我卻甘心.我 並不需要你的回報,我只願默默的關 心你,在背後祝福你,不讓你苦惱, 也無意擾亂你生活,要是你深覺不妥, 我願意忍住痛苦,裝做不曾為了你而 動過心,我不是聰明伶俐的人,但也 不至是如此不明理的人.年輕都會有 夢想,我的愚昧,使我踏入了情感陷 阱,整個人就如斷線風箏,飛向夢想. 在這季節裡,天氣正如我的心情,時 而愉快,時而感傷.此時,我不抱任 何樂觀的態度,但只願你瞭解我的心. ...僅以真誠的心...

  10. Substitution Ciphers(對稱性加密) 原始文字與加密文字對照表 • 那麼apple這個字就會變成bqqmf了 • I love you 變成j mpwf zpv • 加密時向右移一位, 解密時向左移一位 • 加解密的 Key 相同

  11. Transposition Ciphers 這富額代能都一獸貴上表買能個又,打名賣夠人強奴印字。算。迫隸記的這出這所或。數裡獸數有自這字需的字的由印;要數是人人記沒有字六,,就有智,百無在是這慧因六論他那印。為十 大們獸記凡這六小的的的是數。,右右,聰字貧手字就明代窮和或不人表

  12. 這富額代能都一  獸貴上表買能個  又,打名賣夠人  強奴印字。算。 迫隸記的這出這 所或。數裡獸數 有自這字需的字 的由印;要數是 人人記沒有字六 ,,就有智,百 無在是這慧因六 論他那印。為十 大們獸記凡這六 小的的的是數。 ,右右,聰字 貧手字就明代 窮和或不人表

  13. Vigenere 加密法 Jwlmliplopwkjmiplopwkjmzieufvhshhnabhofodqfauiipjaoxabtwlmleffrsnruhloggbnn Fesnedxabieltmbeevuiqzizjlogoomoziipfvhsslochiewpufiegnykfauuinoozuhhseltnw brDedotrpdhfpdnoxotdjnvphlhhlucdotnfeslehqmhbwdzazbyisopiivmoyf

  14. DES(Data Encryption Standard) • Plaintext M(64 bits) • Ciphertext C(64 bits) • Key K(56 bits or 64 bits) • Round Function F(X, Y) : X(32 bits) and Y(48 bits) • Rounds: 16

  15. DES(Cont.) • IP: initial permutation IP(M) = (L, R) • FP: final permutation : IP.FP = FP.IP • (Ln, Rn) = (Rn-1, Ln-1 F(Rn-1, K)) • F(X, Y) = Perm(S_box( Ext(X)  Y)) • C = FP(R, L)

  16. DES(Fig.)

  17. DES(One round)

  18. Triple DES

  19. RSA密碼系統(非對稱加密) 產生兩把鑰匙的步驟: • 隨機取兩個很大的質數p, q。(最好大於2512) • 計算出 n = p * q 及 (n)=(p-1)*(q-1) • 隨機找一個與 (n) 互質的數目 : e。 (意即 gcd (e, (n))=1) • 利用歐幾里得演算法得出 : d such that d 滿足e * d ≡1 mod (n)。 • 以(e, n)為 Public key,d為 Private key。

  20. RSA (原理) (Cd mod n) = ((Me mod n)d mod n) = Me*d mod n = M(k * (p-1) * (q-1)) + 1 mod n = M1 mod n=M (因為e * d ≡1 (mod ((p-1) * (q-1)))。) Fermat’s Theorem (n) mod n =1

  21. RSA密碼系統 • 取兩個質數 p=101, q=53, n=101*53=5353 • 明文=4657 • 設A的公開金匙(eA,NA)=(7,5353) • 利用歐幾里得演算法得出秘密金匙dA=743, [Where eA, dA=1 mod (100*52)] • 得到密文為 4657743 mod 5353 = 1003 • 密文用的公開金匙(eA,NA )解開得回明文 10037mod 5353=4657

  22. RSA 例子1,BA • 取兩個質數 p=3, q=5 • n=3*5=15 • Φ(n)= (3-1)*(5-1)=8 • 明文 m=13 • 任取一數11得A’s Public key (eA,NA)=(11,15) • 利用歐幾里得演算法得出 Private key dA=3,

  23. 11與Φ(n) 輾轉相除 11 8 1=3-2 =3-(8-6) =3-8+6 =(11-8)-8+2(11-8) =3(11-8)-8 =3(11)-4(8) 取Public key 11與Φ(n) 輾轉相除 最後(11)旁的係數3,為另一支key 8 6 3 2 2 1

  24. RSA 例子1,BA(Cont.) • eA*dA=11*3=1 mod Φ(n) • B用A’s Public key加密得密文為:1311 mod 15 = 7 • A 用自己的Private key 解開密文得回明文 73mod 15=13

  25. RSA (例子2, 驗證) • Example(承上例, p=3, q=5, n=15, e=11, d=3) • A將文件(m=13)用A的 Private key 加密 133mod 15=7 • B用A’s Public key 解密得回明文 711 mod 15 =13 • 可用來做電子簽章驗證

  26. RSA特性及其運用 • RSA運用exponential algorithm • RSA執行速度較DES等對稱加密慢 • 硬體的RSA比硬體的DES慢1000倍 • 軟體的RSA則比軟體的DES慢100倍 • 故RSA其主要的用途: • digital signature • protocol中的key exchange。

  27. 單向函數 One-way Function • 定義:一函數滿足下列條件則稱 f 為One-way Function • 1. 對於所有屬於F域之x, 很容易計算出f(x)=y. • 2. 對於幾乎所有屬於f 之範圍的任一y, 在計算上不可 能求出x 使得y=f(x) • Example: • y = f(x) =xn+an-1 xn-1+…+a1x+a0 mod p 易 f 難 X Y

  28. Message Authentication Codes (MAC) • MAC is an authentication tag (also called a checksum) derived by appying an authentic-ation scheme, together with a secret key, to a message. • There are four types of MACs: (1) unconditionally secure (2) hash function-based (3) stream cipher-based or (4) block cipher-based.

  29. MAC • Hash function H(m1, m2, …, mt)=m • 現有的Hash function: MD5, SHA-1, ... • MAC is key-dependent one-way hash function • MAC are computed and verified with the same key • A & B 共同擁有 key K • A send H(K, M) to B • B can reproduce A’s result

  30. 現有對稱與非對稱加密法 • 對稱加密法 • DES, IDEA, AES(MARS, RC6, Rijndael, Serpent, and Twofish), ... • 非對稱加密法 • RSA, ElGamal, …

  31. 總結(1/) • 對稱式加密 Session Key Session Key I am Yiter Asd$#v#$h I am Yiter DES DES

  32. 總結(2/) • 非對稱式加密 第三公正者 對方的 Public key 自己的Private Key I am Yiter I am Yiter @#SDFGSASDF RSA RSA

  33. 總結(3/) • 對稱與非對稱式加密交互運用 自己的Private Key 對方的 Public key Session Key Session Key ^%$(*&#$ RSA RSA Session Key Session Key Dthfgb$shgzxcv I am 陳水扁 I am 陳水扁 DES DES Bdve$%^@dgrse

  34. 總結(4/)電子簽章 • Example(承上例, p=3, q=5, n=15, e=11, d=3) • 將簽署文件(m=13)用A自己的Private key 加密後得到密文 133 mod 15=7 • A 將簽署文及密文(m=13, c=7)一齊送給B • B 可拿A的 Public key (eA,NA)驗證得回簽署文 • m’=711 mod 15 =13 • 若m=m’ 則驗證正確

  35. 文 電子簽章 總結(5/) 電子簽章圖示  原文  原文 Hashing 訊息摘要 比對 Hashing 訊息摘要 電子簽章 電子簽章 訊息摘要 Secret Key Public Key

  36. 文 原 文 電子簽章 電子簽章 總結(6/) • 對稱;非對稱式加密加電子簽章 自己的Private Key 對方的 Public key Session Key Session Key ^%$(*&#$ RSA RSA Session Key Session Key Dthfgb$shgzxcv Rijndael Rijndael

  37. Firewall 定義: 只讓具備特殊身分的外在使用者才能連上一個被保護的網站, 使用其軟體或硬體 A firewall system is used to control access to or from a protected network ( a site ). 小問題: pcanywhere

  38. Firewall圖示

  39. Firewall 的種類 • 簡單交通記錄系統 • 封包過濾(Packet Filtering) • Application Gateway (Dual-homed Gateway) • Proxy Server • Screened Host Firewall

  40. 簡單交通記錄系統 • 將網路上傳輸記錄在稽查記錄檔案(.log) • 記錄的資料 • 被存取的檔案 • 使用者何時由何地用什麼程式進來 • 使用者存取及上傳的位元數

  41. 封包過濾(Packet Filtering)

  42. 封包過濾常用審查法則 • 根據協定(ICP, UDP, ICMP)來控制及過濾 • 對某些應用做限制性取用(port 80, 443...) • 對己知來源的IP位置做限制(.edu) Block or filter protocols「ports」and「addresses」

  43. 封包過濾優缺點 • 優點 • Most Common ,easy and cheap • Fully transparency, no impact to user • 缺點 • Little or no logging capability • Complex filtering rules may become unmanageable • Rules are difficult to test thoroughly

  44. Application GatewayDual-homed Gateway

  45. Application Gateway圖示

  46. Application Gateway • 外界使用者在做進一步連結前, 先連接到受信賴的應用程式上 • 系統管理注意事項 • 除Firewall必須帳戶外, 刪除所以使用者帳戶 • 刪除不必要的檔案及程式(FTP, Telnet) • 將記錄(.log)和監控延伸到可以檢查遠端存取 • 關閉IP轉寄的功能

  47. Proxy Server Proxy Server 位於Internet 和內部網路之間, 提供中間人的服務 支援「extra logging」and「advanced authentication」 Client Proxy Server Remote Server Cache

  48. Screened Host Firewall Screened Host Firewall為封包濾器 (packet filter) 與應用閘道器 (application gateway) 的組合

  49. Screened Host Firewall • 允許外界封包輸至內部閘道器 • 不允許外界封包輸至內部其它主機 • 允許閘道器的封包輸出至外界網路 • 不允許其它內部主機的封包輸出至外界網路

  50. Screened Host Firewall • 優點 • More flexibility. • Router filtering rules are simplified . • 缺點 • Less security. (packet can go directly inside)

More Related