What it can do
- Normalize an analyst-supplied username
- Encode it as Windows UTF-16LE
- Calculate SHA-256
- Convert digest hex back to bytes
- Match the event log's Base64 representation
How the recipe works
Decode text
Interpret the candidate as UTF-8 text.
Encode text
Re-encode it as Windows UTF-16LE.
SHA2
Hash those bytes with SHA-256.
From Hex
Recover digest bytes from hexadecimal output.
To Base64
Encode the digest in Base64 for comparison.
Demonstration
Sample input
demo-userExpected result
4iL1l7ZB5cJmYMr08Jsi0keyG6LU7K/Ty65L88oLads=When to use it
- Windows Event ID 1029 investigations
- Testing a known username hypothesis
- Explaining hash-versus-encoding layers
Adapt it
Preserve the exact username spelling and case used by the source system; a one-character difference produces a different digest.
Source and verification
Adapted from mattnotmax CyberChef recipes. The explanation and sample are written for Serialize, use synthetic or documentation-safe data, and are checked against the current operation catalogue. The workflow runs locally without an external API call.