Lecture 10: Network Security
Security properties Confidentiality Authenticity Integrity only the sender and the receiver understand the contents of the message Authenticity the message is from whom it claims to be Integrity the message was not changed along the way
Outline Building blocks Providing security properties Securing Internet protocols Operational security
Outline Building blocks Providing security properties Securing Internet protocols Operational security
Encryption & decryption “Dear Bob, ...” “Dear Bob, ...” encryption algorithm decryption algorithm “daghj2$%@^” “daghj2$%@^” “daghj2$%@^” communication channel Alice Bob
Encryption & decryption plaintext plaintext encryption algorithm decryption algorithm ciphertext ciphertext Alice Bob
Encryption & decryption Encryption algorithm: input: plaintext, output: ciphertext Decryption algorithm: input: ciphertext, output: plaintext Ciphertext: ideally, should reveal no information about the message
Symmetric key cryptography plaintext plaintext encryption algorithm decryption algorithm ciphertext ciphertext Alice key key Bob
Symmetric key cryptography plaintext plaintext encryption algorithm decryption algorithm key key ciphertext ciphertext key{ } key{ } plaintext = plaintext
Symmetric key cryptography Alice and Bob share the same key used both for the encryption and decryption algorithm Used to “scramble” the plaintext RC4, AES, Blowfish
Symmetric key cryptography Challenge: how to share a key? out of band not always an option
Asymmetric key cryptography plaintext plaintext encryption algorithm decryption algorithm ciphertext ciphertext Alice Bob key+ key-
Asymmetric key cryptography plaintext plaintext encryption algorithm decryption algorithm key+ key- ciphertext ciphertext key-{ } key+{ } plaintext = plaintext
Asymmetric key cryptography Alice and Bob use different keys public (key+) and private (key-) key There is a special relationship between them key-{ key+{ plaintext } } = plaintext key+{ key-{ plaintext } } = plaintext RSA, DSA
Asymmetric key cryptography Challenge: computationally expensive sophisticated encryption/decryption algorithms based on number theory
Cryptographic hash function Dear Bob, .................... Cheers, Alice hash function tru46hj#$% hash
Cryptographic hash function Dear Bob, .................... Cheers, Alice Dear Bob, .................... Thanks, Celine Dear Bob, .................... Best wishes, Dabir hash function Dear Bob, hash
Cryptographic hash function Dear Bob, .................... Cheers, Alice hash function tru46hj#$% hash ?
Cryptographic hash function Maps larger input to smaller hash Hash should not reveal information on input Should be hard to identify 2 inputs that lead to the same hash
Building blocks Symmetric key encryption/decryption Alice and Bob share the same key challenge: exchanging the key Asymmetric key encryption/decryption Alice and Bob use different keys challenge: computationally expensive Cryptographic hash function produces a hash of the original message that’s different from encryption
Outline Building blocks Providing security properties Securing Internet protocols Operational security
Providing confidentiality plaintext plaintext encryption algorithm decryption algorithm key key ciphertext ciphertext ciphertext Alice Bob Eve
Providing confidentiality plaintext plaintext encryption algorithm decryption algorithm ciphertext ciphertext Alice Bob Bob_key+ Bob_key-
Providing confidentiality plaintext plaintext encryption algorithm decryption algorithm ciphertext ciphertext Alice Bob Manuel Bob_key+ Bob_key-
Man in the middle Alice Manuel Bob plaintext plaintext plaintext decryption algorithm encryption algorithm decryption algorithm encryption algorithm Manuel_key- Bob_key- ciphertext ciphertext ciphertext ciphertext ciphertext ciphertext Manuel_key+ Bob_key+ Alice Manuel Bob
Providing confidentiality With symmetric key crypto Alice encrypts message with shared key only Bob can decrypt it With asymmetric key crypto Alice encrypts message with Bob’s public key only Bob can decrypt it (with his private key) but beware of man-in-the-middle attacks
Providing authenticity Persa Alice Bob I am Alice
Providing authenticity Persa Alice Bob I am Alice Alice’s IP address
Providing authenticity Alice Bob I am Alice key
Providing authenticity Alice Bob I am Alice hjdfk678vnx key{ I am Alice } key{ I am Alice } = hjdfk678vnx
Providing authenticity Persa Bob I am Alice hgdja54637452 key{ I am Alice } != hgdja54637452
Providing authenticity Alice Bob I am Alice key{ I am Alice }
Providing authenticity Alice Bob I am Alice 46873astubv hash{key|I am Alice} hash{ key | I am Alice } = 46873astubv
Providing authenticity Alice Bob I am Alice hash{key|I am Alice} Message Authentication Code (MAC)
Providing authenticity Alice Bob I am Alice Alice_key-{ I am Alice } 687retwyw Alice_key+{ 687retwyw } = I am Alice
Providing authenticity Persa Bob I am Alice ghdj67d%^& Alice_key+{ ghdj67d%^& } != I am Alice
Providing authenticity Alice Bob I am Alice Alice_key-{ I am Alice }
Providing authenticity Alice Bob I am Alice Alice_key-{ hash{ I am Alice } } Digital signature
Providing authenticity Alice Bob I am Alice key
Providing authenticity Alice Bob I am Alice key{ I am Alice }
Providing authenticity Alice Bob I am Alice hash{key|I am Alice} Message Authentication Code (MAC)
Providing authenticity Alice Bob I am Alice Alice_key-{ I am Alice }
Providing authenticity Alice Bob I am Alice Alice_key-{ hash{ I am Alice } } Digital signature
Providing authenticity Alice Bob Meet me after class hash{ key|Meet me after class }
Providing authenticity Alice Bob I have something to say nonce Meet me after class hash{ key|nonce|Meet me after class }
Providing authenticity With symmetric key crypto Alice appends hash of message + shared key Bob verifies that it is correct (using shared key) With asymmetric key crypto Alice encrypts hash of message with her private key, appends to unencrypted message Bob verifies that it is correct (using Alice’s public key)
Providing authenticity Nonce for avoiding replay attacks Bob sends Alice a nonce (random number) Alice appends hash of message + shared key + nonce
hash{ key|Meet me after class } Providing integrity Alice Bob Meet me after class hash{ key|Meet me after class }
Alice_key-{ hash{ Meet me after class} } Providing integrity Alice Bob Meet me after class Alice_key-{ hash{ Meet me after class} }
Providing integrity With the same mechanisms that provide authenticity
Man in the middle Alice Manuel Bob plaintext plaintext plaintext decryption algorithm encryption algorithm decryption algorithm encryption algorithm Manuel_key- Bob_key- ciphertext ciphertext ciphertext ciphertext ciphertext ciphertext Manuel_key+ Bob_key+ Alice Manuel Bob
Public key certification Trusted certificate authority (CA) digitally signs that key+ is Bob’s public key using the CA’s private key CA’s public key is obtained out of band web browsers pre-configured with CA public keys
Outline Building blocks Providing security properties Securing Internet protocols Operational security
Securing email (confidentiality) shared_key{ } message Alice + Bob_key+{ } shared_key
Securing email (confidentiality) shared_key{ } shared_key{ } message Bob - Bob_key-{ } Bob_key+{ } shared_key
Securing email (auth & integrity) Alice_key-{ } hash{ } message Alice + message
Securing email (auth & integrity) Alice_key+{ } Alice_key-{ } hash{ } message Bob - hash{ } message
Bob_key+{ shared_key } Securing email Alice_key-{ } hash{ } message Alice + shared_key{ ... } message + Bob_key+{ shared_key }
store_key+{ shared_master_key } Securing TCP Alice online store SYN SYN ACK ACK SSL hello certificate store_key+{ shared_master_key }
Securing TCP Server sends its certificate includes its public key Client creates and sends a shared master key encrypts it with server’s public key Both use master key to create 4 session keys 1 key for encrypting client --> server data 1 key for creating MAC for client --> server data same for server --> client data
Securing TCP Alice online store key2{ } place order, hash{ key1|...} cancel order, key2{ } hash{ key1|...}
Securing TCP Alice online store key2{ } place order, hash{ key1| #1, ...} cancel order, key2{ } hash{ key1| #2, ...}
Securing TCP Client organizes data in records each record has a sequence number Creates MAC for each record + sequence # using one of the 4 session keys Encrypts the data + MAC for each record using (another) one of the 4 session keys
hash{ key2, key1{ IP packet } } Securing IP key1{ IP packet }, hash{ key2, key1{ IP packet } } IP packet IP packet Alice Bob
Securing IP 2 IP routers establish a “secure tunnel” usually between branch offices of a company Source encrypts each IP packet using a shared key Source creates MAC for encrypted IP packet using another shared key
Key ideas Combination of symmetric/asymmetric keys asymmetric key crypto to exchange shared keys symmetric key crypto for confidentiality, authenticity, & integrity symmetric key crypto is faster Seq. numbers to avoid reordering attacks organize data in records with seq. numbers compute MAC on record data + seq. number
Outline Building blocks Providing security properties Securing Internet protocols Operational security
Firewalls action src IP dst IP proto src port dst port flag allow 167.67/16 any TCP > 1023 80 all allow any 167.67/16 TCP 80 > 1023 ACK deny all all all all all all