Blowfish
Schneier's 1993 64-bit Feistel cipher with key-dependent S-boxes
Overview
Blowfish is a 64-bit block cipher designed by Bruce Schneier in 1993 as a free alternative to DES. It accepts keys from 32 to 448 bits and was widely adopted in the 1990s; its key schedule lives on in the bcrypt password hash.
Blowfish is a 16-round Feistel network. Its F-function splits a 32-bit half into four bytes, looks each up in one of four 256-entry S-boxes, and combines them with additions and XOR. The S-boxes and an 18-entry P-array are initialised from the digits of pi and then repeatedly encrypted under the key, so the key schedule is slow, equivalent to encrypting about 4 KB of data.
That expensive key setup is a drawback for frequent rekeying but was turned into a feature in bcrypt's Eksblowfish. Blowfish was placed in the public domain and was widely used in early SSH, VPN and file-encryption software. It is still found in older embedded systems and archives that need to be decrypted. Its 64-bit block means that no more than a few gigabytes should be encrypted under a single key, since block collisions become likely around 2^32 blocks.
History
1993–2016Blowfish published by Bruce Schneier as a free alternative to DES
bcrypt builds its password hash on Blowfish's key schedule
Sweet32 shows the risk of 64-bit block ciphers in long sessions
Security notes
No practical key-recovery attack on full Blowfish is known, but its 64-bit block makes it vulnerable to birthday-bound attacks such as Sweet32 when large amounts of data are encrypted under one key. Some weak keys produce weak S-boxes. Schneier himself recommends Twofish or AES instead.
Typical uses
Variants in NextSSL
1| Algorithm | Tier | Sizes (bytes) | Standards | API |
|---|---|---|---|---|
| Blowfish blowfish |
legacy | key 4–56 · block 8 | Schneier 1993 | root |
Frequently asked questions
Which Blowfish variants does NextSSL include?
NextSSL registers 1 Blowfish variant: blowfish.