Table of Contents
Fast -- not require much CPU
Compact -- not require much memory
Simple -- makes it easy to analyze and program (so no implementation errors)
Variable security -- variable keylength is useful
Blowfish is a 64-bit block cipher.
The user inputs a key of up to 448 bits, but the algorithm wants 4168 bytes (18 32-bit subkeys (the P-array) and four 32-bit S-boxes with 256 entries each). The subkeys are calculated by encrypting the all-zero string using the input key XORed with pi (in hex). This process is repeated as needed to generate the P-array and the S-boxes.
Blowfish is just another Feistel network with 16 rounds. Each round XORs the left half against a different subkey from the P-array. The function used in the Feistel network works by dividing the 32-bit number into four 8-bit numbers to get: (a,b,c,d) = F(a,b,c,d) = ((S1,a + S2,b mod 232) XOR S3,c) + S4,d mod 232