Blowfish (cipher)

In cryptography, Blowfish is a keyed, symmetric block cipher, made in 1993 by Bruce Schneier and since 1993 has been included(put together) in a large number of encryption products. Blowfish has a good encryption rate in software and until 2008 no cryptanalytic attack model of it has been found. However, the AES block cipher algorithm now has more attention.
Schneier made Blowfish as a general-purpose algorithm, to be used as a replacement for the old DES algorithm and to remove the problems and difficulties of other encryption algorithms. At the time Blowfish was released, many other algorithms were proprietary, or were secrets. Schneier has said that, "Blowfish is unpatented, and will remain so in all countries. The algorithm is hereby placed in the public domain, and can be freely used by anyone."
Main features of the design include key-dependent S-boxes and a very complex key schedule. Blowfish is one of the fastest block ciphers used by many people, except when changing keys. Each new key needs to be pre-processed which takes the same time as encrypting about 4 kilobytes of text, which is very slow compared to other block ciphers. This stops its use in certain applications (such as in the smallest embedded systems like the early smartcards), but it is not a problem in other applications. In one of the applications, it is actually good: the password-hashing method used in OpenBSD uses an algorithm that comes from Blowfish which makes use of the slow key schedule; the idea is that the extra computational effort required gives protection against dictionary attacks. See key strengthening.
Blowfish has a 64-bit block size and a variable key length from 0 up to 448 bits
It is a 16-round Feistel cipher and uses large key-dependent S-boxes. It is similar in structure to CAST-128, which uses fixed S-boxes.
In 1996, Serge Vaudenay found a known-plaintext attack needing 28r + 1 known plaintexts to break, where r is the number of rounds. Moreover, he also found a class of weak keys that can be detected and broken by the same attack with only 24r + 1 known plaintexts. This attack cannot be used against the regular Blowfish; it assumes knowledge of the key-dependent S-boxes. Vincent Rijmen, in his Ph.D. papers, introduced a second-order differential attack that can break four rounds and no more. Still there is no known way to break the full 16 rounds, apart from a brute-force search.
A sign extension bug in one of the published C code has been found in 1996.
There is no good cryptanalysis on the full-round version of Blowfish known publicly till 2008. However, in 2007, Bruce Schneier noted that while Blowfish is still in use, he recommended using the new Twofish algorithm instead
Related pages
Advanced Encryption Standard
eSTREAM - An evaluation of new stream ciphers being conducted by the EU.
Twofish
MacGuffin
Notes and references
Vincent Rijmen, "Cryptanalysis and design of iterated block ciphers", doctoral dissertation, October 1997.
Bruce Schneier, Description of a New Variable-Length Key, 64-bit Block Cipher (Blowfish). Fast Software Encryption 1993: 191-204 .
Bruce Schneier, The Blowfish Encryption Algorithm--One Year Later, Dr. Dobb's Journal, 20(9), p. 137, September 1995 .
Serge Vaudenay, "On the weak keys of Blowfish," Fast Software Encryption (FSE'96), LNCS 1039, D. Gollmann, Ed., Springer-Verlag, 1996, pp. 27-32.
Other websites
Official Blowfish website
List of products using Blowfish
SCAN's entry for Blowfish
Blowfish PHP and JavaScript implementation with online demo
Blowfish JavaScript implementation and Page Encryption
Blowfish PHP implementation
Blowfish Java implementation (LGPL)
Cryptography