You are on page 1of 11

Blowfish Algorithm

Blowfish Algorithm
 Blowfish is a symmetric block cipher algorithm.
 It is an replacement of DES and IDEA algorithm.
 Designed by Bruce Schneier in 1993

Here,
Plaintext  64bits
Key  varies from 32bits to 448bits
Subkeys 18 [P-array]
Round  16
Substitution Boxes  4 [256 entries]
Properties
1) Fast
2) Compact [executes in less memory]
3) Simple [use simple operations like XOR and ADD]
4) Secure[ because of variable length key]

It has mainly two parts:


 Subkey Generation
 Data Encryption
Key Generation
1) Keys are stored in an array
K1, K2, K3, ….. , Kn [1n14]

Length of each block is 32 bit (32×14 = 448bits)


2) Initialize Permutation Array (P)
P1, P2, P3, ….. , P18
Length of each array is 32 bit The P array and then the four
S-boxes are initialized with a
3) Initialize S(substitution)-boxes (4) fixed string. The string is the
S0  s1, s2, s3, ….. , s255 hexadecimal digits of
S1  s1, s2, s3, ….. , s255
S2  s1, s2, s3, ….. , s255
S3  s1, s2, s3, ….. , s255

each of 32 bit
4) XOR operations are performed:
P1 = P1 XOR K1
P2 = P2 XOR K2
P3 = P3 XOR K3
…. … …

…. … …

P14 = P14 XOR K14


P15 = P15 XOR K1

…. … …

…. … …

P18 = P18 XOR K4


5) An all-zero string is encrypted with the Blowfish algorithm,
with the subkeys P1 to P18 obtained so far in steps 2, 3 & 4.

6) P1 and P2 are replaced by the 64-bit output of step 5.

7) The output of step 5 is now encrypted with the updated


subkeys to replace P3 and P4 with the ciphertext of step 5.
8) This process is continued to replace all the P-arrays and the S-
Boxes in order.
Data Encryption 64 bit plain text

L1 (32bit) R1 (32bit)

P1 ⁺ F ⁺

L2 (32bit) R2 (32bit)

P2 ⁺ F ⁺

… …
L16 (32bit) R16 (32bit)

P16 ⁺ F ⁺

P18 ⁺ ⁺ P17

64 bit cipher text


Transformative F-function

8 S – Box 1
bits ADD

8 S – Box 2
32 bit bits

8 S – Box 3 XOR
bits

8 S – Box 4 ADD 32 bit


bits
Encryption Algorithm
1) divide the plaintext into 2 blocks (L and R are of equal
sizes – 32bit each)
2) For i = 0 to 16:
I. L = L Pi
II. R = F(L) R
III. Swap(L,R)
3) Undo last swap
4) R = R P17
5) L = L P18
6) Concatenate L and R to get 64 bit ciphertext
Advantages of Blowfish Algorithm
Almost three decades after it was first developed, Blowfish is still
widely used because it offers the following advantages:
 much faster and more efficient than DES and IDEA algorithms;
 unpatented and can be freely used by anyone even without a
license;
 despite the complex initialization phase before encryption, the data
encryption process is efficient on large microprocessors;
 provides extensive security for software and applications
developed in Java;
 provides secure access for backup tools;
 and supports secure user authentication for remote access.
Conclusion
Blowfish is used by many popular products, such as
CryptoDisk, PasswordWallet, Access Manager,
Symantec NetBackup and SplashID. Many social
media platforms and e-commerce websites also use
Blowfish to protect user data.

You might also like