Cryptography

Understanding block ciphers in cryptography

Nitesh Malviya
December 16, 2020 by
Nitesh Malviya

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. 

Learn Applied Cryptography

Learn Applied Cryptography

Build your applied cryptography and cryptanalysis skills with 13 courses covering hashing, PKI, SSL/TLS, full disk encryption and more.

Block size consideration

There are few considerations to be made while selecting a block size. They are as follows: 

  1. 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. 
  2. Avoid blocks of bigger size: With a bigger block size, it becomes very difficult to operate the cipher.
  3. 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

Learn Applied Cryptography

Learn Applied Cryptography

Build your applied cryptography and cryptanalysis skills with 13 courses covering hashing, PKI, SSL/TLS, full disk encryption and more.

Sources

  1. https://www.geeksforgeeks.org/block-cipher-modes-of-operation/ 
  2. https://www.tutorialspoint.com/cryptography/block_cipher.htm 
  3. https://www.sciencedirect.com/topics/computer-science/block-ciphers 
  4. https://binaryterms.com/block-cipher.html 
Nitesh Malviya
Nitesh Malviya

Nitesh Malviya is a Security Consultant. He has prior experience in Web Appsec, Mobile Appsec and VAPT. At present he works on IoT, Radio and Cloud Security and open to explore various domains of CyberSecurity. He can be reached on his personal blog - https://nitmalviya03.wordpress.com/ and Linkedin - https://www.linkedin.com/in/nitmalviya03/.