Lecture 24 Secure Communications CPE 401 / 601 Computer Network Systems Slides are modified from Jim Kurose & Keith Ross.

Slides:



Advertisements
Similar presentations
Spring 2012: CS419 Computer Security Vinod Ganapathy SSL, etc.
Advertisements

Internet and Intranet Protocols and Applications Lecture 9a: Secure Sockets Layer (SSL) March, 2004 Arthur Goldberg Computer Science Department New York.
SSL CS772 Fall Secure Socket layer Design Goals: SSLv2) SSL should work well with the main web protocols such as HTTP. Confidentiality is the top.
SSL: Secure Sockets Layer
Socket Layer Security. In this Presentation: need for web security SSL/TLS transport layer security protocols HTTPS secure shell (SSH)
Working Connection Computer and Network Security - SSL, IPsec, Firewalls – (Chapter 17, 18, 19, and 23)
8-1 Chapter 8 Security Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
Chapter 5 Network Security Protocols in Practice Part I
IPsec Internet Headquarters Branch Office SA R1 R2
ECE 454/CS 594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall.
Lecture 25 Secure Communications CPE 401 / 601 Computer Network Systems slides are modified from Jim Kurose & Keith Ross and Dave Hollinger.
8-1 What is network security? Confidentiality: only sender, intended receiver should “understand” message contents m sender encrypts message m receiver.
Network Security. Contents Security Requirements and Attacks Confidentiality with Conventional Encryption Message Authentication and Hash Functions Public-Key.
Summer Workshop on Cyber Security Computer Networks Security (Part 2) Dr. Hamed Mohsenian-Rad University of California at Riverside and Texas Tech University.
Lecture 7: Network Level Security – IPSec CS 336/536: Computer Network Security Fall 2013 Nitesh Saxena Adopted from previous lecture by Keith Ross, and.
Lecture 23 Network Security (cont) CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger slides are modified from Jim Kurose,
Secure connections.
Secure Socket Layer (SSL)
8-1Network Security Chapter 8 roadmap 8.1 What is network security? 8.2 Principles of cryptography 8.3 Message integrity, authentication.
Behzad Akbari Spring 2012 (These slides are based on lecture slides by Lawrie Brown)
Cosc 4765 SSL/TLS and VPN. SSL and TLS We can apply this generally, but also from a prospective of web services. Multi-layered: –S-http (secure http),
Introduction1-1 Data Communications and Computer Networks Chapter 6 CS 3830 Lecture 31 Omar Meqdadi Department of Computer Science and Software Engineering.
23-1 Last time □ P2P □ Security ♦ Intro ♦ Principles of cryptography.
Security at different layers
8-1 Chapter 8 Security Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 part 4: Securing IP.
Network Security7-1 CIS3360: Chapter 8: Cryptography Application of Public Cryptography Cliff Zou Spring 2012 TexPoint fonts used in EMF. Read the TexPoint.
Secure Sockets Layer (SSL) and Transport layer security (TLS)
8-1 Chapter 8 Security Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 part 3: Securing TCP.
1 Security Protocols in the Internet Source: Chapter 31 Data Communications & Networking Forouzan Third Edition.
Karlstad University IP security Ge Zhang
Network Security David Lazăr.
Upper OSI Layers Natawut Nupairoj, Ph.D. Department of Computer Engineering Chulalongkorn University.
8-1 Chapter 8 Security Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 part 2: Message integrity.
IP Security: Security Across the Protocol Stack. IP Security There are some application specific security mechanisms –eg. S/MIME, PGP, Kerberos, SSL/HTTPS.
1 CMPT 471 Networking II Authentication and Encryption © Janice Regan,
IP security Ge Zhang Packet-switched network is not Secure! The protocols were designed in the late 70s to early 80s –Very small network.
SMUCSE 5349/7349 SSL/TLS. SMUCSE 5349/7349 Layers of Security.
IPSec and TLS Lesson Introduction ●IPSec and the Internet key exchange protocol ●Transport layer security protocol.
IPSec  general IP Security mechanisms  provides  authentication  confidentiality  key management  Applications include Secure connectivity over.
Lecture 22 Network Security (cont) CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger slides are modified from Jim Kurose,
K. Salah1 Security Protocols in the Internet IPSec.
8-1 CSE 4707/5850 Network Security (2) SSL/TLS. 8-2 Think about Google or YouTube  Desired properties  Indeed the other side is Google or YouTube server.
@Yuan Xue CS 285 Network Security Secure Socket Layer Yuan Xue Fall 2013.
8-1Network Security Virtual Private Networks (VPNs) motivation:  institutions often want private networks for security.  costly: separate routers, links,
Chapter 8 Security Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these ppt.
8-1 Chapter 8 Security Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
Real Security Protocols 1. Securing 2. Securing TCP connections: SSL 3. Network layer security: IPsec 4. Securing wireless LANs Computer Networking:
CSE 4905 IPsec.
Public Key Cryptography
Digital Signatures Cryptographic technique analogous to hand-written signatures. sender (Bob) digitally signs document, establishing he is document owner/creator.
Basic Network Encryption
CSE 4095 Transport Layer Security TLS
IP Security and VPN Most of the slides are derived from the slides (Chapter-8) by the authors of «Computer Networking: A Top Down Approach», and from the.
Digital Signatures Cryptographic technique analogous to hand-written signatures. sender (Bob) digitally signs document, establishing he is document owner/creator.
Slides have been taken from:
Virtual Private Networks (VPNs)
Intro to Cryptography Some slides have been taken from:
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.
Virtual Private Networks (VPNs)
Digital Signatures Cryptographic technique analogous to hand-written signatures. sender (Bob) digitally signs document, establishing he is document owner/creator.
Basic Network Encryption
Digital Signatures Cryptographic technique analogous to hand-written signatures. sender (Bob) digitally signs document, establishing he is document owner/creator.
Security at the Transport Layer
Security: Integrity, Authentication, Non-repudiation
Digital Signatures Cryptographic technique analogous to hand-written signatures. sender (Bob) digitally signs document, establishing he is document owner/creator.
Chapter 8 roadmap 8.1 What is network security?
Presentation transcript:

Lecture 24 Secure Communications CPE 401 / 601 Computer Network Systems Slides are modified from Jim Kurose & Keith Ross

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 2

Message Digests Function H( ) that takes as input an arbitrary length message and outputs a fixed-length string: “message signature” – Note that H( ) is a many-to-1 function Desirable properties: – Easy to calculate – Irreversibility: Can’t determine m from H(m) – Collision resistance: Computationally difficult to produce m and m’ such that H(m) = H(m’) – Seemingly random output 3 Message m H: Hash Function H(m)

Hash Function Algorithms MD5 hash function widely used (RFC 1321) – computes 128-bit message digest in 4-step process SHA-1 is also used – US standard [NIST, FIPS PUB 180-1] – 160-bit message digest 4

Message Authentication Code (MAC) Authenticates sender No encryption ! Also called “keyed hash” 5 message H( ) s message s H( ) compare s = shared secret

End-point authentication Want to be sure of the originator of the message – end-point authentication Assuming Alice and Bob have a shared secret, will MAC provide end-point authentication – We do know that Alice created the message – But did she send it? 6

Playback attack MAC Transfer $1M from Bill to Trudy MAC Transfer $1M from Bill to Trudy MAC = f(msg,s)

“I am Alice” R MAC Transfer $1M from Bill to Susan MAC = f(msg,s,R) Defending playback attack: nonce

Digital Signatures Cryptographic technique analogous to hand- written signatures Goal is similar to that of a MAC, – except now use public-key cryptography 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 9

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

Digital signature = signed message digest 11 Alice verifies signature and integrity of digitally signed message large message m H(m) digital signature (encrypt) Bob’s private key K B - + Bob sends digitally signed message K B (H(m)) - encrypted msg digest K B (H(m)) - encrypted msg digest large message m H: Hash function H(m) digital signature (decrypt) H(m) Bob’s public key K B + equal ? H: Hash function

Digital Signatures (more) Suppose Alice receives msg m with digital signature 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 12

Digital Signatures (more) 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. 13

Public-key certification Motivation: 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 pizzas to Bob 14

binds public key to particular entity, E – 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” Certification Authorities (CAs) 15 Bob’s public key K B + Bob’s identifying information digital signature (encrypt) CA private key K CA - K B + certificate for Bob’s public key, signed by CA

When 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 Certification Authorities 16 Bob’s public key K B + digital signature (decrypt) CA public key K CA + K B +

Certificates Primary standard X.509 (RFC 2459) Certificate contains: – Issuer name – Entity name, address, domain name, etc. – Entity’s public key – Digital signature (signed with issuer’s private key) Public-Key Infrastructure (PKI) – Certificates and certification authorities 17

Secure Sockets Layer

SSL: Secure Sockets Layer Widely deployed security protocol – Supported by almost all browsers and web servers – Tens of billions $ spent per year over SSL – Originally designed by Netscape in 1993 Number of variations: – TLS: transport layer security, RFC 2246 Provides confidentiality, integrity, and authentication 19

SSL: Secure Sockets Layer 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 20

SSL and TCP/IP 21 Application TCP IP Normal Application Application SSL TCP IP Application with SSL SSL provides application programming interface (API) to developers C and Java SSL libraries/classes readily available

Toy SSL: a simple secure channel Handshake: Alice and Bob use their certificates and private keys to authenticate each other and exchange shared secret Key Derivation: Alice and Bob use shared secret to derive set of keys Data Transfer: Data to be transferred is broken up into a series of records Connection Closure: Special messages to securely close connection 22

Toy: A simple handshake MS = master secret EMS = encrypted master secret 23 hello certificate K B + (MS) = EMS

Toy: Key derivation Use different keys for message authentication code (MAC) and encryption – Kc = encryption key for data sent from client to server – Mc = MAC key for data sent from client to server – Ks = encryption key for data sent from server to client – Ms = MAC key for data sent from server to client Keys derived from key derivation function (KDF) – Takes master secret and (possibly) some additional random data and creates the keys 24

Toy: Data Records Why not encrypt data in constant stream as we write it to TCP? – Where would we put the MAC? If at end, no message integrity until all data processed – For example, with instant messaging, how can we do integrity check over all bytes sent before displaying? 25

Toy: Data Records Instead, break stream in series of records – Each record carries a MAC – Receiver can act on each record as it arrives Issue: in record, receiver needs to distinguish MAC from data – Want to use variable-length records 26 lengthdataMAC

Toy: Sequence Numbers Attacker can capture and replay record or re- order records Solution: put sequence number into MAC: – MAC = MAC(Mx, sequence||data) – Note: no sequence number field Attacker could still replay all of the records – Use random nonce 27

Toy: Control information Truncation attack: – attacker forges TCP connection close segment – One or both sides thinks there is less data than there actually is Solution: record types, with one type for closure – type 0 for data; type 1 for closure MAC = MAC(Mx, sequence||type||data) 28 lengthtypedataMAC

Toy SSL: summary 29 hello certificate, nonce K B + (MS) = EMS type 0, seq 1, data type 0, seq 2, data type 0, seq 1, data type 0, seq 3, data type 1, seq 4, close type 1, seq 2, close encrypted bob.com

Toy SSL isn’t complete How long are the fields? What encryption protocols? No negotiation – Allow client and server to support different encryption algorithms – Allow client and server to choose together specific algorithm before data transfer 30

Common symmetric ciphers in SSL DES – Data Encryption Standard: block 3DES – Triple strength: block RC2 – Rivest Cipher 2: block RC4 – Rivest Cipher 4: stream Public key encryption RSA 31

SSL Cipher Suite Cipher Suite – Public-key algorithm – Symmetric encryption algorithm – MAC algorithm SSL supports a variety of cipher suites Negotiation: client and server must agree on cipher suite Client offers choice; server picks one 32

Real SSL: Handshake Purpose – Server authentication – Negotiation: agree on crypto algorithms – Establish keys – Client authentication (optional) Client sends list of algorithms it supports, along with client nonce Server chooses algorithms from list; sends back: choice + certificate + server nonce 33

Real SSL: Handshake Client verifies certificate, extracts server’s public key, generates pre_master_secret, encrypts with server’s public key, sends to server Client and server independently compute encryption and MAC keys from pre_master_secret and nonces Client sends a MAC of all handshake messages Server sends a MAC of all handshake messages 34

Real SSL: Handshaking Last 2 steps protect handshake from tampering Client typically offers range of algorithms, some strong, some weak Man-in-the middle could delete the stronger algorithms from list – Last 2 steps prevent this – Last two messages are encrypted 35

Real SSL: Handshaking Why two random nonces? Suppose Trudy sniffs all messages Next day, Trudy sets up TCP connection with Bob, sends exact same sequence of records – Bob (Amazon) thinks Alice made two separate orders for the same thing Solution: Bob sends different random nonce for each connection – Causes encryption keys to be different – Trudy’s messages will fail Bob’s integrity check 36

SSL Record Protocol 37 data fragment data fragment MAC encrypted data and MAC encrypted data and MAC record header record header record header: content type; version; length MAC: includes sequence number, MAC key M x Fragment: each SSL fragment 2 14 bytes (~16 Kbytes)

SSL Record Format 38 content type SSL version length MAC data 1 byte 2 bytes3 bytes Data and MAC encrypted (symmetric algo)

Connection 39 handshake: ClientHello handshake: ServerHello handshake: Certificate handshake: ServerHelloDone handshake: ClientKeyExchange ChangeCipherSpec handshake: Finished ChangeCipherSpec handshake: Finished application_data Alert: warning, close_notify TCP Fin follow Everything henceforth is encrypted

IPsec

What is confidentiality at network-layer? Between two network entities: Sending entity encrypts the payloads of datagrams – Payload could be TCP segment, UDP segment, ICMP message, OSPF message, and so on All data sent from one entity to the other would be hidden – Web pages, , P2P file transfers, TCP SYN packets, and so on That is, “blanket coverage” 41

Virtual Private Networks (VPNs) Institutions often want private networks for security. – Costly! Separate routers, links, DNS infrastructure With a VPN, institution’s inter-office traffic is sent over public Internet instead – But inter-office traffic is encrypted before entering public Internet 42

43 IP header IPsec header Secure payload IP header IPsec header Secure payload IP header IPsec header Secure payload IP header payload IP header payload headquarters branch office salesperson in hotel Public Internet laptop w/ IPsec Router w/ IPv4 and IPsec Router w/ IPv4 and IPsec Virtual Private Network (VPN)

IPsec services Data integrity Origin authentication Replay attack prevention Confidentiality Two protocols providing different service models: – Authentication Header – Encapsulation Security Protocol 44

IPsec Transport Mode IPsec datagram emitted and received by end- system Protects upper level protocols 45 IPsec

End routers are IPsec aware Hosts need not be IPsec – Tunneling mode 46 IPsec

Two protocols Authentication Header (AH) protocol – provides source authentication & data integrity but not confidentiality Encapsulation Security Protocol (ESP) – provides source authentication, data integrity, and confidentiality – more widely used than AH 47

Four combinations are possible! Host mode with AH Host mode with ESP Tunnel mode with AH Tunnel mode with ESP 48 Most common and most important

Security associations (SAs) Before sending data, a virtual connection is established from sending entity to receiving entity Called “security association (SA)” – SAs are simplex: for only one direction Both sending and receiving entites maintain state information about the SA – TCP endpoints also maintain state information – IP is connectionless; – IPsec is connection-oriented! 49

Example SA from R1 to R2 32-bit identifier for SA: Security Parameter Index (SPI) the origin interface of the SA ( ) destination interface of the SA ( ) type of encryption to be used (e.g., 3DES with CBC) encryption key type of integrity check (e.g., HMAC with with MD5) authentication key / /24 SA Internet Headquarters Branch Office R1 R2

Security Association Database (SAD) Endpoint holds state of its SAs in a SAD, – where it can locate them during processing When sending IPsec datagram – R1 accesses SAD to determine how to process datagram When IPsec datagram arrives to R2 – R2 examines SPI in IPsec datagram – indexes SAD with SPI – processes datagram accordingly 51

IPsec datagram Focus for now on tunnel mode with ESP 52 new IP header ESP hdr original IP hdr Original IP datagram payload ESP trl ESP auth encrypted authenticated padding pad length next header SPI Seq #

What happens? / /24 SA Internet Headquarters Branch Office R1 R2 new IP header ESP hdr original IP hdr Original IP datagram payload ESP trl ESP auth encrypted authenticated padding pad length next header SPI Seq #

R1 converts IP into IPsec datagram Appends “ESP trailer” to back of original datagram – already includes original header fields! Encrypts result using algorithm & key specified by SA Appends to front of this encrypted quantity the “ESP header” Creates authentication MAC over whole datagram, using algorithm and key specified in SA Appends MAC to back of datagram, forming payload Creates brand new IP header, with all classic header fields – which it appends before payload 54

Inside the datagram ESP trailer: Padding for block ciphers ESP header: – SPI, so receiving entity knows what to do – Sequence number, to thwart replay attacks ESP auth: MAC created with shared secret key 55 new IP header ESP hdr original IP hdr Original IP datagram payload ESP trl ESP auth encrypted authenticated padding pad length next header SPI Seq #

Security Policy Database (SPD) Policy: For a given datagram, sending entity needs to know if it should use IPsec Needs also to know which SA to use – May use: source and destination IP address; protocol number Info in SPD indicates “what” to do with arriving datagram Info in the SAD indicates “how” to do it 56

Summary: IPsec services Suppose Trudy sits somewhere between R1 and R2. She doesn’t know the keys. – Will Trudy be able to see contents of original datagram? – How about source, dest IP address, transport protocol, application port? – Flip bits without detection? – Masquerade as R1 using R1’s IP address? – Replay a datagram? 57