In cryptography, Twofish is an encryption algorithm designed by Bruce Schneir. It is a symmetric key block cipher, meaning a single key is used for both encryption and decryption. Twofish has a block size of 128 bits and key sizes up to 256 bits.

Twofish is related to the earlier block cipher Blowfish, which is a 64-bit clock cipher that uses a key length varying between 32 and 448 bits also developed by Bruce Schneir. Twofish is also related to Advanced Encryption Standard (AES), a 128-bit block cipher that the United States government adopted as it’s specification for the encryption of electronic data by the U.S. National Institute of Standards and Technology In 2001. While Twofish was a finalist to become the industry standard for encryption, it was beaten out by AES because of Twofish’s slower speed.

Twofish features

Twofish has distinguishing features that set it apart from other cryptographic protocols including using a pre-computed, key-dependent S-box (substitution box), which is a basic component of any symmetric key algorithm that performs substitution. The S-box works to mask the relationship between the key and the ciphertext. Because of the precomputation, Twofish is vulnerable to side channel attacks.

The encryption algorithm employs a Maximum Distance Separable matrix, or a matrix that represents a function with certain diffusion properties that have useful applications in cryptography. Twofish has a Fiestel structure, which is a symmetric structure used in the construction of block ciphers. This same structure is also used in Data Encryption Standard (DES), an influential encryption standard that was popular in the 1970s.

Twofish has not been patented, and the reference implementation has been placed in the public domain, meaning that the algorithm is free for anyone to use without restrictions. Twofish has less widespread usage than Blowfish.

Abby Braden
Abby Braden
Abby Braden is an award-winning writer and editor for websites such as,, and, where she covers technology trends and enterprise and SMB project management platforms. When she’s not writing about technology, she enjoys giving too many treats to her dog and coaching part-time at her local gym.
Get the Free Newsletter
Subscribe to Daily Tech Insider for top news, trends & analysis
This email address is invalid.
Get the Free Newsletter
Subscribe to Daily Tech Insider for top news, trends & analysis
This email address is invalid.

Related Articles

Virtual Private Network (VPN)

A virtual private network (VPN) encrypts a device's Internet access through a secure server. It is most frequently used for remote employees accessing a...

Gantt Chart

A Gantt chart is a type of bar chart that illustrates a project schedule and shows the dependency between tasks and the current schedule...

Input Sanitization

Input sanitization is a cybersecurity measure of checking, cleaning, and filtering data inputs from users, APIs, and web services of any unwanted characters and...

IT Asset Management Software

IT asset management software (ITAM software) is an application for organizing, recording, and tracking all of an organization s hardware and software assets throughout...


ScalaHosting is a leading managed hosting provider that offers secure, scalable, and affordable...


Human resources information system (HRIS) solutions help businesses manage multiple facets of their...

Best Managed Service Providers...

In today's business world, managed services are more critical than ever. They can...