Skip to main content

Cryptography & Ciphers

Twofish Decryption

Decrypt Twofish with exact key bytes, strict Hex or Base64 input, and checked padding. Run a published ECB test vector.

Tool workspace

Your input stays in this browser.

The tool is ready to run.

Ready

Run the tool when your input is ready.

Paste Hex, Base64, or Raw ciphertext. Select its encoding below.

Options

Use 16, 24, or 32 key bytes. Match the key encoding; no password derivation occurs.

Supply exactly 16 IV bytes for CBC, CFB, OFB, or CTR. ECB ignores the IV.

CFB uses 128-bit feedback. CTR increments the full 16-byte counter in little-endian order. Match the sender.

Hex preserves binary plaintext. Raw requires valid UTF-8 and retains a leading byte-order mark.

CBC and ECB check padding. PKCS5 uses repeated length bytes. BIT uses 80 then zeros. NO, ZERO, and RANDOM retain bytes.

Ready for a result

Decrypt Twofish with exact key bytes, strict Hex or Base64 input, and checked padding. Run a published ECB test vector.

This tool runs open-source code from CyberChef by GCHQ (Apache License 2.0). See open-source credits.

Twofish applies the selected mode to ciphertext with a raw key. It does not derive keys from passwords.

Hex output preserves plaintext bytes. Raw output requires valid UTF-8.

  • Compare a Twofish implementation with the original submission's known ciphertext and plaintext.

Sources: Twofish submission: intermediate-value test vectors; RFC 5652 section 6.3: repeated-length padding

Raw keys and unauthenticated plaintext

  • CFB uses full-block feedback; CTR increments its counter in little-endian order.
  • NO, ZERO, and RANDOM preserve trailing bytes. Stream modes ignore padding.
  • Successful decryption does not authenticate data or parse encrypted file containers.

Match the mode, IV, and padding

  1. Enter the key with its encoding and select Input format.
  2. Match the sender’s Mode and supply the IV outside ECB.
  3. Match Padding for CBC or ECB, then run decryption.

Recover a block of zero bytes

Input: 9f589f5cf6122c32b6bfec2f2ae8c35a

Settings: Key Hex: 00000000000000000000000000000000; ECB; Input Hex; Output Hex; Padding NO; IV blank.

Result: 00000000000000000000000000000000

The Twofish submission publishes this ciphertext for sixteen zero plaintext bytes under a 128-bit zero key.