CS 6431 Security Protocols Vitaly Shmatikov.

Slides:



Advertisements
Similar presentations
ECE454/CS594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2011.
Advertisements

CS470, A.SelcukStream Ciphers1 CS 470 Introduction to Applied Cryptography Instructor: Ali Aydin Selcuk.
CMSC 414 Computer (and Network) Security Lecture 4 Jonathan Katz.
Your Wireless Network has No Clothes CS 395T William A. Arbaugh, Narendar Shankar, Y.C. Justin Wan.
WEP 1 WEP WEP 2 WEP  WEP == Wired Equivalent Privacy  The stated goal of WEP is to make wireless LAN as secure as a wired LAN  According to Tanenbaum:
Wireless Security Ryan Hayles Jonathan Hawes. Introduction  WEP –Protocol Basics –Vulnerability –Attacks –Video  WPA –Overview –Key Hierarchy –Encryption/Decryption.
1 MD5 Cracking One way hash. Used in online passwords and file verification.
CS470, A.SelcukReal-Time Communication Issues1 Real-Time Communication Security IPsec & SSL Issues CS 470 Introduction to Applied Cryptography Instructor:
CS555Spring 2012/Topic 161 Cryptography CS 555 Topic 16: Key Management and The Need for Public Key Cryptography.
WEP Weaknesses Or “What on Earth does this Protect” Roy Werber.
Intercepting Mobiles Communications: The Insecurity of Danny Bickson ACNS Course, IDC Spring 2007.
How To Not Make a Secure Protocol WEP Dan Petro.
CMSC 414 Computer and Network Security Lecture 3 Jonathan Katz.
Wired Equivalent Privacy (WEP)
Vulnerability In Wi-Fi By Angus U CS 265 Section 2 Instructor: Mark Stamp.
RC4 1 RC4 RC4 2 RC4  Invented by Ron Rivest o “RC” is “Ron’s Code” or “Rivest Cipher”  A stream cipher  Generate keystream byte at a step o Efficient.
CMSC 414 Computer and Network Security Lecture 2 Jonathan Katz.
Department of Computer Science Southern Illinois University Carbondale Wireless and Network Security Lecture 9: IEEE
Slide 1 Vitaly Shmatikov CS 378 Key Establishment Pitfalls.
How cryptography is used to secure web services Josh Benaloh Cryptographer Microsoft Research.
Computer Security CS 426 Lecture 3
Wireless Security Issues David E. Hudak, Ph.D. Senior Software Architect Karlnet, Inc.
1 Authentication Protocols Celia Li Computer Science and Engineering York University.
CMSC 414 Computer and Network Security Lecture 3 Jonathan Katz.
WLAN What is WLAN? Physical vs. Wireless LAN
Mobile and Wireless Communication Security By Jason Gratto.
Wireless security & privacy Authors: M. Borsc and H. Shinde Source: IEEE International Conference on Personal Wireless Communications 2005 (ICPWC 2005),
9/01/2010CS 686 Stream Cipher EJ Jung CS 686 Special Topics in CS Privacy and Security.
Cryptography and Network Security Chapter 6. Multiple Encryption & DES  clear a replacement for DES was needed theoretical attacks that can break it.
Slide 1 Stream Ciphers uBlock ciphers generate ciphertext Ciphertext(Key,Message)=Message  Key Key must be a random bit sequence as long as message uIdea:
COEN 350 Mobile Security. Wireless Security Wireless offers additional challenges: Physical media can easily be sniffed. War Driving Legal? U.S. federal.
CS555Spring 2012/Topic 51 Cryptography CS 555 Topic 5: Pseudorandomness and Stream Ciphers.
How cryptography is used to secure web services Josh Benaloh Cryptographer Microsoft Research.
Intercepting Mobile Communications: The Insecurity of Nikita Borisov Ian Goldberg David Wagner UC Berkeley Zero-Knowledge Sys UC Berkeley Presented.
A Survey of Authentication Protocol Literature: Version 1.0 Written by John Clark and Jeremy Jacob Presented by Brian Sierawski.
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
Security protocols  Authentication protocols (this lecture)  Electronic voting protocols  Fair exchange protocols  Digital cash protocols.
Stream Cipher July 2011.
NSRI1 Security of Wireless LAN ’ Seongtaek Chee (NSRI)
CWSP Guide to Wireless Security Chapter 2 Wireless LAN Vulnerabilities.
WEP Protocol Weaknesses and Vulnerabilities
COEN 350 Mobile Security. Wireless Security Wireless offers additional challenges: Physical media can easily be sniffed. War Driving Legal? U.S. federal.
WEP AND WPA by Kunmun Garabadu. Wireless LAN Hot Spot : Hotspot is a readily available wireless connection.  Access Point : It serves as the communication.
Wireless LAN Security. Security Basics Three basic tools – Hash function. SHA-1, SHA-2, MD5… – Block Cipher. AES, RC4,… – Public key / Private key. RSA.
3DES and Block Cipher Modes of Operation CSE 651: Introduction to Network Security.
WEP Case Study Information Assurance Fall or Wi-Fi IEEE standard for wireless communication –Operates at the physical/data link layer –Operates.
CSCE 813 Internet Security Cryptographic Protocol Analysis.
Intercepting Mobiles Communications: The Insecurity of ► Paper by Borisov, Goldberg, Wagner – Berkley – MobiCom 2001 ► Lecture by Danny Bickson.
Security Protocols Vitaly Shmatikov CS Security Protocols  Use cryptography to achieve some higher-level security objective Authentication, confidentiality,
Hacking Wireless Networks (Part II – WEP & WPA)
Group 9 Chapter 8.3 – 8.6. Public Key Algorithms  Symmetric Key Algorithms face an inherent problem  Keys must be distributed to all parties but kept.
Slide 1 Vitaly Shmatikov CS 378 (In)Security of b.
How To Not Make a Secure Protocol WEP Dan Petro.
Giuseppe Bianchi Warm-up example WEP. Giuseppe Bianchi WEP lessons  Good cipher is far from being enough  You must make good USAGE of cipher.
IEEE Security Specifically WEP, WPA, and WPA2 Brett Boge, Presenter CS 450/650 University of Nevada, Reno.
Wired Equivalent Privacy (WEP) Chris Overcash. Contents What is WEP? What is WEP? How is it implemented? How is it implemented? Why is it insecure? Why.
University of Malawi, Chancellor College
WLAN Security1 Security of WLAN Máté Szalay
Slide 1 Vitaly Shmatikov CS 378 Stream Ciphers. slide 2 Stream Ciphers uRemember one-time pad? Ciphertext(Key,Message)=Message  Key Key must be a random.
Pertemuan #8 Key Management Kuliah Pengaman Jaringan.
@Yuan Xue CS 285 Network Security Secure Socket Layer Yuan Xue Fall 2013.
Wireless LAN Security Daniel Reichle Seminar Security Protocols and Applications SS2003.
หัวข้อบรรยาย Stream cipher RC4 WEP (in)security LFSR CSS (in)security.
1. Introduction In this presentation, we will review ,802.1x and give their drawbacks, and then we will propose the use of a central manager to replace.
Security Protocols Analysis
Man in the Middle Attacks
CSE 4905 WiFi Security I WEP (Wired Equivalent Privacy)
How crypto fails in practice? CSS and WEP
RC4 RC
Block Ciphers (Crypto 2)
Presentation transcript:

CS 6431 Security Protocols Vitaly Shmatikov

Cryptographic Protocols Use cryptography to achieve some higher-level security objective Authentication, confidentiality, integrity, key distribution or establishment… Examples: SSL/TLS, IPsec, Kerberos, SSH, 802.11b and 802.11i, Skype, S/MIME, hundreds of others New protocols constantly proposed, standardized, implemented, and deployed

Needham-Schroeder Protocols Needham and Schroeder. “Using Encryption for Authentication in Large Networks of Computers” (CACM 1979) Initiated the field of cryptographic protocol design Led to Kerberos, IPsec, SSL, and all modern protocols Observed the need for rigorous protocol analysis “Protocols … are prone to extremely subtle errors that are unlikely to be detected in normal operation… The need for techniques to verify the correctness of such protocols is great, and we encourage those interested in such problems to consider this area.”

Things Goes Wrong Many simple attacks against protocols have been discovered over the years Even carefully designed, widely deployed protocols ...often years after the protocol has been deployed Examples: SSL, SSH, 802.11b, GSM Simple = attacks do not involve breaking crypto! Why is the problem difficult? Concurrency + distributed participants + (often incorrect) use of cryptography Active attackers in full control of communications Implicit assumptions and goals behind protocols

Design Principles (1) 1. Every message should say what it means [Abadi and Needham. “Prudent Engineering Practice for Cryptographic Protocols ”. Oakland 1994] 1. Every message should say what it means 2. The conditions for a message to be acted on should be clearly set out 3. Mention the principal’s name explicitly in the message if it is essential to the meaning 4. Be clear as to why encryption is being done 5. Don’t assume a principal knows the content of encrypted material that is signed by that principal

Design Principles (2) [Abadi and Needham] 6. Be clear on what properties you are assuming about nonces 7. Predictable quantities used for challenge-response should be protected from replay 8. Timestamps must take into account local clock variation and clock maintenance mechanisms 9. A key may have been used recently, yet be old

Design Principles (3) [Abadi and Needham] 10. If an encoding is used to present the meaning of a message, then it should be possible to tell which encoding is being used 11. The protocol designer should know which trust relations his protocol depends on

NS Symmetric-Key Protocol Ka, Kb Trusted key server A, B, NonceA Kb { NonceA, B, Kc, {Kc, A}Kb }Ka Ka {Kc, A}Kb {NonceB}Kc Alice Bob {NonceB-1}Kc Goal: A and B establish a fresh, shared, secret key Kc with the help of a trusted key server

Denning-Sacco Attack Attacker recorded an old session and compromised session key Kx used in that session B now believes he shares a fresh secret Kx with A Moral: use timestamps to detect replay of old messages {Kx, A}Kb {NonceB}Kx {NonceB-1}Kx Bob

NS Public-Key Protocol A’s identity Fresh random number generated by A Kb { A, NonceA } Encrypted with B’s public key Ka { NonceA, NonceB } A B Kb { NonceB} B’s reasoning: The only way to learn NonceB is to decrypt the second message Only A can decrypt second message Therefore, A is on the other end A is authenticated! A’s reasoning: The only person who could know NonceA is the person who decrypted the first message Only B can decrypt message encrypted with Kb Therefore, B is on the other end of the line B is authenticated!

What Does This Protocol Achieve? Kb { A, NonceA } Ka { NonceA, NonceB } A B Kb { NonceB } Protocol aims to provide both authentication and secrecy After this exchange, only A and B know NonceA and NonceB  they can be used to derive a shared key

Lowe’s Attack on NSPK A B C { A, Na } { Na, Nc } { Nc } [Lowe. “Breaking and Fixing the Needham-Schroeder Public-Key Protocol using FDR”. TACAS 1996] { A, Na } Kb A { Na, Nc } Ka B { Nc } Kb { Na, Nc } Ka { A, Na } Kc C Evil B pretends that he is A B can’t decrypt this message, but he can replay it Evil participant B tricks honest A into revealing C’s nonce Nc C is convinced that he is talking to A!

Abadi-Needham Principle #1 Every message should say what it means { A, Na } Kb A { Na, Nc } Ka B { Na, Nc } { A, Na } Ka Kc Who sent this message? C

Lowe’s Fix to NSPK A B { A, NonceA } Kb { NonceA, B, NonceB } Ka Does this solve the problem? How?

Lessons of Lowe’s Attack Attacker is a legitimate protocol participant! Exploits participants’ reasoning to fool them A is correct that B must have decrypted {A,Na}Kb message, but this does not mean that the {Na,Nb}Ka message came from B The attack does not rely on breaking cryptography! It is important to realize limitations of protocols The attack requires that A willingly talk to adversary In the original setting, each workstation is assumed to be well-behaved, and the protocol is correct! Discover attacks like this automatically?

Analyzing Security Protocols Model protocol Model adversary Formally state security properties See if properties preserved under attack Result: under given assumptions about the system, no attack of a certain form will destroy specified properties There is no “absolute” security

Analysis Techniques Crypto Protocol Analysis Formal Models Dolev-Yao (perfect cryptography) Computational Models Random oracle Probabilistic process calculi Probabilistic I/O automata … Modal Logics Model Checking Process Calculi Game Theory … BAN logic Applied pi calculus Finite-state Checking Symbolic Analysis Finite processes, finite attacker Finite processes, infinite attacker

Dolev-Yao Model (1983) Abstract, idealized model of cryptography Treat cryptographic operations as abstract data types Symmetric-key decryption: decrypt({M}K,K) = M Public-key decryption: decrypt({M}PubKey(A), PrivKey(A)) = M Attacker is a nondeterministic process Can intercept any message, decompose into parts Decrypt if and only if it knows the correct key Create new message from data it has observed Attacker cannot perform computational analysis Cannot analyze actual cryptographic scheme used Cannot perform statistical tests, timing attacks…

Finite-State Analysis Describe protocol as a finite-state system State variables with initial values Transition rules Communication by shared variables Scalable: choose system size parameters Specify correctness condition Find violations by automatic exhaustive state enumeration Many tools available: FDR, Mur, …

Rules for Protocol Participants Messages = abstract terms Participants = finite-state automata operating on terms AB {A,NA}pk(B) IF net[i].dest = B & net[i].encKey = B.myPubKey THEN msg.nonce1:= B.myNonce; msg.nonce2:= net[i].nonce; msg.encKey:= B.keys[net[i].snd]; net[i+1]:= msg BA {NB,NA}pk(A)

Rules for Dolev-Yao Attacker Read and write on the network Full control over all messages exchanged by honest parties (but cannot break cryptography) Analyze messages Decrypt if and only if correct key is known Break into smaller pieces Construct messages Concatenate known fragments Encrypt with known keys

Correctness Conditions Specified as predicates over system variables Secrecy ! setInclusion(B.myNonce, Attacker.KnownNonces) & ! setInclusion(A.myNonce, Attacker.KnownNonces) Authentication  A (B.state=DONE) & (B.talkingTo=A) -> A.talkingTo=B

Protocol State Space Participant + attacker rules define a state transition graph Every possible execution of the protocol is a path in the graph Exhaustively enumerate all nodes of the graph, verify whether correctness conditions hold in every node If not, the path to the violating node describes the attack ... ... Correctness condition violated

Restrictions on the Model Two sources of infinite behavior Multiple protocol runs, multiple participant roles Message space or data space may be infinite Finite approximation Assume finite number of participants Example: 2 clients, 2 servers Assume finite message space Represent random numbers by r1, r2, r3, … Do not allow encrypt(encrypt(encrypt(…))) This restriction is necessary for decidability This is restriction is not necessary (symbolic analysis!)

Tradeoffs Finite models are abstract and greatly simplified Components modeled as finite-state machines Cryptographic functions modeled as abstract data types Security property stated as unreachability of “bad” state They are tractable… Lots of verification methods, many automated …but not necessarily sound Proofs in the abstract model are subject to simplifying assumptions which ignore some of attacker’s capabilities Attack in the finite model implies actual attack

Stream Ciphers One-time pad: Ciphertext(Key,Message)=MessageKey Key must be a random bit sequence as long as message Idea: replace “random” with “pseudo-random” Use a pseudo-random number generator (PRNG) PRNG takes a short, truly random secret seed and expands it into a long “random-looking” sequence E.g., 128-bit seed into a 106-bit pseudo-random sequence Ciphertext(Key,Msg)=IV, MsgPRNG(IV,Key) Message processed bit by bit (unlike block cipher) No efficient algorithm can tell this sequence from truly random

Stream Cipher Terminology The seed of a pseudo-random generator typically consists of initialization vector (IV) and key The key is a secret known only to the sender and the recipient, not sent with the ciphertext IV is usually sent with the ciphertext The pseudo-random bit stream produced by PRNG(IV,key) is referred to as the keystream Encrypt message by XORing with keystream ciphertext = message  keystream

Properties of Stream Ciphers Usually very fast (faster than block ciphers) Used where speed is important: WiFi, DVD, RFID, VoIP Unlike one-time pad, stream ciphers do not provide perfect secrecy Only as secure as the underlying PRNG If used properly, can be as secure as block ciphers PRNG must be cryptographically secure

Using Stream Ciphers No integrity Associativity & commutativity: (M1PRNG(seed))  M2 = (M1M2)  PRNG(seed) Need an additional integrity protection mechanism Known-plaintext attack is very dangerous if keystream is ever repeated Self-cancellation property of XOR: XX=0 (M1PRNG(seed))  (M2PRNG(seed)) = M1M2 If attacker knows M1, then easily recovers M2 … also, most plaintexts contain enough redundancy that can recover parts of both messages from M1M2

How Random is “Random”?

Cryptographically Secure PRNG Next-bit test: given N bits of the pseudo-random sequence, predict (N+1)st bit Probability of correct prediction should be very close to 1/2 for any efficient adversarial algorithm (means what?) PRNG state compromise Even if the attacker learns the complete or partial state of the PRNG, he should not be able to reproduce the previously generated sequence … or future sequence, if there’ll be future random seed(s) Common PRNGs are not cryptographically secure

RC4 Designed by Ron Rivest for RSA in 1987 Simple, fast, widely used SSL/TLS for Web security, WEP for wireless Byte array S[256] contains a permutation of numbers from 0 to 255 i = j := 0 loop i := (i+1) mod 256 j := (j+S[i]) mod 256 swap(S[i],S[j]) output (S[i]+S[j]) mod 256 end loop

RC4 Initialization Divide key K into L bytes for i = 0 to 255 do S[i] := i j := 0 j := (j+S[i]+K[i mod L]) mod 256 swap(S[i],S[j]) Key can be any length up to 2048 bits Generate initial permutation from key K To use RC4, usually prepend initialization vector (IV) to the key IV can be random or a counter RC4 is not random enough… First byte of generated sequence depends only on 3 cells of state array S - this can be used to extract the key! To use RC4 securely, RSA suggests discarding first 256 bytes Fluhrer-Mantin-Shamir attack

BSS (infrastructure) mode 802.11b Overview Standard for wireless networks (IEEE 1999) Two modes: infrastructure and ad hoc BSS (infrastructure) mode IBSS (ad hoc) mode

WEP: Wired Equivalent Privacy Special-purpose protocol for 802.11b Goals: confidentiality, integrity, authentication Intended to make wireless as secure as wired network Assumes that a secret key is shared between access point and client Uses RC4 stream cipher seeded with 24-bit initialization vector and 40-bit key Terrible design choice for wireless environment

Shared-Key Authentication [Borisov et al.  “Intercepting Mobile Communications: The Insecurity of 802.11”. MOBICOM 2001] Prior to communicating data, access point may require client to authenticate Access Point Client beacon unauthenticated & unassociated OR probe request Passive eavesdropper recovers RC4(IV,K), can respond to any subsequent challenge without knowing K authenticated & unassociated challenge IV, challengeRC4(IV,K) association request authenticated & associated association response

How WEP Works no integrity! (IV, shared key) used as RC4 seed Must never be repeated (why?) There is no key update protocol, so security relies on never repeating IV 24 bits 40 bits We should use CRC32 to … NEVER USE CRC32 FOR ANYTHING IV sent in the clear Worse: changing IV with each packet is optional! CRC-32 checksum is linear in : if attacker flips some plaintext bits, he knows which bits of CRC to flip to produce the same checksum no integrity! Picture: iSEC Partners

RC4 Is a Bad Choice for Wireless [Borisov et al.] Stream ciphers require sender and receiver to be at the same place in the keystream Not suitable when packet losses are common WEP solution: a separate keystream for each packet (requires a separate seed for each packet) Can decrypt a packet even if a previous packet was lost But there aren’t enough possible seeds! RC4 seed = 24-bit initialization vector + fixed key Assuming 1500-byte packets at 11 Mbps, 224 possible IVs will be exhausted in about 5 hours Seed reuse is deadly for stream ciphers

Recovering the Keystream [Borisov et al.] Get access point to encrypt a known plaintext Send spam, access point will encrypt and forward it Get victim to send an email with known content With known plaintext, easy to recover keystream C  M = (MRC4(IV,key))  M = RC4(IV,key) Even without knowing the plaintext, can exploit plaintext regularities to recover partial keystream Plaintexts are not random: for example, IP packet structure is very regular Not a problem if the keystream is not re-used

Keystream Will Be Re-Used [Borisov et al.] In WEP, repeated IV means repeated keystream Busy network will repeat IVs often Many cards reset IV to 0 when re-booted, then increment by 1  expect re-use of low-value IVs If IVs are chosen randomly, expect repetition in O(212) due to birthday paradox Recover keystream for each IV, store in a table (KnownM  RC4(IV,key))  KnownM = RC4(IV,key) Wait for IV to repeat, decrypt, enjoy plaintext (M’  RC4(IV,key))  RC4(IV,key) = M’

It Gets Worse Misuse of RC4 in WEP is a design flaw with no fix Longer keys do not help! The problem is re-use of IVs, their size is fixed (24 bits) Attacks are passive and very difficult to detect Perfect target for the Fluhrer et al. attack on RC4 Attack requires known IVs of a special form WEP sends IVs in plaintext Generating IVs as counters or random numbers will produce enough “special” IVs in a matter of hours This results in key recovery (not just keystream) Can decrypt even ciphertexts whose IV is unique

Fixing the Problem Extensible Authentication Protocol (EAP) Developers can choose their own authentication method Passwords (Cisco EAP-LEAP), public-key certificates (Microsoft EAP-TLS), passwords OR certificates (PEAP), etc. 802.11i standard fixes 802.11b problems Patch (TKIP): still RC4, but encrypts IVs and establishes new shared keys for every 10 KBytes transmitted Use same network card, only upgrade firmware Deprecated by the Wi-Fi alliance Long-term: AES in CCMP mode, 128-bit keys, 48-bit IVs Block cipher in a stream cipher-like mode