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
- Confirm the input byte length is a positive multiple of 8 (Blowfish block size).
- Match key, IV, and mode exactly to those used during encryption.
- Re-verify the inputType option (Hex/Base64) reflects the actual ciphertext encoding.
- 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
- Keep the key, IV, and mode in lockstep with the encryption side.
- Validate ciphertext is block-aligned before decrypting.
- Treat a finish() failure as wrong parameters, not a transient retry candidate.
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
- Invalid key length: ${key.length} bytes Blowfish's key leng
- Invalid IV length: ${iv.length} bytes. Expected 8 bytes.
- Invalid key length: ${key.length} bytes Blowfish's key leng
- Invalid IV length: ${iv.length} bytes. Expected 8 bytes.
- Letter ${letter} is not included in LS47
AI-assisted analysis of gchq/CyberChef@4290ea7539 (2026-08-13).
Data as JSON: /api/errors/7992332ceda06ff4.
Report an issue: GitHub.