tags: cryptography

Electronic Code Block

Normal encryption mode, plaintext gets encrypted with key and transmitted. This mode is not recommended for data with repeated sections because crypt-analysts can deduce information from the repetition, let’s say they know how the cipher of a PDF header looks like, from the repetition of the cipher they can know how many PDFs are encrypted.

Cipher Block Chaining Mode

The encryption here is chained, it starts with a known initialization vector and every cipher text contributes to the encryption of the next cipher. It is recommended for long data.

If one cipher text is transmitted incorrectly it corrupts the current plaintext and the next one only.

Cipher Feedback Mode

This is a cipher that is applied to variable bits and does not require a constant block size We start with an initialization vector IV, and we encrypt the vector not the data, after that say the plain-text is s-bits long so we only select the most significant s-bits from the register and XOR it with the plain-text, the output will be s-bits, we take them and left shit the register s times and put them in the place of the least significant bits and do the process all over.

The downside of CFB that an error in transmission causes all the subsequent blocks to corrupt due to the presence if in the shift register.

NOTE: Both blocks are encryption

Output Feedback Mode

The same as cipher feedback mode, the only difference is instead of using the cipher in the next phase of encryption, we only use the output of the encryption block. This won’t cause any decryption problems in the next stage even if transmission errors happened This is more reliable than CFB but less secure.

The OFB in the reference is a bit different, it operates on complete blocks that are the same size as the encryption block.

Counter Mode

Use a counter and encrypt it There were benefits in the slide but DR didn’t talk about them so we can have them here. They are pretty obvious.

Pre-processing is allowed since the encryption algorithm does not depend on the plain-text, so all the counter values can be pre-processed an when a plain-text comes just do an XOR.