Foundations of Network and Computer Security J J ohn Black Lecture #24 Nov 23 rd 2004 CSCI 6268/TLEN 5831, Fall 2004.

Slides:



Advertisements
Similar presentations
CS470, A.SelcukStream Ciphers1 CS 470 Introduction to Applied Cryptography Instructor: Ali Aydin Selcuk.
Advertisements

Modern Symmetric-Key Ciphers
Stream Ciphers Part 1  Cryptography 3 Stream Ciphers.
Encryption/Decyprtion using RC4 Vivek Ramachandran.
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:
CS457 – Introduction to Information Systems Security Cryptography 1b Elias Athanasopoulos
Quick Sort, Shell Sort, Counting Sort, Radix Sort AND Bucket Sort
1 Foundations of Software Design Fall 2002 Marti Hearst Lecture 18: Hash Tables.
Great Theoretical Ideas in Computer Science.
Chalmers University of Technology Wireless security Breaking WEP and WPA.
Foundations of Network and Computer Security J J ohn Black Lecture #10 Sep 18 th 2009 CSCI 6268/TLEN 5550, Fall 2009.
Wireless Network Security: WEP And Beyond Heidi Parsaye Jason DeVries Roxanne Ilse Heidi Parsaye - Jason DeVries - Roxanne Ilse.
Foundations of Network and Computer Security J J ohn Black Lecture #11 Oct 4 th 2005 CSCI 6268/TLEN 5831, Fall 2005.
Foundations of Network and Computer Security J J ohn Black Lecture #5 Sep 7 th 2007 CSCI 6268/TLEN 5831, Fall 2007.
Akelarre 1 Akelarre Akelarre 2 Akelarre  Block cipher  Combines features of 2 strong ciphers o IDEA — “mixed mode” arithmetic o RC5 — keyed rotations.
Foundations of Network and Computer Security J J ohn Black Lecture #8 Sep 15 th 2005 CSCI 6268/TLEN 5831, Fall 2005.
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.
Foundations of Network and Computer Security J J ohn Black Lecture #34 Dec 5 th 2007 CSCI 6268/TLEN 5831, Fall 2007.
Foundations of Network and Computer Security J J ohn Black Lecture #22 Oct 21 st 2009 CSCI 6268/TLEN 5550, Fall 2009.
Foundations of Network and Computer Security J J ohn Black Lecture #12 Sep 23 rd 2009 CSCI 6268/TLEN 5550, Fall 2009.
1 Lecture #10 Public Key Algorithms HAIT Summer 2005 Shimrit Tzur-David.
Foundations of Network and Computer Security J J ohn Black Lecture #3 Aug 28 th 2009 CSCI 6268/TLEN 5550, Fall 2009.
Tirgul 7. Find an efficient implementation of a dynamic collection of elements with unique keys Supported Operations: Insert, Search and Delete. The keys.
1 CSCD 439/539 Wireless Networks and Security Lecture 9 WEP Fall 2007.
Security – Wired Equivalent Privacy (WEP) By Shruthi B Krishnan.
ORYX 1 ORYX ORYX 2 ORYX  ORYX not an acronym, but upper case  Designed for use with cell phones o To protect confidentiality of voice/data o For “data.
MD4 1 MD4. MD4 2 MD4  Message Digest 4  Invented by Rivest, ca 1990  Weaknesses found by 1992 o Rivest proposed improved version (MD5), 1992  Dobbertin.
Random walks and analysis of algorithms in cryptography Ilya Mironov Stanford University.
Computer Security CS 426 Lecture 3
Encryption Schemes Second Pass Brice Toth 21 November 2001.
Binary Arithmetic Math For Computers.
Foundations of Network and Computer Security J J ohn Black Lecture #14 Oct 1 st 2007 CSCI 6268/TLEN 5831, Fall 2007.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 9: Cryptography.
Lecture 18 Page 1 CS 111 Online Design Principles for Secure Systems Economy Complete mediation Open design Separation of privileges Least privilege Least.
ICS220 – Data Structures and Algorithms Lecture 10 Dr. Ken Cosh.
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.
Great Theoretical Ideas in Computer Science.
CS555Spring 2012/Topic 51 Cryptography CS 555 Topic 5: Pseudorandomness and Stream Ciphers.
Pseudo-Random Functions 1/22 Encryption as Permutation Assume cryptosystem correct and P = C If x  x’ then E K (x)  E K (x’) So, no y is hit by more.
Stream Ciphers Making the one-time pad practical.
Stream Cipher July 2011.
Moving Around in Scratch The Basics… -You do want to have Scratch open as you will be creating a program. -Follow the instructions and if you have questions.
COEN 350 Mobile Security. Wireless Security Wireless offers additional challenges: Physical media can easily be sniffed. War Driving Legal? U.S. federal.
Multiple Encryption & DES  clearly a replacement for DES was needed Vulnerable to brute-force key search attacks Vulnerable to brute-force key search.
Attacks on PRNGs - By Nupura Neurgaonkar CS-265 (Prof. Mark Stamp)
Security Technologies built into std. Presented by T.R.Santhosh.
CRYPTOGRAPHY. WHAT IS PUBLIC-KEY ENCRYPTION? Encryption is the key to information security The main idea- by using only public information, a sender can.
WEP – Wireless Encryption Protocol A. Gabriel W. Daleson CS 610 – Advanced Security Portland State University.
COSC 2007 Data Structures II Chapter 13 Advanced Implementation of Tables IV.
 Advisor: Dr. Quincy Wu  Speaker: Hui - Hsiung Chung  Date:
Tirgul 11 Notes Hash tables –reminder –examples –some new material.
1 Ch. 2: Getting Started. 2 About this lecture Study a few simple algorithms for sorting – Insertion Sort – Selection Sort (Exercise) – Merge Sort Show.
1 Analysis of Non-fortuitous Predictive States of the RC4 Keystream Generator Souradyuti Paul and Bart Preneel K.U. Leuven, ESAT/COSIC Indocrypt 2003 India.
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.
University of Malawi, Chancellor College
COEN 350 Mobile Security. Wireless Security Wireless offers additional challenges: Physical media can easily be sniffed. War Driving Legal? U.S. federal.
1 A New Weakness in the RC4 Keystream Generator and an Approach to Improve the Security of the Cipher Souradyuti Paul and Bart Preneel K.U. Leuven, ESAT/COSIC.
Foundations of Network and Computer Security J J ohn Black CSCI 6268/TLEN 5550, Spring 2014.
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.
หัวข้อบรรยาย Stream cipher RC4 WEP (in)security LFSR CSS (in)security.
Cryptography CS 555 Topic 15: Stream Ciphers.
Topic 5: Constructing Secure Encryption Schemes
Cryptography Lecture 16.
RC4 RC
Ch. 2: Getting Started.
Chapter -4 STREAM CIPHERS
A toy example for RC4.
By: Anthony Gervasi & Adam Dickinson
Presentation transcript:

Foundations of Network and Computer Security J J ohn Black Lecture #24 Nov 23 rd 2004 CSCI 6268/TLEN 5831, Fall 2004

Announcements Proj #2 – Due today –Can hand in Tuesday if need be Quiz #4: next time No class Thurs (Thanksgiving) or Tues (the 30 th )

WEP and RC4 We saw last time how WEP uses RC4 –C = P © RC4(v, k) –v is a 24-bit IV –k is a 40-bit key (could be 104-bits too) C is then sent along with v –So we seed RC4 with 64 bits, 24 of which are public and 40 of which are private Turns out this is bad

RC4 Designed by Rivest Secret algorithm (trade secret) for years –One day, reverse-engineered code showed up on a cypherpunks mailing list (1995) –Was called “alleged RC4” for a while –Now just assumed to be RC4 Meant to be simple enough to be memorized –This was to circumvent export problems Most common mode used in SSL –But they don’t use it like WEP does

RC4 Algorithm Uses an internal state of: –256 byte permutation S –2 pointers into that permutation So how many states possible? –256! * ¼ –Exhaustive search on the state is clearly not a good idea State array S fffe Byte values; must be a permutation of {0,…,255}

RC4 Algorithm (cont) Two phases of the algorithm: –Key Schedule Algorithm (KSA) Digest the key to get the initial state –Pad Generation (PRGA) Start generating endless stream of pseudorandom bytes We run the KSA first with the key; discard the key; keep the state; then ask the PRGA for bytes as-needed

RC4-KSA(K) K has 8 bytes for 24-bit IV v and 40-bit WEP key k RC4_KSA(K) for i à 0 to 255 S[i] à i j à 0 for i à 0 to 255 j à (j + S[i] + K[i mod 8]) S[i] $ S[j] Assume all arithmetic is mod 256 when manipulating indices to S (so j stays in the range 0 to 255) Please take a moment to memorize this one

RC4-PRGA i à 0; j à 0 while (1) do i++ j à (j+S[i]) S[i] $ S[j] output S[S[i] + S[j]] State S is global; PRGA outputs bytes forever Once again, assume mod 256 as needed

Let’s Run KSA First we need an IV v and WEP key k –eg, v=0x020441, k=0x0567f1a3dd Next we initialize the state array –Permutation is the identity, i and j point to f1a3dd IV v WEP Key k RC4 Key K fffe fffe i, j

Running the KSA fffe fffe S0S0 i à 0 j à K[0] = fffe fffe S1S1 i à 1 j à K[1] = fffe fffe S2S2 i à 2 j à K[1] = 7 S i denotes the state of array S after i iterations of the for loop

Then Run PRGA Suppose we have some permutation at the end of the KSA; now run PRGA once i is 1, j is 0 j à j + S[i], so j à S[1] swap S[i] and S[j] output S[S[i] + S[j]], so S[S[1] + S[S[1]]] So first byte of PRGA after KSA is run is S[S[1] + S[S[1]]] fffe 270faa09229a 5fb1

The Attack David Wagner noticed in 1996 that if the first bytes of the RC4 seed were of a certain form, interesting things happen Fluhrer, Mantin, Shamir expanded on this and showed how it applies to WEP Idea: –Suppose WEP IV is of the following form: 0x03ffxx Here, “xx” means any value, so we just need it to start with 0x03ff

Special IV What does K look like then? 03ffxxT IV v WEP Key k RC4 Key K T here is the first part of the WEP key k –This is a secret value that we would like to find –The IV is of course public, so we can recognize when it is in this special form Let’s run the KSA with this IV

fffe fffe S0S0 i à 0 j à K[0] = fffe fffe S1S1 i à 1 j à K[1] = fffe fffe S2S2 i à 2 j à K[2] = 5 + X K = 03 ff xx T … ; Set X = xx Note: We can compute all of this without the WEP key k

fffe 30 S 2 [X+5] fffe S3S3 i à 3 j à (X+5) K[3] = X+6+T 2 X fffe 30 S 2 [X+5] S 3 [X+6+T] 45 fffe S4S4 2 X+5 Note: This is the first time something happens that we cannot compute using just the IV Now let’s assume that for the remaining 252 iterations of i (from 4 through 255) we never disturb S[0], S[1], or S[3] –i will never point here again, but j might; we assume that it won’t, and see what happens Then the PRGA runs and outputs S[S[1]+S[S[1]]] as its first byte –This is S[0 + S[0]] = S[3] = S 3 [X+6+T] –We can solve for T

Solving for T We have S 3 [X+6+T] and we know S 3 completely –Search for S 3 [X+6+T] in the S_3 array –Say the index is Z –Then T = Z-X-6 Taken mod 256, as always –This gives T, the first byte of the secret WEP key k Other bytes found in similar manner

But what if j messes things up? Recall j was “randomly” jumping through S –It may point to 0, 1, or 3 and then our computation doesn’t work Moreover, if j messes things up, we can’t detect that it did or didn’t! –Let’s assume j is uniform and random What is the probability it will avoid these 3 locations? (1-3/255) 252 ¼ lim N ! 1 (1-3/N) N = e -3 ¼ 0.05 So 95% of the time, j messes us up…

Using statistics However, 5% of the time we strike gold –And we can assume that the times we don’t, we get a uniformly random value out –Imagine a die with 256 sides with 1 side coming up 5% of the time and the other sides coming up 0.37% of the time So 1 side is 13 times more likely than any other –Run a statistical test: For  different values of X, get the candidate T The majority element is the correct T value –Calculations show that  = 60 is sufficient –Challenge problem #4: compute how many values of X are needed to get a probability p that the majority element is T

Example Suppose you have IV’s: –0x03ff00, 0x03ff01, 0x03ff02, …, 0x03ff3b –You get candidate T values (using our computation): … So we choose T=19 as the first byte of the secret key

RC4 Attack: Further Notes Need IV’s of a certain form –A passive attacker has to wait until they occur naturally –An active attacker will just set them to whatever values he needs Note that we need to get the first byte of the key stream –With WEP this is easy because the first byte of every frame is 0xaa Has to do with an encapsulation standard

Extending the Attack Once you get T = K[3] you can get all further bytes as well –For 40-bit WEP, there are 4 more bytes –For 104-bit WEP there are 12 more So for this attack, key size DOES matter –To attack K[4] you need to have K[3] It had better be right! IVs should be of the form 0x04ffxx

Practical Implications An attacker has to sit outside and collect a LOT of packets to get your WEP key This attack, combined with the BGW attack from last time are quite damaging, but it still makes sense to run WEP if you’re worried about securing your network AirSnort and other programs have the FMS attack built in