> For the complete documentation index, see [llms.txt](https://alham-rizvi.gitbook.io/alhamrizvi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alham-rizvi.gitbook.io/alhamrizvi/cryptography/hashing/44.-hash-identification.md).

# 44. Hash Identification

## Quick Identification by Length

| Hash Type | Length (hex chars) | Length (bytes) |
| --------- | ------------------ | -------------- |
| MD5       | 32                 | 16             |
| SHA-1     | 40                 | 20             |
| SHA-224   | 56                 | 28             |
| SHA-256   | 64                 | 32             |
| SHA-384   | 96                 | 48             |
| SHA-512   | 128                | 64             |
| NTLM      | 32                 | 16             |
| bcrypt    | 60 (with prefix)   | —              |
| MySQL4    | 16                 | 8              |
| MySQL5    | 40                 | 20             |

## Prefix-Based Identification

| Prefix          | Hash Type           |
| --------------- | ------------------- |
| `$1$`           | MD5-crypt           |
| `$2a$` / `$2b$` | bcrypt              |
| `$5$`           | SHA-256-crypt       |
| `$6$`           | SHA-512-crypt       |
| `$apr1$`        | Apache MD5          |
| `{SHA}`         | Base64 SHA-1 (LDAP) |

## Character Set Clues

* **Hex only** `[0-9a-f]` → MD5, SHA family
* **Base64** `[A-Za-z0-9+/=]` → bcrypt output, some password managers
* **All uppercase** → often Windows hashes (NTLM, LM)

## Tools for Identification

```bash
# hash-identifier (Python tool)
hash-identifier <hash>

# hashid
hashid <hash>
hashid -m <hash>    # show hashcat mode number

# Name-that-hash (modern, color output)
nth --text <hash>

# Online
# https://www.tunnelsup.com/hash-analyzer/
# https://hashes.com/en/tools/hash_identifier
```

## CTF Tips

* Always check **length first** — narrows down candidates instantly
* Check for **salt patterns**: `hash:salt` or `$type$salt$hash`
* Double-hashed values are still the same length (MD5(MD5(x)) = 32 chars)
* Look for context clues: PHP apps → MD5, Linux login → SHA-512-crypt


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://alham-rizvi.gitbook.io/alhamrizvi/cryptography/hashing/44.-hash-identification.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
