Anusheh Zohair Mustafeez

The **Blowfish encryption algorithm** is a symmetric block cipher designed to succeed in the DES algorithm that was slow and insecure. In this shot, we will study the steps in the Blowfish encryption algorithm.

The diagram above provides a high-level overview of how the Blowfish algorithm works. Let’s look at this step by step:

- Since Blowfish makes use of an SP network, the first step is to initiate the substitution box (Sbox) and permutation box (Pbox). The Pbox entries are shown as the
*P*in the diagram above. There are a total of 18 Pbox entries._{i} - Next, we split our 64-bit plaintext into two equal blocks,
*L*and*R*. - Next, we enter an encryption loop that runs 16 times. The following steps take place in each loop:

a. We XOR*L*with*P*, where_{i}*i*depends on the loop’s current iteration.

b. We then XOR*R*with*F*, which is a function of*L*that makes use of the Sbox split into 4 blocks. The overview of the*F*function is shown in the image below.

c. Finally,*L*and*R*are swapped before the loop enters its next iteration. - After the loop finishes,
*L*and*R*are swapped once more. - Next, we make use of our last two unused Pbox entries by XORing
*R*with*P*and_{17}*L*with*P*._{18} - Finally, we combine
*L*and*R*to retrieve the ciphertext.

Blowfish was a strong contender to succeed DES, but it had one main drawback: a small block size of 64. The creator of Blowfish, Bruce Schneier, improved on this flaw by coming up with the Twofish encryption algorithm, which had a block size of 128. Ultimately, the AES algorithm was selected as the new standard, but Schneier’s algorithms are still to be considered resilient and secure.

RELATED TAGS

CONTRIBUTOR

Anusheh Zohair Mustafeez

Copyright ©2023 Educative, Inc. All rights reserved

RELATED COURSES

View all Courses

Keep Exploring