Cryptography CS 555 Topic 15: Stream Ciphers.

Slides:



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

Stream Ciphers Part 1  Cryptography 3 Stream Ciphers.
Dan Boneh Stream ciphers Real-world Stream Ciphers Online Cryptography Course Dan Boneh.
An Introduction to Stream Ciphers Zahra Ahmadian Electrical Engineering Department Sahrif University of Technology
CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (3) Information Security.
Digital Kommunikationselektroink TNE027 Lecture 6 (Cryptography) 1 Cryptography Algorithms Symmetric and Asymmetric Cryptography Algorithms Data Stream.
CIS 5371 Cryptography 3b. Pseudorandomness.
Symmetric Encryption Example: DES Weichao Wang. 2 Overview of the DES A block cipher: – encrypts blocks of 64 bits using a 64 bit key – outputs 64 bits.
Cryptography and Network Security Chapter 7 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
1 Overview of the DES A block cipher: –encrypts blocks of 64 bits using a 64 bit key –outputs 64 bits of ciphertext A product cipher –basic unit is the.
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.
Introduction to Modern Cryptography Lecture 2 Symmetric Encryption: Stream & Block Ciphers.
1 CS 255 Lecture 4 Attacks on Block Ciphers Brent Waters.
Wireless Security Presentation by Paul Petty and Sooner Brooks-Heath.
6. Practical Constructions of Symmetric-Key Primitives
Chapter 2 (D) – Contemporary Symmetric Ciphers "I am fairly familiar with all the forms of secret writings, and am myself the author of a trifling monograph.
Computer Security CS 426 Lecture 3
Cryptography and Network Security Chapter 7 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
CS526Topic 3: One-time Pad and Perfect Secrecy 1 Information Security CS 526 Topic 3 Cryptography: One-time Pad, Information Theoretic Security, and Stream.
Lecture slides prepared for “Computer Security: Principles and Practice”, 2/e, by William Stallings and Lawrie Brown, Chapter 21 “Public-Key Cryptography.
Cryptography and Network Security Chapter 6. Multiple Encryption & DES  clear a replacement for DES was needed theoretical attacks that can break it.
CS555Spring 2012/Topic 51 Cryptography CS 555 Topic 5: Pseudorandomness and Stream Ciphers.
Chapter 21 Public-Key Cryptography and Message Authentication.
Stream Cipher July 2011.
CS555Spring 2012/Topic 111 Cryptography CS 555 Topic 11: Encryption Modes and CCA Security.
Applied Cryptography Spring 2015 Chaining Modes. What happens when the clear text is longer than the block length k? Most simple solution — encrypt each.
Multiple Encryption & DES  clearly a replacement for DES was needed Vulnerable to brute-force key search attacks Vulnerable to brute-force key search.
1 Symmetric-Key Encryption CSE 5351: Introduction to Cryptography Reading assignment: Chapter 3 Read sections first (skipping 3.2.2)
Cryptography and Network Security Contemporary Symmetric Ciphers.
1 CIS 5371 Cryptography 4. Message Authentication Codes B ased on: Jonathan Katz and Yehuda Lindell Introduction to Modern Cryptography.
Presented by: Dr. Munam Ali Shah
1 Symmetric-Key Encryption CSE 5351: Introduction to Cryptography Reading assignment: Chapter 2 Chapter 3 (sections ) You may skip proofs, but are.
Dr. Lo’ai Tawalbeh summer 2007 Chapter 6: Contemporary Symmetric Ciphers Dr. Lo’ai Tawalbeh New York Institute of Technology (NYIT) Jordan’s Campus INCS.
Cryptography and Network Security Chapter 7 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
IEEE Security Specifically WEP, WPA, and WPA2 Brett Boge, Presenter CS 450/650 University of Nevada, Reno.
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.
หัวข้อบรรยาย Stream cipher RC4 WEP (in)security LFSR CSS (in)security.
Practical Aspects of Modern Cryptography Josh Benaloh & Brian LaMacchia.
Chapter6: More on Symmetric Ciphers
Topic 26: Discrete LOG Applications
HEY DOUG HOW ARE YOU? NKE JUAM NUC GXK EUA. HEY DOUG HOW ARE YOU? NKE JUAM NUC GXK EUA.
Homework 2 Due Thursday Due: Thursday, September 28th at 9 AM (beginning of class) Please Typeset Your Solutions (LaTeX, Word etc…) You may collaborate,
Unit -1.
Topic 11: Authenticated Encryption + CCA-Security
Stream Cipher.
Pseudo Random Number Generators
Topic 5: Constructing Secure Encryption Schemes
Cryptography Lecture 16.
Cryptography and Security Fall 2009 Steve Lai
Cryptography Lecture 15.
Topic 3: Perfect Secrecy
Topic 7: Pseudorandom Functions and CPA-Security
PART VII Security.
Symmetric-Key Encryption
ADVANCED ENCRYPTION STANDARDADVANCED ENCRYPTION STANDARD
Homework 2 Due: Tuesday, October 2nd at 3PM (beginning of class)
RC4 RC
Cryptography Lecture 11.
Topic 13: Message Authentication Code
Chapter -4 STREAM CIPHERS
Information Security CS 526 Topic 3
Information and Computer Security CPIS 312 Lab 4 & 5
Cryptography Lecture 15.
The RC4 Algorithm Network Security.
Stream Cipher Structure
By: Anthony Gervasi & Adam Dickinson
Presentation transcript:

Cryptography CS 555 Topic 15: Stream Ciphers

An Existential Crisis? We have used primitives like PRGs, PRFs to build secure MACs, CCA- Secure Encryption etc… Do such primitives exist? In practice? How do we build them?

Recap Hash Functions/PRGs/PRFs, CCA-Secure Encryption, MACs Goals for This Week: Practical Constructions of Symmetric Key Primitives Today’s Goals: Stream Ciphers Linear Feedback Shift Registers (and attacks) RC4 (and attacks) Trivium

PRG Security as a Game ∀ Pr 𝐺𝑢𝑒𝑠𝑠𝑒𝑠 𝑏 ′ =𝑏 ≤ 1 2 +𝜇(𝑛) Random bit b If b=1 r← 0,1 𝑛 R = G(r) Else 𝑅← 0,1 ℓ 𝑛 b’ ∀ Pr 𝐺𝑢𝑒𝑠𝑠𝑒𝑠 𝑏 ′ =𝑏 ≤ 1 2 +𝜇(𝑛) 𝑝𝑝𝑡 𝑎𝑡𝑡𝑎𝑐𝑘𝑒𝑟 𝑛𝑒𝑔𝑙𝑖𝑔𝑖𝑏𝑙𝑒 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 Suppose we have m,m’,c’ s.t. Pr[EncK(m)= c’] > Pr[EncK(m’)=c’] then adversary can select m0= m, m1=m’. If the ciphertext challenge c=c’ then the adversary outputs guess b’ = 1. Otherwise, the adversary outputs random guess b’.

Stream Cipher vs PRG PRG pseudorandom bits output all at once Pseudorandom bits can be output as a stream RC4, RC5 (Ron’s Code) st0 := Init(s) For i=1 to ℓ: (yi,sti):=GetBits(sti-1) Output: y1,…,yℓ

Linear Feedback Shift Register

Linear Feedback Shift Register State at time t: 𝑠 𝑛−1 𝑡 ,…, 𝑠 1 𝑡 , 𝑠 0 𝑡 (n registers) Feedback Coefficients: 𝐒⊆ 0,…,𝑛

Linear Feedback Shift Register State at time t: 𝑠 𝑛−1 𝑡 ,…, 𝑠 1 𝑡 , 𝑠 0 𝑡 (n registers) Feedback Coefficients: 𝐒⊆ 0,…,𝑛−1 State at time t+1: ⨁ 𝑖∈𝑆 𝑠 𝑖 𝑡 , 𝑠 𝑛−1 𝑡 ,…, 𝑠 1 𝑡 , 𝑠 𝑛−1 𝑡+1 = ⨁ 𝑖∈𝑆 𝑠 𝑖 𝑡 , and 𝑠 𝑖 𝑡+1 = 𝑠 𝑖+1 𝑡 for i<n−1 Output at time t+1: 𝒚 𝒕+𝟏 =𝒔 𝟎 𝒕

Linear Feedback Shift Register Observation 1: First n bits of output reveal initial state 𝑦 1 ,…, 𝑦 𝑛 =𝑠 0 0 , 𝑠 1 0 ,…, 𝑠 𝑛−1 0 Observation 2: Next n bits allow us to solve for n unknowns 𝑥 𝑖 = 1 if 𝑖∈𝑆 0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 𝑦 𝑛+1 = 𝑦 𝑛 𝑥 𝑛−1 +…+ 𝑦 1 𝑥 0

Linear Feedback Shift Register Observation 1: First n bits of output reveal initial state 𝑦 1 ,…, 𝑦 𝑛 =𝑠 0 0 , 𝑠 1 0 ,…, 𝑠 𝑛−1 0 Observation 2: Next n bits allow us to solve for n unknowns 𝑥 𝑖 = 1 if 𝑖∈𝑆 0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 𝑦 𝑛+1 = 𝑦 𝑛 𝑥 𝑛−1 +…+ 𝑦 1 𝑥 0 mod 2

Linear Feedback Shift Register Observation 2: Next n bits allow us to solve for n unknowns 𝑥 𝑖 = 1 if 𝑖∈𝑆 0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 𝑦 𝑛+1 = 𝑦 𝑛 𝑥 𝑛−1 +…+ 𝑦 1 𝑥 0 mod 2 𝑦 2𝑛 = 𝑦 2𝑛−1 𝑥 𝑛−1 +…+ 𝑦 𝑛 𝑥 0 mod 2 N unknowns & N linear independent constraints …

Removing Linearity Attacks exploited linear relationship between state and output bits Nonlinear Feedback: 𝑠 𝑛−1 𝑡+1 = ⨁ 𝑖∈𝑆 𝑠 𝑖 𝑡 , 𝑠 𝑛−1 𝑡+1 =𝑔 𝑠 0 𝑡 , 𝑠 1 𝑡 ,…, 𝑠 𝑛−1 𝑡 Non linear function

Removing Linearity Attacks exploited linear relationship between state and output bits Nonlinear Combination: 𝒚 𝒕+𝟏 =𝒔 𝟎 𝒕 𝑦 𝑡+1 =𝑓 𝑠 0 𝑡 , 𝑠 1 𝑡 ,…, 𝑠 𝑛−1 𝑡 Important: f must be balanced! Pr 𝑓 𝑥 =1 ≈ 1 2 Non linear function

Trivium (2008) Won the eSTREAM competition Currently, no known attacks are better than brute force Couples Output from three nonlinear Feedback Shift Registers First 4*288 “output bits” are discared

Trivium (2008)

Trivium (2008) AND (Non-linear)

Trivium (2008) (Non-linear) Feedback

Combination Generator Attacks exploited linear relationship between state and output bits Nonlinear Combination: 𝒚 𝒕+𝟏 =𝒔 𝟎 𝒕 𝑦 𝑡+1 =𝑓 𝑠 0 𝑡 , 𝑠 1 𝑡 ,…, 𝑠 𝑛−1 𝑡 Important: f must be balanced! Pr 𝑓 𝑥 =1 ≈ 1 2 Non linear function

Feedback Shift Registers Good performance in hardware Performance is less ideal for software

The RC4 Stream Cipher A proprietary cipher owned by RSA, designed by Ron Rivest in 1987. Became public in 1994. Simple and effective design. Variable key size (typical 40 to 256 bits), Output unbounded number of bytes. Widely used (web SSL/TLS, wireless WEP). Extensively studied, not a completely secure PRNG, when used correctly, no known attacks exist Newer Versions: RC5 and RC6 Rijndael selected by NIST as AES in 2000 CS555

The RC4 Cipher The cipher internal state consists of a 256-byte array S, which contains a permutation of 0 to 255 total number of possible states is 256!  21700 two indexes: i, j i = j = 0 Loop i = (i + 1) (mod 256) j = (j + S[i]) (mod 256) swap(S[i], S[j]) output S[S[i] + S[j] (mod 256)] End Loop CS555

Distinguishing Attack Let 𝑆 0 denote initial state Suppose that 𝑆 0 [2]=0 and 𝑆 0 [1]=X≠0 i = j = 0 Loop i = (i + 1) (mod 256) j = (j + S[i]) (mod 256) swap(S[i], S[j]) output S[S[i] + S[j] (mod 256)] End Loop 1 2 3 … X 255 𝑆 0 𝑆 0 [1]≠0 𝑆 0 [3] 𝑆 0 [X] 𝑆 0 [255] CS555

Distinguishing Attack Let 𝑆 0 denote initial state Suppose that 𝑆 0 [2]=0 and 𝑆 0 [1]=X≠0 i = j = 0 Loop i = (i + 1) (mod 256) j = (j + S[i]) (mod 256) swap(S[i], S[j]) output S[S[i] + S[j] (mod 256)] End Loop 1 2 3 … X 255 𝑆 0 𝑿≠𝟎 𝑆 0 [3] 𝑺 𝟎 [X] 𝑆 0 [255] i=1, j =X CS555

Distinguishing Attack 1 2 3 … X 255 𝑆 0 𝑿≠𝟎 𝑆 0 [3] 𝑺 𝟎 [X] 𝑆 0 [255] 𝑆 1 Let 𝑆 0 denote initial state Suppose that 𝑆 0 [2]=0 and 𝑆 0 [1]=X≠0 i = j = 0 Loop i = (i + 1) (mod 256) j = (j + S[i]) (mod 256) swap(S[i], S[j]) output S[S[i] + S[j] (mod 256)] End Loop i=1, j =X Output y1= 𝑆 1 [S[i]+S[j]] i=2, j =X CS555

Distinguishing Attack 1 2 3 … X 255 𝑆 0 𝑿≠𝟎 𝑆 0 [3] 𝑺 𝟎 [X] 𝑆 0 [255] 𝑆 1 𝑆 0 [X] 𝑆 2 Let 𝑆 0 denote initial state Suppose that 𝑆 0 [2]=0 and 𝑆 0 [1]=X≠0 i = j = 0 Loop i = (i + 1) (mod 256) j = (j + S[i]) (mod 256) swap(S[i], S[j]) output S[S[i] + S[j] (mod 256)] End Loop i=2, j =X Output: y2= S2[S2[2]+S2[X]] = S2[0+X] =0 CS555

Distinguishing Attack Let p=Pr 𝑆 0 [2]=0 and 𝑆 0 [1] ≠2 𝑝= 1 256 1− 1 255 Probability second output byte is 0 Pr 𝑦2=0 | 𝑆 0 [2]=0 and 𝑆 0 [1] ≠2 𝑝+Pr 𝑦2=0 | 𝑆 0 [2]≠0 or 𝑆 0 [1]≠2 (1−𝑝) =𝑝+ 1−𝑝 1 256 = 1 256 1− 1 255 + 1− 1 256 + 1 256 1 255 1 256 ≈ 2 256 CS555

Other Attacks Wired Equivalent Privacy (WEP) encryption used RC4 with an initialization vector Description of RC4 doesn’t involve initialization vector… But WEP imposes an initialization vector K=IV || K’ Since IV is transmitted attacker may have first few bytes of K! Giving the attacker partial knowledge of K often allows recovery of the entire key K’ over time! CS555

Next Class Read Katz and Lindell 6.2-6.2.2 Block Ciphers