meltedinhex/analyst-ai-pack / skills/extracting-encryption-keys-from-binaries
extracting-encryption-keys-from-binaries
VerifiedLocates 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.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 340 B |
| SKILL.md | skill md | 2.8 KB |
| references/api-reference.md | markdown | 1.3 KB |
| scripts/analyst.py | script | 2.5 KB |
references/api-reference.md
View on GitHub# API Reference: Extracting Encryption Keys From Binaries
## Overview
`scripts/analyst.py` surfaces candidate encryption keys: it finds key-sized (16/24/32-byte)
high-entropy, high-diversity regions and extracts printable hex (32–64 chars) and base64 (24–44
chars) strings matching common key lengths. It reads bytes statically and executes nothing.
Entropy is a heuristic — confirm by decryption.
## Dependencies
| Package | Version | Purpose |
|---------|---------|---------|
| (stdlib) | — | math, regex, Counter, JSON |
## Core functions
### `keys(path)`
Returns high-entropy key candidates (offset/size/entropy/hex), hex-string keys, and base64-string
keys.
### `_high_entropy_regions(data)`
Sliding-window search requiring near-maximal byte diversity to reduce false positives.
## Tuning
- `KEY_SIZES = (16, 24, 32)` for AES-128/192/256.
- `ENTROPY_THRESHOLD` over short windows; raise to reduce noise on packed binaries.
## Usage
```bash
python scripts/analyst.py keys sample.bin
```
## Sources
- FIPS 197 (AES key sizes 128/192/256) — https://csrc.nist.gov/publications/detail/fips/197/final
- MITRE ATT&CK T1573 Encrypted Channel — https://attack.mitre.org/techniques/T1573/
- High-entropy key-region heuristic from public key-recovery research; confirm by decryption
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |