Twofish
Twofish is a symmetric block cipher designed by Bruce Schneier et al. for the AES competition, using 128-bit blocks with 128/192/256-bit keys; it was one of the AES finalists.
Purpose
It offered a secure alternative in the AES competition, adopting a different structure (Feistel + key-dependent S-boxes) to diversify analysis.
Mechanism
It is a 16-round Feistel network on 128-bit blocks. It uses four key-dependent S-boxes (determined by the key), combined with an MDS matrix and a pseudo-Hadamard transform. The key schedule is relatively complex but provides whitening (input/output key XORs).
Use cases
- AES competition historical research
- An optional algorithm in some crypto libraries
- Cryptography teaching
- A high-security alternative
Examples
- Input
key=256bit, data=16bytesOutput16-byte ciphertextAES finalist
Common errors
- Mistaking Twofish for the AES standard
- AES ultimately selected Rijndael
Related terms
AES
The Advanced Encryption Standard (AES) is the symmetric block cipher NIST standardized in 2001, supporting 128/192/256-bit keys, and is the de facto standard of modern encryption. GLOSSARY
Blowfish
Blowfish is a symmetric block cipher designed by Bruce Schneier in 1993, using variable-length keys (32-448 bits) and 64-bit blocks; it is fast and unencumbered by patents. GLOSSARY
Serpent
Serpent is a symmetric block cipher designed by Ross Anderson et al. for the AES competition, using 128-bit blocks with 128/192/256-bit keys, known for its large security margin. GLOSSARY
Block Cipher
A block cipher is a symmetric cipher that encrypts and decrypts fixed-length blocks (e.g., 128 bits) and requires a mode of operation to handle arbitrary-length data. GLOSSARY