Distributed Systems Fall 2016

Slides:



Advertisements
Similar presentations
Key Management. Shared Key Exchange Problem How do Alice and Bob exchange a shared secret? Offline – Doesnt scale Using public key cryptography (possible)
Advertisements

Internet and Intranet Protocols and Applications Lecture 9a: Secure Sockets Layer (SSL) March, 2004 Arthur Goldberg Computer Science Department New York.
L-13 Security 1. Schedule up to Midterm 2/26 No class (work on project 1, hw3) Review 3/2 Monday 4:30 pm NSH 3002 HW 3 due Midterm 3/3 Tuesday in class.
Network Security – Part 2 V.T. Raja, Ph.D., Oregon State University.
Secure Communication with an Insecure Internet Infrastructure.
Alexander Potapov.  Authentication definition  Protocol architectures  Cryptographic properties  Freshness  Types of attack on protocols  Two-way.
Secure Communication with an Insecure Internet Infrastructure Lecture Nov. 21 st 2006 Dan Wendlandt.
Chapter 31 Network Security
Cryptography and Network Security (CS435) Part Fourteen (Web Security)
Security: An Overview of Cryptographic Techniques /440 With slides from: Debabrata Dash, Nick Feamster, Gregory Kesden, Vyas Sekar and others.
23-1 Last time □ P2P □ Security ♦ Intro ♦ Principles of cryptography.
Advanced Database Course (ESED5204) Eng. Hanan Alyazji University of Palestine Software Engineering Department.
31.1 Chapter 31 Network Security Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
L-24 Security 1. Today's Lecture Internet security weaknesses Establishing secure channels (Crypto 101) Key distribution 2.
L-25 Security II 1. Today's Lecture Effective secure channels Access control Privacy and Tor 2.
SSL: Secure Socket Layer By: Mike Weissert. Overview Definition History & Background SSL Assurances SSL Session Problems Attacks & Defenses.
Distributed Systems Fall 2016
Cryptography CS 555 Topic 34: SSL/TLS.
Reviews Rocky K. C. Chang 20 April 2007.
Distributed Systems Fall 2016
Basics of Cryptography
Security Outline Encryption Algorithms Authentication Protocols
Cryptography and Network Security
Digital Signatures Cryptographic technique analogous to hand-written signatures. sender (Bob) digitally signs document, establishing he is document owner/creator.
Cryptography Why Cryptography Symmetric Encryption
Computer Communication & Networks
Network Security.
Cryptography Reference: Network Security
Cryptography Reference: Network Security
Secure Sockets Layer (SSL)
Information Security message M one-way hash fingerprint f = H(M)
Public Key Encryption Systems
CS480 Cryptography and Information Security
Chapter 8 Network Security.
Distributed Systems Final Review (part 2) Fall 2017
Basic Network Encryption
Secure Communication with an Insecure Internet Infrastructure
CSE 4095 Transport Layer Security TLS, Part II
Information Security message M one-way hash fingerprint f = H(M)
Information Security message M one-way hash fingerprint f = H(M)
NET 311 Information Security
Digital Signatures Cryptographic technique analogous to hand-written signatures. sender (Bob) digitally signs document, establishing he is document owner/creator.
Cryptography and Network Security
0x1A Great Papers in Computer Security
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
Security through Encryption
Cryptography and Network Security
SSL (Secure Socket Layer)
Information Security message M one-way hash fingerprint f = H(M)
24 – Security Protocols - II
The Secure Sockets Layer (SSL) Protocol
Protocol ap1.0: Alice says “I am Alice”
Encryption INST 346, Section 0201 April 3, 2018.
Digital Signatures Cryptographic technique analogous to hand-written signatures. sender (Bob) digitally signs document, establishing he is document owner/creator.
Lecture 10: Network Security.
Digital Signatures Cryptographic technique analogous to hand-written signatures. sender (Bob) digitally signs document, establishing he is document owner/creator.
Chapter 29 Cryptography and Network Security
Basic Network Encryption
Digital Signatures Cryptographic technique analogous to hand-written signatures. sender (Bob) digitally signs document, establishing he is document owner/creator.
Advanced Computer Networks
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
Security: Integrity, Authentication, Non-repudiation
Public Key Encryption Systems
Security: Public Key Cryptography
Digital Signatures Cryptographic technique analogous to hand-written signatures. sender (Bob) digitally signs document, establishing he is document owner/creator.
Cryptography and Network Security
Cryptography Lecture 27.
Chapter 8 roadmap 8.1 What is network security?
Presentation transcript:

15-440 Distributed Systems Fall 2016 L-23 Security

What do we need for a secure communication channel? Authentication (Who am I talking to?) Confidentiality (Is my data hidden?) Integrity (Has my data been modified?) Availability (Can I reach the destination?) We will talk about the first three of these things today… availability we must tolerate failures and assume network gives us some guarantee

Example: Web access Alice wants to connect to her bank to transfer some money... Alice wants to know ... that she’s really connected to her bank. That nobody can observe her financial data That nobody can modify her request That nobody can steal her money! The bank wants to know ... That Alice is really Alice (or is authorized to act for Alice) The same privacy things that Alice wants so they don’t get sued or fined by the government. Authentication Confidentiality Integrity (A mix)

How do we create secure channels? What tools do we have at hand? Hashing e.g., SHA-1 Secret-key cryptography, aka symmetric key. e.g., AES Public-key cryptography e.g., RSA

Secret Key Cryptography Given a key k and a message m Two functions: Encryption (E), decryption (D) ciphertext c = E(k, m) plaintext m = D(k, c) Both use the same key k. “secure” channel Hello,Bob Alice Bob.com knows K knows K But... how does that help with authentication? They both have to know a pre-shared key K before they start!

Symmetric Key: Confidentiality One-time Pad (OTP) is secure but usually impractical Key is as long at the message Keys cannot be reused (why?) Keys cannot be resused often since if you use the same key with others they know how to decrypt the message. Also, using frequency analysis an attacker could guess the key. In practice, two types of ciphers are used that require only constant key length: Stream Ciphers: Ex: RC4, A5 Block Ciphers: Ex: DES, AES, Blowfish

Symmetric Key: Integrity Background: Hash Function Properties Consistent hash(X) always yields same result One-way given X, can’t find Y s.t. hash(Y) = X Collision resistant given hash(W) = Z, can’t find X such that hash(X) = Z Hash Fn Fixed Size Hash Message of arbitrary length

Symmetric Key: Integrity Hash Message Authentication Code (HMAC) Step #1: Alice creates MAC Hash Fn Message MAC This is similar to a checksum, but secure. Why? Note: the message does not have to be encrypted, unless you also desire confidentiality. Will the MAC always check out on the receiving end? Yes, b/c receiver has key, and HASH is consistent. Can attacker substitute in another message? No, b/c of collision resistance of HASH Can attacker recover the key, based on the message? No, b/c of one-way nature of HASH K A-B Alice Transmits Message & MAC Step #2 Step #3 Bob computes MAC with message and KA-B to verify. MAC Message Why is this secure from a message integrity perspective? How do properties of a hash function help us?

Symmetric Key: Authentication You already know how to do this! (hint: think about how we showed integrity) Hash Fn I am Bob A43FF234 Wrong! K A-B Alice receives the hash, computes a hash with KA-B , and she knows the sender is Bob

Symmetric Key: Authentication What if Mallory overhears the hash sent by Bob, and then “replays” it later? ISP D ISP B ISP C ISP A Hello, I’m Bob. Here’s the hash to “prove” it A43FF234

Symmetric Key: Authentication A “Nonce” A random bitstring used only once. Alice sends nonce to Bob as a “challenge”. Bob Replies with “fresh” MAC result. Nonce Bob Alice Nonce Hash B4FE64 K A-B B4FE64 Performs same hash with KA-B and compares results

Symmetric Key: Authentication A “Nonce” A random bitstring used only once. Alice sends nonce to Bob as a “challenge”. Bob Replies with “fresh” MAC result. Nonce ?!?! Alice Mallory If Alice sends Mallory a nonce, she cannot compute the corresponding MAC without K A-B

Symmetric Key Crypto Review Confidentiality: Stream & Block Ciphers Integrity: HMAC Authentication: HMAC and Nonce Are we done? Not Really: Number of keys scales as O(n2) How to securely share keys in the first place?

Asymmetric Key Crypto: Instead of shared keys, each person has a “key pair” KB Bob’s public key Bob’s private key Note: We are not going to go into the details of what KB(m) means as far as computation. We will treat it as a black box function with these properties. KB-1 The keys are inverses, so: KB-1 (KB (m)) = m

Asymmetric/Public Key Crypto: Given a key k and a message m Two functions: Encryption (E), decryption (D) ciphertext c = E(KB, m) plaintext m = D(KB-1 , c) Encryption and decryption use different keys! “secure” channel Hello,Bob Alice Bob.com Knows KB Knows KB, KB-1 But how does Alice know that KB means “Bob”?

Asymmetric Key: Confidentiality KB Bob’s public key KB-1 Bob’s private key encryption algorithm decryption algorithm plaintext message ciphertext m = KB-1 (KB (m)) KB (m)

Asymmetric Key: Sign & Verify If we are given a message M, and a value S such that KB(S) = M, what can we conclude? The message must be from Bob, because it must be the case that S = KB-1(M), and only Bob has KB-1 ! This gives us two primitives: Sign (M) = KB-1(M) = Signature S Verify (S, M) = test( KB(S) == M )

Asymmetric Key: Integrity & Authentication We can use Sign() and Verify() in a similar manner as our HMAC in symmetric schemes. S = Sign(M) Message M Integrity: Note: there is another way to do authentication, which we will see when we look at SSL. Receiver must only check Verify(M, S) Nonce Authentication: S = Sign(Nonce) Verify(Nonce, S)

Asymmetric Key Review: Confidentiality: Encrypt with Public Key of Receiver Integrity: Sign message with private key of the sender Authentication: Entity being authenticated signs a nonce with private key, signature is then verified with the public key But, these operations are computationally expensive*

The Great Divide Yes No Fast Slow Asymmetric Crypto: (Public key) Example: RSA Symmetric Crypto: (Private key) Example: AES Requires a pre-shared secret between communicating parties? Yes No The three attributes of a secure communication we mentioned can be achieved using two different “types”, or “families” of cryptography. Each family has within it many different algorithms, with slightly different properties. Symmetric and Asymmetric cryptography differ in the assumptions they make about the “secrets”, or “keys” that two participants use to enable secure communication. Symmetric key crypto assumes that the parties have used some mechanism to set-up a “shared secret” between the two parties that can be used to secure further communication. Public key crypto, as we will see, does not make this assumption, yet can still provide strong security properties. However, the mechanism to do this uses complex math, and as a result, the time to perform asymmetric crypto operations is significantly longer than their symmetric counter-parts. Overall speed of cryptographic operations Fast Slow

One last “little detail”… How do I get these keys in the first place?? Remember: Symmetric key primitives assumed Alice and Bob had already shared a key. Asymmetric key primitives assumed Alice knew Bob’s public key. This may work with friends, but when was the last time you saw Amazon.com walking down the street?

Key Distribution Center (KDC) Q: How does KDC allow Bob, Alice to determine shared symmetric secret key to communicate with each other? KDC generates R1 KA-KDC(A,B) Downside: KDC must always be online to communicate securely KDC can give our session keys away (escrow) KA-KDC(R1, KB-KDC(A,R1) ) Alice knows R1 Bob knows to use R1 to communicate with Alice KB-KDC(A,R1) Alice and Bob communicate: using R1 as session key for shared symmetric encryption

Certification Authorities Certification authority (CA): binds public key to particular entity, E. An entity E registers its public key with CA. E provides “proof of identity” to CA. CA creates certificate binding E to its public key. Certificate contains E’s public key AND the CA’s signature of E’s public key. Note: CA’s do NOT generate keys. They simply are handed a public key along with proof of identify, and generate a signature which can accompany the key when it is given to a user that must validate that they key is in fact Bob’s public key. CA generates S = Sign(KB) Bob’s public key KB KB certificate = Bob’s public key and signature by CA CA private key Bob’s identifying information K-1 CA

Certification Authorities When Alice wants Bob’s public key: Gets Bob’s certificate (Bob or elsewhere). Use CA’s public key to verify the signature within Bob’s certificate, then accepts public key Verify(S, KB) KB If signature is valid, use KB CA public key KCA

Transport Layer Security (TLS) aka Secure Socket Layer (SSL) Used for protocols like HTTPS Special TLS socket layer between application and TCP (small changes to application). Handles confidentiality, integrity, and authentication. Uses “hybrid” cryptography. Originally created by a little known and now largely defunct net start-up called “netscape” in the mid-90’s

How TLS Handles Data 1) Data arrives as a stream from the application via the TLS Socket 2) The data is segmented by TLS into chunks 3) A session key is used to encrypt and MAC each chunk to form a TLS “record”, which includes a short header and data that is encrypted, as well as a MAC. 4) Records form a byte stream that is fed to a TCP socket for transmission.

Analysis Public key lets us take the trusted third party offline: If it’s down, we can still talk! But we trade-off ability for fast revocation If server’s key is compromised, we can’t revoke it immediately... Usual trick: Certificate expires in, e.g., a year. Have an on-line revocation authority that distributes a revocation list. Kinda clunky but mostly works, iff revocation is rare. Clients fetch list periodically. Better scaling: CA must only sign once... no matter how many connections the server handles. If CA is compromised, attacker can trick clients into thinking they’re the real server.

Forward secrecy In KDC design, if key Kserver-KDC is compromised a year later, from the traffic log, attacker can extract session key (encrypted with auth server keys). attacker can decode all traffic retroactively. In SSL, if CA key is compromised a year later, Only new traffic can be compromised. Cool… But in SSL, if server’s key is compromised... Old logged traffic can still be compromised...

Diffie-Hellman Key Exchange Different model of the world: How to generate keys between two people, securely, no trusted party, even if someone is listening in. Illustrative Example image from wikipedia https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange

Diffie-Hellman Key Exchange Different model of the world: How to generate keys between two people, securely, no trusted party, even if someone is listening in. This is cool. But: Vulnerable to man-in-the-middle attack. Attacker pair-wise negotiates keys with each of A and B and decrypts traffic in the middle. No authentication... a,b are very large numbers and p is a very large prime number (600 digits!). Fun side reads: [1] http://security.stackexchange.com/questions/45963/diffie-hellman-key-exchange-in-plain-english [2] https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange image from wikipedia

Authentication? But we already have protocols that give us authentication! They just happen to be vulnerable to disclosure if long-lasting keys are compromised later... Hybrid solution: Use diffie-hellman key exchange with the protocols we’ve discussed so far. Auth protocols prevent M-it-M attack if keys aren’t yet compromised. D-H means that an attacker can’t recover the real session key from a traffic log, even if they can decrypt that log. Client and server discard the D-H parameters and session key after use, so can’t be recovered later. This is called “perfect forward secrecy”. Nice property.

Access Control Once secure communication between a client and server has been established, we now have to worry about access control – when the client issues a request, how do we know that the client has authorization?

Two ways to cut a table (ACM) Order by columns (ACL) or rows (Capability Lists)? File1 File2 File3 Ann rx r rwx Bob -- Charlie rw w ACLs Capability

Access Control Lists An ACL stores (non-empty elements of) each column with its object Columns of access control matrix ACLs: file1: { (Andy, rx) (Betty, rwx) (Charlie, rx) } file2: { (Andy, r) (Betty, r) (Charlie, rw) } file3: { (Andy, rw) (Charlie, w) } File1 File2 File3 Andy rx r rwx Betty -- Charlie rw w 34

Capability Lists Rows of access control matrix C-Lists: File1 File2 Andy: { (file1, rx) (file2, r) (file3, rw) } Betty: { (file1, rwx) (file2, r) } Charlie: { (file1, rx) (file2, rw) (file3, w) } File1 File2 File3 Andy rx r rwx Betty -- Charlie rw w 35

Onion Routing R R R4 R R3 R R1 R R2 R Alice R Bob Sender chooses a random sequence of routers Some routers are honest, some controlled by attacker Sender controls the length of the path

Route Establishment R2 R4 R3 R1 Alice R3 Bob R1 [Nov2016] k1, k2, k3 etc are session keys, so when each router (R1, Rn) use their private keys to decrypt the packets, they can only then get the next hop (e.g. R2) and the session key (k1) to decrypt the rest of the packet and send it along. {M}pk(B) {B,k4}pk(R4),{ }k4 {R4,k3}pk(R3),{ }k3 {R3,k2}pk(R2),{ }k2 {R2,k1}pk(R1),{ }k1 Routing info for each link encrypted with router’s public key Each router learns only the identity of the next router

Tor Circuit Setup (3) Client proxy extends the circuit by establishing a symmetric session key with Onion Router #3 Tunnel through Onion Routers #1 and #2

Key Bits: Today's Lecture Effective secure channels Key Distribution Centers and Certificate Authorities Diffie-Hellman for key establishment in the “open” Access control Way to store what “subjects” can do to “objects” Access Control Matrix: ACLs and Capability lists Privacy and Tor Used for anonymity on the internet (Onion Routes) Uses ideas from encryption, networking, P2P