Block cipher family

Twofish

Schneier and colleagues' AES finalist with key-dependent S-boxes

standard 1 variant AES finalist

Overview

Twofish is a 128-bit block cipher designed by Bruce Schneier, John Kelsey, Doug Whiting, David Wagner, Chris Hall and Niels Ferguson. It was one of the five AES finalists and is the successor to Blowfish.

Twofish is a 16-round Feistel network. Its round function g applies four key-dependent 8-bit S-boxes and an MDS matrix, and two g outputs are combined with a pseudo-Hadamard transform and round subkeys. Additional one-bit rotations and input and output whitening with key material complete the round. Key-dependent S-boxes make the cipher's internal tables unknown to an attacker, at the cost of a more complex key schedule.

NextSSL includes Twofish with 128-, 192- and 256-bit keys. It is available in GnuPG, VeraCrypt and many cryptographic libraries. Its key schedule can be precomputed for speed or computed on the fly to save memory, and the designers documented many implementation trade-offs. Twofish was released unpatented and free for any use.

History

1997–2001
  1. NIST calls for a successor to DES

    AES selection process
  2. Twofish published

  3. 15 candidates accepted

    AES selection process
  4. Five finalists: MARS, RC6, Rijndael, Serpent and Twofish

    AES selection process
  5. Rijndael selected

    AES selection process
  6. AES published as FIPS 197

    AES selection process

Security notes

No practical attacks on full Twofish are known; published results break reduced rounds only. It is slower than AES on hardware with AES instructions and is mostly used where cipher diversity is desired.

Typical uses

Disk encryption and cascadesReplacing Blowfish in older designs

Variants in NextSSL

1
AlgorithmTierSizes (bytes)StandardsAPI
Twofish
twofish
standard key 16–32 · block 16 AES finalist (Twofish) safe

Frequently asked questions

Which Twofish variants does NextSSL include?

NextSSL registers 1 Twofish variant: twofish.

Families with similar names