Skip to main content

Steam Ciphers

Steam ciphers encrypt bits one at a time, for as long as it is necessary. Can have any size of input

Steam ciphers encrypt using modulo 2 addition Encryption and decryption operations are identical

Modulo 2 - XOR

Binary operator between two values that returns true if either one input or the other is true, but not both

Randomness

  • The security of a stream cipher depends entirely on the nature of the key stream
  • If the stream is truly random, the output is truly random

True Randomness (TRNG)

  • Impossible to recreate except by chance (e.g. coin flips)
  • Computer systems often use hardware sources for randomness
  • How can someone generate a key if its truly random, would have to be sent over the internet

Pseudo Randomness (PRNGs)

  • Generate a sequence of values based on a seed
  • Usually the only requirement is statistical randomness
  • Super fast
  • Linear congruential generator

CSPRNGs

  • PRNGs whose output is unpredictable
  • ...
  • Given nn bits of keystream, can we predict the next bit xx?
  • What do we assign epsilon ϵ\epsilon. (1/2321/2^{32})

Unconditional Security

Unconditional Security - A cryptosystem is unconditionally or information-theoretically secure if it cannot be broken even with infinite computational resources

Perfect Secrecy - The ciphertext should reveal no information about the plaintext

The One Time Pad (OTP)

  • Key stream s0,s1,s2,...s_0,s_1,s_2,... generated by a TRNG

  • Key stream is known only to the communicating parties

  • Every key stream bit sis_i is used only once

  • Any plaintext is equally likely depending on the key

  • Example where M=CK(mod26)M=C-K (mod 26)

OTP is not practical

  • 1gb file would need 1gb key
  • How are we transporting and storing the keys
  • If you ever reuse a key, the entire cipher is broken

Modern Stream Ciphers

  • Modern stream ciphers use an initial seed key to generate an infinite pseudorandom keystream
  • Stream ciphers use a nonce value to alter the keystream for a given key
  • This allows us to create different keystreams for a given key

Number Used Once (NONCE)

  • Vital for stream cipher security
  • Instead of always using a unique key, the security requirement is you always use a unique (key + nonce) pair
  • Nonces are not secret - they are public random seed for a key stream

LCG

Linear congurent generator