Skip to main content

Modern Steam Ciphers

Modern stream ciphers use an initial seed key to generate an infinite pseudorandom keystream

Pseudo Randomness

There are three types of random number generators

  • True Random Number Generator (TRNGs) - Impractical at scale
  • Pseudorandom Number Generators (PRNGs) - insecure
  • Cryptographically Secure Random Number Generators (CSPRNGs) - Are modern stream ciphers

LFSR

  • A linear-feedback shift register is a register of bits whose positions shift to the right
  • Usually comprised of flip-flops, the last bit represents the output

Mathematical Representation

  • Usually represent m-bit LFSRs using polynomials of degree m

Attacking LFSRs

  • Suppose an attacker knows 2m2m plaintext bits
  • Step 1 - Calculate key bits
  • Step 2 - Reconstruct the LFSR

Trivium

LFSRs are much more cryptographically secure if we combine more than one together in a non-linear way

  • 3 LFSRs
  • Feedback between each with non-linear AND gates
  • Initialises the LSFRs with an 80-bit key and 80-bit random value

ChaCha20

  • ChaCha is a stream cipher written by Daniel Berstein
  • Modificaiton of a previous cipher, Salsa
  • Very lightweight, using only add, xor and rotate operations
  • One of two ciphers in TLS1.3

Vulnerabilities

  • Stream ciphers give us confidentiality, but not integrity
  • Must include another mechanism