- Home
- Encrypt
- Encrypt / Decrypt
- Twofish
Twofish Encryption & Decryption
Encrypt and decrypt text with Twofish, the AES finalist.
You'll need it again to decrypt. Nothing you type leaves this page.
OpenSSL's default is 10,000. Any number works: more makes the password slower to guess; decrypting needs the same number.
The usual choice with OpenSSL. Needs an IV; pads to whole blocks.
OpenSSL has no Twofish cipher.
Twofish, from Bruce Schneier's team, was one of the five finalists of the AES competition and is the successor to Blowfish: it encrypts 16-byte blocks with a 128-, 192- or 256-bit key, and no practical attack on it is known. It is offered by encryption software as an alternative to AES, and this page lets you encrypt and decrypt text with it: Twofish-256 by default (or 128 or 192), in CBC, ECB, CTR, CFB or OFB mode. Use a password — the key and IV are derived with PBKDF2-HMAC-SHA256 and a random salt, in the Salted__ layout of openssl enc -pbkdf2 — or your own key and IV in hex. It all runs in your browser, so your text and keys never leave your device; free, no sign-up.
How to encrypt text with Twofish
- Choose Encrypt or Decrypt. Type the text to encrypt, or paste the Base64 or hex text to decrypt — the format is detected automatically.
- Enter a password (Generate makes a strong one), or switch to Key & IV (hex) and enter or generate a key and a 32-digit IV (ECB has no IV).
- Pick the key size (256 bits by default) and the mode, CBC by default. To decrypt, use the same settings that encrypted the text.
- Copy or download the result, or press Swap to move it into the input and flip the direction.
Features
- Twofish with a 128-, 192- or 256-bit key, 256 by default
- CBC, ECB, CTR, CFB and OFB modes; PKCS#7 padding or none
- Password mode with PBKDF2-HMAC-SHA256 and the Salted__ header of openssl enc -pbkdf2
- PBKDF2 iterations from 1 to 10 million, 10,000 by default
- Key & IV mode for exchanging data with other Twofish software: hex key and 32-digit IV, typed or generated
- Base64 or hex in and out; copy, download or Swap the result
Is it private?
Yes. Twofish runs in WebAssembly inside your browser, so your text, password and key are never uploaded or saved — not even in the browser's storage.
Frequently asked questions
Is Twofish more secure than AES?
Neither is known to be weaker: no practical attack exists on full Twofish or on AES, and both use 16-byte blocks and keys up to 256 bits. AES won the competition, so it has hardware support and is available almost everywhere; choose Twofish when a program or partner you exchange data with uses it.
Can OpenSSL decrypt Twofish?
No — OpenSSL doesn't include Twofish, so no openssl command reads this output. Use Key & IV mode and give a library that has Twofish, such as Bouncy Castle, Botan or libgcrypt, the same key, IV and mode, with PKCS#7 padding for CBC and ECB.
What key and IV does Twofish need?
A 16-, 24- or 32-byte key — 32, 48 or 64 hex digits for Twofish-128, 192 or 256 — and a 16-byte IV of 32 hex digits, except in ECB, which has none. Paste a key and the key size follows its length. In password mode both are derived from the password and a salt, which the output carries after Salted__.
Twofish or Blowfish?
Twofish. It is Blowfish's successor from the same designer: its 16-byte block avoids the Sweet32 weakness of Blowfish's 8-byte block, and its key goes up to 256 bits. Use Blowfish only to read data that was made with it.