Extracting encryption keys from binaries
Skill meltedinhex/analyst-ai-pack/skills/extracting-encryption-keys-from-binaries
Locates candidate encryption keys in a binary by finding high-entropy fixed-size regions (16/24/32 bytes) near cryptographic constants or crypto API references, and surfacing printable key/passphrase strings. Activates for requests to extract encryption keys, find an AES key in a sample, or recover hardcoded crypto material.From its SKILL.md
npx -y skills add meltedinhex/analyst-ai-pack --skill extracting-encryption-keys-from-binariesAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 21 stars21 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as Apache-2.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
2.8 KB, 449 tokens by cl100k_base, as published. Nobody here has run it
Extracting Encryption Keys From Binaries
When to Use
- You have a sample with hardcoded crypto and want to surface candidate keys/IVs (16/24/32-byte high-entropy blocks) and passphrase strings.
- You are recovering material to decrypt config, C2 traffic, or ransomware test vectors.
Do not use entropy alone as proof a region is a key — corroborate with proximity to crypto constants/APIs and by attempting decryption. This skill reads the binary statically and executes nothing.
Prerequisites
- The binary (read inertly). Pairs well with the crypto-constant scanner.
Safety & Handling
- Read bytes statically; handle recovered keys as sensitive and store securely.
Workflow
Step 1: Find high-entropy key-sized regions
python scripts/analyst.py keys sample.bin
Slides a window of 16/24/32 bytes and reports regions whose entropy exceeds a threshold (likely random key material), with offsets.
Step 2: Surface printable secrets
Extract printable strings that look like passphrases/hex keys (e.g., 32/64-hex, base64 of 16/32 bytes).
Step 3: Corroborate
Rank candidates by proximity to crypto constants/API references and confirm by decrypting a known ciphertext.
Step 4: Document
Record candidate keys, sizes, offsets, and the corroborating evidence.
Validation
- Candidate regions are exactly key-sized (16/24/32 bytes) and high-entropy.
- Hex/base64 key strings are length-consistent with a real key size.
- A candidate is confirmed only by successful decryption, not entropy alone.
Pitfalls
- Compressed/packed data producing many false high-entropy regions — unpack first.
- Keys derived at runtime (KDF) not present statically.
- Endianness/encoding of the key (raw vs hex vs base64) before use.
References
- See
references/api-reference.mdfor the extractor. - FIPS 197 and ATT&CK T1573 (linked in frontmatter).
What ships with it: 3 files
4.1 KB alongside SKILL.md, 1 of them executable
references/
- api-reference.md1.3 KB
scripts/
- analyst.pyruns2.5 KB
- LICENSE340 B