Скачать презентацию Chapter 8 Network Security Chapter goals understand Скачать презентацию Chapter 8 Network Security Chapter goals understand

02bc7298542c0bc94f5aed217506ec7f.ppt

  • Количество слайдов: 99

Chapter 8: Network Security Chapter goals: • understand principles of network security: – cryptography Chapter 8: Network Security Chapter goals: • understand principles of network security: – cryptography and its many uses beyond Security “confidentiality” – authentication – message integrity – key distribution • security in practice: – firewalls – security in application, transport, network, link layers CPSC 558 Advanced Computer Networks

Roadmap • • What is network security? Principles of cryptography Security Authentication Integrity Key Roadmap • • What is network security? Principles of cryptography Security Authentication Integrity Key Distribution and certification Access control: firewalls Attacks and counter measures Security in many layers CPSC 558 Advanced Computer Networks

What is network security? Confidentiality: only sender, intended receiver should “understand” message contents – What is network security? Confidentiality: only sender, intended receiver should “understand” message contents – sender encrypts message Security – receiver decrypts message Authentication: sender, receiver want to confirm identity of each other Message Integrity: sender, receiver want to ensure message not altered (in transit, or afterwards) without detection Access and Availability: services must be accessible and available to users CPSC 558 Advanced Computer Networks

Friends and enemies: Alice, Bob, Trudy • well-known in network security world • Bob, Friends and enemies: Alice, Bob, Trudy • well-known in network security world • Bob, Alice (lovers!) want to communicate “securely” Security • Trudy (intruder) may intercept, delete, add messages Alice data channel secure sender Bob data, control messages secure receiver Trudy CPSC 558 Advanced Computer Networks data

Who might Bob, Alice be? • … well, real-life Bobs and Alices! Security • Who might Bob, Alice be? • … well, real-life Bobs and Alices! Security • Web browser/server for electronic transactions (e. g. , on-line purchases) • on-line banking client/server • DNS servers • routers exchanging routing table updates CPSC 558 Advanced Computer Networks

There are bad guys (and girls) out there! Q: What can a “bad guy” There are bad guys (and girls) out there! Q: What can a “bad guy” do? A: a lot! Security – intercept messages – actively insert messages into connection – impersonation: can fake (spoof) source address in packet (or any field in packet) – hijacking: “take over” ongoing connection by removing sender or receiver, inserting himself in place – denial of service: prevent service from being used by others (e. g. , by overloading resources) more on this later …… CPSC 558 Advanced Computer Networks

roadmap • • What is network security? Security Principles of cryptography Authentication Integrity Key roadmap • • What is network security? Security Principles of cryptography Authentication Integrity Key Distribution and certification Access control: firewalls Attacks and counter measures Security in many layers CPSC 558 Advanced Computer Networks

The language of cryptography Alice’s K encryption A key Security plaintext encryption algorithm ciphertext The language of cryptography Alice’s K encryption A key Security plaintext encryption algorithm ciphertext Bob’s K decryption B key decryption plaintext algorithm symmetric key crypto: sender, receiver keys identical public-key crypto: encryption key public, decryption key secret (private) CPSC 558 Advanced Computer Networks

Symmetric key cryptography substitution cipher: substituting one thing for another – monoalphabetic cipher: substitute Symmetric key cryptography substitution cipher: substituting one thing for another – monoalphabetic cipher: substitute one letter for another Security plaintext: abcdefghijklmnopqrstuvwxyz ciphertext: mnbvcxzasdfghjklpoiuytrewq E. g. : Plaintext: bob. i love you. alice ciphertext: nkn. s gktc wky. mgsbc Q: How hard to break this simple cipher? : q brute force q other? CPSC 558 Advanced Computer Networks

Symmetric key cryptography KA-B plaintext message, m Security encryption ciphertext algorithm K (m) A-B Symmetric key cryptography KA-B plaintext message, m Security encryption ciphertext algorithm K (m) A-B KA-B decryption plaintext algorithm m=K A-B ( KA-B(m) ) symmetric key crypto: Bob and Alice share know same (symmetric) key: K A-B • e. g. , key is knowing substitution pattern in mono alphabetic substitution cipher • Q: how do Bob and Alice agree on key value? CPSC 558 Advanced Computer Networks

Symmetric key crypto: DES: Data Encryption Standard • US encryption standard [NIST 1993] Security Symmetric key crypto: DES: Data Encryption Standard • US encryption standard [NIST 1993] Security • 56 -bit symmetric key, 64 -bit plaintext input • How secure is DES? – DES Challenge: 56 -bit-key-encrypted phrase (“Strong cryptography makes the world a safer place”) decrypted (brute force) in 4 months – no known “backdoor” decryption approach • making DES more secure: – use three keys sequentially (3 -DES) on each datum CPSC 558 Advanced Computer Networks

Symmetric key crypto: DES operation Security initial permutation 16 identical “rounds” of function application, Symmetric key crypto: DES operation Security initial permutation 16 identical “rounds” of function application, each using different 48 bits of key final permutation CPSC 558 Advanced Computer Networks

AES: Advanced Encryption Standard • new (Nov. 2001) symmetric-key NIST standard, Security replacing DES AES: Advanced Encryption Standard • new (Nov. 2001) symmetric-key NIST standard, Security replacing DES • processes data in 128 bit blocks • 128, 192, or 256 bit keys • brute force decryption (try each key) taking 1 sec on DES, takes 149 trillion years for AES CPSC 558 Advanced Computer Networks

Public Key Cryptography symmetric key crypto public key cryptography Security • requires sender, receiver Public Key Cryptography symmetric key crypto public key cryptography Security • requires sender, receiver • radically different know shared secret key approach [Diffie. Hellman 76, RSA 78] • Q: how to agree on key in first place (particularly if • sender, receiver do not never “met”)? share secret key • public encryption key known to all • private decryption key known only to receiver CPSC 558 Advanced Computer Networks

Public key cryptography + Bob’s public B key K Security plaintext message, m encryption Public key cryptography + Bob’s public B key K Security plaintext message, m encryption ciphertext algorithm + K (m) B K - Bob’s private B key decryption plaintext algorithm message + m = K B(K (m)) CPSC 558 Advanced Computer Networks B

Public key encryption algorithms Requirements: 1 + Security need K ( ) and K Public key encryption algorithms Requirements: 1 + Security need K ( ) and K - ( ) such that B B - + . . K (K (m)) = m B 2 B + given public key K B, it should be impossible to compute private key KB RSA: Rivest, Shamir, Adelson algorithm CPSC 558 Advanced Computer Networks

RSA: Choosing keys 1. Choose two large prime numbers p, q. (e. g. , RSA: Choosing keys 1. Choose two large prime numbers p, q. (e. g. , 1024 bits each) Security 2. Compute n = pq, z = (p-1)(q-1) 3. Choose e (with e

RSA: Encryption, decryption 0. Given (n, e) and (n, d) as computed above Security RSA: Encryption, decryption 0. Given (n, e) and (n, d) as computed above Security 1. To encrypt bit pattern, m, compute e mod n (i. e. , remainder when m e is divided by n) c=m 2. To decrypt received bit pattern, c, compute d m = c d mod n (i. e. , remainder when c is divided by n) Magic d m = (m e mod n) mod n happens! c CPSC 558 Advanced Computer Networks

RSA example: Bob chooses p=5, q=7. Then n=35, z=24. e=5 (so e, z relatively RSA example: Bob chooses p=5, q=7. Then n=35, z=24. e=5 (so e, z relatively prime). Security d=29 (so ed-1 exactly divisible by z. encrypt: decrypt: letter m me l 12 1524832 c 17 d c 48196857210675091411825223071697 c = me mod n 17 m = cd mod n letter 12 l CPSC 558 Advanced Computer Networks

RSA: Why is that m = (m e mod n) d mod n Useful RSA: Why is that m = (m e mod n) d mod n Useful number theory result: If p, q prime and n = pq, then: y y mod Security (p-1)(q-1) mod n x mod n = x e (m mod n) d mod n = med mod n = m ed mod (p-1)(q-1) mod n (using number theory result above) 1 = m mod n (since we chose ed to be divisible by (p-1)(q-1) with remainder 1 ) = m CPSC 558 Advanced Computer Networks

RSA: another important property The following property will be very useful later: Security - RSA: another important property The following property will be very useful later: Security - + + K (K (m)) = m = K (K (m)) B B B use public key first, followed by private key B use private key first, followed by public key Result is the same! CPSC 558 Advanced Computer Networks

roadmap What is network security? Security Principles of cryptography Authentication Integrity Key Distribution and roadmap What is network security? Security Principles of cryptography Authentication Integrity Key Distribution and certification Access control: firewalls Attacks and counter measures Security in many layers CPSC 558 Advanced Computer Networks

Authentication Goal: Bob wants Alice to “prove” her identity to him Security Protocol ap Authentication Goal: Bob wants Alice to “prove” her identity to him Security Protocol ap 1. 0: Alice says “I am Alice” Failure scenario? ? CPSC 558 Advanced Computer Networks

Authentication Goal: Bob wants Alice to “prove” her identity to him Security Protocol ap Authentication Goal: Bob wants Alice to “prove” her identity to him Security Protocol ap 1. 0: Alice says “I am Alice” in a network, Bob can not “see” Alice, so Trudy simply declares herself to be Alice CPSC 558 Advanced Computer Networks

Authentication: another try Protocol ap 2. 0: Alice says “I am Alice” in an Authentication: another try Protocol ap 2. 0: Alice says “I am Alice” in an IP packet containing her source IP address Security Alice’s “I am Alice” IP address Failure scenario? ? CPSC 558 Advanced Computer Networks

Authentication: another try Protocol ap 2. 0: Alice says “I am Alice” in an Authentication: another try Protocol ap 2. 0: Alice says “I am Alice” in an IP packet containing her source IP address Security Alice’s IP address Trudy can create a packet “spoofing” “I am Alice” Alice’s address CPSC 558 Advanced Computer Networks

Authentication: another try Protocol ap 3. 0: Alice says “I am Alice” and sends Authentication: another try Protocol ap 3. 0: Alice says “I am Alice” and sends her secret password to “prove” it. Security Alice’s “I’m Alice” IP addr password Alice’s IP addr OK Failure scenario? ? CPSC 558 Advanced Computer Networks

Authentication: another try Protocol ap 3. 0: Alice says “I am Alice” and sends Authentication: another try Protocol ap 3. 0: Alice says “I am Alice” and sends her secret password to “prove” it. Security Alice’s “I’m Alice” IP addr password Alice’s IP addr OK playback attack: Trudy records Alice’s packet and later plays it back to Bob Alice’s “I’m Alice” IP addr password CPSC 558 Advanced Computer Networks

Authentication: yet another try Protocol ap 3. 1: Alice says “I am Alice” and Authentication: yet another try Protocol ap 3. 1: Alice says “I am Alice” and sends her encrypted secret password to “prove” it. Security Alice’s encrypted “I’m Alice” IP addr password Alice’s IP addr OK Failure scenario? ? CPSC 558 Advanced Computer Networks

Authentication: another try Protocol ap 3. 1: Alice says “I am Alice” and sends Authentication: another try Protocol ap 3. 1: Alice says “I am Alice” and sends her encrypted secret password to “prove” it. Security Alice’s encryppted “I’m Alice” IP addr password Alice’s IP addr OK Alice’s encrypted “I’m Alice” IP addr password CPSC 558 Advanced Computer Networks record and playback still works!

Authentication: yet another try Goal: avoid playback attack Nonce: number (R) used only once Authentication: yet another try Goal: avoid playback attack Nonce: number (R) used only once –in-a-lifetime Security ap 4. 0: to prove Alice “live”, Bob sends Alice nonce, R. Alice must return R, encrypted with shared secret key “I am Alice” R KA-B(R) Failures, drawbacks? CPSC 558 Advanced Computer Networks Alice is live, and only Alice knows key to encrypt nonce, so it must be Alice!

Authentication: ap 5. 0 ap 4. 0 requires shared symmetric key • can we Authentication: ap 5. 0 ap 4. 0 requires shared symmetric key • can we authenticate using public key techniques? Security ap 5. 0: use nonce, public key cryptography “I am Alice” R Bob computes + - - K A (R) “send me your public key” + KA KA(KA (R)) = R and knows only Alice could have the private key, that encrypted R such that + K (K (R)) = R A A Is KA+ really Alice’s public key? CPSC 558 Advanced Computer Networks

ap 5. 0: security hole I am Alice Security I am Alice R K ap 5. 0: security hole I am Alice Security I am Alice R K (R) T Trudy poses as Man (woman) in the middle attack: R Send Alice (to Bob) and - (R)Bob (to Alice) me your public key as + K K A Send me your public key + K A - + m = K (K (m)) A A + K (m) A Trudy gets - + m = K (K (m)) sends T to Alice m T + K (m) T ennrypted with Alice’s public key CPSC 558 Advanced Computer Networks T

ap 5. 0: security hole Man (woman) in the middle attack: Trudy poses as ap 5. 0: security hole Man (woman) in the middle attack: Trudy poses as Alice (to Bob) and as Bob (to Alice) Security Difficult to detect: q Bob receives everything that Alice sends, and vice versa. (e. g. , so Bob, Alice can meet one week later and recall conversation) q problem is that Trudy receives all messages as well! CPSC 558 Advanced Computer Networks

Chapter 7 roadmap What is network security? Security Principles of cryptography Authentication Message integrity Chapter 7 roadmap What is network security? Security Principles of cryptography Authentication Message integrity Key Distribution and certification Access control: firewalls Attacks and counter measures Security in many layers CPSC 558 Advanced Computer Networks

Digital Signatures Cryptographic technique analogous to hand. Security written signatures. • sender (Bob) digitally Digital Signatures Cryptographic technique analogous to hand. Security written signatures. • sender (Bob) digitally signs document, establishing he is document owner/creator. • verifiable, nonforgeable: recipient (Alice) can prove to someone that Bob, and no one else (including Alice), must have signed document CPSC 558 Advanced Computer Networks

Digital Signatures Simple digital signature for message m: • Bob signs m by encrypting Digital Signatures Simple digital signature for message m: • Bob signs m by encrypting with his private key KB, Security creating “signed” message, KB(m) Bob’s message, m Dear Alice Oh, how I have missed you. I think of you all the time! …(blah) Bob K B Bob’s private key Public key encryption algorithm CPSC 558 Advanced Computer Networks K B(m) Bob’s message, m, signed (encrypted) with his private key

Digital Signatures (more) - • Suppose Alice receives msg m, digital signature KB(m) • Digital Signatures (more) - • Suppose Alice receives msg m, digital signature KB(m) • Alice verifies m signed by Bob by applying Bob’s public + - Security + key KB to KB(m) then checks KB(KB(m) ) = m. + - • If KB(KB(m) ) = m, whoever signed m must have used Bob’s private key. Alice thus verifies that: ü Bob signed m. ü No one else signed m. ü Bob signed m and not m’. Non-repudiation: ü Alice can take m, and signature KB(m) to court and prove that Bob signed m. CPSC 558 Advanced Computer Networks

Message Digests large message m H: Hash Function Computationally expensive to Security public-key-encrypt long Message Digests large message m H: Hash Function Computationally expensive to Security public-key-encrypt long H(m) messages Goal: fixed-length, easy- to. Hash function properties: compute digital • many-to-1 “fingerprint” • produces fixed-size msg • apply hash function H to digest (fingerprint) m, get fixed size message • given message digest x, digest, H(m). computationally infeasible to find m such that x = H(m) CPSC 558 Advanced Computer Networks

Internet checksum: poor crypto hash function Internet checksum has some properties of hash function: Internet checksum: poor crypto hash function Internet checksum has some properties of hash function: Security ü produces fixed length digest (16 -bit sum) of message ü is many-to-one But given message with given hash value, it is easy to find another message with same hash value: message I O U 1 0 0. 9 9 B O B ASCII format 49 4 F 55 31 30 30 2 E 39 39 42 D 2 42 B 2 C 1 D 2 AC message I O U 9 0 0. 1 9 B O B ASCII format 49 4 F 55 39 30 30 2 E 31 39 42 D 2 42 B 2 C 1 D 2 AC different messages but identical checksums! CPSC 558 Advanced Computer Networks

Digital signature = signed message digest Alice verifies signature and integrity of digitally signed Digital signature = signed message digest Alice verifies signature and integrity of digitally signed message: Bob sends digitally signed message: large message m H: Hash function Bob’s private key + - KB Security encrypted msg digest H(m) digital signature (encrypt) encrypted msg digest KB(H(m)) large message m H: Hash function KB(H(m)) Bob’s public key H(m) equal ? CPSC 558 Advanced Computer Networks + KB digital signature (decrypt)

Hash Function Algorithms • MD 5 hash function widely used (RFC 1321) – computes Hash Function Algorithms • MD 5 hash function widely used (RFC 1321) – computes 128 -bit message digest in 4 -step process. Security – arbitrary 128 -bit string x, appears difficult to construct msg m whose MD 5 hash is equal to x. • SHA-1 is also used. – US standard [NIST, FIPS PUB 180 -1] – 160 -bit message digest CPSC 558 Advanced Computer Networks

Chapter 7 roadmap What is network security? Security Principles of cryptography Authentication Integrity Key Chapter 7 roadmap What is network security? Security Principles of cryptography Authentication Integrity Key distribution and certification Access control: firewalls Attacks and counter measures Security in many layers CPSC 558 Advanced Computer Networks

Trusted Intermediaries Symmetric key problem: Public key problem: • How do two entities Security Trusted Intermediaries Symmetric key problem: Public key problem: • How do two entities Security When Alice obtains • establish shared secret key Bob’s public key (from over network? web site, e-mail, diskette), how does she Solution: know it is Bob’s public • trusted key distribution key, not Trudy’s? center (KDC) acting as Solution: intermediary between entities • trusted certification authority (CA) CPSC 558 Advanced Computer Networks

Key Distribution Center (KDC) Security • Alice, Bob need shared symmetric key. • KDC: Key Distribution Center (KDC) Security • Alice, Bob need shared symmetric key. • KDC: server shares different secret key with each registered user (many users) KDC • Alice, Bob know own symmetric keys, KA-KDC KB-KDC , for KA-KDC KP-KDC KX-KDC communicating with KDC. K KP-KDC B-KDC KA-KDC KY-KDC KB-KDC CPSC 558 Advanced Computer Networks KZ-KDC

Key Distribution Center (KDC) Q: How does KDC allow Bob, Alice to determine shared Key Distribution Center (KDC) Q: How does KDC allow Bob, Alice to determine shared symmetric secret key to communicate with each other? Security KA-KDC(A, B) Alice knows R 1 KDC generates R 1 KA-KDC(R 1, KB-KDC(A, R 1) ) KB-KDC(A, R 1) Bob knows to use R 1 to communicate with Alice and Bob communicate: using R 1 as session key for shared symmetric encryption CPSC 558 Advanced Computer Networks

Certification Authorities Security • Certification authority (CA): binds public key to particular entity, E. Certification Authorities Security • Certification authority (CA): binds public key to particular entity, E. • E (person, router) registers its public key with CA. – E provides “proof of identity” to CA. – CA creates certificate binding E to its public key. digital Bob’s + – certificate containing E’s public key digitally signed by CA – signature KB public + CA says “this is E’s public key” (encrypt) key K B Bob’s identifying information CA private key K- CA CPSC 558 Advanced Computer Networks certificate for Bob’s public key, signed by CA

Certification Authorities • When Alice wants Bob’s public key: – gets Bob’s certificate (Bob Certification Authorities • When Alice wants Bob’s public key: – gets Bob’s certificate (Bob or elsewhere). Security certificate, get – apply CA’s public key to Bob’s public key + KB digital signature (decrypt) CA public key + K CA CPSC 558 Advanced Computer Networks Bob’s public + key KB

A certificate contains: • Serial number (unique to issuer) • info about certificate owner, A certificate contains: • Serial number (unique to issuer) • info about certificate owner, including algorithm and key value itself (not shown) Security • info about certificate issuer • valid dates • digital signature by issuer CPSC 558 Advanced Computer Networks

Chapter 7 roadmap What is network security? Security Principles of cryptography Authentication Integrity Key Chapter 7 roadmap What is network security? Security Principles of cryptography Authentication Integrity Key Distribution and certification Access control: firewalls Attacks and counter measures Security in many layers CPSC 558 Advanced Computer Networks

Firewalls firewall isolates organization’s internal net from larger Security Internet, allowing some packets to Firewalls firewall isolates organization’s internal net from larger Security Internet, allowing some packets to pass, blocking others. public Internet administered network firewall CPSC 558 Advanced Computer Networks

Firewalls: Why prevent denial of service attacks: – SYN flooding: attacker establishes many bogus Firewalls: Why prevent denial of service attacks: – SYN flooding: attacker establishes many bogus TCP connections, Security no resources left for “real” connections. prevent illegal modification/access of internal data. – e. g. , attacker replaces CIA’s homepage with something else allow only authorized access to inside network (set of authenticated users/hosts) two types of firewalls: – application-level – packet-filtering CPSC 558 Advanced Computer Networks

Packet Filtering Should arriving packet be allowed in? Departing packet let out? Security • Packet Filtering Should arriving packet be allowed in? Departing packet let out? Security • internal network connected to Internet via router firewall • router filters packet-by-packet, decision to forward/drop packet based on: – – source IP address, destination IP address TCP/UDP source and destination port numbers ICMP message type TCP SYN and ACK bits CPSC 558 Advanced Computer Networks

Packet Filtering • Example 1: block incoming and outgoing datagrams with IP protocol field Packet Filtering • Example 1: block incoming and outgoing datagrams with IP protocol field = 17 and with either source or dest port = 23. Security – All incoming and outgoing UDP flows and telnet connections are blocked. • Example 2: Block inbound TCP segments with ACK=0. – Prevents external clients from making TCP connections with internal clients, but allows internal clients to connect to outside. CPSC 558 Advanced Computer Networks

Application gateways host-to-gateway telnet session • Filters packets on application data as well as Application gateways host-to-gateway telnet session • Filters packets on application data as well as Security on IP/TCP/UDP fields. • Example: allow select internal users to telnet outside. application gateway-to-remote host telnet session router and filter 1. Require all telnet users to telnet through gateway. 2. For authorized users, gateway sets up telnet connection to dest host. Gateway relays data between 2 connections 3. Router filter blocks all telnet connections not originating from gateway. CPSC 558 Advanced Computer Networks

Limitations of firewalls and gateways • IP spoofing: router can’t • filters often use Limitations of firewalls and gateways • IP spoofing: router can’t • filters often use all or know if data “really” nothing policy for UDP. comes from claimed Security • tradeoff: degree of source communication with • if multiple app’s. need outside world, level of special treatment, each security has own app. gateway. • many highly protected • client software must sites still suffer from know how to contact attacks. gateway. – e. g. , must set IP address of proxy in Web browser CPSC 558 Advanced Computer Networks

Chapter 7 roadmap What is network security? Security Principles of cryptography Authentication Integrity Key Chapter 7 roadmap What is network security? Security Principles of cryptography Authentication Integrity Key Distribution and certification Access control: firewalls Attacks and counter measures Security in many layers CPSC 558 Advanced Computer Networks

Internet security threats Mapping: – before attacking: “case the joint” – find out what Internet security threats Mapping: – before attacking: “case the joint” – find out what Security services are implemented on network – Use ping to determine what hosts have addresses on network – Port-scanning: try to establish TCP connection to each port in sequence (see what happens) – nmap (http: //www. insecure. org/nmap/) mapper: “network exploration and security auditing” Countermeasures? CPSC 558 Advanced Computer Networks

Internet security threats Mapping: countermeasures – record traffic entering network Security – look for Internet security threats Mapping: countermeasures – record traffic entering network Security – look for suspicious activity (IP addresses, pots being scanned sequentially) CPSC 558 Advanced Computer Networks

Internet security threats Packet sniffing: – – broadcast media Security promiscuous NIC reads all Internet security threats Packet sniffing: – – broadcast media Security promiscuous NIC reads all packets passing by can read all unencrypted data (e. g. passwords) e. g. : C sniffs B’s packets C A src: B dest: A payload Countermeasures? CPSC 558 Advanced Computer Networks B

Internet security threats Packet sniffing: countermeasures – all hosts in orgnization run software that Internet security threats Packet sniffing: countermeasures – all hosts in orgnization run software that checks periodically if host Security promiscuous mode. interface in – one host per segment of broadcast media (switched Ethernet at hub) C A src: B dest: A payload CPSC 558 Advanced Computer Networks B

Internet security threats IP Spoofing: – can generate “raw” IP packets directly from Security Internet security threats IP Spoofing: – can generate “raw” IP packets directly from Security application, putting any value into IP source address field – receiver can’t tell if source is spoofed – e. g. : C pretends to be B C A src: B dest: A payload Countermeasures? CPSC 558 Advanced Computer Networks B

Internet security threats IP Spoofing: ingress filtering – routers should not forward outgoing packets Internet security threats IP Spoofing: ingress filtering – routers should not forward outgoing packets with Security invalid source addresses (e. g. , datagram source address not in router’s network) – great, but ingress filtering can not be mandated for all networks C A src: B dest: A payload B CPSC 558 Advanced Computer Networks

Internet security threats Denial of service (DOS): – flood of maliciously generated packets “swamp” Internet security threats Denial of service (DOS): – flood of maliciously generated packets “swamp” Security receiver – Distributed DOS (DDOS): multiple coordinated sources swamp receiver – e. g. , C and remote host SYN-attack A C A SYN SYN SYN B Countermeasures? SYN CPSC 558 Advanced Computer Networks

Internet security threats Denial of service (DOS): countermeasures – filter out flooded packets (e. Internet security threats Denial of service (DOS): countermeasures – filter out flooded packets (e. g. , SYN) before Security reaaching host: throw out good with bad – traceback to source of floods (most likely an innocent, compromised machine) C A SYN SYN SYN B SYN CPSC 558 Advanced Computer Networks

Chapter 7 roadmap What is network security? Principles of cryptography Security Authentication Integrity Key Chapter 7 roadmap What is network security? Principles of cryptography Security Authentication Integrity Key Distribution and certification Access control: firewalls Attacks and counter measures Security in many layers a. Secure email b. Secure sockets c. IPsec d. 802. 11 WEP CPSC 558 Advanced Computer Networks

Secure e-mail q Alice wants to send confidential e-mail, m, to Bob. KS m Secure e-mail q Alice wants to send confidential e-mail, m, to Bob. KS m KS K (. ) S + . K B( ) K+ B Security KS(m ) + + KB(KS ) KS(m ) - Internet + KB(KS ) Alice: q q . K S( ) generates random symmetric private key, KS. encrypts message with KS (for efficiency) also encrypts KS with Bob’s public key. sends both KS(m) and KB(KS) to Bob. CPSC 558 Advanced Computer Networks KS - . K B( ) KB m

Secure e-mail q Alice wants to send confidential e-mail, m, to Bob. KS m Secure e-mail q Alice wants to send confidential e-mail, m, to Bob. KS m KS K (. ) S + . K B( ) K+ B Security KS(m ) + + KB(KS ) KS(m ) . K S( ) - Internet + KB(KS ) Bob: q uses his private key to decrypt and recover K S q uses KS to decrypt KS(m) to recover m CPSC 558 Advanced Computer Networks KS - . K B( ) KB m

Secure e-mail (continued) • Alice wants to provide sender authentication message integrity. m H(. Secure e-mail (continued) • Alice wants to provide sender authentication message integrity. m H(. ) KA - . K A( ) Security - - KA(H(m)) + + KA Internet m m • Alice digitally signs message. + . K A( ) H(m ) compare . H( ) H(m ) • sends both message (in the clear) and digital signature. CPSC 558 Advanced Computer Networks

Secure e-mail (continued) • Alice wants to provide secrecy, sender authentication, message integrity. m Secure e-mail (continued) • Alice wants to provide secrecy, sender authentication, message integrity. m . H( ) KA - . K A( ) - Security KA(H(m)) + . K S( ) m KS KS + . K B( ) K+ B + Internet + KB(KS ) Alice uses three keys: her private key, Bob’s public key, newly created symmetric key CPSC 558 Advanced Computer Networks

Pretty good privacy (PGP) • Internet e-mail encryption A PGP signed message: scheme, de-facto Pretty good privacy (PGP) • Internet e-mail encryption A PGP signed message: scheme, de-facto standard. ---BEGIN Security PGP SIGNED MESSAGE-- • uses symmetric key Hash: SHA 1 cryptography, public key Bob: My husband is out of town cryptography, hash function, tonight. Passionately yours, and digital signature as Alice described. ---BEGIN PGP SIGNATURE-- • provides secrecy, sender Version: PGP 5. 0 authentication, integrity. Charset: noconv • inventor, Phil Zimmerman, was yh. HJRHh. GJGhgg/12 Ep. J+lo 8 g. E 4 v. B 3 mq. Jh FEv. ZP 9 t 6 n 7 G 6 m 5 Gw 2 target of 3 -year federal ---END PGP SIGNATURE--investigation. CPSC 558 Advanced Computer Networks

Secure sockets layer (SSL) • server authentication: • transport layer security Security– SSL-enabled browser Secure sockets layer (SSL) • server authentication: • transport layer security Security– SSL-enabled browser to any TCP-based app includes public keys for using SSL services. trusted CAs. – Browser requests server • used between Web certificate, issued by browsers, servers for etrusted CA. commerce (shttp). – Browser uses CA’s public key to extract server’s • security services: – server authentication – data encryption – client authentication (optional) public key from certificate. • check your browser’s security menu to see its trusted CAs. CPSC 558 Advanced Computer Networks

SSL (continued) Encrypted SSL session: • • Browser generates symmetric session key, Security encrypts SSL (continued) Encrypted SSL session: • • Browser generates symmetric session key, Security encrypts it with server’s • public key, sends encrypted key to server. • Using private key, server • decrypts session key. • Browser, server know session key SSL: basis of IETF Transport Layer Security (TLS). SSL can be used for non-Web applications, e. g. , IMAP. Client authentication can be done with client certificates. – All data sent into TCP socket (by client or server) encrypted with session key. CPSC 558 Advanced Computer Networks

IPsec: Network Layer Security • Network-layer secrecy: • For both AH and ESP, source, IPsec: Network Layer Security • Network-layer secrecy: • For both AH and ESP, source, – sending host encrypts the destination handshake: data in IP datagram Security – create network-layer logical – TCP and UDP segments; channel called a security ICMP and SNMP messages. association (SA) • Network-layer authentication • Each SA unidirectional. – destination host can • Uniquely determined by: authenticate source IP – security protocol (AH or address ESP) • Two principle protocols: – source IP address – authentication header (AH) – 32 -bit connection ID protocol – encapsulation security payload (ESP) protocol CPSC 558 Advanced Computer Networks

Authentication Header (AH) Protocol AH header includes: • provides source authentication, data • connection Authentication Header (AH) Protocol AH header includes: • provides source authentication, data • connection identifier integrity, no Security • authentication data: source confidentiality - signed message digest • AH header inserted calculated over original IP between IP header, datagram. field. • next header field: specifies • protocol field: 51 type of data (e. g. , TCP, UDP, ICMP) • intermediate routers process datagrams as usual IP header AH header data (e. g. , TCP, UDP segment) CPSC 558 Advanced Computer Networks

ESP Protocol • provides secrecy, host • authentication, data integrity. Security • data, ESP ESP Protocol • provides secrecy, host • authentication, data integrity. Security • data, ESP trailer encrypted. • • next header field is in ESP trailer. ESP authentication field is similar to AH authentication field. Protocol = 50. authenticated encrypted IP header ESP TCP/UDP segment header trailer CPSC 558 Advanced Computer Networks ESP authent.

IEEE 802. 11 security • War-driving: drive around Bay area, see what 802. 11 IEEE 802. 11 security • War-driving: drive around Bay area, see what 802. 11 networks available? Security – More than 9000 accessible from public roadways – 85% use no encryption/authentication – packet-sniffing and various attacks easy! • Wired Equivalent Privacy (WEP): authentication as in protocol ap 4. 0 – host requests authentication from access point – access point sends 128 bit nonce – host encrypts nonce using shared symmetric key – access point decrypts nonce, authenticates host CPSC 558 Advanced Computer Networks

IEEE 802. 11 security • Wired Equivalent Privacy (WEP): data encryption Security – Host/AP IEEE 802. 11 security • Wired Equivalent Privacy (WEP): data encryption Security – Host/AP share 40 bit symmetric key (semi-permanent) – Host appends 24 -bit initialization vector (IV) to create 64 -bit key – 64 bit key used to generate stream of keys, ki. IV – ki. IV used to encrypt ith byte, di, in frame: ci = di XOR ki. IV – IV and encrypted bytes, ci sent in frame CPSC 558 Advanced Computer Networks

802. 11 WEP encryption Security Sender-side WEP encryption CPSC 558 Advanced Computer Networks 802. 11 WEP encryption Security Sender-side WEP encryption CPSC 558 Advanced Computer Networks

Breaking 802. 11 WEP encryption Security hole: • 24 -bit IV, one IV per Breaking 802. 11 WEP encryption Security hole: • 24 -bit IV, one IV per frame, -> IV’s eventually reused Security • IV transmitted in plaintext -> IV reuse detected • Attack: – Trudy causes Alice to encrypt known plaintext d 1 d 2 d 3 d 4 … – Trudy sees: ci = di XOR ki. IV – Trudy knows ci di, so can compute ki. IV – Trudy knows encrypting key sequence k 1 IV k 2 IV k 3 IV … – Next time IV is used, Trudy can decrypt! CPSC 558 Advanced Computer Networks

Network Security (summary) Basic techniques…. . . – – cryptography (symmetric and public) Security Network Security (summary) Basic techniques…. . . – – cryptography (symmetric and public) Security authentication message integrity key distribution …. used in many different security scenarios – – secure email secure transport (SSL) IP sec 802. 11 WEP CPSC 558 Advanced Computer Networks

Security Summary Review Outline Security Encryption Algorithms Authentication Protocols Message Integrity Protocols Key Distribution Security Summary Review Outline Security Encryption Algorithms Authentication Protocols Message Integrity Protocols Key Distribution Firewalls CPSC 558 Advanced Computer Networks

Overview • Cryptography functions – Secret key (e. g. , DES) – Public key Overview • Cryptography functions – Secret key (e. g. , DES) – Public key (e. g. , RSA) Security – Message digest (e. g. , MD 5) • Security services – Privacy: preventing unauthorized release of information – Authentication: verifying identity of the remote participant – Integrity: making sure message has not been altered CPSC 558 Advanced Computer Networks

Secret Key (DES) Security CPSC 558 Advanced Computer Networks Secret Key (DES) Security CPSC 558 Advanced Computer Networks

 • 64 -bit key (56 -bits + 8 -bit parity) • 16 rounds • 64 -bit key (56 -bits + 8 -bit parity) • 16 rounds • Each Round Security Li ─1 Ri ─1 F + Li CPSC 558 Advanced Computer Networks Ri Ki

 • Repeat for larger messages Security CPSC 558 Advanced Computer Networks • Repeat for larger messages Security CPSC 558 Advanced Computer Networks

Public Key (RSA) Security • Encryption & Decryption c = memod n m = Public Key (RSA) Security • Encryption & Decryption c = memod n m = cdmod n CPSC 558 Advanced Computer Networks

RSA (cont) • Choose two large prime numbers p and q (each 256 bits) RSA (cont) • Choose two large prime numbers p and q (each 256 bits) Security • Multiply p and q together to get n • Choose the encryption key e, such that e and (p - 1) x (q - 1) are relatively prime. • Two numbers are relatively prime if they have no common factor greater than one • Compute decryption key d such that d = e-1 mod ((p - 1) x (q - 1)) • Construct public key as (e, n) • Construct public key as (d, n) • Discard (do not disclose) original primes p and q CPSC 558 Advanced Computer Networks

Message Digest • Cryptographic checksum – just as a regular checksum protects the receiver Message Digest • Cryptographic checksum – just as a regular checksum protects the receiver from accidental changes to the message, a cryptographic Security checksum protects the receiver from malicious changes to the message. • One-way function – given a cryptographic checksum for a message, it is virtually impossible to figure out what message produced that checksum; it is not computationally feasible to find two messages that hash to the same cryptographic checksum. • Relevance – if you are given a checksum for a message and you are able to compute exactly the same checksum for that message, then it is highly likely this message produced the checksum you were given. CPSC 558 Advanced Computer Networks

Authentication Protocols • Three-way handshake Client Security Clien t. Id, E ( , C Authentication Protocols • Three-way handshake Client Security Clien t. Id, E ( , C Server HK) Y E(y + , CHK ) ) K K, SH (S E CPSC 558 Advanced Computer Networks

 • Trusted third party (Kerberos) Security CPSC 558 Advanced Computer Networks • Trusted third party (Kerberos) Security CPSC 558 Advanced Computer Networks

 • Public key authentication A B Security E( x , Pu blic B • Public key authentication A B Security E( x , Pu blic B ) x CPSC 558 Advanced Computer Networks

Message Integrity Protocols • Digital signature using RSA – special case of a message Message Integrity Protocols • Digital signature using RSA – special case of a message integrity where the code can only have been generated by one participant Security – compute signature with private key and verify with public key • Keyed MD 5 – sender: m + MD 5(m + k) + E(k, private) – receiver • recovers random key using the sender’s public key • applies MD 5 to the concatenation of this random key message • MD 5 with RSA signature – sender: m + E(MD 5(m), private) – receiver • decrypts signature with sender’s public key • compares result with MD 5 checksum sent with message CPSC 558 Advanced Computer Networks

Message Integrity Protocols • Digital signature using RSA – special case of a message Message Integrity Protocols • Digital signature using RSA – special case of a message integrity where the code can only have been generated by one participant Security – compute signature with private key and verify with public key • Keyed MD 5 – sender: m + MD 5(m + k) + E(E(k, rcv-pub), private) – receiver • recovers random key using the sender’s public key • applies MD 5 to the concatenation of this random key message • MD 5 with RSA signature – sender: m + E(MD 5(m), private) – receiver • decrypts signature with sender’s public key • compares result with MD 5 checksum sent with message CPSC 558 Advanced Computer Networks

Key Distribution • Certificate – special type of digitally signed document: Security “I certify Key Distribution • Certificate – special type of digitally signed document: Security “I certify that the public key in this document belongs to the entity named in this document, signed X. ” – the name of the entity being certified – the public key of the entity – the name of the certified authority – a digital signature • Certified Authority (CA) – administrative entity that issues certificates – useful only to someone that already holds the CA’s public key. CPSC 558 Advanced Computer Networks

Key Distribution (cont) • Chain of Trust Security – if X certifies that a Key Distribution (cont) • Chain of Trust Security – if X certifies that a certain public key belongs to Y, and Y certifies that another public key belongs to Z, then there exists a chain of certificates from X to Z – someone that wants to verify Z’s public key has to know X’s public key and follow the chain • Certificate Revocation List CPSC 558 Advanced Computer Networks

Firewalls Security • Filter-Based Solution – example ( 192. 13. 14, 1234, 128. 7. Firewalls Security • Filter-Based Solution – example ( 192. 13. 14, 1234, 128. 7. 6. 5, 80 ) (*, *, 128. 7. 6. 5, 80 ) – default: forward or not forward? – how dynamic? CPSC 558 Advanced Computer Networks

Proxy-Based Firewalls • Problem: complex policy • Example: web server Security • Solution: proxy Proxy-Based Firewalls • Problem: complex policy • Example: web server Security • Solution: proxy • Design: transparent vs. classical • Limitations: attacks from within CPSC 558 Advanced Computer Networks

Denial of Service • Attacks on end hosts Security – SYN attack • Attacks Denial of Service • Attacks on end hosts Security – SYN attack • Attacks on routers – Christmas tree packets – pollute route cache • Authentication attacks • Distributed Do. S attacks CPSC 558 Advanced Computer Networks