1 Chapter 8 Network SecurityCOMP211 Chapter 8 Network Security Computer Networking: A Top Down Approach 7th edition Jim Kurose, Keith Ross Pearson/Addison Wesley April 2016 All material copyright J.F Kurose and K.W. Ross, All Rights Reserved
2 Network Security Our Goals: understand principles of network security:cryptography and its many uses beyond “confidentiality” authentication message integrity security in practice: security in application, transport, network, link layers
3 Outline Introduction Symmetric Key CryptographyWhat is network security? Why is network security important? What are the requirements for a secure network? An introduction to Cryptography Symmetric Key Cryptography Public Key Cryptography Authentication Integrity Security in Internet protocol stack
4 Do we need network security?Internet and WWW computing standards (IP, HTTP, etc) are public Therefore, intruders know about the types of messages being sent around the Internet The Internet is open and pervasive The Internet has many connecting components A message sent between two computer will often pass through many others Can we trust the others?
5 There are bad guys (and girls) out there!Q: What can a “bad guy” do? A: A lot! eavesdrop: intercept messages (packet sniffing) Traffic analysis Collect (and sell) sensitive information Guess data content by studying traffic patterns impersonation: can fake (spoof) source address in packet (or any field in packet) man-in-the-middle attacks actively insert/modify/delete messages into connection 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) Passive attack Hard to detect Active attacks
6 What is network security?Confidentiality: only sender, intended receiver should “understand” message contents sender encrypts message 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
7 Friends and enemies: Alice, Bob, TrudyWell-known in network security world Bob, Alice (lovers!) want to communicate “securely” Trudy (intruder – a jealous spouse?) may intercept, delete, add messages Alice Bob channel data, control messages secure sender secure receiver data data Trudy
8 Who might Bob, Alice be? … well, real-life Bobs and Alices!Web browser/server for electronic transactions (e.g., on-line purchases) On-line banking client/server DNS servers Routers exchanging routing table updates Other examples?
9 Cryptography From the Greek words: ‘Cryptos’ (= secret) and ‘Grafien’ (= writing) From ancient times to around 30 years ago: essentially private communications for personal, political and military matters Today: study and application of techniques relying on the existence of hard problems A lot of historic uses of Cryptography...
10 Cryptography in “ancient” timesThe bible codes Atbash, Albam and Atbah Spartan Scytale (7th century BC) Caesar cipher Babington plot Enigma Some sources The Code Book by Simon Singh The codebreakers: the Story of Secret Writing by David Kahn Google, Wikipedia, etc.
11 Caesar cipher (a substitution cipher)Caesar wants to encrypt the message: omnia gallia est divisa in partes tres rpqld jdoold hvw glylvd lq sduwhv wuhv How to get the original message back? abcdefghijklmnopqrstuvwxyz defghijklmnopqrstuvwxyzabc
12 The language of cryptographyplaintext ciphertext K A encryption algorithm decryption Alice’s key Bob’s B m plaintext message KA(m) ciphertext, encrypted with key KA m = KB(KA(m)) Network Security
13 Caesar cipher (a substitution cipher)Caesar wants to encrypt the message: omnia gallia est divisa in partes tres rpqld jdoold hvw glylvd lq sduwhv wuhv How to get the original message back? plaintext abcdefghijklmnopqrstuvwxyz defghijklmnopqrstuvwxyzabc ciphertext Key: the shift of the alphabet (3 in the example)
14 Outline Introduction Symmetric Key CryptographyPublic Key Cryptography Authentication Integrity Security in Internet protocol stack
15 Symmetric key cryptographyA-B K A-B encryption algorithm plaintext message, m ciphertext decryption algorithm plaintext K (m) K (m) A-B m = K ( ) A-B Symmetric key crypto: Bob and Alice share same (symmetric) key: KA-B e.g., key is knowing alphabet shift in Caeser cipher Q: how do Bob and Alice agree on key value?
16 How secure is Caesar cipher ?Caesar wants to encrypt the message: omnia gallia est divisa in partes tres rpqld jdoold hvw glylvd lq sduwhv wuhv plaintext abcdefghijklmnopqrstuvwxyz defghijklmnopqrstuvwxyzabc symmetric key ciphertext There are only 25 possible keys! Given a ciphertext it is easy to compute the corresponding plaintext.
17 Monoalphabetic cipherSubstitute one letter for another Similar to Caesar’s, except no fixed pattern of substitution The key is a one-to-one mapping between letters plaintext: abcdefghijklmnopqrstuvwxyz ciphertext: mnbvcxzasdfghjklpoiuytrewq Plaintext: bob. i love you. alice E.g.: ciphertext: nkn. s gktc wky. mgsbc
18 How secure are monoalphabetic ciphers?Key is a mapping from the set of 26 letters to the set of 26 letters 26 factorial (26!) different pairings 26! = 26 x x 2 x 1 = Use statistical analysis, e.g. ‘e’ and ‘t’ account for 13% and 9% of letter occurrences respectively
19 How secure are monoalphabetic ciphers?If Trudi knows that the words ‘alice’ and ‘bob’ are in the plaintext, then given the ciphertext she can determine the mapping of 7 letters Less possibilities to be checked! Trudi can also notice that some certain letters appear often together (‘in’, ‘it’, ‘the’, ‘ing’, ...) What kind of information does Trudy have when breaking a cipher?
20 Breaking Encryption Cipher-text only attack Known-plaintext attackIntruder analyses encrypted message Statistical methods: e.g., knowing the frequency of letters or combinations in plaintext language Brute-force attack: try every possible key (infeasible for long keys) Known-plaintext attack Intruder knows some of the (plaintext, ciphertext) pairings Chosen-plaintext attack Intruder can get ciphertext for some chosen plaintext Monoalphabetic ciphers can be easily broken in this case Simply ask to encrypt: “The quick brown fox jumps over the lazy dog”
21 Polyalphabetic encryptionn monoalphabetic cyphers, M1,M2,…,Mn Cycling pattern: e.g., for n=4: M1,M3,M4,M3,M2; M1,M3,M4,M3,M2; For each new plaintext symbol, use subsequent monoalphabetic pattern in cyclic pattern ‘dog’: d from M1, o from M3, g from M4 Key: the n ciphers and the cyclic pattern
22 Two types of symmetric ciphersBlock ciphers Break plaintext message in equal-size blocks Encrypt each block as a unit Stream ciphers encrypt one bit at time
23 Stream Ciphers pseudo random keystream generator key keystream Combine each bit of keystream with bit of plaintext to get bit of ciphertext m(i) = i’th bit of message ks(i) = i’th bit of keystream c(i) = i’th bit of ciphertext c(i) = ks(i) m(i) ( = exclusive or) m(i) = ks(i) c(i)
24 RC4 Stream Cipher RC4 is a popular stream cipherExtensively analyzed and considered good Key can be from 1 to 256 bytes Used in WEP for Can be used in SSL
25 Block ciphers Message to be encrypted is processed in blocks of k bits (e.g., 64-bit blocks). 1-to-1 mapping is used to map k-bit block of plaintext to k-bit block of ciphertext Example with k=3: input output input output What is the ciphertext for ?
26 Block ciphers How many possible mappings are there for k=3?How many 3-bit inputs? How many permutations of the 3-bit inputs? Answer: 8! = 40,320; not very many! In general, 2k! mappings; huge for k=64 Problem: Table approach requires table with 264 entries, each entry with 64 bits Table too big: instead use function that simulates a randomly permuted table
27 Prototype function From Kaufman et al 64-bit input S1 8bits 8 bits S264-bit intermediate 64-bit output Loop for n rounds 8-bit to 8-bit mapping
28 Why rounds in prototpe? If only a single round, then one bit of input affects at most 8 bits of output. In 2nd round, the 8 affected bits get scattered and inputted into multiple substitution boxes. How many rounds? How many times do you need to shuffle cards Becomes less efficient as n increases
29 Encrypting a large messageWhy not just break message in 64-bit blocks, encrypt each block separately? If same block of plaintext appears twice, will give same cyphertext. How about: Generate random 64-bit number r(i) for each plaintext block m(i) Calculate c(i) = KS( m(i) r(i) ) Transmit c(i), r(i), i=1,2,… At receiver: m(i) = KS(c(i)) r(i) Problem: inefficient, need to send c(i) and r(i)
30 Cipher Block Chaining (CBC)CBC generates its own random numbers Have encryption of current block depend on result of previous block c(i) = KS( m(i) c(i-1) ) m(i) = KS( c(i)) c(i-1) How do we encrypt first block? Initialization vector (IV): random block = c(0) IV does not have to be secret Change IV for each message (or session) Guarantees that even if the same message is sent repeatedly, the ciphertext will be completely different each time
31 Cipher Block Chaining +cipher block: if input block repeated, will produce same cipher text: m(1) = “HTTP/1.1” c(1) = “k329aM02” t=1 block cipher … m(17) = “HTTP/1.1” c(17) = “k329aM02” t=17 block cipher cipher block chaining: XOR ith input block, m(i), with previous block of cipher text, c(i-1) c(0) transmitted to receiver in clear what happens in “HTTP/1.1” scenario from above? m(i) + c(i-1) block cipher c(i)
32 Symmetric key in the real world: DESDES: Data Encryption Standard US encryption standard [NIST 1993] 56-bit symmetric key 256 = 64-bit plaintext input How secure is DES? no known good analytic attack DES Challenge III (1999): 56-bit-key-encrypted phrase decrypted (brute force) in 22h 15m 1 supercomputer ‘Deep Crack’ and 100,000 distributed PCs on the internet testing 245 billion keys per second! Making DES more secure: 3DES: encrypt 3 times with 3 different keys (actually encrypt, decrypt, encrypt) - using cipher-block chaining
33 Symmetric key crypto: DESDES operation initial permutation 16 identical “rounds” of function application, each using different 48 bits of key final permutation
34 Symmetric key crypto: DESOriginal Without cipher-block chaining With cipher-block chaining
35 AES: Advanced Encryption StandardNew (Nov. 2001) symmetric-key NIST standard, replacing DES Processes data in 128 bit blocks 128, 192, or 256 bit keys 2256 = 115,792,089,237,316,195,423,570,985,008,687,907,853,269, 984,665,640,564,039,457,584,007,913,129,639,936 (that’s 78 digits) Brute force decryption (try each key) taking 1sec on DES, takes 149 trillion years for AES
36 So AES is unbreakable then?Not at all! The key could be found on the first guess (a probability of 1/2256)! The trick is to have a key space so large that it is not worth anyone trying a brute-force attack
37 Outline Introduction Symmetric Key CryptographyPublic Key Cryptography Authentication Integrity Security in Internet protocol stack
38 Public Key Cryptographysymmetric key crypto requires sender, receiver know shared secret key Q: how to agree on key in first place (particularly if never “met”)? public key cryptography radically different approach [Diffie- Hellman76, RSA78] sender, receiver do not share secret key public encryption key known to all private decryption key known only to receiver
39 Public key cryptography+ Bob’s public key K B - Bob’s private key K B plaintext message, m encryption algorithm ciphertext decryption algorithm plaintext message K (m) B + m = K (K (m)) B + -
40 Requirements for public key encryption algorithms+ - Need K ( ) and K ( ) such that B B K (K (m)) = m B - + It is computationally easy to Generate a pair of keys Encrypt and decrypt messages using these keys It is computationally infeasible Determine the private key from the public key Recover the plaintext from the public key and the ciphertext
41 Prerequisite: modular arithmeticx mod n = remainder of x when divide by n Facts: [(a mod n) + (b mod n)] mod n = (a+b) mod n [(a mod n) - (b mod n)] mod n = (a-b) mod n [(a mod n) * (b mod n)] mod n = (a*b) mod n Thus (a mod n)d mod n = ad mod n Example: a=14, n=10, d=2: (a mod n)d mod n = 42 mod 10 = 6 ad mod 10 = 142 mod 10 = 196 mod 10 = 6
42 RSA: getting ready A message is a bit pattern.A bit pattern can be uniquely represented by an integer number. Thus encrypting a message is equivalent to encrypting a number. Example m= This message is uniquely represented by the decimal number 145. To encrypt m, we encrypt the corresponding number, which gives a new number (the cyphertext).
43 RSA: Rivest, Shamir, Adleman algorithmRSA: Choosing keys RSA: Rivest, Shamir, Adleman algorithm 1. Choose two large prime numbers p, q. (e.g., 1024 bits each) 2. Compute n = pq, z = (p-1)(q-1) 3. Choose e (with e
44 RSA: Encryption, decryption0. Given (n,e) and (n,d) as computed above 1. To encrypt bit pattern, m, compute c = m mod n e (i.e., remainder when m is divided by n) 2. To decrypt received bit pattern, c, compute m = c mod n d d (i.e., remainder when c is divided by n) Magic happens! m = (m mod n) e mod n d c
45 Bob chooses p=5, q=7. Then n=35, z=24.RSA example: Bob chooses p=5, q=7. Then n=35, z=24. e=5 (so e, z relatively prime) d=29 (so ed-1 exactly divisible by z) Encrypting 8-bit messages. e c = m mod n e bit pattern m m encrypt: 12 248832 17 c d m = c mod n d c decrypt: 17 12
46 Why does RSA work? Must show that cd mod n = m where c = me mod nResult from number theory: for any x and y, xy mod n = x(y mod z) mod n, where n= pq and z = (p-1)(q-1) Thus, cd mod n = (me mod n)d mod n = med mod n = m(ed mod z) mod n (by the result above) = m1 mod n (since ed is divisible by (p-1)(q-1) with remainder 1) = m
47 RSA: another important propertyThe following property will be very useful later: K (K (m)) = m B - + K (K (m)) = use public key first, followed by private key use private key first, followed by public key Result is the same! Why is it true for RSA?
48 Why is RSA Secure? Generating RSA keysSuppose you know Bob’s public key (n,e). How hard is it to determine d? Essentially need to find factors of n without knowing the two factors p and q. Fact: factoring a big number is hard. Generating RSA keys Have to find big primes p and q Approach: make good guess then apply testing rules
49 Session keys Exponentiation is computationally intensiveDES is at least 100 times faster than RSA Combination of public and symmetric key cryptography using Session key, KS Bob and Alice use RSA to exchange a symmetric key KS Once both have KS, they use symmetric key cryptography
50 Outline Introduction Symmetric Key CryptographyPublic Key Cryptography Authentication Integrity Security in Internet protocol stack
51 What is authentication?Process of proving one’s identity to someone else As humans, we authenticate each other using personal traits, e.g. faces, voices For electronic systems, use authentication protocols Typically run before some other protocol
52 Protocol ap1.0: Alice says “I am Alice”Authentication Goal: Bob wants Alice to “prove” her identity to him Protocol ap1.0: Alice says “I am Alice” “I am Alice” Failure scenario?? Network Security
53 Authentication Goal: Bob wants Alice to “prove” her identity to himProtocol ap1.0: Alice says “I am Alice” in a network, Bob can not “see” Alice, so Trudy simply declares herself to be Alice “I am Alice” Network Security
54 Authentication: another tryProtocol ap2.0: Alice says “I am Alice” in an IP packet containing her source IP address “I am Alice” Alice’s IP address Failure scenario?? Network Security
55 Authentication: another tryProtocol ap2.0: Alice says “I am Alice” in an IP packet containing her source IP address Trudy can create a packet “spoofing” Alice’s address “I am Alice” Alice’s IP address Network Security
56 Authentication: another tryProtocol ap3.0: Alice says “I am Alice” and sends her secret password to “prove” it. “I’m Alice” Alice’s IP addr password Failure scenario?? OK Alice’s IP addr Network Security
57 Authentication: another tryProtocol ap3.0: Alice says “I am Alice” and sends her secret password to “prove” it. Alice’s IP addr Alice’s password “I’m Alice” playback attack: Trudy records Alice’s packet and later plays it back to Bob OK Alice’s IP addr “I’m Alice” Alice’s IP addr password Network Security
58 Authentication: yet another tryProtocol ap3.1: Alice says “I am Alice” and sends her encrypted secret password to “prove” it. “I’m Alice” Alice’s IP addr encrypted password Failure scenario?? OK Alice’s IP addr Network Security
59 Authentication: yet another tryProtocol ap3.1: Alice says “I am Alice” and sends her encrypted secret password to “prove” it. Alice’s IP addr encrypted password “I’m Alice” record and playback still works! OK Alice’s IP addr “I’m Alice” Alice’s IP addr encrypted password Network Security
60 Authentication: yet another tryGoal: avoid playback attack nonce: number (R) used only once-in-a-lifetime ap4.0: to prove Alice “live”, Bob sends Alice nonce, R. Alice must return R, encrypted with shared secret key “I am Alice” R K (R) A-B Alice is live, and only Alice knows key to encrypt nonce, so it must be Alice! Failures, drawbacks? Network Security
61 Authentication: ap5.0 K (K (m)) = m K (K (m))ap4.0 requires shared symmetric key Can we authenticate using public key techniques? Recall the following property: K (K (m)) = m B - + K (K (m)) = use public key first, followed by private key use private key first, followed by public key Result is the same!
62 “send me your public key”Authentication: ap5.0 ap5.0: use nonce, public key cryptography “I am Alice” Bob computes R (K (R)) = R A - K + K (R) A - and knows only Alice could have the private key, that encrypted R such that “send me your public key” K A + (K (R)) = R A - K + Network Security
63 sends m to Alice encrypted with Alice’s public keyap5.0: security hole man (or woman) in the middle attack: Trudy poses as Alice (to Bob) and as Bob (to Alice) I am Alice I am Alice R T K (R) - R A K (R) - Send me your public key T K + Send me your public key A K + T K (m) + Trudy gets T m = K (K (m)) + - A K (m) + sends m to Alice encrypted with Alice’s public key A m = K (K (m)) + - Network Security
64 ap5.0: security hole difficult to detect:man (or woman) in the middle attack: Trudy poses as Alice (to Bob) and as Bob (to Alice) difficult to detect: Bob receives everything that Alice sends, and vice versa. (e.g., so Bob, Alice can meet one week later and recall conversation!) problem is that Trudy receives all messages as well! Network Security
65 Outline Introduction Symmetric Key CryptographyPublic Key Cryptography Authentication Integrity Digital Signatures Public Key Infrastructure Hash Functions Security in Internet protocol stack
66 What is message integrity?Allows communicating parties to verify that received messages are authentic. Content of message has not been altered Source of message is who/what you think it is Message has not been replayed Sequence of messages is maintained Example: proving that an came from a specific person
67 Digital signatures cryptographic technique analogous to hand-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 Network Security
68 Public key encryption propertyRecall the following property: K (K (m)) = m B - + K (K (m)) = use public key first, followed by private key use private key first, followed by public key Result is the same!
69 Bob’s message, m, signed (encrypted) with his private keyDigital signatures simple digital signature for message m: Bob signs m by encrypting with his private key KB, creating “signed” message, KB(m) - - K B - Bob’s message, m Bob’s private key - m,K (m) B Dear Alice Oh, how I have missed you. I think of you all the time! …(blah blah blah) Bob Bob’s message, m, signed (encrypted) with his private key Public key encryption algorithm Network Security
70 Digital signatures - suppose Alice receives msg m, with signature: m, KB(m) Alice verifies m signed by Bob by applying Bob’s public 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 - Network Security
71 Message digests large message m H: Hash Function computationally expensive to public-key-encrypt long messages goal: fixed-length, easy- to-compute digital “fingerprint” apply hash function H to m, get fixed size message digest, H(m). H(m) Hash function properties: many-to-1 produces fixed-size msg digest (fingerprint) given message digest x, computationally infeasible to find m such that x = H(m) Sign only small message digest! Network Security
72 Internet checksum: poor crypto hash functionInternet checksum has some properties of hash function: 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 ASCII format message ASCII format I O U 1 9 B O B 49 4F 55 31 E 39 39 42 D2 42 I O U 9 9 B O B 49 4F 55 39 E 31 39 42 D2 42 B2 C1 D2 AC B2 C1 D2 AC different messages but identical checksums! Network Security
73 Digital signature = signed message digestBob sends digitally signed message: Alice verifies signature, integrity of digitally signed message: large message m H: Hash function KB(H(m)) - encrypted msg digest H(m) digital signature (encrypt) Bob’s private key large message m K B - Bob’s public key digital signature (decrypt) K B + KB(H(m)) - encrypted msg digest H: Hash function + H(m) H(m) equal ? Network Security
74 Hash function algorithmsMD5 hash function widely used (RFC 1321) computes 128-bit message digest in 4-step process. arbitrary 128-bit string x, appears difficult to construct msg m whose MD5 hash is equal to x SHA-1 is also used US standard [NIST, FIPS PUB 180-1] 160-bit message digest Network Security
75 Recall: ap5.0 security holeman (or woman) in the middle attack: Trudy poses as Alice (to Bob) and as Bob (to Alice) I am Alice I am Alice R T K (R) - R A K (R) - Send me your public key T K + Send me your public key A K + T K (m) + Trudy gets T m = K (K (m)) + - A K (m) + sends m to Alice encrypted with Alice’s public key A m = K (K (m)) + - Network Security
76 Public-key certificationmotivation: Trudy plays pizza prank on Bob Trudy creates order: Dear Pizza Store, Please deliver to me four pepperoni pizzas. Thank you, Bob Trudy signs order with her private key Trudy sends order to Pizza Store Trudy sends to Pizza Store her public key, but says it’s Bob’s public key Pizza Store verifies signature; then delivers four pepperoni pizzas to Bob Bob doesn’t even like pepperoni Network Security
77 Certification authoritiescertification 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. certificate containing E’s public key digitally signed by CA – CA says “this is E’s public key” digital signature (encrypt) K B + Bob’s public key K B + CA private key certificate for Bob’s public key, signed by CA - Bob’s identifying information K CA Network Security
78 Certification authoritieswhen Alice wants Bob’s public key: gets Bob’s certificate (Bob or elsewhere). apply CA’s public key to Bob’s certificate, get Bob’s public key K B + digital signature (decrypt) Bob’s public key K B + CA public key + K CA Network Security
79 A certificate contains:Serial number (unique to issuer) info about certificate owner, including algorithm and key value itself (not shown) info about certificate issuer valid dates digital signature by issuer
80 Outline Introduction Symmetric Key CryptographyPublic Key Cryptography Authentication Integrity Security in Internet protocol stack secure secure sockets wireless security: WEP
81 Secure e-mail . - Alice wants to send confidential e-mail, m, to Bob.KS( ) . KB( ) + - KS(m ) KB(KS ) m KS KB Internet Alice: 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 Network Security
82 Secure e-mail . - Alice wants to send confidential e-mail, m, to Bob.KS( ) . KB( ) + - KS(m ) KB(KS ) m KS KB Internet Bob: uses his private key to decrypt and recover KS uses KS to decrypt KS(m) to recover m Network Security
83 Secure e-mail (continued)Alice wants to provide sender authentication message integrity H( ) . KA( ) - + H(m ) KA(H(m)) m KA Internet compare Alice digitally signs message sends both message (in the clear) and digital signature Network Security
84 Secure e-mail (continued)Alice wants to provide secrecy, sender authentication, message integrity. H( ) . KA( ) - + KA(H(m)) m KA KS( ) KB( ) KB(KS ) KS KB Internet Alice uses three keys: her private key, Bob’s public key, newly created symmetric key Network Security
85 Pretty good privacy (PGP)used for signing, encrypting and decrypting s de-facto standard Design (in essence) the same as on previous slide. Uses symmetric key cryptography, public key cryptography, hash function, and digital signature as described. Provides secrecy, sender authentication, integrity. Inventor, Phil Zimmerman, was target of 3-year U.S. federal investigation (crypto programs considered munitions under U.S. law) A PGP signed message: ---BEGIN PGP SIGNED MESSAGE--- Hash: SHA1 Bob:My husband is out of town tonight.Passionately yours, Alice ---BEGIN PGP SIGNATURE--- Version: PGP 5.0 Charset: noconv yhHJRHhGJGhgg/12EpJ+lo8gE4vB3mqJhFEvZP9t6n7G6m5Gw2 ---END PGP SIGNATURE---
86 SSL: Secure Sockets LayerWidely deployed security protocol Supported by almost all browsers and web servers https Crucial for E-commerce applications Originally designed by Netscape in 1993 Provides Confidentiality Integrity Authentication Original goals: Had Web e-commerce transactions in mind Encryption (especially credit-card numbers) Web-server authentication Optional client authentication Minimum hassle in doing business with new merchant Available to all TCP applications Secure socket interface
87 SSL and TCP/IP Application TCP IP Normal Application Application SSL TCP IP with SSL SSL provides application programming interface (API) to applications C and Java SSL libraries/classes readily available
88 SSL (continued) Server authentication: Security services:SSL-enabled browser includes public keys for trusted CAs. Browser requests server certificate, issued by trusted CA. Browser uses CA’s public key to extract server’s public key from certificate. Security services: server authentication data encryption client authentication (optional) Check your browser’s security menu to see its trusted CAs
89 SSL (continued) Encrypted SSL session:Browser generates symmetric session key, encrypts it with server’s public key, sends encrypted key to server. Using private key, server decrypts session key. Browser, server know session key All data sent into TCP socket (by client or server) encrypted with 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.
90 IEEE (Wi-Fi) security War-driving: drive around San Francisco Bay area, see what networks available 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 ap4.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
91 IEEE (Wi-Fi) security Wired Equivalent Privacy (WEP): data encryption Stream cipher (RC4) used: message XOR key 1 XOR R L Plaintext 1100 XOR Key 0101 = Ciphertext 1001 E.g.:
92 IEEE (Wi-Fi) security Easily cracked if the same key is used every time Example: Messages a and b encrypted with key k Ek(a) = a XOR k and Ek(b) = b XOR k However, XOR is commutative (a XOR b) XOR c = a XOR (b XOR c) And for any a, the inverse w.r.t XOR is a a XOR a = 000… and j XOR 000… = j Intercept Ek(a) and Ek(b) , then Ek(a) XOR Ek(b) = (a XOR k) XOR (b XOR k) (definition of Ek) = a XOR b XOR (k XOR k) (commutative law) = a XOR b (self-inverse law)
93 IEEE (Wi-Fi) security Wired Equivalent Privacy (WEP): data encryption Host/AP share 40 bit symmetric key (semi-permanent) Host appends 24-bit initialization vector (IV) to every message to create 64-bit key 64 bit key used to generate stream of keys, kiIV kiIV used to encrypt ith byte, di, in frame: ci = di XOR kiIV IV and encrypted bytes, ci sent in frame IV sent as plaintext
94 Sender-side WEP encryptionIV Generator IV Headers IV WEP encrypted data + seed keystream KS RC4 m + CRC( ) Sender-side WEP encryption
95 Breaking 802.11 WEP encryptionSecurity hole: 24-bit IV, one IV per frame, -> IV’s eventually reused 99% probability the same IV reused after just frames (birthday paradox) IV transmitted in plaintext -> IV reuse detected Attack: Trudy causes Alice to encrypt plaintext d1 d2 d3 d4 … Trudy sees: ci = di XOR kiIV Trudy knows ci di, so can compute kiIV Trudy knows encrypting key sequence k1IV k2IV k3IV … Next time IV is used, Trudy can decrypt!
96 IEEE 802.11i (Wifi Protected Access - WPA)IEEE superceded by IEEE i 802.11i uses Shared private key to establish a session key Four-way handshake for authentication Two nonces to prevent playback attacks GTK (Group Temporal Key) to decrypt multicast and broadcast traffic Lightweight (pre-shared key) version for small business and home users
97 Network Security (summary)basic techniques…... cryptography (symmetric and public) message integrity end-point authentication …. used in many different security scenarios secure secure transport (SSL) (IP sec) 802.11 Network Security