JWT (JSON Web Token) Hash

Technical details, regex signatures, and cracking commands for the JWT (JSON Web Token) algorithm.

Regex Identification Signature:
^[A-Za-z0-9-_]*\.[A-Za-z0-9-_]*\.[A-Za-z0-9-_]*$
Hashcat Command (Mode: 16500):
Not supported natively by John the Ripper
← Back to Hash Identifier

What is JWT (JSON Web Token)?

JSON Web Tokens (JWT) were introduced in 2014 as a compact, stateless mechanism for securely transmitting claims between parties as JSON objects, standardized via RFC 7519. The format consists of three base64url-encoded segments separated by dots: a **header** (defining the algorithm, e.g., HS256 or RS256, and token type), a **payload** (storing claims like `sub`, `exp`, and custom data), and a **signature** (generated via HMAC-SHA256 or RSA/ECDSA with a secret key or private key). JWTs are primarily used for authentication (e.g., OAuth2) and authorization, enabling stateless validation of identity and permissions across distributed systems without persistent server-side storage. Their ubiquity stems from lightweight transmission (typically <1KB) and compatibility with HTTP headers, though this simplicity trades off for cryptographic rigor.

JWTs are vulnerable to cracking due to inherent design flaws and computational optimizations. **HMAC-based JWTs (HS256/HS384)** lack salt or key stretching, making them susceptible to brute-force attacks if secrets are weak or reused, as modern GPUs and parallelized tools (e.g., Hashcat) can test billions of candidates per second. **Collision risks** arise from the payload’s deterministic encoding—identical claims produce identical tokens, enabling replay attacks if not properly scoped. **Signature verification** relies on the recipient’s possession of the secret key, but key leakage (e.g., via environment variables or misconfigured APIs) invalidates security. Additionally, **preimage attacks** exploit the base64url encoding’s predictability, allowing adversaries to reverse-engineer claims if the signature is bypassed (e.g., via weak middleware). Finally, **algorithm confusion** (e.g., downgrade attacks to HS256 from RS256) exploits trust in untrusted parties, while **side-channel leaks** (timing attacks, cache exploits) can infer key material from poorly implemented verification routines.

Identifying JWT (JSON Web Token) 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 JWT (JSON Web Token), security researchers analyze the hash against a strict regular expression (regex) signature (shown above) to find structural matches.

How to Crack JWT (JSON Web Token)

If you need to recover the plaintext password for a JWT (JSON Web Token) 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.