gchq/CyberChef · warning · OperationError
Enter the private key of the recipient.
Error message
Enter the private key of the recipient.
What it means
PGPDecrypt.run reads args[0] as the recipient's private key. If it is falsy (empty string, null, undefined) the operation aborts immediately - there is nothing to decrypt with. This is an input-validation guard thrown before any crypto runs; importPrivateKey has not yet been called.
Source
Thrown at src/core/operations/PGPDecrypt.mjs:67
"value": ""
}
];
}
/**
* @param {string} input
* @param {Object[]} args
* @returns {string}
*
* @throws {OperationError} if invalid private key
*/
async run(input, args) {
const encryptedMessage = input,
[privateKey, passphrase] = args,
keyring = new kbpgp.keyring.KeyRing();
let plaintextMessage;
if (!privateKey) throw new OperationError("Enter the private key of the recipient.");
const key = await importPrivateKey(privateKey, passphrase);
keyring.add_key_manager(key);
try {
plaintextMessage = await promisify(kbpgp.unbox)({
armored: encryptedMessage,
keyfetch: keyring,
asp: ASP
});
} catch (err) {
throw new OperationError(`Couldn't decrypt message with provided private key: ${err}`);
}
return plaintextMessage.toString();
}
}View on GitHub (pinned to 4290ea7539)
Solutions
- Provide the recipient's ASCII-armoured PGP private key in the first argument.
- If the key is passphrase-protected, also fill the passphrase field.
- Verify the key block begins with '-----BEGIN PGP PRIVATE KEY BLOCK-----'.
Defensive patterns
Strategy: validation
Validate before calling
const [privateKey, passphrase] = args;
if (!privateKey || !privateKey.trim()) {
throw new Error('Private key argument is required before running PGP Decrypt.');
} Type guard
const isArmouredPrivateKey = (s) =>
typeof s === 'string' && /-----BEGIN PGP PRIVATE KEY BLOCK-----/.test(s); Prevention
- Always populate the private-key argument before running.
- Validate the key is an armoured PGP private key block.
- Provide a passphrase when the key is locked.
When it happens
Trigger: The 'Private key of recipient' argument is left empty; the args array is shorter than expected; the key text failed to bind from the UI/recipe.
Common situations: User forgot to paste the private key; an automated recipe with a blank key field; copy-paste that missed the clipboard; programmatic call passing an empty string.
Related errors
- Enter the public key of the signer.
- Enter the public key of the recipient.
- Enter the private key of the signer.
- Enter the private key of the signer.
- Enter the public key of the signer.
AI-assisted analysis of gchq/CyberChef@4290ea7539 (2026-08-13).
Data as JSON: /api/errors/954b7eb7f4661cb9.
Report an issue: GitHub.