SCRAM Hash Hash

Technical details, regex signatures, and cracking commands for the SCRAM Hash algorithm.

Regex Identification Signature:
^\$scram\$[0-9]+\$[a-z0-9\/.]{16}\$sha-1=[a-z0-9\/.]{27},sha-256=[a-z0-9\/.]{43},sha-512=[a-z0-9\/.]{86}$
Not supported natively by Hashcat
Not supported natively by John the Ripper
← Back to Hash Identifier

What is SCRAM Hash?

The **SCRAM Hash** (Simple Challenge-Response Authentication Mechanism) is a cryptographic hash format standardized in RFC 5802 as part of the SCRAM authentication framework, designed to secure authentication protocols such as SASL (Simple Authentication and Security Layer) for services like IMAP, XMPP, and PostgreSQL. Originating from the need for a more secure alternative to plaintext passwords or weak hashes like MD5, SCRAM employs a challenge-response mechanism where the server sends a nonce (number used once) to the client, which then derives a hashed response incorporating the password, server nonce, and a client nonce. The structure consists of three primary components: the *client-first-message* (containing the client nonce and optional salt), the *server-first-message* (providing the server nonce and salt), and the *client-final-message* (hashing the password, nonces, and salt via HMAC-SHA-256 or HMAC-SHA-1, depending on the variant). This format ensures protection against replay attacks and eavesdropping by binding the password to dynamic challenge values, though its security heavily relies on the cryptographic strength of the underlying hash function and proper implementation of salts.

SCRAM Hash is vulnerable to cracking primarily due to its reliance on **pre-image resistance without sufficient salting** in older variants (e.g., SCRAM-SHA-1) and **optimizable hash functions** that enable GPU/ASIC-based brute-force attacks. Without a robust salt (or with weak salts in legacy implementations), rainbow table attacks become feasible, as identical passwords produce identical hashes. Additionally, HMAC-SHA-1’s collision resistance is compromised by modern cryptanalytic advances, and its parallelizability makes it susceptible to GPU-accelerated cracking (e.g., via tools like Hashcat). Even SCRAM-SHA-256 is at risk if the salt derivation lacks entropy or if the client nonce reuse is mishandled, as the hash’s output can be precomputed for specific salted inputs. Furthermore, the absence of key stretching mechanisms (e.g., PBKDF2 or Argon2) in vanilla SCRAM allows attackers to evaluate millions of hashes per second on specialized hardware, rendering it inadequate for high-security applications without additional mitigations.

Identifying SCRAM Hash Hashes

Identifying a hash blindly is often difficult because multiple algorithms can output strings of the exact same length. For example, a standard 32-character hexadecimal string could be MD5, NTLM, MD4, or LM. To definitively identify SCRAM Hash, security researchers analyze the hash against a strict regular expression (regex) signature (shown above) to find structural matches.

How to Crack SCRAM Hash

If you need to recover the plaintext password for a SCRAM Hash hash during a penetration test or forensics investigation, you must supply the correct module ID to your cracking software. Use the exact commands provided at the top of this page to target the hash successfully.