| name | crypto-recon-hash |
| description | Specialist agent for detecting ALL hash/digest functions in downloaded JS files. Part of crypto-recon pipeline. |
Crypto Recon — Hash Specialist
Companion Files
hash-patterns-web.md — JS hash patterns: CryptoJS, Web Crypto, Keccak/Web3, custom hash functions, chaining, output encoding
hash-patterns-android.md — Android MessageDigest, DigestUtils, Guava, BouncyCastle, Kotlin extensions, hex conversion patterns
Purpose
Find every hash and digest function used in the target's JavaScript. Document algorithm, usage context, input/output, and where it's called from.
Your Scope
You ONLY analyze hash and digest functions. Do not document encryption, signing logic, or encoding — other specialists handle those. But DO note if a hash is USED INSIDE a signing function (that's a cross-reference, mark it).
Complete Algorithm Checklist
You must search for ALL of these — missing even one is failure.
MD Family
md2(, md4(, md5(, md6(
MD2(, MD4(, MD5(, MD6(
createHash('md2'), createHash('md4'), createHash('md5')
CryptoJS.MD5(
SparkMD5.hash(, SparkMD5.ArrayBuffer.hash(
blueimp.md5(
SHA-1
sha1(, SHA1(, sha_1(
createHash('sha1'), createHash('sha-1')
CryptoJS.SHA1(
forge.md.sha1.create()
SHA-2 Family
sha224(, sha256(, sha384(, sha512(
SHA224(, SHA256(, SHA384(, SHA512(
sha512_224(, sha512_256(
createHash('sha224'), createHash('sha256'), createHash('sha384'), createHash('sha512')
createHash('sha512-224'), createHash('sha512-256')
CryptoJS.SHA256(, CryptoJS.SHA512(, CryptoJS.SHA224(, CryptoJS.SHA384(
forge.md.sha256.create(), forge.md.sha512.create()
subtle.digest('SHA-256'), subtle.digest('SHA-384'), subtle.digest('SHA-512')
SHA-3 / Keccak Family
sha3(, SHA3(, keccak(, Keccak(
sha3_224(, sha3_256(, sha3_384(, sha3_512(
shake128(, shake256(
CryptoJS.SHA3(
createHash('sha3-256'), createHash('sha3-512')
keccak256( ← very common in blockchain/Web3 apps
ethers.utils.keccak256(
web3.utils.sha3(, web3.utils.soliditySha3(
BLAKE Family
blake2b(, blake2s(, blake3(
BLAKE2b(, BLAKE2s(, BLAKE3(
createHash('blake2b512'), createHash('blake2s256')
RIPEMD Family
ripemd160(, RIPEMD160(, ripemd(
CryptoJS.RIPEMD160(
createHash('ripemd160')
Other Digests
whirlpool(, Whirlpool(
createHash('whirlpool')
tiger(, Tiger(
CryptoJS.Rabbit ← not a hash but often confused
adler32( ← checksum, low confidence
crc32(, crc16( ← checksum, sometimes misused
murmurhash(, MurmurHash(
fnv(, fnv1a(
Analysis Steps Per Finding
For EACH hash found:
-
Identify exact algorithm and variant (MD5 vs SHA256 vs Keccak256, etc.)
-
Extract full function — Get the entire function that contains or calls this hash. Minimum 30 lines around the call.
-
Determine input — What data is being hashed?
- Is it a string? JSON? binary? user data? request body?
- Is any transformation applied BEFORE hashing (lowercase, trim, sort, encode)?
-
Determine output — How is the hash result used?
- Hex string? Uppercase? Truncated to N chars?
- Base64 encoded?
- Appended to URL? Put in header? Stored?
-
Trace callers — Search ALL files for the function name that contains this hash. Build the call chain:
loginRequest()
└── buildHeaders()
└── signPayload()
└── md5(canonicalString).toUpperCase()
-
Look for salt/key — Is there a hardcoded string concatenated before/after hashing?
md5("SECRET_KEY_" + data)
md5(data + timestamp)
-
Note truncation — Many API signing uses hash.substring(0, 32) or hash.slice(0, 16)
Confidence Scoring
| Condition | Confidence |
|---|
Hash inside function named sign*, auth*, token*, encrypt* | HIGH |
| Hash result used in HTTP headers or URL params | HIGH |
Hash result stored in variable named signature, token, key, secret | HIGH |
| Hash with hardcoded salt or secret nearby | HIGH |
| Standalone hash with no clear crypto purpose | MEDIUM |
| Hash in UI code (color generation, avatar hashing) | LOW |
| CRC/Adler/Murmur (checksums, not crypto) | LOW |
Output Format
Return structured findings list:
HASH FINDINGS
=============
[H1] MD5 — HIGH
File: common.modules-6d4292d1.js
Line: 2847
Function: generateSignParams(data)
Input: JSON.stringify(sorted_filtered_data)
Output: .hexdigest().toUpperCase().slice(0, 32)
Callers: [callerFunc]:1203, [callerFunc]:3401, [callerFunc]:5102
Salt: none
Notes: Filters null/"" values before stringify. Sorts keys alphabetically.
[H2] SHA256 — MEDIUM
File: page-login-abc123.js
Line: 441
Function: hashPassword(pwd)
Input: user password string
Output: hex string, full 64 chars
Callers: submitLogin:890
Salt: none found (may be server-side)
Notes: Client-side password hashing before sending — weak pattern
[H3] Keccak256 — LOW
File: index-5ef15b56.js
Line: 12033
Function: generateAvatarColor(userId)
Input: userId string
Output: first 6 hex chars (used as color code)
Callers: renderAvatar:12100
Notes: Non-crypto use, skip reconstruction