gchq/CyberChef · error · OperationError

Unable to decrypt input with these parameters.

Error message

Unable to decrypt input with these parameters.

What it means

After feeding the ciphertext through forge's Blowfish decipher, decipher.finish() returns false when the cipher cannot finalize correctly - typically because the input is not a valid multiple of the 8-byte block size, the padding cannot be removed, or the key/IV/mode do not match the encryption parameters. The operation interprets this as unrecoverable decryption failure.

Source

Thrown at src/core/operations/BlowfishDecrypt.mjs:93

Blowfish's key length needs to be between 4 and 56 bytes (32-448 bits).`);
        }

        if (mode !== "ECB" && iv.length !== 8) {
            throw new OperationError(`Invalid IV length: ${iv.length} bytes. Expected 8 bytes.`);
        }

        input = Utils.convertToByteString(input, inputType);

        const decipher = Blowfish.createDecipher(key, mode);
        decipher.start({iv: iv});
        decipher.update(forge.util.createBuffer(input));
        const result = decipher.finish();

        if (result) {
            return outputType === "Hex" ? decipher.output.toHex() : decipher.output.getBytes();
        } else {
            throw new OperationError("Unable to decrypt input with these parameters.");
        }
    }

}

export default BlowfishDecrypt;

View on GitHub (pinned to 4290ea7539)

Solutions

  1. Confirm the input byte length is a positive multiple of 8 (Blowfish block size).
  2. Match key, IV, and mode exactly to those used during encryption.
  3. Re-verify the inputType option (Hex/Base64) reflects the actual ciphertext encoding.
  4. If data may be truncated, reject or retransmit rather than retrying the same parameters.

Example fix

// before
mode='CBC', ciphertext '00112233' (4 bytes)
// after
mode='CBC', ciphertext '0011223344556677' (8 bytes)
Defensive patterns

Strategy: try-catch

Validate before calling

if (input.length % 8 !== 0) throw new Error('Ciphertext must be a multiple of 8 bytes');

Try / catch

try { blowfishDecrypt.run(input, args); }
catch (e) { if (/Unable to decrypt/.test(e.message)) { /* verify key/IV/mode, re-fetch ciphertext */ } else throw e; }

Prevention

When it happens

Trigger: Calling BlowfishDecrypt.run where decipher.finish() returns false: input length not a multiple of 8 bytes, wrong padding, mismatched key/IV/mode versus the original encryption, or corrupted/truncated ciphertext.

Common situations: Decrypting with a different mode or IV than was used to encrypt; feeding ciphertext that lost bytes in transit; hex/base64 decoding mismatch; using ECB-padded data in CBC mode.

Related errors


AI-assisted analysis of gchq/CyberChef@4290ea7539 (2026-08-13). Data as JSON: /api/errors/7992332ceda06ff4. Report an issue: GitHub.