File size: 5,886 Bytes
41a6da3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
---
license: other
task_categories:
  - other
language:
  - en
  - code
tags:
  - reverse-engineering
  - cryptography
  - binary-analysis
  - benchmark
  - security
  - decompilation
pretty_name: CREBench
size_categories:
  - n<1K
configs:
  - config_name: default
    data_files:
      - split: train
        path: manifest.jsonl
---

# CREBench

**CREBench** is a benchmark for evaluating large language models (LLMs) on **cryptographic binary reverse engineering**.

- **Paper:** [arXiv:2604.03750](https://arxiv.org/abs/2604.03750)
- **Code:** [wangyu-ovo/CREBench](https://github.com/wangyu-ovo/CREBench)
- **Project Page:** [CREBench Homepage](https://jams-zhou-james.github.io/CREBench/)

![CREBench Overview](overview.png)

## Dataset Description

CREBench measures reverse-engineering performance on cryptographic binaries across four evaluation levels:

| Level | Task |
|-------|------|
| **L1** | Algorithm identification |
| **L2** | Key (and IV) extraction |
| **L3** | Wrapper-level code reimplementation |
| **L4** | Flag recovery |

The main benchmark corpus contains:

- **48** cryptographic algorithms
- **3** key embedding modes: `hardcode_plain`, `fragmented_build`, `weak_prng_seeded`
- **3** compilation / obfuscation difficulties: `O0`, `O3`, `constxor`
- **432** challenge instances in total (`48 × 3 × 3`)

### Algorithms

`3-Way`, `A5-1`, `A5-2`, `AES-128-CBC`, `ARIA-128-CBC`, `Anubis-128-CBC`, `BF-CBC-Official`, `CAMELLIA-128`, `CAST5`, `ChaCha20`, `Clefia`, `Crypto-1`, `DES`, `DESX`, `E0`, `GOST-28147-89`, `IDEA`, `KHAZAD-64`, `Kalyna-128`, `Kasumi`, `Kuznyechik-128-ECB`, `LEA`, `LOKI97`, `Lucifer-128-ECB`, `MAGENTA-128`, `MARS`, `MISTY1-64`, `NOEKEON`, `RC2-CBC-Official`, `RC4`, `RC5-CBC`, `RC6`, `SAFER`, `SC2000`, `SEED`, `SHACAL-2`, `SHARK`, `SKIPJACK`, `SM4-CBC-Official`, `Serpent`, `Simon`, `Speck`, `Square`, `TEA`, `Threefish`, `Unicorn-A`, `XTEA`, `XXTEA`

## Dataset Structure

Each algorithm directory (e.g. `CREBench/AES-128-CBC/`) contains:

```text
CREBench/<algorithm>/
  config.yaml                          # Challenge metadata and evaluation config
  challenge_src/                       # Source templates and generated key material
    generated/<key_mode>/metadata.json # Ground-truth key, IV, flag, and ciphertext
  public-<key_mode>-<difficulty>/      # Public release artifacts for one instance
    challenge                          # Stripped ELF binary
    address.json                       # Ghidra function address map
    decompile/                         # Ghidra decompiled function dumps
  test_vectors-<key_mode>.json         # Mode-specific verification vectors
  src/                                 # Reference cryptographic implementation
  python_implementation/               # Python reference (when available)
```

### Instance naming convention

Public instance directories follow the pattern:

```text
public-<key_mode>-<difficulty>
```

Examples:

- `public-hardcode_plain-O0`
- `public-fragmented_build-O3`
- `public-weak_prng_seeded-constxor`

### Ground-truth labels

Files such as `config.yaml` and `challenge_src/generated/*/metadata.json` contain evaluation labels (keys, IVs, flags, and target ciphertexts). These are **intentional ground-truth annotations** required for automated scoring in the official evaluation harness.

## Usage

### Download the full corpus

```python
from huggingface_hub import snapshot_download

local_dir = snapshot_download("Danny-1223/CREBench", repo_type="dataset")
print(local_dir)
```

Or with the Hugging Face CLI:

```bash
hf download Danny-1223/CREBench --repo-type dataset --local-dir ./CREBench-data
```

### Browse the instance index

```python
from datasets import load_dataset

dataset = load_dataset("Danny-1223/CREBench", split="train")
print(dataset[0])
```

Each row in `manifest.jsonl` indexes one challenge instance and points to the corresponding binary, decompilation, config, and metadata paths inside the repository.

### Run official evaluation

Clone the evaluation code repository and point the runner at the downloaded corpus:

```bash
git clone https://github.com/wangyu-ovo/CREBench.git
cd CREBench
pip install -r requirements.txt

# Single challenge
python3 scripts/run_passk_eval.py \
  --model gpt-5.4 \
  --challenge AES-128-CBC \
  --difficulty O0 \
  --key-mode weak_prng_seeded \
  --pass-k 3

# Full benchmark matrix (48 × 3 × 3)
python3 scripts/run_passk_eval.py \
  --model gpt-5.4 \
  --all-c-all \
  --all-key-modes \
  --difficulty ALL \
  --pass-k 3 \
  --eval-mode full \
  --jobs 4
```

For Docker-based sandbox setup, Ghidra packaging, and provider configuration, see the [GitHub README](https://github.com/wangyu-ovo/CREBench/blob/main/README.md).

## Evaluation Levels

The official harness scores each run on four levels:

1. **L1 — Algorithm identification:** recover the underlying cipher / mode
2. **L2 — Key extraction:** recover secret key material (and IV when applicable)
3. **L3 — Code reimplementation:** produce a working wrapper-level reimplementation
4. **L4 — Flag recovery:** decrypt the target ciphertext and recover the embedded flag

## Supported Models (paper experiments)

The paper reports results with:

- `gpt-5.4`, `gpt-5.4-mini`, `gpt-5.2`, `o4-mini`
- `gemini-2.5-pro`
- `claude-sonnet-4-6`
- `doubao-seed-1-8-251228`
- `mimo-v2-pro`

## Citation

If you use CREBench, please cite:

```bibtex
@article{chen2026crebench,
  title={CREBench: Evaluating Large Language Models in Cryptographic Binary Reverse Engineering},
  author={Chen, Baicheng and Wang, Yu and Zhou, Ziheng and Liu, Xiangru and Li, Juanru and Chen, Yilei and He, Tianxing},
  journal={arXiv preprint arXiv:2604.03750},
  year={2026}
}
```

## License

Please refer to the [GitHub repository](https://github.com/wangyu-ovo/CREBench) for the latest license terms governing the benchmark corpus and evaluation code.