leo.blog();

Stream cipher

A stream cipher is basically a cryptographically secure RNG. It takes a key (and sometimes an IV or nonce) and generates an endless stream of random bytes.

Counter (CTR) mode

One popular way to make stream ciphers recently is to take a regular block cipher and just encrypting a counter with it.

Let’s say you have an encryption function E(k, x) that takes a key k and the plaintext block x, and returns the encrypted block.

Sponge functions

An easy way to get a stream cipher out of a sponge function is as follows.

  1. Absorb the IV
  2. Absorb the key
  3. Squeeze as many bytes as you want to encrypt the entire plaintext

Tags: Cryptography

Leave a Comment