430 likes | 617 Views
Pseudorandom Bit Generators (PRBGs) and Stream Ciphers Based on Random Shuffle. Speaker: Souradyuti Paul Co mputer S ecurity and I ndustrial C ryptography ( COSIC ) Department of Electrical Engineering Katholieke Universiteit Leuven, Belgium
E N D
Pseudorandom Bit Generators (PRBGs) and Stream Ciphers Based on Random Shuffle Speaker: Souradyuti Paul Computer Security and Industrial Cryptography (COSIC) Department of Electrical Engineering Katholieke Universiteit Leuven, Belgium Email: Souradyuti.Paul@esat.kuleuven.be CACR-Seminar
Indian Statistical Institute, Kolkata Master of Computer Sc. (2001) CACR-Seminar
Katholieke Universiteit Leuven, Belgium, Ph.D. (2002- ) CACR-Seminar
My given name is Souradyuti Meaning: Rays of Sun (in Bengali) My family name is Paul But ….. CACR-Seminar
The rest of the world: Paul Bengal: Souradyuti CACR-Seminar
“What's in a Name?“ -William Shakespeare CACR-Seminar
Pseudorandom Bit Generators (PRBG) and Stream Ciphers Based on Random Shuffle Speaker: Souradyuti Paul Computer Security and Industrial Cryptography (COSIC) Department of Electrical Engineering Katholieke Universiteit Leuven, Belgium Email: Souradyuti.Paul@esat.kuleuven.be CACR-Seminar
Overview • PRBG and Stream Cipher • Random Shuffle • RC4 • Basic Strengths and Weaknesses • Some attacks on RC4 • RC4A, VMPC, NGG, Py etc. • Conclusions and Remarks CACR-Seminar
What is aPseudorandom Bit Generator? • Deterministic algorithm, Short input (seed) and long output • Distribution of output is computationally indistinguishable from the uniform distribution On a uniformly selected seed an attacker (with limited resource) cannot distinguishoutput bits from random bits seed 011001001101001101010010….. CACR-Seminar
Stream Cipher from a Pseudorandom Bit Generator seed 011001001101001101010010….. Bitwise XOR Plaintext: 100101001000101001001110….. Ciphertext: 111100000101011001101100… CACR-Seminar
How to construct a Pseudorandom Bit Generator (I) • Well Structured Methods: • Use number theoretic hard problems such as factorization problem, discrete logarithm problem etc. • Elegant • Very slow because of heavy operations like modular exponentiation • Not very attractive for practical purposes CACR-Seminar
How to construct a Pseudorandom Bit Generator (II) • Crazy Methods: • Mix many simple operations • Not very elegant and not easy to analyze • Extremely fast • Suitable for practical purposes CACR-Seminar
How Stream Ciphers Work (I) • (Step1) Initialization (Key/IV Scheduling Algorithm): Mixing Key, IV and fixed Initial state to generate the working Internal State. • (Step 2) Pseudorandom Bit Generation algorithm: Update Internal State and produce pseudorandom bits which are XORed with paintexts. CACR-Seminar
How Stream Ciphers Work (II) Key scheduling Algo (Step 1) Initialization CACR-Seminar
How Stream Ciphers Work(III) Pseudorandom Generation Algorithm (Step 2) PRBG PRBG . . . Output 0Output 1Output 2 XOR … … Plaintext 0 … … Ciphertext 0 CACR-Seminar
What isRandom Shuffle? • Shuffling of a deck of Cards. Start with an initial permutation and end up with a “random looking” permutation of cards. Shuffle CACR-Seminar
Meaning ofRandom shuffle • Statistical indistinguishability: The probablility distribution of the permutation after the shuffling process is uniform Or atleast • Computational indistinguishability: It is difficult to tell apart two distributions CACR-Seminar
How to generate arandom shuffle? • In 1987, such an attempt was made by Ron Rivest to design the famous RC4 stream cipher CACR-Seminar
000 001 254 002 095 093 255 094 255 094 000 001 002 093 ... 254 095 ... RC4 Key Scheduling Algo. Input: Key, Indentity permutation 094 254 000 001 i j CACR-Seminar
094 000 001 254 002 093 255 095 221 009 187 210 138 130 241 ... 142 ... RC4 Key Scheduling Algo. (II) Output: Pseudorandom Permutation, known pointers i=j=0 CACR-Seminar
Does RC4 Key Scheduling Algo. Generate a Random Shuffle? • NO. • Key size of RC4 is 40 t0 256 bits. • 256! all possible permutations • 256!>>> 2256 • Idealized model of RC4 is not a random shuffle, sign distinguisher, position distinguisher [Mironov, Crypto 2002] CACR-Seminar
255 254 000 095 001 002 094 093 033 099 205 092 013 ... 143 162 079 ... RC4 Pseudorandom Bit Generation Algo. (again shuffle) Input: Internal state, Output: Next internal state, psedorandom bits i:=i+1 j:=(j + S[i]) mod 256 swap S[i] and S[j] t:=(S[i] + S[j]) mod 256 output S[t] t 162 92 i CACR-Seminar
Strengths of RC4-like Ciphers (I) Key scheduling Algo (Step 1) • Short key to large Internal State: Increase in the pseudo-entropy • Recovery of internal state from output bits is difficult CACR-Seminar
Strengths of RC4-like Ciphers (II) • It is ‘hard’ to represent inputs and outputs of RC4 as a set of multivariate polynomial equations • Apparently resists algebraic attacks CACR-Seminar
Weaknesses of RC4-like Ciphers: Approximating Inter. States PRBG PRBG • Most of the elements in two successive rounds of RC4 remain stationary • Generation of Outputs involve small number of variables • Outputs and Internal States in near-by rounds seem to have high correlation leading to distinguishing attacks = = . . . CACR-Seminar
Attacks on RC4-like Ciphers • The approach to most of the attacks • Distinguishing attacks • Fix one or more elements in the Internal State • Show a relation among outputs with probability significantly different from random CACR-Seminar
Attack on RC4: Biased 2nd Output [Mantin and Shamir, SAC 2001](I) Index: 0 1 2 3 4 x N-1 i j CACR-Seminar
Attack on RC4: Biased 2nd Output [Mantin and Shamir, SAC 2001](II) Index: 0 1 2 3 4 …. x N-1 j i Index: 0 1 2 3 4 …. N-1 i j Output: S2 [X]=0 CACR-Seminar
First Two Outputs are Unequal if S0[1]=2 [Paul and Preneel FSE04] Index: 0 1 2 3 4 N-1 i j CACR-Seminar
First Two Outputs are Unequal if S0[1]=2 (contd.) Index: 0 1 2 3 4 …. N-1 i j Output: S1 [X+2] Index: 0 1 2 3 4 …. N-1 i j • S1[X+2] ≠ S2[Z+2] Output: S2 [Z+2] CACR-Seminar
Generalizing: Predictive States Snapshot at Round t Round: 0 1 … … r …. c i j Number of Known elements in the S-box is a. CACR-Seminar
Generalizing: Predictive States Snapshot at Round t + c Round: 0 1 … … r …. c i j Outputs:Z1 Z2 Z3 …… Zb Number of Predicted Outputs is b. CACR-Seminar
Distinguishers after N bytes CACR-Seminar
Other recent RC4-like ciphers • VMPC-one way function • Bartoz Zoltak at FSE 2004 • Main features: 8-bit output, one S-box, swapping, more memory accesses to generate output, slower than RC4 • Vulnerable against same types of distinguishing attacks as RC4 (fix elements and predict outputs) CACR-Seminar
Other recent RC4-like ciphers • RC4A • Paul and Preneel at FSE 2004 • Main features: 8-bit output, two S-boxes, swapping, less operations per byte, marginally faster than RC4 • Vulnerable against same types of distinguishing attacks as RC4 (fix elements and predict outputs) CACR-Seminar
Other recent RC4-like ciphers • NGG (suitable for 32-bit machine) • Nawaz, Gupta, Gong, IACR ePrint 2005 • Main features: 32-bit output, one S-box, swapping, less operations per byte, 3 times as fast as RC4 • Weakness: short index (8-bit) and long word (32-bit), correlation among elements of internal state, slow change • Latest News: Repaired recently… CACR-Seminar
Other recent RC4-like ciphers • Py (suitable for 32-bit machine) • Biham and Seberry, ECRYPT proposal 2005 • Main features: 32-bit output, two S-boxes, swapping, less operations per byte, 2.5 times as fast as RC4 • Weakness: short index (8-bit) and long word (32-bit), slow change in rounds • Investigation underway …. • IB, IBAA, ISAAC by Jenkins, FSE 1996 CACR-Seminar
255 001 000 094 096 095 096 254 002 000 001 002 093 094 095 255 143 143 079 096 079 ... 093 001 ... … 093 165 205 251 003 011 ... 233 033 162 Example: RC4A 165 93 i j1 251 003 i j2 CACR-Seminar
Conclusions and Remarks • some attacks on RC4-like ciphers derived from some generic flaws such as slow change in successive rounds • Common problems in designing ciphers based on shuffling • Future work: extending the weaknesses of Py, IB, IBAA, ISAAC and similar ciphers into cryptanaytic attacks CACR-Seminar
Thanks. CACR-Seminar