Computer Security :: Lessons :: Stream vs. Block Ciphers
A stream cipher is a symmetric cipher that encrypts data one bit or byte at a time. This type of cipher is dealing with bits, not text, so it could be any type of data being encrypted. The ideal stream cipher would be a one-time pad which a key, or keystream that is as long as the plaintext bit stream. If the keystream is random, this scheme would be unbreakable unless the keystream were acquired, making it unconditionally secure. The keystream must be provided to both parties in a secure way to prevent its release.
A block cipher is a symmetric cipher in which blocks of plaintext are treated as a whole and used to produce ciphertext blocks. The block cipher takes blocks that are b bits long and encrypts them to blocks that are also b bits long. Block sizes are typically 64 or 128 bits long. Below is a general substitution cipher with a 4-bit input.
The above general block cipher is referred to as the ideal block cipher because it allows the maximum number of possible encryption mappings from the block of plaintext. One problem with this ideal block cipher is how it works with a small block size, such as the 4 bit block seen above. It is ultimately a simple substitution cipher, which is easily broken.
Horst Feistel proposed the idea for what became known as a Feistel Cipher structure, or Feistel network, while working for IBM in the 1970s. A Feistel network alternates substitutions and permutations to produce a cryptographically stronger block cipher. In a Feistel cipher, the decryption process is basically the same as the encryption process. This means that a single algorithm can be used for both encryption and decryption. The video below explain the structure of a Feistel Cipher. Note that the xor, or exclusive or operation is only true when the two inputs are not the same. So 0 ⊕ 0 = 0, 0 ⊕ 1 = 1, 1 ⊕ 0 = 1, and 1 ⊕ 1 = 0.