Understanding block ciphers in cryptography
Block ciphers fall under the symmetric encryption category. Thus, using block ciphers the sender and the recipient of the data use the same key to encrypt and decrypt the data.
As the name suggests, a block cipher takes an input of fixed size in the form of a block and converts it into ciphertext. The block size in block ciphers always remains constant.
Block size consideration
There are few considerations to be made while selecting a block size. They are as follows:
- Avoid small block size: The block size to be used should not be too small in length. If an attacker discovers some ciphertext block corresponding to a plain text block, then it’s possible for an attacker to launch Dictionary Attack by building a dictionary of ciphertext and plain text pairs. The large block size makes this attack difficult to perform.
- Avoid blocks of bigger size: With a bigger block size, it becomes very difficult to operate the cipher.
- 8-bit multiples: It is advisable to consider block size of multiple of 8. 8 bits and its multiple are easy to process and don’t need padding.
Block cipher schemes
Block ciphers have many schemes to operate. Some of the widely used and popular ones are as follows:
- DES: Digital Encryption Standard. It’s broken and no more used.
- Triple DES: Repeated DES. Much stronger algos are available than this.
- AES: Advanced Encryption Standard.
- Serpent: Has block size of 128 bits and keys of length 128,196 or 256 bits. Slower but very secure than other block ciphers.
- TwoFish: With a block size of 128 bits, it is based on an earlier block cipher called Blowfish which uses a block of 64 bits.
- IDEA: PGP makes use of this algo.
Modes of operation
Block cipher can be implemented and operated in the following modes:
- ECB: Electronic Code Book. The easiest and simplest mode of all. Parallel Encryption of each block is possible but more prone to cryptanalysis attacks.
- CBC: Cipher Block Chaining. A better version of ECB and widely used of all the modes available.
- CFB: Cipher Feedback Mode.
- OFM: Output Feedback Mode.
- Counter Mode