Document 7373773

Download Report

Transcript Document 7373773

ICT+
Introduction to Networks
ั ์ ม ังสงิ ห์
ดร. สุรศกดิ
URL:
E-mail: [email protected]
[email protected]
http://www.spu.ac.th/~surasak.mu
1
ICT+ Agenda
SUN 06/07/51 (0900-1200): Overview
(1300-1600): Network Topology and Basic Protocols
SAT 12/07/51 (0900-1200): Principle of Data Communication
SUN 13/07/51 (0900-1200): Guided and Wireless Networks
(1300-1600): Networking Devices and Software
and the Internet
SAT 19/07/51 (0900-1200): Switching and Routing
SUN 20/07/51 (0900-1200): Network Security
(1300-1600): Examination
การร ักษาความปลอดภ ัยบน
เครือข่าย
3
Types of Security
Information Security - ความปลอดภัยของข้อมูล
 Computer Security - ความปลอดภัยของคอมพิวเตอร์
 Network Security - ความปลอดภัยของเครื อข่าย

4
Need for Security
Some people who cause security problems and why.
5
Security Threats - ภ ัยคุกคามความปลอดภ ัย

Passive attacks (eavesdropping)
 Release of message contents - ลักลอบนาข้อมูลออกไป
 Traffic analysis – แอบวิเคราะห์สภาวะการจราจร และสังเกตุกระบวนการรับส่ งข้อมูล
 Difficult to detect because there is no data alteration
 Emphasis on prevention through encryption

Active attacks - เกี่ยวข้องกับการแก้ไขเปลี่ยนแปลงสายข้อมูลสายข้อมูล
 Masquerade – ปลอมเป็ นผูใ้ ช้ที่ได้รับอนุญาต
 Replay – ดักจับข้อมูลโดยไม่ให้รู้ตวั แล้วนามาส่ งใหม่โดยมีวต
ั ถุประสงค์ร้าย
 Modification of messages - เปลี่ยนแปลงแก้ไขบางส่ วนของข้อความโดยมี
วัตถุประสงค์ร้าย
 Denial of Service – ป้ องกันการใช้งานตามปกติหรื อการทาให้ server ทางานมาก
ผิดปกติจนไม่สามารถให้บริ การได้ตามปกติ
6
Security Requirements
Confidentiality – ความลับของข้ อมูล เฉพาะผู้ทไี่ ด้ รับอนุญาต
เท่ านั้นจึงจะสามารถเข้ าถึงข้ อมูลได้ เท่ านั้น
 Integrity – ความมั่นคงของข้ อมูล เฉพาะผู้ทไี่ ด้ รับอนุญาตเท่ านั้นจึงจะ
สามารถเปลีย่ นแปลงแก้ไขข้ อมูลได้
 Availability - ความพร้ อมให้ บริการข้ อมูลเพาะกับผู้ทไี่ ด้ รับอนุญาต
 Authenticity - ความสามารถในการพิสูจน์ ทราบผู้ใช้

7
Cryptography
The encryption model (for a symmetric-key cipher).
8
Substitution Ciphers

เป็ นวิธีการแทนตัวอักษรหนึ่งตัวหรื อหนึ่งกลุ่มด้วยตัวอักษรอีกตัวหนึ่งเพื่อ
ปิ ดบังค่าที่แท้จริ ง วิธีการแบบนี้ที่เก่าแก่ที่สุดเรี ยกว่า Caesar cipher
Plaintext:
a b c d e fg h i j k l mn o pqr s t u v wxy z
Ciphertext:
QWERTY UI OPASD FG HJKLZXCVBNM
ตัวอย่างเช่น “attack” จะถูกแปลงเป็ น “QZZQEA”
9
Transposition Ciphers
เป็ นแบบที่ตวั อักษรยังรักษาลาดับเดิมของตัวอักษรในข้อความต้นฉบับเอาไว้
แต่จดั การสับเปลี่ยนตัวอักษรเหล่านั้นเป็ นตัวอื่นทั้งหมด
A transposition cipher.
10
One-Time Pads
เป็ นการสร้าง ciphertext ที่ไม่สามารถถอดรหัส (โดยผูท้ ี่ไม่ได้รับอนุญาต) ได้
ขั้นตอนแรกให้เลือกสายอักขระ (bit string) แบบสุ่ มเลือก จากนั้นเปลี่ยน
plaintext ให้เป็ นสายอักขระแล้วทาการ exclusive OR สายอักขระทั้งสองเข้า
ด้วยกันทีละบิต
11
Quantum Cryptography
ื่ สารสญ
ั ญาณผ่านใยแก ้วนาแสงโดยใชหลั
้ กการของ
เป็ นการเข ้ารหัสทีใ่ ชกั้ บการสอ
quantum mechanics ซงึ่ จะมีการใช ้ polarizing filter เพือ
่ ปรับความเข ้มของแสงที่
ลอดออกมา 2 ชุดสาหรับทัง้ ฝ่ ายผู ้รับและฝ่ ายผู ้สง่ คือ rectilinear basis และ diagonal
basis
12
Symmetric Encryption


The only form of encryption prior to late 1970s
Five components to the algorithm
เอกสารหรื อข้อมูลต้นฉบับ
 Encryption algorithm - ขั้นตอนวิธีการเข้ารหัสข้อมูล
 Secret key - กุญแจที่ใช้ในการเข้ารหัส
 Ciphertext - ข้อความใหม่ที่ผา่ นการเข้ารหัสแล้ว
 Decryption algorithm - ขั้นตอนวิธีในการถอดรหัสโดยใช้กญ
ุ แจตัวเดิม


Plaintext-
Two requirements


Strong encryption algorithm
Secure exchange of keys
13
Conventional Encryption Operation
14
Symmetric Encryption Attacks


Cryptanalysis
• เป็ นความพยายามที่จะวิเคราะห์ข้ น
ั ตอนวิธีการเข้ารหัส หากมีตวั อย่างของข้อความ
ก่อนเข้ารหัสและหลังเข้ารหัสด้วยแล้วก็ยงิ่ มีโอกาสที่จะนาไปสู่ กญ
ุ แจที่ใช้ในการ
เข้ารหัสได้
• ถ้าประสบความสาเร็ จ ข้อความที่ส่งไปแล้วและที่จะส่ งใหม่ในอนาคตซึ่ งใช้กุญแจ
ดังกล่าวเข้ารหัสจะถูกถอดรหัสได้
Brute Force
• เป็ นการพยายามใช้กญ
ุ แจที่คิดว่าเป็ นไปได้ทุกตัวในการถอดรหัส จนกว่าจะได้
ข้อความที่อ่านได้อย่างมีเหตุผล
• โดยฉลี่ยแล้วต้องใช้กญ
ุ แจในความพยายามถึงครึ่ งของกุญแจที่เป็ นไปได้ท้ งั หมดจึงจะ
ประสบความสาเร็ จ
15
Average time Required for Exhaustive Key Search
16
Symmetric Key Encryption Algorithm

Most commonly used symmetric encryption
algorithm are block ciphers.
A block cipher processes the plaintext input in fixed-size blocks and
produce a block of ciphertext of equal size for each plaintext block.

Two most important symmetric algorithms
 DES – Data Encryption Standard
 AES – Advanced Encryption Standard
17
Data Encryption Standard (DES)
เป็ น encryption algorithm ที่มีความโดดเด่นหลังจากที่เริ่ มใช้งานในปี 1977
 กุญแจขนาด 56-bit ทาให้ algorithm นี้ ง่ายเกินไปที่จะถูก crack ได้ภายในไม่
เกินปี 1998
 ได้มีการยืดอายุการใช้ DES โดยใช้เทคนิ ค triple DES (3DES)




Repeats basic DES algorithm three times, using either two or three
unique keys
Key size of 112 or 168 bits
Drawbacks: Algorithm is sluggish in software, 64-bit block size is
inefficient
18
Data Encryption Standard
The data encryption standard. (a) General outline.
(b) Detail of one iteration. The circled + means exclusive OR.
19
Advanced Encryption Standard



3DES is not a reasonable candidate for long-term
use
National Institute of Standard and Technology (NIST)
proposes AES with equal or better strength than
3DES
AES be symmetric cipher with a block length of 128
bits and support for key lengths of 128, 192, and 256
bits
20
Advanced Encryption Standard
21
Cryptanalysis
22
Encryption across a Packet –Switching Network
23
Location of Encryption Devices

Link encryption




Each vulnerable communications link is equipped on both ends
with an encryption device.
All traffic over all communications links is secured.
Vulnerable at each switch
End-to-end encryption



Encryption process carried out at two end systems
Encrypted data transmitted unaltered across network; destination
shares key with source to decrypt data
Packet headers cannot be secured
24
Symmetric Encryption Key Distribution




Both parties must have the secret key
Key is changed frequently
Requires either manual delivery of keys, or a thirdparty encrypted channel
Most effective method is a Key Distribution Center
(e.g. Kerberos)
25
End-to-End Encryption

Two types of keys
 Session
keys – data are encrypted with one-time session key
 Permanent keys – used between entities for the purpose of
distributing session keys

Required components
 Key distribution center – determines which systems are allowed to
communicate with each other and provides one-time session key for that
connection
 Security service module (SSM) – performs end-to-end encryption
and obtain session keys on behalf of users.
26
Automated Key Distribution
27
Traffic Padding
เพื่อป้องกันการโจมตีแบบ Cryptanalysis



A function that produces ciphertext output continuously, even in the
absence of plaintext
Continuous random data stream is generated. When plaintext is
available, it is encrypted and transmitted. When input plaintext is
not present, the random data are encrypted and transmitted
Makes it impossible for an attacker to distinguish between true data
flow and noise and therefore impossible to deduce the amount of
traffic
28
Message Authentication
Must verify that contents have not been altered and
that source is authentic
 Approaches

 Authentication
using symmetric encryption
 Authentication without message encryption
 Message authentication code
 One-way hash function
29
Message authentication code (MAC)
30
Message Authentication using One-Way Hash Function
Only sender and receiver share the encryption key.
31
Message Authentication using One-Way Hash Function (cont.)
32
Message Authentication using One-Way Hash Function (cont.)
Technique that uses a hash function but no encryption.
33
Hash Function (H) Requirements






Can be applied to a block of data of any size.
Produces a fixed-length output.
H(x) is relatively easy to compute for any given x
For any given code h, it is computationally infeasible to
find x such that H(x) = h.
For any given block x, it is computationally infeasible to
find y ≠ x with H(y) = H(x).
It is computationally infeasible to find any pair (x, y) such
that H(x) = H(y).
34
Public-Key Encryption


ใช้วิธีการเข้ารหัสที่ใช้คียใ์ นการเข้ารหัสและถอดรหัสแตกต่างกัน และคียท์ ี่
ใช้ถอดรหัสนั้นไม่สามารถสร้างขึ้นมาจากคียท์ ี่ใช้เข้ารหัสได้
การเข้ารหัส (E) และการถอดรหัส (D) จะต้องอยูใ่ นเงื่อนไข 3 ประการ
1. D(E(P))=P
2. เป็ นการยากที่จะสร้าง D ขึ้นมาจาก E
3. E
จะต้องทนทานต่อวิธีการถอดรหัสแบบ
chosen plaintext attack

Asymmetric, involving the use of two separate keys

ความเข้าใจผิดเกี่ยวกับการเข้ารหัสด้วย public key
คิดว่ามีความปลอดภัยสู งจากการโจมตีแบบ cryptanalysis
 คิดว่าเป็ นเทคนิ คที่ใช้ได้เอนกประสงค์ที่ทาให้ conventional encryption ล้าสมัย
 คิดว่ามีความยุง่ ยากน้อยกว่า conventional encryption

35
Public-Key Encryption Components
Plaintext
 Encryption algorithm
 Public and private key
 Ciphertext
 Decryption algorithm

36
Public-Key Encryption Operation
Encryption
37
Public-Key Signature Operation
Authentication
38
Characteristics of Public-Key
Computationally infeasible to determine the
decryption key given knowledge of the
cryptographic algorithm and the encryption
key
 Either of the two related keys can be used for
encryption, with the other used for decryption

39
Steps in Public Key Encryption




Each user generates a pair of keys to be used for the
encryption and decryption of messages.
Each user places one of the two keys in a public register
or other accessible file. This is the public key. The
companion key is kept private.
If Bob wishes to send a private message to Alice, Bob
encrypts the message using Alice's public key.
When Alice receives the message, she decrypts it using
her private key. No other recipient can decrypt the message
because only Alice knows Alice's private key.
40
Digital Signature Process
41
RSA Encryption Algorithm


Developed in 1977, by Ron Rivest, Adi Schamir and Len
Adleman at MIT, first published in 1978
Widely accepted and implemented approach to public-key
encryption – ในช่ วง 25 ปี ทีผ่ ่ านมายังไม่ มผี ้ ูใดสามารถถอดรหัสวิธีการนีไ้ ด้ เลย (โดย
ไม่ ทราบคีย์)

For plaintext block M and ciphertext block C





C = Me mod n
M = Cd mod n = (Me)d mod n = Med mod n
Both sender and receiver must know values of n and e;
only receiver knows value of d
Public key of KU = {e, n}
Private key of KR = {d, n}.
42
RSA Encryption Algorithm (cont.)

วิธีการแบบ RSA นั้นนาพื้นฐานของทฤษฎีตวั เลขมาใช้ มีข้นั ตอนการทางาน
ดังนี้
1. เลือกตัวเลขที่เป็ น prime number ขนาดใหญ่ p และ q (โดยทัว
่ ไป
ขนาด 1024 bit)
2. คานวณ n=p x q และ z=(p-1) x (q-1)
3. เลือกตัวเลขที่เป็ น prime number เรี ยกว่า d
4. หาค่า e ซึ่ ง e x d =1 mod z
43
RSA
An example of the RSA algorithm.
44
RSA Requirements
It is possible to find values of e, d, n such that
Med = M mod n for all M < n.
 It is relatively easy to calculate Me and Cd for
all values of M < n.
 It is infeasible to determine d given e and n.

 This
requirement can be met with large values of e
and n
45
Approaches to Defeating RSA

Brute force approach: try all possible private keys.
 The
larger the number of bits in e and d, the more secure
the algorithm.
 However, the larger the size of the key, the slower the
system will run.

Cryptanalysis: factoring n into its two prime factors
A
hard problem, but not as hard as it used to be
 Currently, a 1024-bit key size is considered strong enough
for virtually all applications
46
Key Management
Symmetric encryption requires both parties to
share a secret key
 Secure distribution of keys is the most difficult
problem for symmetric encryption
 Public key encryption solves this problem, but
adds the issue of authenticity
 Public key certificates address this issue

47
Public Key Certificate Process
Public-key Certificate consists of a public key plus a User ID of the key owner,
with the whole block signed by the third trusted party.
48
Public Key Certificate Process
1. A public key is generated by the user and submitted
to Agency X for certification.
2. X determines by some procedure, such as a face-toface meeting, that this is authentically the user’s
public key.
3. X appends a timestamp to the public key, generates
the hash code of the result, and encrypts that result
with X’s private key forming the signature.
4. The signature is attached to the public key.
49
Virtual Private Networks (VPNs)




Internet connectivity provides easier access for
telecommuters and off-site employees
Use of a public network exposes corporate traffic to
eavesdropping and provides an entry point for
unauthorized users
A variety of encryption and authentication packages
and products are available to secure and
authenticate remote access
Need for a standard that allows a variety of platforms
to interconnect securely
50
Virtual Private Networks
(a) A leased-line private network. (b) A virtual private network.
51
Applications of IPSec



Secures communications across a LAN, WANs, and/or
the Internet
Can encrypt and/or authenticate all traffic at the IP level
Examples of use:
 Secure
branch office connectivity over the Internet
 Secure remote access over the Internet
 Establishing extranet and intranet connectivity with partners
 Enhancing electronic commerce security
52
Benefits of IPSec





When implemented in a firewall or router, provides
strong security for all traffic crossing the perimeter
IPSec in a firewall is resistant to bypass
Runs below the transport layer (TCP, UDP) and so is
transparent to applications
Can be transparent to end users
Can provide security for individual users if needed
53
An IP Security Scenario
54
IPSec Functions

IPSec provides three main facilities
 authentication-only
function referred to as
Authentication Header (AH)
 combined authentication/encryption function called
Encapsulating Security Payload (ESP)
 a key exchange function

For VPNs, both authentication and encryption
are generally desired
55
IPsec
The IPsec authentication header in transport mode for IPv4.
56
IPsec (2)
(a) ESP in transport mode. (b) ESP in tunnel mode.
57
ESP Transport and Tunneling

Transport Mode




provides protection primarily
for upper-layer protocols.
Typically used for end-to-end
communication between two
hosts
encrypts and optionally
authenticates the IP payload
but not the IP header
useful for relatively small
networks; for a full-blown
VPN, tunnel mode is far more
efficient

Tunnel Mode




Provides protection to the
entire packet
Original packet is
encapsulated in ESP fields,
protecting contents from
examination
Used when one or both ends
is a security gateway
Multiple hosts on networks
behind firewalls may engage
in secure communications
without implementing IPSec
58
Scope of ESP
Encryption and
Authentication
59
IPSec Key Management

Manual
 System
administrator manually configures each system
with its own keys and with the keys of other communicating
systems
 Practical for small, relatively static environments

Automated
 Enables
the on-demand creation of keys for SAs and
facilitates the use of keys in a large distributed system
 Most flexible but requires more effort to configure and
requires more software
60
IPSec and VPNs



Organizations need to isolate their networks and at
the same time send and receive traffic over the
Internet
Authentication and privacy mechanisms of secure IP
allow for security strategy
IPSec can be implemented in routers or firewalls
owned and operated by the organization, allowing
the network manager complete control over security
aspects of the VPN
61
Firewalls
A firewall consisting of two packet filters and an application gateway.
62
E-Mail Security - Pretty Good Privacy(PGP)
ทาการเข ้ารหัสข ้อมูลโดยการใช ้ block cipher เรียกว่า IDEA (International
Data Encryption Algorithm) ใชคี้ ยข
์ นาด 128 bits การบริหารคีย ์ ใชวิ้ ธ ี RSA
และการตรวจสอบความถูกต ้องของข ้อมูลเป็ นแบบ MD5
PGP in operation for sending a message.
63
Web Security
Threats - ภัยคุกคาม
 Secure Naming- การตั้งชื่ออย่างปลอดภัย

SSL – The Secure Sockets Layer
 Mobile Code Security-การใช้โค้ดที่ปลอดภัยสาหรับโมบาย

64
ภัยคุกคาม






Hackers- ที่มีความสามารถสู งกว่าโปรแกรมเมอร์ ทวั่ ไป
Cracker – เว็บไซต์ ยอดนิยม เช่น Yahoo, CIA, NASA เคยถูกโจมตีมาแล้ว
Denial of Service attack ซึ่ ง Cracker จะโดมตีดว้ ยการส่ งข่ าวสารจานวนมหาศาลมายัง
เว็บไซต์น้ นั ทาให้ไม่สามารถบริ การได้ตามปกติ
ปี 1999 Cracker ชาวสวีเดนบุกเข้าเว็บไซต์ของ Microsoft Hotmail แล้วสร้าง mirror site ที่
อนุญาตให้ผใู ้ ดก็ได้สมารถพิมพ์ชื่อผูใ้ ช้ hotmail แล้วอ่านข้ อความใน email ได้
Cracker ชาวรัสเซี ย อายุ 19 ปี บุกเข้าเว็บไซต์ e-commerce แห่งหนึ่งและขโมยหมายเลขบัตร
เครดิตไปกว่า 30,000 ใบแล้วเรี ยกร้องเงินจากเจ้าของเว็บไซต์ $100,000 เจ้าของร้านปฏิเสธ
จึงประกาศหมายเลขเครดิตการ์ ดไปทัว่ อินเทอร์ เน็ต ทาให้เจ้าของบัตรสู ญเสี ยเงินไปจานวน
มาก
อีกกรณี หนึ่ง หนุ่มชาวแคลิฟอเนีย อายุ 23 ปี ส่ ง email เป็ นการแถลงข่าวกล่าวว่า emulex
Corporation กาลังจะนารายงานการขาดทุนการประกอบการในไตรมาสที่สามเป็ นเงินจานวน
มากซึ่ งมีผลทาให้ประธานกรรมการบริ หารต้องลาออกในทันที ภายในไม่กี่ชวั่ โมงหลังจากนั้น
หุ น้ ของบริ ษทั ได้ตกกว่า 60% ทาให้ผถู ้ ือหุ น้ ต้องขาดทุนไปกว่า $2,000 ล้าน แม้กรณี น้ ีไม่
เกี่ยวกับการบุกรุ กเข้าไปในเว็บไซต์แต่ก่อให้เกิดความเสี ยหายแก่บริ ษทั อย่างใหญ่หลวง 65
Secure Naming
(a) Normal situation. (b) An attack based on breaking into DNS
and modifying Bob's record.
66
Secure DNS
An example RRSet for bob.com. The KEY record is Bob's
public key. The SIG record is the top-level com server's
signed has of the A and KEY records to verify their
authenticity.
67
SSL—The Secure Sockets Layer
Layers (and protocols) for a home user browsing with SSL.
68
Java Applet Security
Applets inserted into a Java Virtual Machine interpreter inside the browser.
69
70