gchq/CyberChef · error · OperationError
Unknown algorithm version: ${version}
Error message
Unknown algorithm version: ${version} What it means
Thrown by the GOST Verify operation's version switch when the `Algorithm` arg is not one of "GOST 28147 (1989)", "GOST R 34.12 (Magma, 2015)", "GOST R 34.12 (Kuznyechik, 2015)". The label sets versionNum/blockLength before the MAC-verify engine is built; an unknown value is rejected up front.
Source
Thrown at src/core/operations/GOSTVerify.mjs:108
const mac = toHexFast(Utils.convertToByteArray(macObj.string, macObj.option));
input = inputType === "Hex" ? input : toHexFast(Utils.strToArrayBuffer(input));
let blockLength, versionNum;
switch (version) {
case "GOST 28147 (1989)":
versionNum = 1989;
blockLength = 64;
break;
case "GOST R 34.12 (Magma, 2015)":
versionNum = 2015;
blockLength = 64;
break;
case "GOST R 34.12 (Kuznyechik, 2015)":
versionNum = 2015;
blockLength = 128;
break;
default:
throw new OperationError(`Unknown algorithm version: ${version}`);
}
const sBoxVal = versionNum === 1989 ? sBox : null;
const algorithm = {
version: versionNum,
length: blockLength,
mode: "MAC",
sBox: sBoxVal,
macLength: mac.length * 4
};
try {
const Hex = CryptoGost.coding.Hex;
if (iv) algorithm.iv = Hex.decode(iv);
const cipher = GostEngine.getGostCipher(algorithm);
const out = cipher.verify(Hex.decode(key), Hex.decode(mac), Hex.decode(input));View on GitHub (pinned to 4290ea7539)
Solutions
- Use one of the three declared option labels verbatim.
- Derive allowed values from `GOSTVerify.args` option list when scripting.
Example fix
// before args[versionIndex] = "Kuznyechik2015"; // after args[versionIndex] = "GOST R 34.12 (Kuznyechik, 2015)";
Defensive patterns
Strategy: validation
Validate before calling
const VALID = ["GOST 28147 (1989)", "GOST R 34.12 (Magma, 2015)", "GOST R 34.12 (Kuznyechik, 2015)"];
if (!VALID.includes(version)) throw new Error(`Bad version; valid: ${VALID.join(", ")}`); Type guard
function isGostVersion(v){return["GOST 28147 (1989)","GOST R 34.12 (Magma, 2015)","GOST R 34.12 (Kuznyechik, 2015)"].includes(v);} Prevention
- Reuse labels from GOSTVerify.args option list when scripting.
- Regenerate older recipe steps after upgrades.
When it happens
Trigger: Programmatic recipe with a misspelled/legacy version label; replaying an older recipe; using the cipher's short name.
Common situations: Recipe migration; docs copy-paste; locale differences.
Related errors
- Unknown algorithm version: ${version}
- Unknown algorithm version: ${version}
- Unknown algorithm version: ${version}
- Unknown algorithm version: ${version}
- Unknown algorithm version: ${version}
AI-assisted analysis of gchq/CyberChef@4290ea7539 (2026-08-13).
Data as JSON: /api/errors/562d8ff0960338a3.
Report an issue: GitHub.