Generated by DeepSeek V3.2| Twofish | |
|---|---|
| Name | Twofish |
| Designers | Bruce Schneier, John Kelsey, Doug Whiting, David Wagner, Chris Hall, Niels Ferguson |
| Publish date | 1998 |
| Key sizes | 128, 192, or 256 bits |
| Block sizes | 128 bits |
| Structure | Feistel network |
| Rounds | 16 |
Twofish. It is a symmetric key block cipher developed in the late 1990s as a candidate for the Advanced Encryption Standard (AES) competition organized by the National Institute of Standards and Technology (NIST). Designed by a renowned team of cryptographers, it was one of the five finalists in the selection process, ultimately losing to the Rijndael cipher. The algorithm is known for its strong security margins, flexibility in key sizes, and efficient performance across a variety of hardware and software platforms.
The development of Twofish was a direct response to the public call by NIST for a new encryption standard to replace the aging Data Encryption Standard (DES). The design team, which included prominent figures like Bruce Schneier of Counterpane Internet Security, aimed to create a cipher that balanced high security with practical speed. During the AES competition, its performance was extensively analyzed by the global cryptographic community, including researchers at IBM and RSA Laboratories. Although not selected as the federal standard, it gained significant respect and adoption in various commercial and open-source security products, such as Pretty Good Privacy (PGP) and the Linux kernel's cryptographic API.
Twofish employs a 16-round Feistel network structure, similar to older ciphers like DES but with significant modern enhancements. Its core operations include key-dependent S-boxes, a MDS matrix for diffusion, and a Pseudo-Hadamard Transform (PHT). The cipher also features a complex key schedule that generates round subkeys and the S-box contents from the user-supplied key, which can be 128, 192, or 256 bits long. This design borrows and improves upon concepts from earlier ciphers like Blowfish and Square, while introducing new elements to resist emerging forms of cryptanalysis.
The security of Twofish was rigorously tested during the AES competition, with no successful practical attacks on the full 16-round cipher being discovered. It demonstrates strong resistance against known analytical techniques, including differential cryptanalysis and linear cryptanalysis, due to its carefully designed non-linear components and diffusion layers. While some theoretical reduced-round attacks have been published by academics from institutions like the Weizmann Institute of Science, they require complexities far beyond practical feasibility. The cipher's conservative design and large security margin have led to its endorsement and use in high-assurance applications, including some modules certified under FIPS 140.
On 32-bit CPUs, such as the Intel Pentium family common at the time of its design, Twofish offers competitive encryption speeds, often outperforming other AES finalists like MARS and Serpent in software implementations. Its performance is highly optimized for general-purpose processors, benefiting from operations that align well with standard processor word sizes and instruction sets. However, on very constrained environments like 8-bit smart cards or in dedicated hardware circuits, its complex key schedule can be a relative performance bottleneck compared to the simpler Rijndael.
Twofish has been implemented in numerous cryptographic libraries and applications since its publication. Notable implementations include its inclusion in the FreeBSD operating system, the GNU Privacy Guard (GnuPG) suite, and the OpenSSL toolkit. Its reference code was placed in the public domain, encouraging widespread adoption and peer review. The algorithm's specification allows for various implementation optimizations, including pre-computed key-dependent tables, which can significantly speed up encryption and decryption operations in software.
Category:Symmetric-key cryptosystems Category:Block ciphers