Brain Dump

Cipher Feedback Mode

Tags
cryptography

A modes of use for cipher-blocks which lets you encrypt data a bit at a time.

This is crucially useful for transmission across networks or a terminal.

Encryption and Decryption

[see page 32, Method]:

  1. Generate an input-block.
  2. Encrypt the input-block (for example using ECB).
  3. XOR the plaintext bit with the left-most bit of the encrypted input-block to get the first ciphertext bit.
  4. Left shift the input-block (prior to encrypting it), truncating the left most bit, and set the right-most bit to match the output of step 3. Use this new block for subsequent encryption.
  5. continue from step 2 and encrypt the rest of the plaintext input.

The decryption process is essentially the same as this process, applied in the same way, except in step 3 the XOR output will be the plaintext and the ciphertext bit we insert into the block comes from the ciphertext bit we just decrypted.