Department of Electrical Engineering, IIT Bombay
September 11, 2024
Used in practice to instantiate pseudorandom generators
A stream cipher is a pair of deterministic algorithms (\textsf{Init}, \textsf{Next})
Starting from some initial state \textsf{st}_0, any number of bits can be generated by repeatedly invoking \textsf{Next}
Image credit: Wikipedia
Trivium accepts a 80-bit key and 80-bit IV
Let s_1, s_2,\ldots, s_{288} be the 288 bits of state
(s_1, s_2, \ldots, s_{93}) \leftarrow (K_1, K_2, \ldots, K_{80}, 0,\ldots,0)
(s_{94}, s_{95}, \ldots, s_{177}) \leftarrow (IV_1, \ldots, IV_{80}, 0,\ldots,0)
(s_{178}, s_{179}, \ldots, s_{288}) \leftarrow (0,\ldots,0,1,1,1)
for i=1, 2, \ldots, 1152 do
Image credit: Wikipedia
Shift register based ciphers are efficient in hardware implementation but have poor performance in software
RC4 was designed by Ron Rivest in 1984 for good software performance
No longer recommended due to recent attacks
State of RC4
Input: 16-byte key k, Output: Initial state (S, i, j)
\begin{align*} &\textbf{for } i=0,1,\ldots,255\\ & \quad\quad S[i] \coloneqq i\\ & \quad\quad k[i] \coloneqq k[i \bmod 16]\\ & j \coloneqq 0\\ &\textbf{for } i=0,1,\ldots,255\\ &\quad\quad j \coloneqq j + S[i] + k[i]\\ &\quad\quad \text{Swap } S[i] \text{ and } S[j]\\ &i \coloneqq 0, \quad j \coloneqq 0\\ & \textbf{return } (S, i, j) \end{align*}
Input: Current state (S,i,j)
Output: Output byte y and updated (S, i, j)
\begin{align*} &i \coloneqq i + 1\\ &j \coloneqq j + S[i]\\ &\text{Swap } S[i] \text{ and } S[j]\\ &t \coloneqq S[i] + S[j]\\ &y \coloneqq S[t] \\ & \textbf{return } y \text{ and } (S, i, j) \end{align*}
An implementation of the confusion-diffusion paradigm
The confusion functions are independent of the key
Consider an SPN with block length 64. For input x, do
Image credit: Katz & Lindell
A method to construct an invertible function from non-invertible components
Image credit: Wikipedia
Image credit: Wikipedia