gchq/CyberChef · warning · OperationError

Enter the public key of the signer.

Error message

Enter the public key of the signer.

What it means

PGPDecryptAndVerify.run reads args[0] as the signer's public key. If it is falsy the operation aborts before importing any keys. This is an input-validation guard - decryption and verification cannot proceed without the signer's public key.

Source

Thrown at src/core/operations/PGPDecryptAndVerify.mjs:72

                "name": "Private key password",
                "type": "string",
                "value": ""
            }
        ];
    }

    /**
     * @param {string} input
     * @param {Object[]} args
     * @returns {string}
     */
    async run(input, args) {
        const signedMessage = input,
            [publicKey, privateKey, passphrase] = args,
            keyring = new kbpgp.keyring.KeyRing();
        let unboxedLiterals;

        if (!publicKey) throw new OperationError("Enter the public key of the signer.");
        if (!privateKey) throw new OperationError("Enter the private key of the recipient.");
        const privKey = await importPrivateKey(privateKey, passphrase);
        const pubKey = await importPublicKey(publicKey);
        keyring.add_key_manager(privKey);
        keyring.add_key_manager(pubKey);

        try {
            unboxedLiterals = await promisify(kbpgp.unbox)({
                armored: signedMessage,
                keyfetch: keyring,
                asp: ASP
            });
            const ds = unboxedLiterals[0].get_data_signer();
            if (ds) {
                const km = ds.get_key_manager();
                if (km) {
                    const signer = km.get_userids_mark_primary()[0].components;
                    let text = "Signed by ";

View on GitHub (pinned to 4290ea7539)

Solutions

  1. Provide the signer's ASCII-armoured PGP public key in the first argument.
  2. Also provide the recipient's private key (and passphrase) in the remaining arguments.
  3. Verify the public key begins with '-----BEGIN PGP PUBLIC KEY BLOCK-----'.
Defensive patterns

Strategy: validation

Validate before calling

const [publicKey, privateKey, passphrase] = args;
if (!publicKey || !publicKey.trim()) {
    throw new Error('Signer public key argument is required before running PGP Decrypt and Verify.');
}

Type guard

const isArmouredPublicKey = (s) =>
    typeof s === 'string' && /-----BEGIN PGP PUBLIC KEY BLOCK-----/.test(s);

Prevention

When it happens

Trigger: The 'Public key of signer' argument is empty; the args array is shorter than expected; the key text was not bound into the recipe.

Common situations: User supplied only the recipient private key and forgot the signer public key; programmatic call with a missing first argument; blank UI field.

Related errors


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