{"record":{"id":"6283076f8c95aa89","repo":"sqlmapproject/sqlmap","slug":"reply-decryption-failed-wrong-password-or-salt","errorCode":null,"errorMessage":"reply decryption failed (wrong password or salt)","messagePattern":"reply decryption failed \\(wrong password or salt\\)","errorType":"exception","errorClass":"KerberosError","httpStatus":null,"severity":"error","filePath":"extra/kerberos/client.py","lineNumber":247,"sourceCode":"        raise KerberosError(-1, \"malformed KDC reply\")\n\ndef _parseRep(response, key, usage, expectedNonce, expectedType):\n    \"\"\"Parse an AS-REP / TGS-REP: decrypt its enc-part with 'key' under 'usage', returning the\n    opaque ticket and the freshly issued session key. The two replies are structurally identical.\n    The reply's application tag MUST match the expected message type, and the nonce carried in the\n    (integrity-protected) enc-part MUST equal the request nonce (RFC 4120).\"\"\"\n\n    try:                                                   # any structural defect in a hostile/truncated reply -> KerberosError\n        tag, repContent = _raiseIfError(response)\n        if tag != der.applicationTag(expectedType):\n            raise KerberosError(-1, \"unexpected reply message type (tag 0x%02x)\" % tag)\n        rep = _fields(der.peel(repContent)[1])\n        encData = _expFields(rep[6])                        # enc-part (EncryptedData)\n        repEtype = _expInteger(encData[0])\n        try:\n            encRepPart = _enctype(repEtype).decrypt(key, usage, _expOctet(encData[2]))\n        except ValueError:                                 # HMAC mismatch -> we hold the wrong long-term key\n            raise KerberosError(-1, \"reply decryption failed (wrong password or salt)\")\n\n        # Enc*RepPart = [APPLICATION 25/26] EncKDCRepPart ; key is field [0], nonce is field [2]\n        encKdcRep = _fields(der.peel(der.peel(encRepPart)[1])[1])\n        if _expInteger(encKdcRep[2]) != expectedNonce:\n            raise KerberosError(-1, \"reply nonce does not match the request (possible replay)\")\n        keyFields = _expFields(encKdcRep[0])\n\n        return {\n            \"ticket\": bytes(rep[5]),\n            \"sessionKey\": _expOctet(keyFields[1]),\n            \"sessionKeyType\": _expInteger(keyFields[0]),\n            \"etype\": repEtype,\n            \"crealm\": _expString(rep[3]),\n            # EncKDCRepPart endtime [7]; a scan can outlive the ticket, so the caller can re-fetch\n            \"endtime\": _expTime(encKdcRep[7]) if 7 in encKdcRep else None,\n        }\n    except (KeyError, IndexError, ValueError, struct.error):\n        raise KerberosError(-1, \"malformed KDC reply\")","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/extra/kerberos/client.py#L229-L265","documentation":"Error \"reply decryption failed (wrong password or salt)\" thrown in sqlmapproject/sqlmap.","triggerScenarios":"Thrown at extra/kerberos/client.py:247 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0a35b20e3953d341be6c7ac75ccb0b3362540c8d","analyzedAt":"2026-08-26T23:02:52.002Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}