sqlmapproject/sqlmap · error · ValueError

RC4 requires a non-empty key

Error message

RC4 requires a non-empty key

What it means

Error "RC4 requires a non-empty key" thrown in sqlmapproject/sqlmap.

Source

Thrown at extra/kerberos/crypto.py:200

        basic = confounder + plaintext
        return self._basicEncrypt(ke, basic) + hmac.new(ki, basic, hashlib.sha1).digest()[:self.macsize]

    def decrypt(self, key, usage, ciphertext):
        if len(ciphertext) < self.blocksize + self.macsize:   # confounder block + HMAC; guards a hostile short reply
            raise ValueError("Kerberos ciphertext too short")
        ke, ki = self._keys(key, usage)
        ct, mac = ciphertext[:-self.macsize], ciphertext[-self.macsize:]
        basic = self._basicDecrypt(ke, ct)
        if not _eq(mac, hmac.new(ki, basic, hashlib.sha1).digest()[:self.macsize]):
            raise ValueError("Kerberos integrity check failed (wrong key or corrupted ciphertext)")
        return basic[self.blocksize:]

def _rc4(key, data):
    """RC4 (ARCFOUR) stream cipher."""

    key, data = bytearray(key), bytearray(data)
    if not key:
        raise ValueError("RC4 requires a non-empty key")
    s = list(range(256))
    j = 0
    for i in range(256):
        j = (j + s[i] + key[i % len(key)]) & 0xff
        s[i], s[j] = s[j], s[i]

    out = bytearray(len(data))
    i = j = 0
    for n in range(len(data)):
        i = (i + 1) & 0xff
        j = (j + s[i]) & 0xff
        s[i], s[j] = s[j], s[i]
        out[n] = data[n] ^ s[(s[i] + s[j]) & 0xff]
    return bytes(out)

class RC4Enctype(object):
    """rc4-hmac (etype 23, RFC 4757). The long-term key is the NT hash MD4(UTF-16LE(password)); the
    salt and iteration count are unused. Legacy, but still enabled in many AD environments."""

View on GitHub (pinned to 0a35b20e39)

When it happens

Trigger: Thrown at extra/kerberos/crypto.py:200 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26). Data as JSON: /api/errors/7adeb76b1b2e89e1. Report an issue: GitHub.